Ralph Iteration Skill
This skill guides you through completing one iteration of a Ralph Mode loop effectively.
Steps
1. Context Gathering (2 min)
bash
# Check current state cat .ralph-mode/state.json # Read the task cat .ralph-mode/prompt.md # See what changed in previous iterations git log --oneline -5 git diff HEAD~1 --stat
2. Analysis (2 min)
- •What's already been done?
- •What's left to do?
- •Are there any errors to fix?
3. Implementation (5-10 min)
Make targeted changes:
- •Focus on ONE aspect of the task
- •Don't try to do everything at once
- •Make changes that can be verified
4. Verification (2 min)
bash
# Run tests if applicable npm test # or pytest, etc. # Check for errors grep -r "TODO" src/ || true grep -r "FIXME" src/ || true
5. Completion Check
Ask yourself:
- •Does this meet ALL requirements?
- •Have I tested the changes?
- •Am I 100% confident?
If YES: Output <promise>COMPLETION_PROMISE</promise>
If NO: Document progress and continue next iteration
Common Patterns
Bug Fix Pattern
- •Reproduce the bug
- •Identify root cause
- •Fix the issue
- •Verify fix works
- •Check for regressions
Feature Pattern
- •Understand requirements
- •Plan the implementation
- •Implement incrementally
- •Add tests
- •Document if needed
Refactor Pattern
- •Ensure tests exist
- •Make small changes
- •Run tests after each change
- •Verify behavior unchanged