# generating-prd-json-from-prd-md > Generates prd.json task tracking file from PRD.md requirements document. Use when initializing Ralph loop or when the user asks to convert PRD to JSON format for autonomous execution. - Author: qte77 - Repository: qte77/RDI-AgentBeats-Test-First-Quality-Bench-GreenAgent - Version: 20260125202321 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/qte77/RDI-AgentBeats-Test-First-Quality-Bench-GreenAgent - Web: https://mule.run/skillshub/@@qte77/RDI-AgentBeats-Test-First-Quality-Bench-GreenAgent~generating-prd-json-from-prd-md:20260125202321 --- --- name: generating-prd-json-from-prd-md description: Generates prd.json task tracking file from PRD.md requirements document. Use when initializing Ralph loop or when the user asks to convert PRD to JSON format for autonomous execution. model: haiku allowed-tools: Read, Write, Bash --- # PRD to JSON Conversion Hybrid approach: Python script parses, AI validates and corrects. ## Workflow 1. **Run parser** (Bash tool) ```bash python ralph/scripts/generate_prd_json.py ``` Script handles: PRD.md parsing, `(depends: ...)` extraction, content hashing, state preservation. 2. **Validate** (Read tool) - Read `ralph/docs/prd.json` (script output) - Read `docs/PRD.md` (cross-reference) - Check against Validation Checklist 3. **Correct errors** (Write tool, if needed) - Fix issues found - Recompute `content_hash` if title/description/acceptance changed - Write corrected `ralph/docs/prd.json` 4. **Report** - Story count and status - Corrections made - Suggest: `make ralph_run` ## Validation Checklist For each story, verify: - [ ] `id` follows STORY-XXX format - [ ] `title` is 3-7 words, matches PRD.md feature - [ ] `description` is non-empty - [ ] `acceptance` array is non-empty - [ ] `files` array contains valid paths (if specified in PRD.md) - [ ] `content_hash` is 64-char hex string - [ ] `depends_on` references valid STORY-XXX IDs (no circular deps, no self-refs) Cross-reference with PRD.md: - [ ] All `#### Feature N:` headings have corresponding stories - [ ] Story order matches PRD.md feature order - [ ] `(depends: STORY-XXX)` syntax correctly parsed ## Common Issues to Correct | Issue | Correction | |-------|------------| | Empty acceptance | Extract from description or PRD.md feature | | Invalid depends_on reference | Remove non-existent story IDs | | Circular dependency | Remove one direction | | Missing content_hash | Recompute from title+description+acceptance | | Duplicate story IDs | Renumber sequentially | ## prd.json Schema See `ralph/docs/templates/prd.json.template` for structure and fields. ## Usage ```bash make ralph_prd_json ``` ## Next Steps ```bash make ralph_init # Validate environment make ralph_run # Start Ralph loop ```