PRD to JSON Conversion Skill
Expert guidance for converting PRDs to Ralf's executable JSON format.
When to Use
- User has a PRD and wants to run Ralf
- User mentions "convert to json" or "prd.json"
- After generating a PRD, to prepare for execution
JSON Schema
{
"project": "string",
"branchName": "ralf/feature-name",
"description": "string",
"settings": {
"tddRequired": true,
"autoPush": true,
"executionMode": "sequential",
"evaluatorEnabled": true,
"allowReorder": true,
"evaluateEveryNIterations": 3,
"maxRetries": 3
},
"userStories": [
{
"id": "US-001",
"title": "string",
"description": "As a..., I want..., so that...",
"acceptanceCriteria": ["string"],
"priority": 1,
"passes": false,
"notes": "",
"targetFiles": ["src/path/to/file.ts"],
"specReference": "FR-1, FR-2",
"metrics": {
"startedAt": null,
"completedAt": null,
"durationMs": null,
"tokensConsumed": null,
"attempts": []
}
}
]
}
Conversion Rules
- Branch Naming:
ralf/prefix + kebab-case feature name - Story IDs: Sequential US-001, US-002, etc.
- Priority: Based on dependency order (1 = first to implement)
- Initial State: All
passes: false, emptynotes - Acceptance Criteria: Always end with "Typecheck passes"
- targetFiles: Scan codebase to identify likely files to create/modify
- specReference: Link to functional requirements (e.g., "FR-1, FR-2")
- metrics: Initialize with null values and empty attempts array
- settings: Include project-level execution preferences
Dependency Ordering
Priority must respect dependencies:
- Database/schema changes
- Backend logic/server actions
- UI components
- Integration/dashboard views
A story cannot depend on a later (higher priority number) story.
Story Size Validation
Before conversion, validate each story is small enough:
- Can be described in 2-3 sentences
- Touches limited number of files
- Has clear start and end point
- No "and then also..." scope creep
Archive Check
Before overwriting existing .ralf/prd.json:
- Check if existing
.ralf/prd.jsonhas different branchName - If yes, archive to
.ralf/archive/YYYY-MM-DD-feature-name/ - Include both
.ralf/prd.jsonand.ralf/progress.txt
Strong Linkage (FR-03)
Each story should have clear linkage to:
targetFiles
Identify files that will be created or modified:
- Scan existing codebase structure
- Consider component/module naming patterns
- Include test files if TDD is enabled
"targetFiles": [
"src/components/LoginForm.tsx",
"src/hooks/useAuth.ts",
"src/components/__tests__/LoginForm.test.tsx"
]
specReference
Link to functional requirements from the PRD:
- Reference FR numbers for traceability
- Helps verify all requirements are covered
- Enables requirement-to-implementation mapping
"specReference": "FR-1, FR-3, NFR-2"
Output
Save to: .ralf/prd.json
Create directory if needed: mkdir -p .ralf
