ralph_loop
Skill1 starsChanged 5 days agoUnlicenseView on GitHub
Implements the Ralph Wiggum technique for iterative, self-referential AI development loops in Gemini. Named after Ralph Wiggum from The Simpsons, embodying the philosophy of persistent iteration despite setbacks. Not good for: A <promise>PHRASE</promise> tag that signals genuine completion. The agent MUST NOT output this until the statement is completely and unequivocally TRUE. Safety limit to prevent infinite loops on impossible tasks. Use the /ralph_loop workflow: Or invoke directly: The loop state is tracked in .ralph-loop-state.json: Delete the state file or…
1 other project uses a version of this.
Adopted by
Most recently taken up by
- lza6/claw-code-tingfengtheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- lza6/claw-code-tingfeng★ 5same name
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 repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ad-copy-writerSkill
- ae-inspect-describeSkill
- algorithmic-artSkill
- animation-directorSkill
- assembly-guideSkill
- brainstorming-and-ideatingSkill
- brainstorming-research-ideasSkill
- brainstormingSkill
- brief-to-tasksSkill
- canvas-designSkill
- cli-designSkill
- cli-output-hierarchySkill
- commit-messageSkill
- craft-uiSkill
- creative-directorSkill
- design-briefSkill
- design-flowSkill
- design-mock-auditSkill
- design-reviewSkill
- design-system-patternsSkill
- design-tokensSkill
- deslopifySkill
- diagnoseSkill
- diagramming-app-routesSkill
- doc-restructureSkill
- eval-criticSkill
- formatting-open-markdownsSkill
- frontend-designSkill
- frontend-slidesSkill
- gdocs-tab-writerSkill
- gemini-apiSkill
- gif-creationSkill
- github_repo_researchSkill
- grill-meSkill
- grill-with-docsSkill
- hallmarkSkill
- handoffSkill
- html-presentationSkill
- humanizerSkill
- i-have-adhdSkill
- improve-codebase-architectureSkill
- information-architectureSkill
- install-skill-from-githubSkill
- markdown-output-hierarchySkill
- marketing-psychologySkill
- merge-latestSkill
- modern-web-performanceSkill
- motion-designSkill
- pdf-readerSkill
- pm-brainstormingSkill
- pm-discovery-brainstormSkill
- product-marketingSkill
- prototypeSkill
- pull-requestSkill
- react-best-practicesSkill
- review-loopSkill
- sandbox-explainerSkill
- skill-creatorSkill
- skill-optSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
MUST NOT output this until the statement is completely and unequivocally TRUE.
- Very specific: line 55
Use the /ralph_loop workflow:
- Very specific: line 93
Delete the state file or use /cancel_ralph:
- Distinctive: line 148
Always set max iterations as a safety net:
- Distinctive: line 161
When running a Ralph loop, follow this pattern each iteration:
- Very specific: line 163
Read State: Check .ralph-loop-state.json for current iteration
- Very specific: line 166
Output Promise: If genuinely complete, output <promise>PHRASE</promise>
- Distinctive: line 168
Iterate: If not complete, increment iteration and continue
- Distinctive: line 172
Never lie to exit: Do NOT output a false promise to escape the loop
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- glint: disable=DevSiteLinter_g3doc --><!-- linter off -->name: Ralph Loop description: Run iterative, self-referential AI development loops. Use when asked to "ralph loop", "iterate until done", "keep trying until tests pass", or for tasks requiring persistent iteration with clear completion criteria.
Ralph Loop
Implements the Ralph Wiggum technique for iterative, self-referential AI development loops in Gemini. Named after Ralph Wiggum from The Simpsons, embodying the philosophy of persistent iteration despite setbacks.
When to Use
Good for:
- Well-defined tasks with clear success criteria
- Tasks requiring iteration and refinement (e.g., getting tests to pass)
- Greenfield projects where you can walk away
- Tasks with automatic verification (tests, linters, builds)
Not good for:
- Tasks requiring human judgment or design decisions
- One-shot operations
- Tasks with unclear success criteria
- Production debugging (use targeted debugging instead)
Core Concepts
The Loop
while not complete:
1. Work on task
2. Check completion criteria
3. If not complete, iterate with same prompt
4. Previous work persists in files/gitCompletion Promise
A <promise>PHRASE</promise> tag that signals genuine completion. The agent
MUST NOT output this until the statement is completely and unequivocally TRUE.
Max Iterations
Safety limit to prevent infinite loops on impossible tasks.
Usage
Starting a Ralph Loop
Use the /ralph_loop workflow:
/ralph_loop "Build a REST API for todos. Requirements: CRUD operations, input validation, tests."Or invoke directly:
Start a Ralph loop with:
- Task: <description>
- Completion promise: <phrase that signals done>
- Max iterations: <number>State File
The loop state is tracked in .ralph-loop-state.json:
{
"active": true,
"iteration": 1,
"max_iterations": 50,
"completion_promise": "ALL TESTS PASSING",
"started_at": "2026-03-18T23:00:00Z",
"prompt": "Build a REST API..."
}Checking Status
cat .ralph-loop-state.json | jq .Canceling
Delete the state file or use /cancel_ralph:
rm .ralph-loop-state.jsonWriting Effective Prompts
1. Clear Completion Criteria
❌ Bad: "Build a todo API and make it good."
✅ Good:
Build a REST API for todos. When complete:
- All CRUD endpoints working
- Input validation in place
- Tests passing (coverage > 80%)
- README with API docs
Output: <promise>COMPLETE</promise>2. Incremental Goals
❌ Bad: "Create a complete e-commerce platform."
✅ Good:
Phase 1: User authentication (JWT, tests)
Phase 2: Product catalog (list/search, tests)
Phase 3: Shopping cart (add/remove, tests)
Output <promise>COMPLETE</promise> when all phases done.3. Self-Correction
❌ Bad: "Write code for feature X."
✅ Good:
Implement feature X following TDD:
1. Write failing tests
2. Implement feature
3. Run tests
4. If any fail, debug and fix
5. Refactor if needed
6. Repeat until all green
7. Output: <promise>COMPLETE</promise>4. Escape Hatches
Always set max iterations as a safety net:
After 15 iterations, if not complete:
- Document what's blocking progress
- List what was attempted
- Suggest alternative approachesImplementation
Loop Execution Pattern
When running a Ralph loop, follow this pattern each iteration:
- Read State: Check
.ralph-loop-state.jsonfor current iteration - Execute Task: Work on the prompt
- Check Completion: Evaluate if completion criteria are met
- Output Promise: If genuinely complete, output
<promise>PHRASE</promise> - Iterate: If not complete, increment iteration and continue
Critical Rules
- Never lie to exit: Do NOT output a false promise to escape the loop
- Trust the process: Even if stuck, continue iterating
- Document progress: Each iteration should make measurable progress
- Check files: Your previous work persists - read and build on it
Reference
- Original technique: https://ghuntley.com/ralph/
- Claude Code plugin: https://github.com/anthropics/claude-code/tree/main/plugins/ralph-wiggum
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

