| name | ralph-wiggum |
| description | Iterative development loop for solving complex tasks through trial-and-error. Use when you need to "fix until passing", "optimize until metric reached", or "iterate until done". |
Ralph Wiggum Skill
This skill defines a disciplined iterative loop for solving stubborn problems.
The Ralph Loop
When you enter a "Ralph Loop", you commit to the following process:
- Define the Promise: What exact state signals completion? (e.g., "All 5 tests pass", "Error log is empty").
- Iterate:
- Action: Attempt a fix or improvement.
- Verification: Run the verification command.
- Observation: Analyze the output.
- Repeat: Continue until the Promise is met or Max Iterations reached.
When to Use
- "Keep trying to fix this bug until the tests pass."
- "Optimize this prompt until the score is > 80."
- "Refactor this module, ensuring no regressions."
Workflow Template
Copy this into your scratchpad.md or keep it in your context to track progress.
# Ralph Loop Tracking
**Goal**: [Describe Goal]
**Completion Promise**: [Exact condition to stop]
**Max Iterations**: [Number]
## Iteration 1
- **Plan**: [What to do]
- **Action**: [Tool call]
- **Result**: [Outcome]
- **Status**: [PASSED / FAILED / PROGRESS]
## Iteration 2
...
See assets/loop_template.md for a raw template.
Native Implementations
Some tools and CLI utilities implement the Ralph Wiggum visual or trial-and-error loop out-of-the-box. For example, the paperbanana CLI uses this loop to generate and visually critique architecture diagrams iteratively until they are accepted. Try leveraging these native loops whenever possible before manually executing the steps.
Principles
- Iteration > Perfection: Don't try to solve it all in one perfect shot. Try, fail, learn, retry.
- Failures are Data: Every error message is a clue. Read them carefully.
- Self-Correction: If a path isn't working, change direction. Don't repeat the same mistake.