ralph-loop
Original:🇺🇸 English
Translated
Self-referential completion loop for OpenCode. Re-injects continuation prompts until the task is fully complete with a completion promise.
1installs
Added on
NPX Install
npx skill4agent add supercent-io/skills-template ralph-loopTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →ralph-loop - Completion Enforcement Loop
When to use this skill
- Long-running implementation tasks that tend to stop early
- Tasks that need strict completion signaling
- Workflows using /
ultraworkin OpenCodeulw - Sessions where the agent must continue until exact completion
1. Core Command Pattern
Use the built-in command form:
text
/ralph-loop "<task description>" [--completion-promise=TEXT] [--max-iterations=N]Defaults:
- Completion promise:
DONE - Max iterations:
100
2. How the Loop Behaves
- Starts with your task prompt.
- On each idle cycle, verifies whether the assistant output contains:
xml
<promise>DONE</promise>- If not found, injects a continuation prompt and increments iteration.
- Stops only when:
- Completion promise is detected, or
- Max iterations is reached, or
- You run .
/cancel-ralph
3. Practical Usage
Standard run
text
/ralph-loop "Refactor auth module and finish all tests"Custom promise
text
/ralph-loop "Migrate API clients to v2" --completion-promise=SHIP_ITBounded iteration run
text
/ralph-loop "Fix flaky CI tests" --max-iterations=20Cancel active loop
text
/cancel-ralph4. Integration Notes for skills-template
- Keep this skill as an operational guide for OpenCode workflows.
- Pair with orchestration skills (for example, ) when tasks require delegation.
ohmg - Require explicit completion tags in final responses to avoid premature stop.
Quick Reference
| Action | Command |
|---|---|
| Start loop | |
| Custom promise | |
| Iteration cap | |
| Cancel | |