prd.json format that Ralph uses for autonomous execution.
Using the Ralph Skill
Once you have a PRD intasks/prd-[feature-name].md, convert it to JSON:
- “convert this prd”
- “turn this into ralph format”
- “create prd.json from this”
- “ralph json”
The Conversion Process
Skill Reads Your PRD
The Ralph skill analyzes your markdown PRD to extract user stories, acceptance criteria, and project metadata.
Stories Are Sized and Ordered
Each user story is validated to ensure it’s:
- Small enough to complete in one Ralph iteration (one context window)
- Ordered by dependencies (schema → backend → UI)
- Verifiable with concrete acceptance criteria
JSON File Generated
The skill creates
prd.json with all stories marked as passes: false and ready for execution.JSON Format Structure
The generatedprd.json follows this structure:
Story Sizing: The Number One Rule
Ralph spawns a fresh AI instance per iteration with no memory of previous work. If a story is too big, the LLM runs out of context before finishing and produces broken code.Right-Sized Stories
Good Story Examples
- Add a database column and migration
- Add a UI component to an existing page
- Update a server action with new logic
- Add a filter dropdown to a list
Stories That Are Too Big
Split These Stories
- “Build the entire dashboard” → Split into: schema, queries, UI components, filters
- “Add authentication” → Split into: schema, middleware, login UI, session handling
- “Refactor the API” → Split into one story per endpoint or pattern
Story Ordering: Dependencies First
Stories execute in priority order. The Ralph skill ensures earlier stories don’t depend on later ones. Correct order:- Schema/database changes (migrations)
- Server actions / backend logic
- UI components that use the backend
- Dashboard/summary views that aggregate data
- UI component (depends on schema that doesn’t exist yet)
- Schema change ❌
Acceptance Criteria Validation
The Ralph skill automatically adds “Typecheck passes” to every story’s acceptance criteria.
Verifiable vs. Vague Criteria
Good criteria (verifiable):- “Add
statuscolumn to tasks table with default ‘pending’” - “Filter dropdown has options: All, Active, Completed”
- “Clicking delete shows confirmation dialog”
- “Typecheck passes”
- “Tests pass”
- “Works correctly”
- “User can do X easily”
- “Good UX”
- “Handles edge cases”
Example Conversion
Here’s how a markdown PRD section converts to JSON: Input (Markdown PRD):Automatic Archiving
Before creating a newprd.json, the skill checks if you’re starting a different feature:
- Reads existing
prd.json(if it exists) - Compares
branchNamevalues - If different AND
progress.txthas content:- Creates
archive/YYYY-MM-DD-feature-name/ - Copies current
prd.jsonandprogress.txtto archive - Resets
progress.txtwith fresh header
- Creates
The
ralph.sh script also handles archiving automatically when you run it.Validation Checklist
Before the skill savesprd.json, it verifies:
- ✓ Each story is completable in one iteration (small enough)
- ✓ Stories are ordered by dependency (schema → backend → UI)
- ✓ Every story has “Typecheck passes” as criterion
- ✓ UI stories have “Verify in browser using dev-browser skill” as criterion
- ✓ Acceptance criteria are verifiable (not vague)
- ✓ No story depends on a later story
Output Location
Theprd.json file is created in:
Next Steps
After converting your PRD to JSON:- Review the generated
prd.json - Make any manual adjustments if needed
- Run Ralph to start autonomous execution
Ready to Run
Your
prd.json is now ready for Ralph to execute autonomously!
