ralph-wiggum
Iterative AI development loops - start, monitor, review, and iterate on tasks using the Ralph Wiggum technique with Kiro CLI - use only when explicitly requested by the user
Best use case
ralph-wiggum is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Iterative AI development loops - start, monitor, review, and iterate on tasks using the Ralph Wiggum technique with Kiro CLI - use only when explicitly requested by the user
Teams using ralph-wiggum should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ralph-wiggum/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ralph-wiggum Compares
| Feature / Agent | ralph-wiggum | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Iterative AI development loops - start, monitor, review, and iterate on tasks using the Ralph Wiggum technique with Kiro CLI - use only when explicitly requested by the user
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Ralph Wiggum - Iterative Development Loops
## Overview
Iterative AI development where an agent works across multiple iterations until task complete. Each iteration builds on previous work in a self-referential feedback loop.
**Core principle:** Iteration > Perfection. Persistence wins.
**Your role:** Orchestrator. Start Ralph, review results, decide next steps.
**Context separation:** Ralph runs in Kiro CLI with separate conversation history from OpenCode. Enables autonomous iteration without cluttering your context.
**Only activate when explicitly requested by user.** Like TDD, don't use by default.
## When to Use
**Use for:**
- Multi-step tasks requiring iteration/refinement
- Tasks with clear, verifiable completion criteria
- Feature development requiring testing/debugging
- Bug fixes needing investigation/validation
- Refactoring with test coverage requirements
- "Try, fail, fix, repeat" workflows
**Don't use for:**
- Quick one-shot tasks (do directly)
- Unclear completion criteria
- Requires human judgment/design decisions
- No concrete deliverables
## Mode Selection
**Decision tree:**
```
Multi-task feature/backlog? → PRD mode
Single task + tests exist? → Verify mode
Single task, no tests? → Promise mode
Open-ended exploration? → Free run
```
**PRD mode is recommended** for most feature work - provides structure, atomic commits, clear progress tracking.
## Modes of Operation
### PRD Mode (Recommended for multi-task work)
```bash
ralph-loop "Implement user authentication" \
--prd plans/auth-prd.json \
--verify-command "npm test"
```
- Works through structured task list one at a time
- Each task has explicit verification steps
- Auto-commits after each completed task
- Exits when all tasks have `passes: true`
- Best for feature implementation with multiple components
### Verify Mode (Single task with tests)
```bash
ralph-loop "Fix failing tests" --verify-command "npm test"
```
- Runs verify after EVERY iteration
- Exits when verify passes
- No promise needed
### Promise Mode (Single task, no tests)
```bash
ralph-loop "Refactor auth module" --completion-promise "DONE"
```
- Exits when model outputs `<promise>DONE</promise>`
- Model self-reports completion
### Verify + Promise (Belt and suspenders)
```bash
ralph-loop "Add user feature" \
--completion-promise "DONE" \
--verify-command "npm test"
```
- Waits for promise, then runs verify to confirm
- Best of both worlds
### Free Run (Exploration)
```bash
ralph-loop "Improve codebase" --max-iterations 10
```
- Just runs N iterations
- No completion detection
- Good for open-ended exploration
### Resume (Continue existing session)
```bash
ralph-loop --resume "New instructions here"
```
- Continues previous conversation
- Requires new prompt
- Flags override previous state
## PRD File
### What is a PRD?
A JSON array of tasks with explicit verification steps. User must provide it - Ralph doesn't create PRDs.
### Schema
```json
[
{
"category": "string - task grouping (ui, functional, api, backend, etc.)",
"description": "string - what to implement or verify",
"steps": ["array", "of", "verification", "steps"],
"passes": false
}
]
```
| Field | Required | Description |
|-------|----------|-------------|
| `category` | Yes | Task grouping (ui, functional, api, backend, etc.) |
| `description` | Yes | What to implement or verify |
| `steps` | Yes | Explicit verification steps |
| `passes` | Yes | Completion status (start: false) |
### Writing Good PRD Tasks
- **One deliverable per task** - each task should be completable in 1-3 iterations
- **Explicit steps** - list what to verify, not just what to build
- **Order by dependency** - tasks that depend on others come later
- **Testable** - each step should be verifiable (test output, UI check, etc.)
- **Avoid vague descriptions** - "improve code" is bad, "add input validation for email field" is good
### Example: User Authentication PRD
```json
[
{
"category": "backend",
"description": "User registration creates account with hashed password",
"steps": [
"POST /register with email and password",
"Verify 201 response with user object",
"Verify password is not returned in response",
"Verify password is hashed in database",
"Verify duplicate email returns 409 conflict"
],
"passes": false
},
{
"category": "backend",
"description": "User login returns valid JWT token",
"steps": [
"POST /login with valid credentials",
"Verify 200 response with token",
"Verify token is valid JWT format",
"POST /login with invalid password",
"Verify 401 unauthorized response"
],
"passes": false
},
{
"category": "backend",
"description": "Protected routes require valid JWT",
"steps": [
"GET /me without token returns 401",
"GET /me with invalid token returns 401",
"GET /me with valid token returns user object"
],
"passes": false
},
{
"category": "ui",
"description": "Login form validates input and shows errors",
"steps": [
"Navigate to /login",
"Submit empty form",
"Verify validation errors shown",
"Enter invalid email format",
"Verify email validation error",
"Enter valid credentials and submit",
"Verify redirect to dashboard"
],
"passes": false
}
]
```
### Example: UI Feature PRD
```json
[
{
"category": "ui",
"description": "Delete video shows confirmation dialog before deleting",
"steps": [
"Navigate to a video",
"Click delete button",
"Verify confirmation dialog appears",
"Click cancel",
"Verify video is not deleted",
"Click delete again and confirm",
"Verify video is deleted"
],
"passes": false
},
{
"category": "ui",
"description": "Video thumbnail shows duration overlay",
"steps": [
"Navigate to video list",
"Verify each thumbnail shows duration in bottom-right",
"Verify format is MM:SS for videos under 1 hour",
"Verify format is HH:MM:SS for videos over 1 hour"
],
"passes": false
}
]
```
## Progress File
### When to Use
- Long-running loops (20+ iterations expected)
- Complex tasks where context matters across iterations
- Work you expect to resume later
- Tasks where learnings from failed attempts matter
### What It Does
- Agent reads at start of each iteration
- Agent appends summary at end of each iteration
- Survives context window compaction
- Acts as cross-session memory
### Usage
```bash
ralph-loop "Build feature" \
--prd plans/prd.json \
--progress plans/progress.md
```
Not required - optional enhancement for complex work.
## Auto-Commit
### Behavior
- **Default ON** when using `--prd`
- **Default OFF** otherwise
- Commits after each task marked `passes: true`
- Format: `feat: <description>` (truncated to 72 chars)
### What Gets Committed
- Code changes from the iteration
- PRD file update (`passes: true`)
- Progress file update (if used)
### Disabling
```bash
ralph-loop "Task" --prd prd.json --no-auto-commit
```
### Requirements
- Must be in git repo (auto-disabled if not)
- Uncommitted changes before Ralph starts are fine
## Starting a Ralph Loop
### Step 1: Create PRD (for PRD mode)
Write your PRD file with tasks and verification steps. See examples above.
### Step 2: Craft the Prompt
Keep it focused - one objective per loop.
**Good:**
```bash
ralph-loop "Implement user authentication per the PRD" \
--prd plans/auth-prd.json \
--verify-command "npm test"
```
**Bad:**
```bash
ralph-loop "Build auth, add tests, refactor DB, update docs" --max-iterations 40
```
### Step 3: Set Max-Iterations
| Complexity | Recommended |
|------------|-------------|
| Simple (1-3 tasks) | 10-15 |
| Medium (4-7 tasks) | 20-30 |
| Complex (8+ tasks) | 40-50 |
Default is 50. Ralph exits early on success.
### Step 4: Execute
```bash
cd /path/to/project
ralph-loop "YOUR_PROMPT" \
--prd plans/prd.json \
--progress plans/progress.md \
--verify-command "npm test" \
--max-iterations 30
```
Ralph runs autonomously. Ctrl+C interrupts cleanly, state preserved for --resume.
## Reviewing Ralph's Work
### For PRD Mode
1. **Check PRD file** - how many tasks have `passes: true`?
2. **Review git log** - see atomic commits per completed task
3. **Read progress file** (if used) - understand decisions and blockers
4. **Run tests yourself** - verify independently
5. **Spot-check completed tasks** - do they actually work?
### For Other Modes
1. **Read modified files** - use Read tool on changed files
2. **Run tests yourself** - `npm test` (or equivalent)
3. **Code review** - use code-reviewer for complex changes
4. **Verify requirements** - all met? Quality acceptable?
Can't verify all? Don't claim success. Resume or take over.
## Workflow
```
ASSESS → CREATE PRD → START → WAIT → REVIEW → ITERATE or COMPLETE
```
**Assess:** Is task suitable? Clear completion criteria? Needs iteration?
**Create PRD:** Break down into tasks with verification steps.
**Review:** Check PRD progress, git log, run tests yourself.
**Always verify independently** - don't trust passes field alone.
## Iteration Patterns
### Complete and Successful
```
All PRD tasks pass: true
Tests pass independently
Requirements met
ACTION: Report success
```
### Incomplete - Resume
```
Max iterations reached
Some tasks still passes: false
Progress was made
ACTION: Use --resume with refined instructions
```
```bash
ralph-loop --resume "Focus on the remaining UI tasks, the backend is complete"
```
### Failed - Take Over
```
Ralph stuck on same task
Multiple failed approaches
Requires human judgment
ACTION: Complete task directly
```
Know when to take over. Don't force Ralph on unsolvable problems.
## Common Patterns
### PRD-Driven Feature
```bash
ralph-loop "Implement user authentication system" \
--prd plans/auth-prd.json \
--progress plans/auth-progress.md \
--verify-command "npm test" \
--max-iterations 30
```
### Bug Fix with TDD
```bash
ralph-loop "Fix bug: empty comments accepted. Write failing test first, then fix." \
--verify-command "npm test" \
--max-iterations 15
```
### Refactoring with Safety
```bash
ralph-loop "Refactor database layer to use repository pattern. Keep all tests passing." \
--verify-command "npm test" \
--max-iterations 25
```
## Troubleshooting
### Max Iterations Reached
**Causes:** Task too complex, unclear PRD steps, missing dependencies
**Solutions:**
1. Check PRD - which tasks are still `passes: false`?
2. Check progress file - what's blocking?
3. Use --resume with clearer instructions
4. Break remaining tasks into smaller steps
5. Take over if Ralph is stuck
### PRD Task Won't Pass
Ralph may not understand the verification steps.
**Solutions:**
1. Check if steps are specific enough
2. Use --resume with clarification
3. Manually verify and mark `passes: true` if actually working
### State File Issues
**Orphaned state:** Delete `.kiro/ralph-state.json` and start fresh
**Can't resume:** State missing. Start new loop.
## Quick Reference
| Situation | Mode | Command |
|-----------|------|---------|
| Multi-task feature | PRD | `--prd file.json --verify-command "..."` |
| Single task + tests | Verify | `--verify-command "..."` |
| Single task, no tests | Promise | `--completion-promise "DONE"` |
| Exploration | Free run | `--max-iterations N` |
| Continue previous | Resume | `--resume "new instructions"` |
| Flag | Default | Description |
|------|---------|-------------|
| `--prd FILE` | none | PRD file path (enables PRD mode) |
| `--progress FILE` | none | Progress file for cross-session memory |
| `--verify-command CMD` | none | Verification command to run |
| `--completion-promise TEXT` | none | Exit when promise detected |
| `--auto-commit` | ON (PRD mode) | Enable auto-commit |
| `--no-auto-commit` | OFF | Disable auto-commit |
| `--max-iterations N` | 50 | Maximum iterations |
| `--resume` | false | Resume existing session |
**You orchestrate. Ralph executes. Always review.**Related Skills
ralph
Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format. Triggers on: convert this prd, turn this into ralph format, create prd.json from this, ralph json.
ralph-prd-starter
Project-agnostic agent setup wizard for Ralph Orchestra with Quick Start, Standard, and Expert modes
ralph-wiggum-loop
The Ralph Wiggum technique for autonomous AI development loops. Use when the user wants to run an agent in a loop for greenfield projects, reverse engineering, code migrations, large refactors, overnight batch work, or any task requiring persistent iteration until completion. Triggers include "ralph loop", "gumloop", "run ralph", "autonomous loop", "overnight coding", "while loop agent", "iterative development", "let it ralph", "run until done", "agentic loop", "context rotation", or when users want to set up autonomous coding that runs unattended. This skill implements Geoffrey Huntley's original philosophy: context rotation with git persistence, not complex multi-agent orchestration.
ralph-loop
Detect requests for iterative AI task loops and invoke the Ralph command
factory-ralph-loop
Iterative task execution using the Ralph Loop pattern (named after Ralph Wiggum). Use when you need to repeatedly run an agent until a condition is met—fixing all lint errors, passing all tests, or exhausting PRD tasks. The filesystem serves as memory between iterations.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
vercel-deploy
Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as "Deploy my app", "Deploy this to production", "Create a preview deployment", "Deploy and give me the link", or "Push this live". No authentication required - returns preview URL and claimable deployment link.
vercel-deploy-claimable
Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as 'Deploy my app', 'Deploy this to production', 'Create a preview deployment', 'Deploy and...
vercel-composition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
vercel-ai-sdk-development
Use when building AI-powered applications with the Vercel AI SDK (V6+). Covers agents (ToolLoopAgent), tool design with execution approval and strict mode, MCP client integration, structured output with tool calling, streaming patterns, DevTools debugging, reranking, provider-specific tools, and UI integration with React/Next.js.
vercel-ai-sdk-best-practices
Best practices for using the Vercel AI SDK in Next.js 15 applications with React Server Components and streaming capabilities.
venice-router
Supreme model router for Venice.ai — the privacy-first, uncensored AI platform. Automatically classifies query complexity and routes to the cheapest adequate model. Supports web search, uncensored mode, private-only mode (zero data retention), conversation-aware routing, cost budgets, function calling, thinking/reasoning mode, and 35+ Venice.ai text models. Use when the user wants to chat via Venice.ai, send prompts through Venice, or needs smart model selection to minimize API costs while keeping data private from Big Tech.