Install
openclaw skills install ec-ralphAutonomous AI coding loop that breaks features into small user stories, runs isolated coding agents per story, tests, commits, and repeats until all pass.
openclaw skills install ec-ralphAutonomous AI coding loop that runs Codex/Claude Code repeatedly until all PRD items are complete.
Source: https://github.com/snarktank/ralph (8,600+ stars)
Ralph solves the "context overflow" problem. Large tasks exceed one context window → bad code. Ralph:
prd.jsonpasses: trueMemory persists via: git history, progress.txt, prd.json (not context).
# 1. Create a PRD for your feature
~/clawd/skills/ralph/scripts/create-prd.sh "Feature description"
# 2. Convert PRD to prd.json
~/clawd/skills/ralph/scripts/convert-prd.sh tasks/prd-feature.md
# 3. Run Ralph loop
~/clawd/skills/ralph/scripts/run-ralph.sh [project_dir] [max_iterations]
| File | Purpose |
|---|---|
prd.json | User stories with passes: true/false |
progress.txt | Learnings between iterations |
AGENTS.md | Updated with patterns/gotchas each iteration |
{
"branchName": "ralph/feature-name",
"userStories": [
{
"id": "1",
"title": "Add database column",
"description": "Add email_verified column to users table",
"acceptanceCriteria": [
"Migration exists",
"Column is boolean, default false",
"Tests pass"
],
"priority": 1,
"passes": false
}
]
}
✅ Good (one context window):
❌ Too big (split these):
Ralph uses Codex CLI (codex exec) or Claude Code for implementation:
# Default: uses Codex CLI
./run-ralph.sh ~/Code/myproject 10
# Or specify Claude Code
./run-ralph.sh ~/Code/myproject 10 --tool claude
# Henry asks: "Implement RLS for all 154 tables"
# 1. Create PRD
~/clawd/skills/ralph/scripts/create-prd.sh "Implement Row Level Security for all database tables"
# 2. Convert (generates 154 user stories)
~/clawd/skills/ralph/scripts/convert-prd.sh tasks/prd-rls-migration.md
# 3. Run overnight
nohup ~/clawd/skills/ralph/scripts/run-ralph.sh ~/Code/myproject 154 > ralph.log 2>&1 &
# 4. Check progress
cat ~/Code/myproject/scripts/ralph/prd.json | jq '.userStories[] | {id, title, passes}'
passes: true → outputs <promise>COMPLETE</promise>