name: ralph description: "Plan a feature and create GitHub Issues for Ralph autonomous execution. Use when planning a feature, starting a new project, or creating stories for Ralph. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out, convert this prd, ralph."
Plan a feature, break it into right-sized stories, and create GitHub Issues for autonomous execution by Ralph.
gh CLIImportant: Do NOT start implementing. Just create the milestone and issues.
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. Remember to indent the options.
After receiving the user's answers, spawn a specialist agent using the Agent tool with model: "opus" to produce the PRD and stories. Pass it:
The specialist agent should return:
Use its output verbatim for Step 3. Do not redesign or re-summarize the stories yourself.
Design user stories following these rules.
Each story must be completable in ONE Ralph iteration (one context window).
Ralph spawns a fresh agent instance per iteration with no memory of previous work. If a story is too big, the LLM runs out of context before finishing and produces broken code.
Rule of thumb: If you cannot describe the change in 2-3 sentences, it is too big.
Issues are created in dependency order. Ralph picks the oldest ralph:todo issue first, so creation order = execution order.
Correct order:
Wrong order:
Each criterion must be something the agent can CHECK, not something vague.
status column to tasks table with default 'pending'"Typecheck passes
For stories with testable logic, also include:
Tests pass
For stories that change UI, also include:
Verify in browser using dev-browser skill
Use gh CLI to create everything. Run these commands in sequence.
gh api repos/{owner}/{repo}/milestones -f title="<feature-name>" -f description="<goals, non-goals, technical context>"
The milestone description should capture the high-level PRD context: goals, non-goals, success metrics, and technical considerations. This is the only place this information lives.
gh label create "ralph:todo" --color "5319E7" --description "Story not started" --force
gh label create "ralph:in-progress" --color "FBCA04" --description "Agent working on story" --force
gh label create "ralph:done" --color "0E8A16" --description "Story completed" --force
gh label create "ralph:failed" --color "D93F0B" --description "Story failed" --force
For each story, create an issue. Creation order matters — Ralph picks the oldest ralph:todo issue first.
Important: Always write the issue body to a temp file and use --body-file instead of --body. This avoids Claude Code permission warnings about quoted newlines with #-prefixed lines.
cat > /tmp/issue-body.md << 'ISSUE_EOF'
As a [user], I want [feature] so that [benefit].
## Acceptance Criteria
- [ ] Specific verifiable criterion
- [ ] Another criterion
- [ ] Typecheck passes
ISSUE_EOF
gh issue create \
--title "<Story title>" \
--body-file /tmp/issue-body.md \
--milestone "<feature-name>" \
--label "ralph:todo"
Keep it simple. The title is the story name. The body is the description + checklist. GitHub's issue number is the ID.
The issue reader is an AI agent with no prior context. Therefore:
If a PRD has big features, split them:
Original:
"Add user notification system"
Split into:
Each is one focused change that can be completed and verified independently.
User asks: "Add task status tracking"
After Q&A, create:
Milestone: task-status
Description: "Track task progress with status indicators. Goals: toggle status, filter by status, visual badges. Non-goals: no status history/audit log, no automated status transitions."
Issues (created in this order):
Add status field to tasks table
As a developer, I need to store task status in the database.
- Add status column: 'pending' | 'in_progress' | 'done' (default 'pending')
- Generate and run migration successfully
- Typecheck passes
Display status badge on task cards
As a user, I want to see task status at a glance.
- 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
Add status toggle to task list rows
As a user, I want to change task status directly from the list.
- Each row has status dropdown or toggle
- Changing status saves immediately
- UI updates without page refresh
- Typecheck passes
- Verify in browser using dev-browser skill
Filter tasks by status
As a user, I want to filter the list to see only certain statuses.
- Filter dropdown: All | Pending | In Progress | Done
- Filter persists in URL params
- Typecheck passes
- Verify in browser using dev-browser skill