ralph-loop
Skill7 starsChanged 3 months agoMITView on GitHub
Autonomous Ralph Wiggum Loop — iterative task execution with fresh context, filesystem memory, and git versioning
26 other projects use a version of this.
Adopted by
Most recently taken up by
- shawnclybor/clybor-claude-toolingtheir own version, first seen Nov 8, 2026
- ZhouYinLong-lab/Dog-Skillstheir own version, first seen Nov 8, 2026
- belumume/claude-skillstheir own version, first seen Nov 3, 2026
- burakkaygusuz/ralph-wiggumtheir own version, first seen Nov 1, 2026
- harness-mini/harness-minitheir own version, first seen Nov 1, 2026
- cornch-k/batontheir own version, first seen Nov 1, 2026
Used with
Projects with it also use to-issues and review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- mikeyobrien/ralph-orchestrator★ 3.2ksame name
- zrosenfield/sharepoint-ai-skills★ 96same name
- dannys-code-corner/incan★ 73same name
- yylo-dev/yylo★ 66same name
- regression-io/coder-config★ 47same name
- belumume/claude-skills★ 46same name
- xfstudio/skills★ 9same name
- mnzralee/claude-multi-agent-architecture★ 8same name
- ZhouYinLong-lab/Dog-Skills★ 7same name
- carlkibler/agent-skills★ 6same name
16 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- enlightenSkill
- brainstormingSkill
- ce-brainstormSkill
- ce-compound-refreshSkill
- ce-compoundSkill
- ce-ideateSkill
- ce-planSkill
- ce-reviewSkill
- ce-workSkill
- claude-permissions-optimizerSkill
- deepen-planSkill
- document-reviewSkill
- evolveSkill
- feature-videoSkill
- instinctsSkill
- karpathy-guidelinesSkill
- learnSkill
- lfgSkill
- observeSkill
- resolve_todo_parallelSkill
- setupSkill
- slfgSkill
- test-browserSkill
- unslopSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
If the argument is a task description (not a path to an existing PRD or plan file):
- Very specific: line 60
If the argument is a path to a plan file (e.g., docs/plans/feature.md), use that as the PRD and generate only PROGRESS.md from its tasks.
- Very specific: line 64
Read PRD.md and PROGRESS.md to determine the next PENDING task, then execute iterations until all tasks are complete.
- Very specific: line 70
Read PROGRESS.md and select the first task with status PENDING.
- Distinctive: line 100
After the executor sub-agent completes:
- Very specific: line 112
When all tasks in PROGRESS.md are DONE (or BLOCKED):
- Very specific: line 128
Default keyword is DONE.
- Very specific: line 151
With
/ce-compound: After loop completion, run /ce-compound to document learnings
“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Arguments
[task description or PRD path] [--completion-promise KEYWORD]
Ralph Wiggum Loop
An autonomous coding loop that executes tasks iteratively with fresh context per iteration, using the filesystem as memory and git for version control. Inspired by the Ralph Wiggum pattern — persistent trial-and-error with external state tracking.
Core Principle
Ralph loop = Fresh context + Filesystem memory + Git versioning
Each iteration starts with a clean context window. Progress is tracked in PROGRESS.md, requirements live in PRD.md, and every completed task is committed to git. This avoids context pollution and produces reliable results for multi-step work.
Usage
/ralph-loop "Build the authentication module"
/ralph-loop docs/plans/my-plan.md
/ralph-loop "finish all slash commands" --completion-promise "DONE"Execution Flow
Phase 0: Planning (if no PRD exists)
If the argument is a task description (not a path to an existing PRD or plan file):
- Read existing plan files — Check
docs/plans/for a relevant plan. If one exists and matches the task, use it as the PRD. - Generate PRD — If no plan exists, create
PRD.mdin the project root with:- Goal: One-sentence summary of what success looks like
- Tasks: Numbered list of atomic, independently-executable tasks
- Acceptance Criteria: Testable criteria for each task
- Completion Promise: The keyword to output when all tasks are done (default:
DONE)
- Generate PROGRESS.md — Create
PROGRESS.mdin the project root with:# Progress ## Status: IN_PROGRESS | # | Task | Status | Notes | |---|------|--------|-------| | 1 | [task name] | PENDING | | | 2 | [task name] | PENDING | | - Commit initial state:
git add PRD.md PROGRESS.md git commit -m "ralph-loop: initialize PRD and progress tracking"
If the argument is a path to a plan file (e.g., docs/plans/feature.md), use that as the PRD and generate only PROGRESS.md from its tasks.
Phase 1: Coordination Loop
Read PRD.md and PROGRESS.md to determine the next PENDING task, then execute iterations until all tasks are complete.
For each iteration:
Step 1 — Pick Next Task
Read PROGRESS.md and select the first task with status PENDING. If no PENDING tasks remain, go to Phase 2 (Completion).
Step 2 — Execute Task
Spawn a fresh sub-agent (via the Task tool) for the selected task. The sub-agent prompt MUST include:
You are a Ralph Executor. Complete this single task with fresh context.
**Task:** [task description from PRD]
**Acceptance Criteria:** [criteria from PRD]
Instructions:
1. Read PRD.md and PROGRESS.md for full context
2. Implement the task — write code, create files, run tests
3. Verify your work meets the acceptance criteria
4. Update PROGRESS.md: set this task's status to DONE with brief notes
5. Stage and commit your changes:
git add -A
git commit -m "ralph-loop: complete task [N] — [brief description]"
Do NOT modify other tasks. Do NOT skip testing. One task only.<critical_requirement> Each executor sub-agent runs with fresh context — it has no memory of previous iterations. All state comes from the filesystem (PRD.md, PROGRESS.md, existing code, git history). </critical_requirement>
Step 3 — Verify Completion
After the executor sub-agent completes:
- Read PROGRESS.md — Confirm the task status was updated to
DONE - Quick review — Spawn a brief reviewer sub-agent to check:
- Does the code compile/pass linting?
- Were tests added or do existing tests still pass?
- Does the change match the acceptance criteria?
- If review fails — Update task status to
FAILEDwith notes, then re-attempt. Each task gets up to 3 total attempts (1 initial + 2 retries). After the third failed attempt, mark the task asBLOCKEDand continue to the next task. - If review passes — Continue to next iteration (back to Step 1)
Phase 2: Completion
When all tasks in PROGRESS.md are DONE (or BLOCKED):
- Update PROGRESS.md — Set top-level status:
COMPLETEif all tasks are DONEPARTIALif any tasks are BLOCKED
- Final commit:
git add PROGRESS.md git commit -m "ralph-loop: all tasks complete" - Output completion promise — If
--completion-promisewas provided:
Default keyword is<promise>[KEYWORD]</promise>DONE. - Summary:
✓ Ralph Loop Complete Tasks: [N] total, [X] done, [Y] blocked Commits: [Z] commits made PRD: PRD.md Progress: PROGRESS.md Blocked tasks (if any): - Task [N]: [reason]
Integration with Compound Engineering
The ralph-loop skill works with existing CE skills:
- As orchestrator: Called by
/lfgand/slfgas an optional first step to autonomously execute all workflow commands - With
/ce-plan: Can use plan files fromdocs/plans/as the PRD input - With
/ce-work: Each executor iteration is similar to a focused/ce-worksession - With
/ce-review: The verification step performs lightweight review; for thorough review use/ce-reviewafter the loop completes - With
/ce-compound: After loop completion, run/ce-compoundto document learnings
State Files
| File | Purpose | Created By |
PRD.md | Requirements and task list | Phase 0 (Planning) |
PROGRESS.md | Task status tracking | Phase 0, updated each iteration |
These files are committed to git and serve as the filesystem memory that enables fresh-context execution.
Design Decisions
- One task per iteration: Keeps each sub-agent focused and prevents context pollution
- Git commits per task: Enables rollback of individual tasks and provides audit trail
- 3 total attempts per task: 1 initial attempt + up to 2 retries prevents infinite loops on genuinely broken tasks
- Reviewer sub-agent: Catches issues before they compound across iterations
- BLOCKED status: Allows the loop to continue past stuck tasks rather than halting entirely
Common Mistakes to Avoid
| ❌ Wrong | ✅ Correct |
| Execute multiple tasks in one sub-agent | One task per sub-agent with fresh context |
| Skip git commits between tasks | Commit after every completed task |
| Carry conversation context across iterations | Each iteration reads state from filesystem |
| Retry failed tasks indefinitely | 3 total attempts (1 initial + 2 retries), then mark BLOCKED and continue |
| Modify PRD.md during execution | PRD.md is read-only after planning phase |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

