| name | ralphy |
| description | Autonomous AI coding orchestration using the Ralph Wiggum technique and Ralphy CLI. This skill should be used when running AI agents in continuous loops until tasks complete, orchestrating multi-task development with PRD/YAML files, configuring parallel agent execution, or implementing the Ralph Wiggum autonomous development methodology. Triggers on mentions of ralphy, ralph, autonomous loops, PRD-driven development, or multi-agent orchestration. |
Ralphy & Ralph Wiggum Technique
Ralphy is an autonomous AI coding orchestrator that runs agents on tasks until done. Built on Geoffrey Huntley's Ralph Wiggum technique - a continuous loop methodology where AI agents iterate until completion.
Quick Reference
ralphy "add dark mode"
ralphy --prd PRD.md
ralphy --yaml tasks.yaml
ralphy --parallel --max-parallel 5
ralphy --branch-per-task --create-pr
Core Concepts
The Ralph Wiggum Technique
The foundational principle: run an AI agent in a loop until the job is done.
while :; do cat PROMPT.md | claude ; done
Key insight: Failures inform improvements. When Ralph fails, tune the prompts like a guitar - add specific guidance based on observed failure patterns.
Three-Phase Architecture
- Requirements Definition: Discuss project, identify Jobs to Be Done (JTBD), break into topics
- Planning Loop: Gap analysis between specs and code, generate IMPLEMENTATION_PLAN.md
- Building Loop: Implement tasks, validate with tests, commit on success
Ralphy CLI Usage
Task Sources
Markdown PRD (checkbox format):
## Tasks
- [ ] create auth system
- [ ] add dashboard
- [x] completed task (skipped)
YAML format:
tasks:
- title: create auth
completed: false
parallel_group: 1
- title: add dashboard
completed: false
parallel_group: 2
GitHub Issues:
ralphy --github owner/repo --github-label "ready"
Parallel Execution
Run multiple agents simultaneously with isolation:
ralphy --parallel
ralphy --parallel --max-parallel 5
ralphy --parallel --sandbox
Each agent gets:
- Isolated worktree or sandbox
- Unique branch:
ralphy/agent-N-task-slug
- Independent execution context
Parallel Groups in YAML control execution order:
tasks:
- title: Create User model
parallel_group: 1
- title: Create Post model
parallel_group: 1
- title: Add relationships
parallel_group: 2
Branch Workflow
ralphy --branch-per-task
ralphy --branch-per-task --create-pr
ralphy --branch-per-task --draft-pr
ralphy --base-branch main
Engine Selection
ralphy "task"
ralphy --opencode "task"
ralphy --cursor "task"
ralphy --codex "task"
ralphy --qwen "task"
ralphy --copilot "task"
Model override:
ralphy --model sonnet "task"
ralphy --sonnet "task"
Pass args to engine:
ralphy --claude "task" -- --no-permissions-prompt
Project Configuration
Initialize with auto-detection:
ralphy --init
Creates .ralphy/config.yaml:
project:
name: "my-app"
language: "TypeScript"
framework: "Next.js"
commands:
test: "npm test"
lint: "npm run lint"
build: "npm run build"
rules:
- "use server actions not API routes"
- "follow error pattern in src/utils/errors.ts"
boundaries:
never_touch:
- "src/legacy/**"
- "*.lock"
capabilities:
browser: "auto"
notifications:
discord_webhook: "https://discord.com/..."
slack_webhook: "https://hooks.slack.com/..."
Add rules dynamically:
ralphy --add-rule "always use TypeScript strict mode"
CLI Flags Reference
| Flag | Purpose |
|---|
--prd PATH | Task file/folder (default: PRD.md) |
--yaml FILE | YAML task file |
--github REPO | Use GitHub issues |
--parallel | Run parallel agents |
--max-parallel N | Max agents (default: 3) |
--sandbox | Lightweight sandboxes vs worktrees |
--branch-per-task | One branch per task |
--create-pr | Create pull requests |
--draft-pr | Create draft PRs |
--no-merge | Skip auto-merge in parallel |
--no-tests | Skip tests |
--no-lint | Skip linting |
--fast | Skip tests and lint |
--no-commit | Don't auto-commit |
--max-iterations N | Stop after N tasks |
--max-retries N | Retries per task (default: 3) |
--dry-run | Preview only |
--browser | Enable browser automation |
-v, --verbose | Debug output |
The Ralph Loop Pattern
For advanced usage implementing the full Ralph Wiggum technique:
See references/ralph_loop_pattern.md for:
- Complete file structure
- PROMPT_plan.md and PROMPT_build.md templates
- Context management strategies
- Backpressure mechanisms
- Plan regeneration triggers
Security Considerations
Critical: Running with --dangerously-skip-permissions requires sandboxing.
- Always set
--max-iterations (e.g., 20-50) to prevent runaway costs
- Run in sandboxed environments (Docker, Fly Sprites, E2B)
- Use minimum viable API key access
- Escape hatches: Ctrl+C stops loop,
git reset --hard reverts
Best Practices
- Start with clear specs: Well-defined PRD items lead to better outcomes
- Use parallel groups: Organize dependent tasks to run efficiently
- Set boundaries: Protect critical files in config
- Add project rules: Guide consistent patterns
- Monitor iterations: Watch for loops that aren't progressing
- Iterate on prompts: When Ralph fails, tune the guidance
Troubleshooting
Agent stuck in loop: Check if task is too vague. Add specific acceptance criteria.
Merge conflicts in parallel: Use --no-merge and resolve manually, or let AI resolve.
Rate limits: Ralphy detects and defers tasks on quota errors.
Tests failing: Ensure commands.test in config matches your test runner.