From Tamir's Superpowers
Use when the user wants to actively drive a PR to completion — 'finish this PR', 'address review comments', 'ship/land/close the PR', 'drive PR #N to merge', 'fix CI and merge', 'clean up this PR'. Persistently loops: addresses all review threads, fixes branch-related CI, retries flakes (max 3×), and stops only when ready (asks for `approved`) or blocked (asks for help).
How this skill is triggered — by the user, by Claude, or both
Slash command
/tamirs-superpowers:pr-dev [PR number, PR URL, or omit to infer from current branch]When to use
User says: finish this PR, address comments, ship/land/merge the PR, drive PR #N, handle review feedback, fix CI and merge, squash-merge, clean up PR branch — or provides a PR number/URL and asks to drive it to done.
[PR number, PR URL, or omit to infer from current branch]claude-sonnet-4-6This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Drive a pull request from open → review addressed → CI green → merge-ready, then stop and wait for explicit user approval before merging.
Drive a pull request from open → review addressed → CI green → merge-ready, then stop and wait for explicit user approval before merging.
After a PR opens, the real work is staying on top of CI failures, reviewer threads, and merge conflicts — often across many minutes. A one-shot "check and report" leaves the PR stalled whenever a simple retry or two-line fix would have unblocked it, and it misses threads that arrive after the initial check.
This skill runs a persistent drive loop — re-fetch, act, push, loop — so you never babysit GitHub tabs. It stops at exactly two states: ready (asks for approved) or blocked (asks for help).
Resolve once at startup; reuse throughout:
| Input | Resolution |
|---|---|
| No argument | gh pr view --json number -q .number from current branch |
PR number 42 | Use directly |
| PR URL | Extract number from URL |
If no PR resolves, ask and stop.
These rules exist because past implementations broke in the specific ways listed.
[skip ci] — required checks must run; skipping forces admin-bypass merges.gh pr merge until the user writes approved in this conversation — protects against accidental merges.--admin unless the user explicitly authorizes it.startup:
resolve PR number and REPO
HEAD = pr head branch name
loop:
state = bash $CLAUDE_SKILL_DIR/scripts/fetch-pr-state.sh $PR
if PR merged or closed → report; STOP
# Review threads
unresolved = threads where isResolved==false and isOutdated==false
for each thread:
read body; assess: agree / partially agree / disagree
state reply text in conversation ← user can redirect
post reply via gh api
if agreed/partial: apply code fix; commit; push
bash $CLAUDE_SKILL_DIR/scripts/resolve-thread.sh $THREAD_ID
if any thread needed a push → restart loop immediately (no sleep)
# CI
if any check failing:
RUN_ID = first failed run for current HEAD commit
gh run view $RUN_ID --log-failed → classify (table below)
branch-related → patch, commit, push; restart loop
flaky, retry<3 → gh run rerun $RUN_ID --failed; retry++; restart loop
flaky, retry≥3 → surface to user; STOP (blocked)
infra/unrelated → surface to user; STOP (blocked)
if any check pending/queued → wait (cadence below); restart loop
# Readiness
if all checks green AND unresolved==0 AND mergeStateStatus==CLEAN:
print readiness summary; STOP — wait for `approved`
sleep(cadence); restart loop
bash "$CLAUDE_SKILL_DIR/scripts/fetch-pr-state.sh" "$PR"
Quick snapshot inside the loop:
gh pr view "$PR" --repo "$REPO" \
--json number,title,state,mergeable,mergeStateStatus,\
reviewDecision,statusCheckRollup,headRefOid,headRefName
agree, partially agree, or disagree.$CLAUDE_SKILL_DIR/templates/review-reply.md.tmpl shapes.gh api "repos/$REPO/pulls/$PR/comments" \
-X POST -f body="$REPLY" -f in_reply_to="$COMMENT_ID"
bash "$CLAUDE_SKILL_DIR/scripts/resolve-thread.sh" "$THREAD_ID"
RUN_ID=$(gh run list --repo "$REPO" \
--commit "$(gh pr view $PR --repo $REPO --json headRefOid -q .headRefOid)" \
--json databaseId,conclusion \
--jq '.[] | select(.conclusion=="failure") | .databaseId' | head -1)
gh run view "$RUN_ID" --repo "$REPO" --log-failed
| Signal in logs | Classification | Action |
|---|---|---|
| Test/lint/compile error in a PR-touched file | Branch-related | Patch, commit, push; restart loop |
runner provisioning failed, network timeout, registry error | Flaky/infra | gh run rerun $RUN_ID --repo $REPO --failed (max 3×) |
| Dependency outage, GH Actions infra error | Unrelated | Surface to user; STOP |
| Ambiguous | Ambiguous | One manual diagnosis; then decide |
git add -p # stage only the relevant change
git commit -m "fix: <what and why>
Co-Authored-By: Claude <noreply@anthropic.com>"
git push origin HEAD
Then restart the loop immediately — never treat a push as a terminal outcome.
For short cycles: gh pr checks "$PR" --watch
For long cycles (5+ min) or when other work can run in parallel, use the Monitor until-loop. See $CLAUDE_SKILL_DIR/references/ci-monitor-loop.md.
| State | Interval |
|---|---|
| CI pending/queued/running | 60 s |
| Fix just pushed | Immediate restart — no sleep |
| CI green, threads still open | 45 s |
| All green + 0 threads | Readiness gate — STOP |
Confirm ALL before printing:
mergeStateStatus is CLEANPrint:
PR #N is ready to merge.
✓ N/N CI checks green
✓ 0 unresolved review threads
✓ Branch up to date with base
Reply `approved` to squash-merge and clean up.
Do not call gh pr merge until the user writes approved.
approved)gh pr merge "$PR" --squash --delete-branch
Close issues linked in the PR body (Closes #N, Fixes #N):
gh issue close <N> --comment "Shipped in PR #$PR."
Then clean up the local environment:
bash "$CLAUDE_SKILL_DIR/scripts/cleanup-after-merge.sh" "$PR"
Surface clearly, then stop:
Blocked on PR #N — need your input:
Issue: <specific description of what can't be resolved>
Options:
A) <option>
B) <option>
Which do you prefer?
Never silently stop, guess, or take a destructive action without confirmation.
| Wrong | Right |
|---|---|
| Stop on one idle poll | Keep looping — CI may still be queued |
| Stop after pushing a fix | Restart loop immediately |
| Retry a flaky runner 10× | Max 3×; then surface to user |
| Post reply without stating it first | State in conversation; then post |
Merge without explicit approved | Stop at readiness gate; wait |
| Patch CI config to silence flaky test | Retry; escalate if it persists |
| Batch unrelated fixes in one commit | One commit per logical fix |
Pushed fix: <what> (SHA abc1234). Resuming.Retried flaky run (attempt N/3). Watching.Thread "<snippet>": agreed/partial/disagree — replied and resolved.npx claudepluginhub tamircohen28/plugins --plugin tamirs-superpowersCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.