Convert markdown PRD to prd.json format for Ralph Zero autonomous execution. Validates story structure, checks dependencies, ensures right-sizing, and generates validated JSON...
Convert markdown Product Requirements Documents into the structured prd.json format required by Ralph Zero, with comprehensive validation and story optimization.
Use this skill when:
Ask for the PRD file path:
Please provide the path to your PRD markdown file
(e.g., tasks/prd-task-priority.md)
Or work with directly provided content.
Parse the PRD to extract:
Convert requirements into properly structured user stories.
Each story must have:
{
"id": "US-001",
"title": "Brief description (max 200 chars)",
"description": "As a [user], I want [action], so that [benefit]",
"acceptanceCriteria": [
"Specific, verifiable criterion 1",
"Specific, verifiable criterion 2",
"Typecheck passes"
],
"priority": 1,
"passes": false,
"notes": ""
}
CRITICAL: Each story MUST be completable in one iteration (30min - 2hrs)
โ Right-sized stories:
โ Too large (MUST split):
Rule of thumb: If it needs >10 acceptance criteria or >500 char description, split it.
"Typecheck passes" as final criterion"Verify in browser using dev-browser skill"โ Good criteria:
โ Bad criteria:
Stories execute in priority order. No forward dependencies allowed.
Correct order:
Wrong: UI component at priority 1 that depends on API at priority 3
Before generating prd.json, validate each story:
if len(acceptanceCriteria) > 10:
return "Too many criteria - split story"
if len(description) > 500:
return "Description too long - split story"
complexity_keywords = ['entire', 'complete', 'all', 'full', 'refactor']
if any(keyword in description.lower()):
return f"Story likely too broad (contains '{keyword}')"
if "Typecheck passes" not in acceptanceCriteria:
return "Missing required 'Typecheck passes' criterion"
vague_phrases = ['works correctly', 'good ux', 'handles edge cases']
for criterion in acceptanceCriteria:
if any(phrase in criterion.lower()):
return f"Vague criterion: '{criterion}'"
Check that no story depends on features from later priority stories
Create the JSON structure:
{
"project": "TaskApp",
"branchName": "ralph/task-priority",
"description": "Task Priority System - Track priorities with visual indicators",
"userStories": [
{
"id": "US-001",
"title": "Add priority field to tasks table",
"description": "As a developer, I need to store task priority in database",
"acceptanceCriteria": [
"Add priority column: 'high' | 'medium' | 'low' (default 'medium')",
"Generate and run migration successfully",
"Typecheck passes"
],
"priority": 1,
"passes": false,
"notes": ""
},
{
"id": "US-002",
"title": "Display priority badge on task cards",
"description": "As a user, I want to see task priority at a glance",
"acceptanceCriteria": [
"Each task card shows colored priority badge",
"Badge colors: red=high, yellow=medium, gray=low",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 2,
"passes": false,
"notes": ""
}
]
}
Before writing new prd.json, check for existing file:
if prd.json exists and has different branchName:
date_str = today's date (YYYY-MM-DD)
old_feature = old branchName without 'ralph/' prefix
archive_dir = f"archive/{date_str}-{old_feature}"
copy prd.json to archive_dir
copy progress.txt to archive_dir (if exists)
reset progress.txt with fresh header
Create fresh progress.txt:
================================================================================
RALPH PROGRESS LOG
================================================================================
Project: TaskApp
Branch: ralph/task-priority
Started: 2026-01-18 12:00:00
================================================================================
Save prd.json and inform user:
โ
Generated prd.json with [N] user stories
โ
All stories validated successfully
โ
Initialized progress.txt
Story breakdown:
- US-001: Add priority field to tasks table
- US-002: Display priority badge on task cards
- US-003: Add priority dropdown to task edit
- US-004: Filter tasks by priority
Ready to run Ralph Zero! Execute:
ralph-zero run --max-iterations 50
Or via agent:
Load ralph-zero skill and run autonomous loop
When a requirement is too large, use these patterns:
Original: "Add user authentication"
Split into:
- US-001: Add users table and auth schema
- US-002: Create login/signup API endpoints
- US-003: Add session management middleware
- US-004: Create login UI component
- US-005: Create signup UI component
- US-006: Add protected route handling
Original: "Build dashboard"
Split into:
- US-001: Create dashboard layout component
- US-002: Add metrics summary card
- US-003: Add recent activity list
- US-004: Add quick actions panel
- US-005: Add filter/search controls
Original: "Add task management"
Split into:
- US-001: Create task (form + API)
- US-002: View task list (query + display)
- US-003: Edit task (modal + API)
- US-004: Delete task (confirmation + API)
- US-005: Bulk operations (select + actions)
Before saving prd.json, verify:
ralph/[feature-name]passes fields are falsenotes fields are empty stringsIf validation fails, report clearly:
โ Validation failed:
- US-003 is too large (15 acceptance criteria)
- US-005 depends on feature from US-007
- US-002 missing "Typecheck passes" criterion
Please revise the PRD to address these issues, then try again.
# Task Status Feature
Add ability to mark tasks with different statuses.
## Requirements
- Toggle between pending/in-progress/done
- Filter list by status
- Show status badge on each task
- Persist status in database
{
"project": "TaskApp",
"branchName": "ralph/task-status",
"description": "Task Status Feature - Track task progress",
"userStories": [
{
"id": "US-001",
"title": "Add status field to tasks table",
"description": "As a developer, I need to store task status",
"acceptanceCriteria": [
"Add status column: 'pending' | 'in_progress' | 'done' (default 'pending')",
"Generate and run migration successfully",
"Typecheck passes"
],
"priority": 1,
"passes": false,
"notes": ""
},
{
"id": "US-002",
"title": "Display status badge on task cards",
"description": "As a user, I want to see task status at a glance",
"acceptanceCriteria": [
"Each task card shows colored status badge",
"Badge colors: gray=pending, blue=in_progress, green=done",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 2,
"passes": false,
"notes": ""
},
{
"id": "US-003",
"title": "Add status toggle to task list",
"description": "As a user, I want to change status directly",
"acceptanceCriteria": [
"Each row has status dropdown",
"Changing status saves immediately",
"UI updates without page refresh",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 3,
"passes": false,
"notes": ""
},
{
"id": "US-004",
"title": "Filter tasks by status",
"description": "As a user, I want to filter by status",
"acceptanceCriteria": [
"Filter dropdown: All | Pending | In Progress | Done",
"Filter persists in URL params",
"Typecheck passes",
"Verify in browser using dev-browser skill"
],
"priority": 4,
"passes": false,
"notes": ""
}
]
}