Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes...
npx skills add cbzehner/claude-skill-double-ralph
Or install specific skill: npx add-skill https://github.com/cbzehner/claude-skill-double-ralph
# Description
Iterative implementation loop with review checkpoints. Use for multi-step tasks that benefit from chunked execution and verification. Adapts to project-specific conventions via .ralph.md guidance file.
# SKILL.md
name: double-ralph
description: Iterative implementation loop with review checkpoints. Use for multi-step tasks that benefit from chunked execution and verification. Adapts to project-specific conventions via .ralph.md guidance file.
Double Ralph: Iterative Implementation Loop
Execute work through iterative cycles with review checkpoints between chunks.
Invocation
/double-ralph [state-file]
Examples:
- /double-ralph plans/my-feature.md - Execute a plan file
- /double-ralph - Auto-detect state file per project guidance
Project Guidance
Double-ralph adapts to project-specific conventions via a .ralph.md file.
Finding .ralph.md
Search in order:
1. Git repository root: git rev-parse --show-toplevel then check for .ralph.md
2. Walk up from current directory: Check each parent until .ralph.md found or root reached
3. State file's directory: If state file provided, check its directory
# Get git project root
git rev-parse --show-toplevel 2>/dev/null
If No .ralph.md Found
Use AskUserQuestion to offer creating one:
"No .ralph.md found for this project. Would you like to create one?"
- Yes, help me create it - Ask design questions, generate .ralph.md
- Use defaults - Continue with plan-file conventions
- Skip for now - Continue without guidance
See examples/ in this skill's directory for templates and the README for guidance on crafting .ralph.md files.
The Loop
1. LOAD
- Find and load
.ralph.mdif present (provides project-specific guidance) - Read the state file
- Parse state according to guidance (or use default plan format)
Default format (when no .ralph.md):
---
status: pending # pending | in_progress | complete | archived
gaps: []
edge_cases: []
progress: []
last_review: null
---
# Title
## Section 1
...
If file lacks frontmatter, add defaults.
2. ASSESS
- Check completion status โ if complete/archived, inform user and exit
- Update status to
in_progressif pending - Identify work units per guidance:
- Default:
##headings not in progress array - Per guidance: acceptance criteria, issues, custom sections
- Group related units if guidance suggests logical groupings
- If all units complete โ proceed to final review
3. SPAWN INNER LOOP
Use the Task tool to spawn a subagent:
Task(
subagent_type: "general-purpose",
description: "Implement: [work unit summary]",
prompt: [see inner-prompt.md, include project guidance if present]
)
Inner loop works until:
- Work unit complete
- Blocked (needs decision, unclear requirement)
- ~15-20 turns (context management)
- Context feels heavy
Returns structured summary (see inner-prompt.md for format).
4. REVIEW
Review method per .ralph.md guidance. Default: magi synthesis.
/magi "Review this implementation work:
## Work Summary
[inner loop's returned summary]
## Work Unit
[what was being implemented]
## Evaluate
1. Implementation correctness - Does it work? Tests pass?
2. Alignment - Did the work match the intended unit?
3. Gap discovery - Any new gaps, edge cases, or TODOs?
4. Completeness - Is the overall work fully realized?
Return structured assessment:
- verdict: pass | fail | needs_work
- gaps_discovered: [list]
- edge_cases_discovered: [list]
- remaining_work: [description]
- recommendation: continue | needs_human_input | archive
- rationale: [brief explanation]"
Fallback: If magi unavailable, perform the review yourself.
5. UPDATE STATE
Update the state file per guidance:
- Default: Update frontmatter arrays (gaps, edge_cases, progress)
- Per guidance: Check off criteria, append to sections, etc.
Set review timestamp.
6. ROUTE
Based on review recommendation:
continue: Go to step 2.
needs_human_input:
- Use AskUserQuestion to surface the decision
- Present: what was attempted, what needs clarification, options
- After response โ step 2
archive (or equivalent completion):
- Verify no remaining gaps/issues per guidance
- Mark complete and move/archive per guidance
- If issues remain โ inform user, continue to step 2
Completion Criteria
The loop completes when:
1. Review assesses work as "fully realized"
2. No remaining gaps or blockers
3. Per-guidance completion signals sent (if applicable)
Error Handling
| Scenario | Action |
|---|---|
| Magi unavailable | Self-review (continue functioning) |
| Inner loop blocked | Surface via AskUserQuestion |
| State file parse error | Show error, ask user to fix |
| No .ralph.md | Offer to create or use defaults |
Manual Control
Interrupt anytime. State file preserves progress. Resume with /double-ralph [state-file].
Reference
inner-prompt.md- Inner loop subagent templateexamples/- Example .ralph.md files for different project typesexamples/README.md- Guide for crafting .ralph.md filesdocs/ARCHITECTURE.md- Full architecture documentation
# README.md
Double Ralph
Iterative implementation loops with review checkpoints. What could possibly go wrong?
"More Ralphs is always better, rite?"
An outer Ralph orchestrates. Inner Ralphs implement. Magi reviews.
It's Ralphs all the way down.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OUTER RALPH โ
โ (the orchestrator) โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ INNER RALPH โ โ
โ โ (does work) โ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ /magi review โ
โ โ โ
โ โผ โ
โ repeat until done โ
โ (or until chaos) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Why?
Long tasks lose context. Claude forgets what it was doing 47 tool calls ago. Double Ralph fixes this by:
- Chunking work - Inner Ralphs work on one unit at a time
- Reviewing progress - Magi checks each chunk before continuing
- Persisting state - Everything saved to file, so you can stop and resume
It's like having a responsible adult supervise the hyperactive code monkeys.
Prerequisites
Works best with magi installed for reviews. Falls back to self-review if unavailable (Ralph reviewing Ralph's workโtotally objective).
Installation
From Marketplace
/plugin marketplace add cbzehner/claude-skill-double-ralph
/plugin install double-ralph@cbzehner
Manual Installation
cd ~/.claude/skills/
git clone https://github.com/cbzehner/claude-skill-double-ralph.git double-ralph
Usage
/double-ralph [state-file]
Point it at a plan or task file and watch the Ralphs go:
You: /double-ralph plans/auth-system.md
Claude: [Outer Ralph reads the plan]
[Spawns Inner Ralph for Section 1]
[Inner Ralph builds stuff, runs tests]
[Inner Ralph returns: "I did things!"]
[Magi reviews: "The things are acceptable."]
[Outer Ralph updates plan, moves to Section 2]
[Repeat until victory or /triple-ralph]
Project Guidance (.ralph.md)
Double-ralph adapts to your project's conventions via a .ralph.md file at your repo root.
What It Does
Without .ralph.md: Uses default plan-file conventions (YAML frontmatter + ## sections).
With .ralph.md: Adapts to your project's way of doing things:
- Where state files live
- How to identify work units (sections, acceptance criteria, issues)
- When and how to review
- How to signal completion
Creating One
Run /double-ralph without a .ralph.md and you'll be offered the choice to create one. The skill asks questions about your project and generates a starter file.
Or see examples/ for templates:
- plan-based.ralph.md - Traditional plan files with ## sections
- task-based.ralph.md - Task files with acceptance criteria (launchpad-style)
- github-issues.ralph.md - GitHub issues as work units
- minimal.ralph.md - Simplest possible configuration
See examples/README.md for a guide on crafting your own.
Example .ralph.md
# .ralph.md - My Project
## State Files
Tasks in `.tasks/` with YAML frontmatter and acceptance criteria.
## Work Units
Each unchecked criterion is a work unit. Group related criteria.
## Review
Self-review after each unit. Magi review before completion.
## Completion
When all criteria met: signal done via `/done`.
Default State Format
When no .ralph.md is found, uses YAML frontmatter + markdown sections:
---
status: pending # pending | in_progress | complete | archived
gaps: [] # things we discovered we need
edge_cases: [] # things that might explode
progress: [] # sections completed
last_review: null
---
# My Feature Plan
## Section 1: The Setup
What to build...
## Section 2: The Hard Part
The actual work...
Frontmatter gets added automatically if missing.
The Loop
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OUTER RALPH โ
โ โ
โ 1. LOAD โ Find .ralph.md, read state file โ
โ 2. ASSESS โ Find next incomplete work unit โ
โ 3. SPAWN โ Inner Ralph implements it โ
โ 4. REVIEW โ Magi (or self) checks the work โ
โ 5. UPDATE โ Save progress per guidance โ
โ 6. ROUTE โ Continue | Ask human | Complete โ
โ โ
โ Inner Ralph exits when: โ
โ โข Work unit complete โ
โ โข Hit a blocker โ
โ โข ~15-20 turns (context getting heavy) โ
โ โข Existential crisis โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Completion
Work gets marked complete when:
1. Review says "this is done"
2. AND no gaps remain
3. AND per-guidance completion signals sent
Until then, the Ralphs keep Ralphing.
Error Handling
| Problem | Solution |
|---|---|
| Magi unavailable | Ralph reviews Ralph (it's fine) |
| Inner Ralph blocked | Asks you for help |
| State file broken | Shows error, asks you to fix it |
| No .ralph.md | Offers to create one or uses defaults |
| Triple Ralph attempted | inconceivable |
Files
double-ralph/
โโโ SKILL.md # The actual skill
โโโ inner-prompt.md # Template for Inner Ralph
โโโ README.md # You are here
โโโ LICENSE # MIT (Ralphs are free)
โโโ docs/
โ โโโ ARCHITECTURE.md # The serious documentation
โโโ examples/
โ โโโ README.md # Guide for crafting .ralph.md
โ โโโ plan-based.ralph.md
โ โโโ task-based.ralph.md
โ โโโ github-issues.ralph.md
โ โโโ minimal.ralph.md
โ โโโ example-plan.md # A sample plan file
โโโ plans/
โโโ archived/ # Where completed plans go to rest
Manual Override
Interrupt anytime. State is saved to file. Come back later and /double-ralph picks up where it left off. The Ralphs are patient.
License
MIT
"What could go wrong?" โ Everyone, right before finding out
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.