Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.
Create detailed Product Requirements Documents that are clear, actionable, and suitable for autonomous AI implementation via the Ralph loop.
PRD.mdprogress.txtImportant: Do NOT start implementing. Just create the PRD.
Ask only critical questions where the initial prompt is ambiguous. Focus on:
1. What is the primary goal of this feature?
A. Improve user onboarding experience
B. Increase user retention
C. Reduce support burden
D. Other: [please specify]
2. Who is the target user?
A. New users only
B. Existing users only
C. All users
D. Admin users only
3. What is the scope?
A. Minimal viable version
B. Full-featured implementation
C. Just the backend/API
D. Just the UI
This lets users respond with "1A, 2C, 3B" for quick iteration.
Each story must be completable in ONE context window (~10 min of AI work).
Ralph spawns a fresh instance per iteration with no memory of previous work. If a story is too big, the AI runs out of context before finishing and produces broken code.
| Too Big | Split Into |
|---|---|
| "Build the dashboard" | Schema, queries, UI components, filters |
| "Add authentication" | Schema, middleware, login UI, session handling |
| "Add drag and drop" | Drag events, drop zones, state update, persistence |
| "Refactor the API" | One story per endpoint or pattern |
Rule of thumb: If you cannot describe the change in 2-3 sentences, it is too big.
Stories execute in priority order. Earlier stories must NOT depend on later ones.
Correct order:
Wrong order:
US-001: UI component (depends on schema that doesn't exist yet!)
US-002: Schema change
Each criterion must be something Ralph can CHECK, not something vague.
status column to tasks table with default 'pending'""Typecheck passes"
"Verify changes work in browser"
Generate the PRD with these sections:
Brief description of the feature and the problem it solves.
Specific, measurable objectives (bullet list).
Each story needs:
Format:
### US-001: [Title]
**Description:** As a [user], I want [feature] so that [benefit].
**Acceptance Criteria:**
- [ ] Specific verifiable criterion
- [ ] Another criterion
- [ ] Typecheck passes
- [ ] [UI stories] Verify changes work in browser
What this feature will NOT include. Critical for scope.
# PRD: Task Priority System
## Introduction
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.
## Goals
- Allow assigning priority (high/medium/low) to any task
- Provide clear visual differentiation between priority levels
- Enable filtering by priority
- Default new tasks to medium priority
## User Stories
### US-001: Add priority field to database
**Description:** As a developer, I need to store task priority so it persists across sessions.
**Acceptance Criteria:**
- [ ] Add priority column: 'high' | 'medium' | 'low' (default 'medium')
- [ ] Generate and run migration successfully
- [ ] Typecheck passes
### US-002: Display priority indicator on task cards
**Description:** As a user, I want to see task priority at a glance so I know what needs attention first.
**Acceptance Criteria:**
- [ ] Each task card shows colored priority badge (red=high, yellow=medium, gray=low)
- [ ] Priority visible without hovering or clicking
- [ ] Typecheck passes
- [ ] Verify changes work in browser
### US-003: Add priority selector to task edit
**Description:** As a user, I want to change a task's priority when editing it.
**Acceptance Criteria:**
- [ ] Priority dropdown in task edit modal
- [ ] Shows current priority as selected
- [ ] Saves immediately on selection change
- [ ] Typecheck passes
- [ ] Verify changes work in browser
### US-004: Filter tasks by priority
**Description:** As a user, I want to filter the task list to see only high-priority items when I'm focused.
**Acceptance Criteria:**
- [ ] Filter dropdown with options: All | High | Medium | Low
- [ ] Filter persists in URL params
- [ ] Empty state message when no tasks match filter
- [ ] Typecheck passes
- [ ] Verify changes work in browser
## Non-Goals
- No priority-based notifications or reminders
- No automatic priority assignment based on due date
- No priority inheritance for subtasks
## Technical Considerations
- Reuse existing badge component with color variants
- Filter state managed via URL search params
Save to PRD.md in the current directory.
Also create progress.txt:
# Progress Log
## Learnings
(Patterns discovered during implementation)
---
After generating a PRD, you can use the bundled ralph.sh script to automatically implement all user stories.
Copy the ralph.sh script from the plugin to your project:
cp ~/.claude/plugins/ralph-prd/scripts/ralph.sh ./
chmod +x ralph.sh
# Run with default settings (max 10 iterations, 2 second pause between)
./ralph.sh
# Run with custom max iterations
./ralph.sh 20
# Run with custom iterations and pause time
./ralph.sh 20 5
The script will automatically: