Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Run RALPH autonomous development loop to implement features from the PRD.
.claude/skills/majiayu000-ralph-run/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 129% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 144% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 507% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 120% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 116% | 0% |
Execute the RALPH development cycle using a multi-agent pipeline: Planner → Coder → QA Reviewer → QA Fixer
| Command | Description | |---------|-------------| | /ralph-run | Start with default 10 iterations | | /ralph-run 20 | Start with 20 iterations | | /ralph-run --parallel | Run independent subtasks in parallel | | /ralph-run --simple | Skip planner, direct implementation | | /ralph-run --task "desc" | Single-task mode (no PRD needed) | | /ralph-run --no-worktree | Run in current branch (skip worktree isolation) |
| Command | Description | |---------|-------------| | /ralph-merge | Merge completed worktree to main branch | | /ralph-review | Review worktree changes before merging | | /ralph-discard | Abandon worktree without merging |
/ralph-run┌─────────────────────────────────────────────────────────────────┐
│ RALPH Pipeline v3.0 │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ PLANNER │───▶│ CODER │───▶│ QA REV │───▶│ QA FIX │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │ │ │ │ │
│ ▼ ▼ ▼ ▼ │
│ impl_plan.json subtask done QA report fixes done │
│ │ │ │
│ └───────────────┘ │
│ (loop until pass) │
│ │
└─────────────────────────────────────────────────────────────────┘Before starting, verify environment and set up isolated worktree:
bash# Check for PRD if [ -f prd.json ]; then REMAINING=$(cat prd.json | jq '[.userStories[] | select(.passes == false)] | length') PROJECT=$(cat prd.json | jq -r '.project') BRANCH=$(cat prd.json | jq -r '.branchName // "ralph/feature"') echo "✓ PRD: $PROJECT - $REMAINING stories remaining" else echo "❌ No prd.json - run /prd first" exit 1 fi # Check for implementation plan if [ -f implementation_plan.json ]; then echo "✓ Implementation plan exists" else echo "⚠ No implementation_plan.json - will invoke Planner" fi # Check for config [ -f .ralph/config.yaml ] && echo "✓ Config loaded" [ -f PROJECT_SPEC.md ] && echo "✓ Project spec loaded"
RALPH runs in an isolated git worktree to protect the main branch:
╔════════════════════════════════════════════════════════════════╗
║ Worktree Setup ║
╚════════════════════════════════════════════════════════════════╝
Checking for existing worktree...
Creating worktree for: user-authentication
Branch: ralph/user-authentication
Path: .worktrees/user-authentication/
✓ Worktree created
✓ .gitignore updated (ignoring .worktrees/)
All development will happen in: .worktrees/user-authentication/
When complete, use:
/ralph-merge - Merge changes to main
/ralph-review - Review changes before merging
/ralph-discard - Abandon changesWorktree Structure:
project/
├── .worktrees/ # Worktree directory (gitignored)
│ └── {spec-name}/ # Isolated working copy
│ ├── src/ # Full project copy
│ ├── .ralph/ # RALPH state
│ └── prd.json # PRD file
├── src/ # Main branch (untouched)
└── prd.json # Original PRDBenefits:
If no implementation_plan.json exists, invoke the Planner:
The Planner agent decomposes stories into subtasks:
╔════════════════════════════════════════════════════════════════╗
║ Phase 1: PLANNING ║
║ Agent: Planner ║
╚════════════════════════════════════════════════════════════════╝
Analyzing PRD...
Reading PROJECT_SPEC.md for patterns...
Querying memory for past implementations...
Decomposing US-001 into subtasks:
ST-001-1: Create User type definitions
ST-001-2: Create Zod validation schema
ST-001-3: Create User service layer
ST-001-4: Add unit tests
Writing implementation_plan.json...Planner outputs implementation_plan.json:
json{ "stories": [{ "storyId": "US-001", "subtasks": [{ "id": "ST-001-1", "title": "Create User type definitions", "files_to_create": ["src/types/user.ts"], "files_to_modify": ["src/types/index.ts"], "dependencies": [], "acceptance_criteria": ["User interface defined", "Exported from index"] }] }] }
For each subtask, the Coder agent implements:
╔════════════════════════════════════════════════════════════════╗
║ Phase 2: IMPLEMENTATION ║
║ Agent: Coder ║
║ Subtask: ST-001-1 ║
╚════════════════════════════════════════════════════════════════╝
Reading subtask requirements...
Checking project patterns...
Loading memory insights...
Implementing: Create User type definitions
→ Creating src/types/user.ts
→ Modifying src/types/index.ts
Running quality gates...
✓ Typecheck passed
✓ Lint passed
✓ Tests passed
Subtask implementation complete.
Passing to QA Reviewer...Coder can spawn subagents for parallel work:
javascript// For independent subtasks, use Task tool Task({ subagent_type: "general-purpose", description: "Implement ST-001-2", prompt: "Implement the Zod validation schema...", run_in_background: true })
QA Reviewer validates each subtask against acceptance criteria:
╔════════════════════════════════════════════════════════════════╗
║ Phase 3: QA REVIEW ║
║ Agent: QA Reviewer ║
║ Subtask: ST-001-1 ║
╚════════════════════════════════════════════════════════════════╝
Validating acceptance criteria...
Criterion: User interface defined
✓ PASS - Found User interface in src/types/user.ts:5-15
Criterion: Exported from index
✗ FAIL - Export statement missing from src/types/index.ts
Quality Gates:
✓ Typecheck
✓ Lint
✓ Tests
Issues Found: 1
[HIGH] Missing export in src/types/index.ts
Status: NEEDS_FIX
Passing to QA Fixer...QA Report Schema:
json{ "subtaskId": "ST-001-1", "status": "needs_fix", "criteria": [ {"criterion": "User interface defined", "passed": true}, {"criterion": "Exported from index", "passed": false, "issue": "Missing export"} ], "issues": [{ "severity": "high", "file": "src/types/index.ts", "suggestion": "Add: export * from './user';" }] }
If QA fails, QA Fixer attempts to resolve issues:
╔════════════════════════════════════════════════════════════════╗
║ Phase 4: QA FIX ║
║ Agent: QA Fixer ║
║ Attempt: 1/3 ║
╚════════════════════════════════════════════════════════════════╝
Issues to fix: 1
[HIGH] Missing export in src/types/index.ts
Applying fix...
→ Editing src/types/index.ts
→ Adding: export * from './user';
Re-running quality gates...
✓ Typecheck passed
✓ Lint passed
✓ Tests passed
Status: ALL_FIXED
Returning to QA Reviewer for verification...QA Fix Loop:
QA Reviewer ─────▶ PASS ─────▶ Next Subtask
│
▼
FAIL (issues)
│
▼
QA Fixer ─────▶ Fixed ─────▶ QA Reviewer (re-verify)
│
▼
Attempt 3 failed
│
▼
ESCALATE TO HUMANAfter subtask passes QA:
bash# Commit the changes git add -A git commit -m "feat: ST-001-1 - Create User type definitions - Created User interface with id, email, createdAt - Exported from src/types/index.ts - All quality gates pass Reviewed-By: QA-Agent Co-Authored-By: RALPH <noreply@anthropic.com>" # Update implementation plan # Mark subtask as complete
Log insights to .ralph/memory/insights.json:
json{ "context": "Implementing type definitions", "learning": "Always export new types from index.ts immediately", "tags": ["types", "exports", "patterns"], "timestamp": "2026-01-25T10:30:00Z" }
If compact_after_each_story: true in config:
📦 Compacting context...
Preserving:
- PRD state (5 stories remaining)
- Memory insights (12 total)
- Progress log (1 story complete)
Releasing:
- File exploration details
- Implementation specifics
- QA fix history
Context compacted at 60% threshold.╔════════════════════════════════════════════════════════════════╗
║ RALPH Iteration 1 Complete ║
╚════════════════════════════════════════════════════════════════╝
Worktree: .worktrees/user-authentication
Branch: ralph/user-authentication
Story: US-001 - Create User model
Subtasks: 4/4 complete
Pipeline Summary:
┌──────────────────────────────────────────────────────────────┐
│ Planner │ ✓ Created 4 subtasks │
│ Coder │ ✓ Implemented all subtasks │
│ QA Review │ ✓ 3 passed first time, 1 needed fix │
│ QA Fixer │ ✓ Fixed 1 issue (missing export) │
└──────────────────────────────────────────────────────────────┘
Quality Gates:
✓ Typecheck passed
✓ Lint passed
✓ Tests passed (4 new tests)
Commits (in worktree):
abc1234 feat: ST-001-1 - Create User type definitions
def5678 feat: ST-001-2 - Create Zod validation schema
ghi9012 feat: ST-001-3 - Create User service layer
jkl3456 feat: ST-001-4 - Add unit tests
Memory:
+ 3 new insights saved
Progress: 1/6 stories (17% complete)
Remaining: 5 stories
Worktree Status:
✓ 4 commits ahead of main
✓ 12 files changed
Next: US-002 - Implement password hashing
When complete, run /ralph-merge to integrate changes.When QA Fixer fails 3 times:
╔════════════════════════════════════════════════════════════════╗
║ ESCALATION REQUIRED ║
╚════════════════════════════════════════════════════════════════╝
Subtask: ST-001-3 - Create User service
Attempts: 3 (max reached)
Unresolved Issue:
[HIGH] Type mismatch in UserService.create()
Tried:
1. Cast to correct type - still fails
2. Add type assertion - introduces any
3. Refactor function signature - breaks tests
Recommendation:
This may require architectural changes.
Options:
1. Provide guidance to continue
2. Skip this subtask for now
3. Abort RALPH runUse AskUserQuestion for human decision.
With /ralph-run --parallel:
╔════════════════════════════════════════════════════════════════╗
║ RALPH Parallel Mode ║
╚════════════════════════════════════════════════════════════════╝
Analyzing subtask dependencies...
Parallel Batch 1 (no dependencies):
→ Spawning agent: ST-001-1
→ Spawning agent: ST-001-2
Waiting for completion...
[████████░░] ST-001-1: Implementing types...
[██████████] ST-001-2: ✓ Complete
Parallel Batch 2 (depends on batch 1):
→ Spawning agent: ST-001-3
→ Spawning agent: ST-001-4With /ralph-run --simple:
Skip the Planner agent, implement stories directly:
╔════════════════════════════════════════════════════════════════╗
║ RALPH Simple Mode ║
╚════════════════════════════════════════════════════════════════╝
Skipping Planner (simple mode)
Implementing US-001 directly...
Pipeline: Coder → QA Reviewer → QA FixerRALPH automatically adapts the pipeline based on PRD complexity:
╔════════════════════════════════════════════════════════════════╗
║ Complexity Classification ║
╚════════════════════════════════════════════════════════════════╝
Analyzing PRD complexity...
Level: STANDARD
Score: 28
Metrics:
Stories: 6
Files affected: 12
Dependencies: 3
Acceptance criteria: 24
Pipeline configured for STANDARD complexity.╔════════════════════════════════════════════════════════════════╗
║ SIMPLE Pipeline ║
╚════════════════════════════════════════════════════════════════╝
Complexity: SIMPLE (score < 15)
Pipeline: CODER → LIGHT QA
- No Planner agent (direct implementation)
- Light QA validation (essential checks only)
- No parallel execution
- No research phase
- Single iteration per story╔════════════════════════════════════════════════════════════════╗
║ STANDARD Pipeline ║
╚════════════════════════════════════════════════════════════════╝
Complexity: STANDARD (score 15-40)
Pipeline: PLANNER → CODER → QA REVIEWER → QA FIXER
- Full planning phase
- Standard QA validation
- Parallel execution enabled
- Max 3 QA fix attempts
- Memory logging╔════════════════════════════════════════════════════════════════╗
║ COMPLEX Pipeline ║
╚════════════════════════════════════════════════════════════════╝
Complexity: COMPLEX (score > 40)
Pipeline: RESEARCH → PLANNER → SELF-CRITIQUE → CODER → EXTENSIVE QA
- Research phase before planning
- Extended planning with risk analysis
- Self-critique validates plan quality
- Extensive QA with more iterations
- Max 5 QA fix attempts
- Mandatory human checkpointsForce a specific complexity level:
bash/ralph-run --complexity=COMPLEX /ralph-run --complexity=SIMPLE
yaml# .ralph/config.yaml complexity: auto_detect: true default_level: STANDARD simple: max_qa_attempts: 2 use_planner: false parallel_enabled: false standard: max_qa_attempts: 3 use_planner: true parallel_enabled: true complex: max_qa_attempts: 5 use_planner: true parallel_enabled: true research_phase: true self_critique: true human_checkpoints: true
| Error | Action | |-------|--------| | No PRD found | Direct to /prd [feature] | | No implementation plan | Invoke Planner agent | | QA fails 3 times | Escalate to human | | Quality gate fails | QA Fixer attempts fix | | Agent timeout | Retry or skip subtask | | Unclear requirements | Use AskUserQuestion |
In .ralph/config.yaml:
yamlpipeline: use_planner: true max_qa_attempts: 3 parallel_enabled: false max_parallel_agents: 4 settings: compact_after_each_story: true compact_threshold: 60 commit_after_each_subtask: true
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | fail→pass | 15,693 | 11,828 | -25% | 1 | 1 | 0% | 2,436 | 5,583 | +129% | 0 | 0 | — |
case-01 | fail→fail | 13,544 | 15,691 | +16% | 1 | 1 | 0% | 508 | 4,849 | +855% | 0 | 0 | — |
case-02 | fail→fail | 15,641 | 5,699 | -64% | 1 | 1 | 0% | 188 | 4,864 | +2487% | 0 | 0 | — |
case-03 | fail→fail | 25,714 | 14,832 | -42% | 1 | 1 | 0% | 3,820 | 4,889 | +28% | 0 | 0 | — |
case-04 | fail→fail | 10,746 | 10,072 | -6% | 1 | 1 | 0% | 311 | 4,744 | +1425% | 0 | 0 | — |
case-05 | fail→fail | 8,184 | 13,576 | +66% | 1 | 1 | 0% | 1,387 | 4,803 | +246% | 0 | 0 | — |
case-06 | fail→fail | 12,797 | 6,476 | -49% | 1 | 1 | 0% | 1,358 | 4,816 | +255% | 0 | 0 | — |
case-07 | pass→pass | 12,202 | 9,180 | -25% | 1 | 1 | 0% | 1,076 | 5,177 | +381% | 0 | 0 | — |
case-08 | fail→pass | 18,928 | 9,096 | -52% | 1 | 1 | 0% | 2,149 | 5,247 | +144% | 0 | 0 | — |
case-09 | fail→pass | 24,948 | 8,463 | -66% | 1 | 1 | 0% | 838 | 5,088 | +507% | 0 | 0 | — |
case-10 | fail→pass | 19,835 | 7,735 | -61% | 1 | 1 | 0% | 2,276 | 5,007 | +120% | 0 | 0 | — |
case-12 | fail→pass | 21,508 | 7,578 | -65% | 1 | 1 | 0% | 2,438 | 5,269 | +116% | 0 | 0 | — |
case-13 | fail→pass | 12,015 | 9,849 | -18% | 1 | 1 | 0% | 1,796 | 5,212 | +190% | 0 | 0 | — |
case-14 | fail→pass | 9,831 | 3,905 | -60% | 1 | 1 | 0% | 1,724 | 5,233 | +204% | 0 | 0 | — |
case-15 | fail→pass | 12,435 | 10,345 | -17% | 1 | 1 | 0% | 1,836 | 5,318 | +190% | 0 | 0 | — |
case-16 | fail→pass | 14,822 | 10,328 | -30% | 1 | 1 | 0% | 2,099 | 5,331 | +154% | 0 | 0 | — |
case-17 | fail→pass | 13,152 | 2,445 | -81% | 1 | 1 | 0% | 1,420 | 4,898 | +245% | 0 | 0 | — |
case-18 | fail→pass | 14,109 | 7,796 | -45% | 1 | 1 | 0% | 1,341 | 4,918 | +267% | 0 | 0 | — |
case-19 | fail→fail | 15,476 | 21,361 | +38% | 1 | 1 | 0% | 1,686 | 5,147 | +205% | 0 | 0 | — |
case-20 | fail→pass | 34,482 | 2,731 | -92% | 1 | 1 | 0% | 4,292 | 5,003 | +17% | 0 | 0 | — |
case-21 | pass→pass | 10,067 | 3,809 | -62% | 1 | 1 | 0% | 870 | 5,135 | +490% | 0 | 0 | — |
case-22 | pass→pass | 6,329 | 11,467 | +81% | 1 | 1 | 0% | 1,019 | 5,493 | +439% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +55 percentage points is the difference between those two pass rates over the 16 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.