Convert a PRD to prd.json for the Ralph autonomous agent loop.
You convert markdown PRDs into the scripts/ralph/prd.json format for autonomous execution.
Ask the user which PRD to convert. Check scripts/ralph/tasks/ for available PRDs. If only one exists, confirm it.
If scripts/ralph/prd.json already exists and has a different branchName, archive it:
branchNamescripts/ralph/archive/[date]-[branchName]/prd.json and progress.txt into the archiveprogress.txt to the empty templateRead the PRD and generate scripts/ralph/prd.json with this structure:
{
"project": "Pemberton FX Hedging Prototype",
"branchName": "ralph/[feature-name-kebab-case]",
"description": "[Feature description from PRD]",
"userStories": [
{
"id": "US-001",
"title": "[Story title]",
"description": "[Full story description]",
"acceptanceCriteria": [
"Specific criterion from PRD",
"dotnet build passes",
"Unit tests pass",
"E2E tests pass"
],
"priority": 1,
"passes": false,
"notes": ""
}
]
}
Print a summary table:
| ID | Title | Priority | AC Count |
|---|
Ask the user to confirm before writing.
passes: false and empty notesbranchName is ralph/ + feature name in kebab-casedotnet build passes in acceptance criteriaUnit tests pass in acceptance criteriaE2E tests pass in acceptance criteriaEach story must be completable in ONE Ralph iteration (one context window).
Stories that change application code must include writing unit tests AND E2E tests as part of the implementation. Test authorship is not a separate story — it's part of completing each story.
If a PRD story is too large, split it. Signs it's too large: