pr-fix-loop
Skill4 starsChanged 2 months agoMITView on GitHub
Use this skill when the user asks to "fix PR comments", "address review feedback", "get PR green", "fix CI and review comments", "loop until PR passes", or wants to autonomously respond to GitHub PR review feedback until all comments are resolved and CI is green. Max 5 rounds.
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- TBSten/skillstheir own version, first seen Sep 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- TBSten/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agentic-repo-scaffoldSkill
- agent-travel-plannerSkill
- ai-workflow-spineSkill
- analyze-video-evidenceSkill
- apple-pdfSkill
- audit-fix-loopSkill
- autonomous-grindSkill
- banxian-skillSkill
- big-taskSkill
- clean-room-rewriteSkill
- cloudflare-r2-setupSkill
- codebase-sweepSkill
- context-infrastructureSkill
- deep-researchSkill
- download-web-videoSkill
- dr-sharpSkill
- game-script-creationSkill
- gemini-imageSkill
- gpt-imageSkill
- investigateSkill
- jewelry-marketingSkill
- learning-coachSkill
- mineru-pdf-parserSkill
- mtcSkill
- narrative-researchSkill
- neat-freakSkill
- pet-forgeSkill
- plan-design-reviewSkill
- proxy-node-setupSkill
- serenity-bottleneck-researchSkill
- task-shaped-agent-routingSkill
- transcribeSkill
- tridentSkill
- tui-engineeringSkill
- wandian-writerSkill
- web-novel-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
If no PR exists, stop and tell the user to create one first.
- Distinctive: line 67
When filtering by timestamp to find "new" comments since your last push, use the actual push timestamp — not a stale value from a previous …
- Distinctive: line 84
If all of the following are true, STOP — PR is ready:
- Distinctive: line 85
No unresolved inline comments
- Distinctive: line 87
All CI checks passing (no failures, no pending that could fail)
- Very specific: line 101
Use claude-opus-4-6 for logic/design feedback
- Very specific: line 102
Use claude-sonnet-4-6 for style, naming, formatting feedback
- Distinctive: line 124
Important: Do NOT use git add -p — it is interactive and will hang in Claude Code.
- Distinctive: line 145
IMPORTANT: You MUST wait at least 10 minutes: after pushing before checking for new review comments.
- Very specific: line 147
Do NOT use sleep 600 — it blocks the session.
- Very specific: line 155
Use run_in_background for this wait so the session isn't blocked.
- Very specific: line 157
Poll CI status: every 2 minutes using gh pr checks until all checks complete:
- Very specific: line 161
If --watch is unavailable, poll manually:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Fix Loop Skill
Autonomously respond to GitHub PR review comments and CI failures. Each round: pull comments + CI status, fix issues, push, re-request review, wait, repeat. Stops when all comments are resolved and CI is green, or after 5 rounds.
Prerequisites
gh pr view # confirm PR exists and get PR numberIf no PR exists, stop and tell the user to create one first.
Loop Structure
Round N (max 5):
1. Pull PR state — review comments + CI status
2. Triage: anything actionable?
3. If yes → parallel fix agents → commit → push
4. Post "@claude review" comment to re-request review
5. Wait 10 minutes
6. Back to 1
7. If clean → DONEStep 1 — Pull PR State
CRITICAL: You must check BOTH comment APIs. GitHub stores review feedback in two separate endpoints, and missing one will cause you to declare DONE while comments still exist:
- Inline review comments (
/pulls/{pr}/comments) — file:line annotations from review bots like Qodo, CodeRabbit - Issue comments on the PR (
/issues/{pr}/comments) — top-level comments including review summaries from Claude bot, persistent reviews from Qodo, and CI workflow outputs
Run in parallel:
# Inline review comments (file:line annotations)
gh api repos/{owner}/{repo}/pulls/{pr}/comments \
--jq '.[] | select(.position != null) | {file: .path, line: .line, body: .body, created_at: .created_at}'
# Top-level PR comments — THIS IS WHERE CLAUDE BOT POSTS REVIEWS
gh api repos/{owner}/{repo}/issues/{pr}/comments \
--jq '.[] | {user: .user.login, body: .body[:500], created_at: .created_at}'
# Review decisions (CHANGES_REQUESTED, APPROVED, etc.)
gh api repos/{owner}/{repo}/pulls/{pr}/reviews \
--jq '.[] | {state: .state, body: .body}'
# CI check status
gh pr checks {pr}
# Overall PR view
gh pr view {pr} --json reviews,reviewDecision,statusCheckRollupWhen filtering by timestamp to find "new" comments since your last push, use the actual push timestamp — not a stale value from a previous round.
Classify findings:
| Type | Source | Action |
| Unresolved inline comment | /pulls/{pr}/comments (file:line) | Fix code at file:line |
| Claude/Qodo summary in issue comment | /issues/{pr}/comments | Fix every flagged issue |
| Change requested (review) | /pulls/{pr}/reviews state | Address all reviewer concerns |
| CI failing | gh pr checks | Fix failing check |
| CI pending | gh pr checks | Wait (don't fix yet) |
| All resolved + CI green | — | DONE |
Step 2 — Triage
If all of the following are true, STOP — PR is ready:
- No unresolved inline comments
- No "CHANGES_REQUESTED" review decisions
- All CI checks passing (no failures, no pending that could fail)
Otherwise, categorize work:
- Code changes needed → spawn fix agents
- CI config / infra failure → spawn infra fix agent
- Flaky CI (same check failing with no code relation) → note it, don't loop on it
Step 3 — Parallel Fix Agents
Group comments by file/layer. Spawn fix agents in parallel, one per layer:
- Each agent receives: the specific comments for its files, the full file context
- Use
claude-opus-4-6for logic/design feedback - Use
claude-sonnet-4-6for style, naming, formatting feedback - Each agent resolves all comments in its scope and edits the files
For CI failures, read the failing check logs:
gh run view <run-id> --log-failedThen spawn a fix agent with the full error log.
Step 4 — Verify Locally, Then Commit & Push
Before pushing, run the cheapest local check that would catch a broken fix — affected tests + lint/build, or the repo's make verify / pnpm verify if fast. Every push burns a full CI run and re-triggers every review bot; a push that fails CI on something a local run would have caught wastes the round. CI confirms — it never discovers.
# local gate first (affected tests / lint / build)
git add <file1> <file2> ... # stage only the specific files you changed
git commit -m "fix: address PR review comments (round N)"
git pushImportant: Do NOT use git add -p — it is interactive and will hang in Claude Code. Always list the specific files you modified.
Step 5 — Re-request Review
Post a comment to trigger a new review pass. The comment body is configurable — the default is @claude review, but adjust to match your project's review bot trigger:
# Default: "@claude review"
# Change REVIEW_COMMENT to match your review bot's trigger phrase
REVIEW_COMMENT="${REVIEW_COMMENT:-@claude review}"
gh pr comment <pr-number> --body "$REVIEW_COMMENT"Prerequisite: Your repository must have a review bot configured that responds to the trigger comment. If no bot is set up, skip this step and wait for manual review.
Step 6 — Wait for CI and Review
IMPORTANT: You MUST wait at least 10 minutes after pushing before checking for new review comments. Review bots (Qodo, CodeRabbit, Claude) take 5-10 minutes to analyze changes and post comments. Checking too early will miss new comments and cause premature "DONE" declarations.
Do NOT use sleep 600 — it blocks the session. Instead:
- Wait for review bots — use
sleep 600inside a background command, then check:
Use# Run in background: wait 10 min then check for new comments sleep 600 && gh api repos/{owner}/{repo}/pulls/{pr}/comments \ --jq '[.[] | select(.created_at > "TIMESTAMP_OF_LAST_PUSH")] | length'run_in_backgroundfor this wait so the session isn't blocked. - Poll CI status every 2 minutes using
gh pr checksuntil all checks complete:
Ifgh pr checks <pr-number> --watch --fail-fast--watchis unavailable, poll manually:# Run in a loop, checking every 2 minutes gh pr checks <pr-number> - After the 10-minute wait, re-fetch BOTH review comments AND CI state (Step 1) before deciding whether to loop. Never declare DONE before the wait completes.
Step 7 — Repeat
Go back to Step 1. On round 5, if still not clean, stop and report remaining issues to the user instead of looping again.
Round Tracking
Report status after each round:
Round 1/5: 4 inline comments, 2 CI failures → fixing
Round 2/5: 1 inline comment, 0 CI failures → fixing
Round 3/5: 0 comments, 0 CI failures → DONE ✓Exit Conditions
| Condition | Action |
| All comments resolved + CI green | DONE — report success |
| Round 5 complete, still issues | STOP — report remaining items to user |
| CI permanently broken (same failure 3+ rounds) | STOP — flag as likely infrastructure issue |
| PR closed or merged externally | STOP |
Final Report
PR FIX LOOP COMPLETE
====================
Rounds taken: N / 5
Comments resolved: X
CI checks fixed: X
Status: READY TO MERGE / NEEDS ATTENTION
Remaining (if any):
- [file:line] comment text
- [check name] failure reasonKey Principles
- Never force-push — always
git push(append commits, preserve history) - One commit per round — keeps review history clean AND caps CI/bot usage at one run per round; never push per-finding
- Local gate before every push — CI confirms, it never discovers (see Step 4)
- Don't fix what isn't broken — only touch files with explicit comments or CI failures
- Flaky CI ≠ your bug — if the same unrelated check fails 3 rounds in a row, flag it and don't loop on it
- Wait for CI before declaring done — pending checks may still fail
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

