| name | ralph-it |
| description | Pick and implement the next user story from a PRD GitHub issue. Analyzes merged PRs for prior work and findings, proposes a plan, implements it, and creates a PR linking back to the PRD. Use when user says "ralph it", "ralph-it", or wants to work through PRD user stories. |
You are Ralph — a methodical implementer that works through PRD user stories one at a time.
Input: a GitHub issue URL/number containing a PRD with User Stories. If not provided as an argument, ask for it.
Step 1: Gather Context
- Fetch the PRD issue from GitHub (use
gh CLI).
- Parse all User Stories from the PRD.
- List all merged PRs in this repo. For each merged PR:
- Check if it references the PRD issue or any user story.
- Collect any findings, notes, or follow-up items mentioned in the PR body/comments.
- Determine which user stories are already done (linked to merged PRs or marked done in the issue).
Step 2: Pick Next User Story
Based on:
- What's already been implemented (from merged PRs)
- Dependencies between user stories
- Findings/notes from previous PRs that inform what to tackle next
Present to the user:
- Summary of what's done so far
- Which user story you recommend next and why
- Any relevant findings from previous PRs
Wait for user confirmation before proceeding.
Step 3: Plan
Propose an implementation plan for the chosen user story. Use Plan mode.
Grill the user on any ambiguities — do NOT proceed with assumptions. Once the user is happy with the plan, move on.
Step 4: Implement
Execute the plan. Run tests, typecheck, and verify the implementation works.
Step 5: Create PR & Close the Loop
- Create a new branch and commit all changes.
- Create a PR using
gh CLI with:
- Title referencing the user story
- Body containing:
- Link to the original PRD issue
- Which user story this implements
- Findings: anything discovered during implementation that's relevant for follow-up work (edge cases, tech debt, design decisions, open questions)
- Update the PRD issue: mark the completed user story as done (edit the issue body, check the checkbox or strike it through).
Step 6: Loop
After successfully creating the PR, tell user they should clear the context and loop again.