بنقرة واحدة
ralph
Execute one iteration of the Ralph loop - pick next open issue from milestone, implement, review, merge
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Execute one iteration of the Ralph loop - pick next open issue from milestone, implement, review, merge
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | ralph |
| description | Execute one iteration of the Ralph loop - pick next open issue from milestone, implement, review, merge |
| argument-hint | <milestone-name> |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob, Task, Skill |
Execute one task from a GitHub milestone. Designed for autonomous batch processing.
Design principle: Run to completion without user interaction. Exit cleanly so the loop can restart.
Issues are processed sequentially by number (ascending). No dependency tracking needed.
Milestone name: $ARGUMENTS
Branch: !git branch --show-current
Uncommitted changes: !git status --porcelain
gh issue list --milestone "$ARGUMENTS" --state open --json number,title --jq 'sort_by(.number)'
If no open issues, create .ralph-complete and exit immediately:
touch .ralph-complete
echo "Milestone complete - no open issues"
Take the issue with the lowest number. Read its full details including comments:
gh issue view <number> --comments
IMPORTANT: Always read comments. Earlier work on related issues often leaves context comments that affect implementation choices.
git checkout main
git pull origin main
If there are uncommitted changes, stash them and warn:
git stash push -m "ralph-stash-$(date +%s)"
echo "WARNING: Uncommitted changes were stashed. Run 'git stash list' to recover them."
git checkout -b <number>-<short-kebab-description>
Example: 12-add-anthropic-streaming
For feature issues, use TDD (RED-GREEN-REFACTOR):
For refactoring/removal issues:
make validate
Fix issues before proceeding.
Do not commit until Phase 5. A post-commit hook triggers a roborev review on every commit. All implementation work stays uncommitted until review passes.
make validate
Must pass before review.
Stage all changes, then review them using --dirty. Run this command exactly
once. Do NOT re-run it, do NOT wrap it with 2>&1, echo $?, or any other
shell constructs. Each invocation submits a new paid review.
git add .
roborev review --dirty --wait
If the output is confusing, check results separately:
roborev status
roborev show <job-id>
If PASS (no actionable findings): Proceed to Phase 5.
If FAIL (actionable findings): Fix the findings:
roborev fix
Then re-validate, re-stage, and re-review:
make validate
git add .
roborev review --dirty --wait
If still failing after 2 fix cycles, yield (see 4.4).
If review cannot be resolved:
gh issue comment <number> --body "$(cat <<'EOF'
## Attempt Failed - Learnings
**What was tried:**
- <brief description of approach>
**Why it failed:**
- <specific feedback from review>
**What to do differently:**
- <concrete changes for next attempt>
EOF
)"
git checkout main
git branch -D <branch-name>
git pull origin main
.ralph-completeThe loop will retry this issue on the next iteration with improved context.
git add .
git commit -m "$(cat <<'EOF'
<issue-title>
<brief description of changes>
Closes #<issue-number>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EOF
)"
make validate
git checkout main
git pull origin main
git merge <branch-name> --no-edit
git push origin main
git branch -d <branch-name>
gh issue comment <number> --body "$(cat <<'EOF'
## Completed
### Changes
- <summary of what changed>
### Validation
- `make validate` passes
- roborev review passed
EOF
)"
gh issue close <number>
Check if the next issues in the milestone would benefit from context about what was just implemented:
gh issue list --milestone "$ARGUMENTS" --state open --json number,title --jq 'sort_by(.number) | .[0:3]'
For issues where this work provides genuinely useful context, post a brief comment:
gh issue comment <next-number> --body "Context from #<number>: <1-2 sentences about what was done and how it affects this issue>"
Skip if the relationship is superficial.
Exit normally. Do NOT create .ralph-complete - there may be more issues.
The loop script will invoke another iteration.