Autonomous AI-assisted development methodology that keeps specs and code in sync through intelligent iteration loops.
Based on Geoffrey Huntley's Ralph pattern with adaptations for Claude Code.
Humans write specs (the "what"). The machine handles implementation (the "how").
specs/ ──► [planning loop] ──► IMPLEMENTATION_PLAN.md ──► [building loop] ──► code
- Specs are the source of truth
- Code is the derived artifact
- Fresh context per iteration prevents context debt
- Built-in quality gates create backpressure
/plugin marketplace add eumemic/ralphRun the setup command in Claude Code:
/ralph-setup
This adds ralph to your PATH.
ralph initCreates:
specs/- Where you write specifications.ralph/config.yaml- Configuration.ralph/IMPLEMENTATION_PLAN.md- Generated task list
Create markdown files in specs/ describing what you want to build. Focus on:
- What success looks like - Observable outcomes
- Acceptance criteria - Testable conditions
- Edge cases - What could go wrong
- Constraints - Performance, security, compatibility
Claude Code (with the Ralph plugin) can help you write specs through a structured conversation - just ask it to help you write a spec.
ralph planAnalyzes your specs against the codebase and generates a prioritized implementation plan in .ralph/IMPLEMENTATION_PLAN.md.
ralph buildImplements tasks one at a time, each iteration:
- Picks ONE task from the plan
- Writes test first
- Implements
- Validates
- Commits
- Restarts with fresh context
RALPH_MODEL=opus # Main agent (default: opus)
RALPH_SUBAGENT_MODEL=sonnet # Subagents (default: sonnet)your-project/
├── specs/ # Commit this - your specifications
│ ├── feature-one.md
│ └── feature-two.md
├── .ralph/ # Gitignore this - generated files
│ ├── config.yaml
│ └── IMPLEMENTATION_PLAN.md
└── src/
specs/should be committed to your repo - these are your project's requirements.ralph/should be gitignored - it contains generated files and local config
Add to your .gitignore:
.ralph/
Edit .ralph/config.yaml:
# Where to find specs (default: ./specs)
specs_dir: ./specs
# Or put them elsewhere
# specs_dir: ./docs/requirements| Command | Description |
|---|---|
/ralph-init |
Initialize Ralph in current project |
/ralph-setup |
Install ralph CLI to your PATH |
/ralph-plan |
Explain/run the planning loop |
/ralph-build |
Explain/run the building loop |
- Reads all specs
- Studies existing codebase with parallel subagents
- Performs gap analysis (spec vs implementation)
- Generates prioritized task list
- Repeats until plan stabilizes
- Reads specs and plan
- Picks highest priority incomplete task
- Searches codebase ("don't assume not implemented")
- Writes test first, then implements
- Runs validation (tests, code review)
- Commits on success
- Exits - loop restarts with fresh context
Each iteration gets a clean 200K token context. No accumulated confusion.
- Original methodology: Geoffrey Huntley
- Playbook synthesis: Clayton Farr
MIT