Task Priority System
This example demonstrates a complete Ralph workflow: from PRD toprd.json to autonomous execution. We’ll build a task priority system that lets users mark tasks as high, medium, or low priority.
The Feature
Add priority levels to tasks so users can focus on what matters most. Tasks can be marked as high, medium, or low priority, with visual indicators and filtering capabilities.Create the PRD
First, use the PRD skill to generate a requirements document:The skill will ask clarifying questions:Answer:
1A, 2B, 3CThe skill saves the PRD to tasks/prd-task-priority.md.Convert to prd.json
Use the Ralph skill to convert the markdown PRD to JSON:This generates
prd.json with properly structured user stories:Run Ralph
Start the autonomous execution loop:Ralph will:
- Create branch
ralph/task-priority - Pick the first story (US-001)
- Implement the database migration
- Run typecheck
- Commit if checks pass
- Mark US-001 as
passes: true - Move to US-002
- Continue until all stories pass
Execution Timeline
Iteration 1: Database Schema
Iteration 1: Database Schema
Story: US-001 - Add priority field to databaseRalph spawns an Amp instance that:
- Reads the existing schema
- Adds priority column with enum type
- Generates migration file
- Runs migration
- Runs typecheck
feat: add priority field to tasks tableUpdates to progress.txt:Iteration 2: Priority Badges
Iteration 2: Priority Badges
Story: US-002 - Display priority indicator on task cardsRalph spawns a fresh Amp instance that:
- Reads git history and progress.txt for context
- Finds the task card component
- Adds Badge component with color variants
- Verifies in browser using dev-browser skill
- Runs typecheck
feat: add priority badges to task cardsUpdates to progress.txt:Iteration 3: Edit UI
Iteration 3: Edit UI
Story: US-003 - Add priority selector to task editRalph spawns a fresh Amp instance that:
- Finds the task edit modal
- Adds Select component for priority
- Wires up to server action
- Verifies in browser using dev-browser skill
- Runs typecheck
feat: add priority selector to task edit modalIteration 4: Filtering
Iteration 4: Filtering
Story: US-004 - Filter tasks by priorityRalph spawns a fresh Amp instance that:
- Adds filter dropdown to task list header
- Implements URL param persistence
- Filters query based on selected priority
- Adds empty state message
- Verifies in browser using dev-browser skill
- Runs typecheck
feat: add priority filter to task listFinal output:Key Lessons
- Story Sizing
- Story Order
- Acceptance Criteria
- Memory Between Iterations
Each story was completable in one context window:Good sizing:
- US-001: Just database schema + migration
- US-002: Just display logic in one component
- US-003: Just edit UI in one modal
- US-004: Just filtering logic
- “Build entire priority system” (split into 4 stories)
- “Add priority with notifications” (separate concerns)
Try It Yourself
Use this example as a template:- Copy
prd.json.exampleto your project asprd.json - Run
./scripts/ralph/ralph.sh 10 - Watch Ralph complete all four stories
- Review commits and
progress.txtto understand the flow
This example is based on the actual
prd.json.example file included with Ralph. It demonstrates real patterns used in production.
