prd.json file is Ralph’s structured format for product requirement documents. It breaks features into small, autonomous user stories that Ralph can implement one at a time.
File Structure
Top-Level Fields
The name of the project or application.Example:
"MyApp"Git branch name for this feature. Must be prefixed with
ralph/ and use kebab-case.Example: "ralph/task-priority"Pattern: ralph/[feature-name-kebab-case]High-level description of the feature being implemented.Example:
"Task Priority System - Add priority levels to tasks"Array of user story objects. Stories execute in priority order.
User Story Object
Each story in theuserStories array has the following structure:
Unique identifier for the story. Use sequential format.Format:
US-001, US-002, US-003, etc.Brief, descriptive title for the user story.Example:
"Add priority field to database"User story in standard format explaining the “who, what, why.”Format:
"As a [user type], I want [feature] so that [benefit]"Example: "As a developer, I need to store task priority so it persists across sessions."Array of verifiable acceptance criteria. Must be checkable, not vague.Required criteria:
- Always include:
"Typecheck passes" - For UI stories, include:
"Verify in browser using dev-browser skill" - For testable logic, include:
"Tests pass"
Execution order. Lower numbers execute first. Must account for dependencies.Values:
1, 2, 3, etc.Ordering rule: Dependencies first (schema → backend → UI)Whether the story has been successfully implemented.Initial value:
falseUpdated by: Ralph sets to true after successful implementation and commitAdditional notes or context. Typically empty initially.Initial value:
""Complete Example
Story Sizing Guidelines
Right-Sized Stories
- 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
Too Big (Split These)
- “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
Rule of thumb: If you cannot describe the change in 2-3 sentences, it’s too big.
Story Ordering Rules
Stories execute inpriority order. Earlier stories must not 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
Wrong Order
- UI component (depends on schema that doesn’t exist yet) ❌
- Schema change
Acceptance Criteria Best Practices
Each criterion must be verifiable, not vague.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”
Bad Criteria (Vague)
- “Works correctly” ❌
- “User can do X easily” ❌
- “Good UX” ❌
- “Handles edge cases” ❌
Required Criteria
Always include as final criterion:Frontend stories are NOT complete until visually verified in the browser.
Archiving Previous Runs
Before writing a newprd.json, check if there’s an existing one from a different feature:
- Read the current
prd.jsonif it exists - Check if
branchNamediffers from the new feature’s branch name - If different AND
progress.txthas content beyond the header:- Create archive folder:
archive/YYYY-MM-DD-feature-name/ - Copy current
prd.jsonandprogress.txtto archive - Reset
progress.txtwith fresh header
- Create archive folder:
The
ralph.sh script handles archiving automatically when you run it.Conversion Checklist
Before savingprd.json, verify:
- Previous run archived (if prd.json exists with different branchName)
- 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
- All stories have
passes: falseinitially - All stories have empty
notesinitially
Related
- progress.txt Format - Track implementation progress
- AGENTS.md Files - Knowledge persistence across iterations
- Ralph Skill - Convert PRDs to prd.json format

