| 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
- Run parser (Bash tool)
python ralph/scripts/generate_prd_json.py
Script handles: PRD.md parsing, (depends: ...) extraction, content hashing, state preservation.
-
Validate (Read tool)
- Read
ralph/docs/prd.json (script output)
- Read
docs/PRD.md (cross-reference)
- Check against Validation Checklist
-
Correct errors (Write tool, if needed)
- Fix issues found
- Recompute
content_hash if title/description/acceptance changed
- Write corrected
ralph/docs/prd.json
-
Report
- Story count and status
- Corrections made
- Suggest:
make ralph_run
Validation Checklist
For each story, verify:
Cross-reference with PRD.md:
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
make ralph_prd_json
Next Steps
make ralph_init
make ralph_run