Next-generation autonomous development orchestrator with cognitive feedback loops...
Ralph Zero is an intelligent orchestration system that autonomously implements complex features by breaking them into verifiable stories and executing each through fresh agent iterations with comprehensive quality verification and cognitive feedback loops.
Ralph Zero is not the original bash-based Ralph implementations. It is a complete reimagining that combines:
AGENTS.md pattern documentationโ Use Ralph Zero when:
โ Don't use for:
Project-local installation (recommended):
# From your project root
git clone https://github.com/davidkimai/ralph-zero.git .claude/skills/ralph-zero
cd .claude/skills/ralph-zero
pip install -e .
Global installation:
git clone https://github.com/davidkimai/ralph-zero.git ~/.claude/skills/ralph-zero
cd ~/.claude/skills/ralph-zero
pip install -e .
For other agents, adjust the skills directory:
~/.cursor/skills/ralph-zero~/.vscode/copilot/skills/ralph-zero~/.config/amp/skills/ralph-zeroUse the prd sub-skill to generate structured requirements:
Load the prd skill and create a PRD for [describe your feature]
Example:
Load the prd skill and create a PRD for adding task priority levels with filtering
The skill guides you through clarifying questions and generates tasks/prd-[feature-name].md.
Use the ralph-convert sub-skill:
Load ralph-convert skill and convert tasks/prd-task-priority.md to prd.json
This validates story structure, checks dependencies, and generates prd.json with all stories marked incomplete.
Via CLI (direct execution):
ralph-zero run --max-iterations 50
Via your agent:
Load ralph-zero skill and run autonomous loop with max 50 iterations
Ralph Zero will:
prd.json and progress.txtโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Python Orchestrator (ralph_zero.py) โ
โ โ
โ โข Context Synthesizer (AGENTS.md + progress)
โ โข Quality Gates (typecheck, tests, etc.) โ
โ โข State Manager (atomic prd.json updates) โ
โ โข Librarian Check (enforces learning) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Fresh Agent Instance โ
โ (stateless per story)โ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Persistent State โ
โ โข prd.json (tasks) โ
โ โข AGENTS.md (patterns)
โ โข progress.txt (history)
โโโโโโโโโโโโโโโโโโโโโโโโโ
Ralph Zero includes helper skills for the full autonomous development workflow:
Create ralph.json in your project root:
{
"agent_command": "auto",
"max_iterations": 50,
"quality_gates": {
"typecheck": {
"cmd": "npm run typecheck",
"blocking": true,
"timeout": 60
},
"test": {
"cmd": "npm test",
"blocking": true,
"timeout": 120
}
},
"git": {
"commit_prefix": "[Ralph]",
"auto_create_branch": true
},
"librarian": {
"check_enabled": true,
"warning_after_iterations": 3
}
}
See assets/examples/ralph.json for complete example.
Ralph Zero provides a comprehensive CLI:
# Run autonomous loop
ralph-zero run [--max-iterations N] [--config PATH]
# Validate prd.json and configuration
ralph-zero validate [--config PATH]
# Show current status
ralph-zero status [--verbose]
# Manually archive current run
ralph-zero archive <branch_name>
Ralph Zero creates and manages these files:
| File | Purpose | Created By |
|---|---|---|
prd.json |
Task list with completion status | ralph-convert |
progress.txt |
Append-only iteration log | Ralph Zero |
AGENTS.md |
Learned patterns (optional) | You or Ralph Zero |
ralph.json |
Project configuration (optional) | You |
orchestrator.log |
Detailed debug log | Ralph Zero |
archive/ |
Completed feature archives | Ralph Zero |
For Ralph Zero to work effectively:
Each story must be completable in one iteration.
Good examples:
Too large (split these):
Every story must include "Typecheck passes" as final criterion.
Good criteria:
Bad criteria (too vague):
Stories execute in priority order. No forward dependencies.
Correct order:
Ralph Zero enforces learning via the Librarian Check:
Good AGENTS.md entries:
## Pattern: SQL Aggregations
Use `sql<number>` template literal for complex queries
Example: `const result = await sql<number>`SELECT SUM(amount) FROM...``
## Gotcha: Migration Order
Always run migrations before starting dev server.
Stale schema causes confusing typecheck errors.
Use git worktrees for concurrent feature development:
git worktree add ../feature-a ralph/feature-a
git worktree add ../feature-b ralph/feature-b
cd ../feature-a && ralph-zero run
cd ../feature-b && ralph-zero run
Add project-specific checks to ralph.json:
{
"quality_gates": {
"security-scan": {
"cmd": "npm audit --audit-level=moderate",
"blocking": false,
"timeout": 30
},
"bundle-size": {
"cmd": "./scripts/check-bundle-size.sh",
"blocking": true,
"timeout": 45
}
}
}
Ralph Zero automatically resumes from current prd.json state:
ralph-zero run # Continues where it left off
Solution: Create prd.json using ralph-convert skill or manually
Solution: Story is too large. Split into 2-3 smaller stories
Solution: Verify commands in ralph.json match your project setup
Solution: Increase context_config.token_budget or reduce max_progress_lines
For more help, see docs/TROUBLESHOOTING.md.
Complete working examples in assets/examples/:
nextjs-feature.json - Next.js TypeScript with Prismapython-api.json - FastAPI with pytestreact-component.json - React component library| Feature | Original Ralph | Ralph Zero |
|---|---|---|
| Orchestrator | Bash script | Python with type safety |
| Agent Support | Amp-specific | Universal (Agent Skills) |
| Context Synthesis | Auto-handoff only | Works with all agents |
| State Management | Basic | Validated, atomic, logged |
| Quality Gates | Fixed | Configurable per project |
| Cognitive Feedback | Optional | Enforced via Librarian |
| Observability | Basic logs | Structured JSON logs |
Based on Geoffrey Huntley's Ralph pattern.
Inspired by:
MIT License - See LICENSE file