Files
portfolio/.bmad/core/resources/excalidraw/validate-json-instructions.md
T
mahdiarghyani 1586bb7f80 chore: add BMAD agent workflows and configuration system
- Add comprehensive agent workflow definitions for 8 specialized roles (analyst, architect, developer, product manager, scrum master, technical writer, UX designer, QA engineer)
- Add 35+ workflow definitions covering analysis, planning, solutioning, and implementation phases
- Add BMAD configuration system with agent, task, tool, workflow, and file manifests
- Add BMM (Business Model Methodology) documentation including quick-start guides, architecture references, and workflow analysis
- Add test architecture knowledge base with 20+ testing patterns and best practices
- Add team configuration templates and party mode setup for collaborative development
- Establish foundation for enterprise agentic development framework with adaptive scaling capabilities
2025-11-30 14:36:05 +03:30

1.7 KiB

JSON Validation Instructions

Purpose

Validate Excalidraw JSON files after saving to catch syntax errors (missing commas, brackets, quotes).

How to Validate

Use Node.js built-in JSON parsing to validate the file:

node -e "JSON.parse(require('fs').readFileSync('FILE_PATH', 'utf8')); console.log('✓ Valid JSON')"

Replace FILE_PATH with the actual file path.

Exit Codes

  • Exit code 0 = Valid JSON
  • Exit code 1 = Invalid JSON (syntax error)

Error Output

If invalid, Node.js will output:

  • Error message with description
  • Position in file where error occurred
  • Line and column information (if available)

Common Errors and Fixes

Missing Comma

SyntaxError: Expected ',' or '}' after property value

Fix: Add comma after the property value

Missing Bracket/Brace

SyntaxError: Unexpected end of JSON input

Fix: Add missing closing bracket ] or brace }

Extra Comma (Trailing)

SyntaxError: Unexpected token ,

Fix: Remove the trailing comma before ] or }

Missing Quote

SyntaxError: Unexpected token

Fix: Add missing quote around string value

Workflow Integration

After saving an Excalidraw file, run validation:

  1. Save the file
  2. Run: node -e "JSON.parse(require('fs').readFileSync('{{save_location}}', 'utf8')); console.log('✓ Valid JSON')"
  3. If validation fails:
    • Read the error message for line/position
    • Open the file at that location
    • Fix the syntax error
    • Save and re-validate
  4. Repeat until validation passes

Critical Rule

NEVER delete the file due to validation errors - always fix the syntax error at the reported location.