copilot-review-loop
Skill87 starsChanged 8 months agoMITView on GitHub
This skill should be used when the user asks to "handle copilot review", "run copilot review loop", "fix copilot issues", "process copilot feedback", "resolve copilot comments", "request copilot review", "address copilot review comments", or says "Copilot 又有新的问题" / "帮我处理 Copilot Review" / "跑一下 Copilot Review". Automatically detects the current PR stage (never reviewed, in-progress, has comments, or clean) and runs the full fix-request-wait loop until Copilot raises no new issues.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- sourcehawk/feature-dev-workflowtheir own version, first seen Nov 15, 2026
- Hermione-Granger-1176/artifactstheir own version, first seen Oct 8, 2026
- xpepper/pr-review-agent-skilltheir own version, first seen Aug 25, 2026
- moreh-dev/runestheir own version, first seen May 27, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- xpepper/pr-review-agent-skill★ 6same name
- Hermione-Granger-1176/artifacts★ 2same name
- sourcehawk/feature-dev-workflow★ 2same name
- moreh-dev/runes★ 0same 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 repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
Use GraphQL (NOT REST — REST in_reply_to_id misses intra-thread replies).
- Distinctive: line 59
Read the full comment body
- Distinctive: line 60
Read the relevant file/function in the codebase
- Distinctive: line 75
After evaluating a comment, identify the class of problem it reveals.
- Distinctive: line 78
Follow the data flow: if a value is mishandled in one function, trace all callers and consumers of that value
- Very specific: line 79
Verify cross-component consistency: if two modules must agree on the same logic (e.g., both computing isDeleted), verify both sides match
- Distinctive: line 80
Audit related docs and comments: if one comment is stale due to a code change, check all comments describing the same behavior
- Very specific: line 88
Follow test-driven development.
- Distinctive: line 98
Always run unit tests after fixing.
- Distinctive: line 104
Never commit if tests fail.
- Very specific: line 108
Commit with a descriptive message.
- Very specific: line 122
Add copilot-pull-request-reviewer[bot] to requested reviewers via gh api.
- Distinctive: line 130
After review completes -> back to Step 1.
- Distinctive: line 137
Poll timeout: If polling times out (20 attempts), re-request review and restart the poll — do not stop.
- Distinctive: line 139
Commit/push failures: Check git status, resolve conflicts or issues, then retry.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Review Loop
Autonomously run the fix -> request -> wait -> check cycle on a PR until Copilot raises no new issues.
For all gh api command snippets, consult references/gh-commands.md.
Stage Detection (Always Start Here)
Determine the current PR state before taking any action. Check pending reviewers, review history, and unhandled threads.
Decision table:
| State | Action |
Copilot in requested_reviewers | Currently reviewing -> skip to Wait for Review |
| Not pending + no reviews ever | Never reviewed -> Request & Wait |
| Not pending + reviews exist + 0 unhandled | All clean -> Done |
| Not pending + reviews exist + unhandled > 0 | Has open issues -> enter Fix Loop |
The Loop
LOOP:
Step 1 — Find unhandled threads (if none -> Request & Wait)
Step 2 — Evaluate & proactive scan
Step 3 — Implement fixes
Step 4 — Run tests
Step 5 — Commit and push
Step 6 — Reply to each comment thread
Step 7 — Resolve all handled threads
Request & Wait:
Step 8 — Request Copilot review
Step 9 — Poll requested_reviewers until Copilot finishes
-> back to Step 1
Step 1 finds 0 unhandled -> DONEStep 1: Find Unhandled Threads
Use GraphQL (NOT REST — REST in_reply_to_id misses intra-thread replies).
"Unhandled" = not resolved AND only 1 comment (no reply yet).
See references/gh-commands.md for the query. UNHANDLED: 0 -> proceed to Request & Wait.
Step 2: Evaluate & Proactive Scan
Evaluate each comment
For each unhandled comment, before touching code:
- Read the full comment body
- Read the relevant file/function in the codebase
- Assess: is the suggestion technically correct for this codebase?
- Decide: fix, push back, or note as already addressed
Evaluation criteria (be skeptical):
- Does the suggestion respect the codebase's architectural constraints and intentional design decisions?
- Could it break existing tests or observable behavior?
- Does the reviewer have full context? (e.g., intentional trade-offs, async queue semantics, platform-specific behavior)
- Is this an actual bug, or a misunderstanding of intent?
Push back with technical reasoning when the suggestion is wrong. Do not implement blindly.
Proactive similar-issue scan
After evaluating a comment, identify the class of problem it reveals. Then use understanding of the codebase architecture to find all similar issues — not just the one flagged:
- Trace the root assumption: identify what incorrect assumption caused the bug, then locate every other place that assumption appears
- Follow the data flow: if a value is mishandled in one function, trace all callers and consumers of that value
- Verify cross-component consistency: if two modules must agree on the same logic (e.g., both computing
isDeleted), verify both sides match - Audit related docs and comments: if one comment is stale due to a code change, check all comments describing the same behavior
This requires deep comprehension of the code, not mechanical grep. Read the relevant modules, understand the invariants, then verify they hold everywhere.
Fix all instances proactively. Group same-class fixes in one commit.
Step 3: Implement Fixes (TDD)
Follow test-driven development. Invoke the superpowers:test-driven-development skill for the full TDD workflow:
- Write or update tests first — add integration/unit tests that cover the expected behavior before implementing the fix. Run them to confirm they fail for the right reason.
- Implement the fix — make minimal, targeted changes per comment.
- Run tests — verify the new tests pass and no existing tests break.
Group same-class fixes together; do not batch unrelated fixes.
Step 4: Run Tests
Always run unit tests after fixing. Run integration tests when:
- The fix changes observable behavior (not just comments/docs)
- The fix touches state management, file watching, or command logic
- Any doubt about whether it could break an integration scenario
Never commit if tests fail.
Step 5: Commit and Push
Commit with a descriptive message. Include Co-Authored-By with the current model name. Push immediately.
Step 6: Reply to Each Comment Thread
Reply inline using comments/{id}/replies (NOT top-level PR comment). Include the commit SHA and a brief description. For pushed-back comments, explain why no change was made.
Step 7: Resolve All Handled Threads
Resolve all unresolved threads via GraphQL mutation. Only resolve threads that have been addressed.
Request & Wait
Step 8: Request Copilot Review
Add copilot-pull-request-reviewer[bot] to requested reviewers via gh api.
Step 9: Poll for Completion
CRITICAL: Poll the requested_reviewers endpoint until Copilot is no longer listed. Do NOT use review count — GitHub sometimes updates an existing review instead of creating a new one, causing count-based polling to hang indefinitely.
Log each poll attempt with timestamp and status. Timeout after 20 attempts (~10 minutes). See references/gh-commands.md for the poll script.
After review completes -> back to Step 1. If 0 unhandled -> DONE.
Error Handling & Resilience
The loop must never stop due to transient errors. Apply these rules:
- gh api failures: Retry up to 3 times with 10-second intervals before giving up on a single API call.
- Poll timeout: If polling times out (20 attempts), re-request review and restart the poll — do not stop.
- Test failures: Diagnose and fix, then re-run. Never abandon the loop due to a failing test.
- Commit/push failures: Check
git status, resolve conflicts or issues, then retry. - Any unexpected error: Log the error, attempt recovery, and continue the loop. Only stop if the same error persists after 3 retries or if the error is clearly unrecoverable (e.g., repo deleted, auth expired).
The goal is autonomous completion — the user should be able to walk away and find the loop finished.
Key Rules
- TDD first — write or update tests before implementing fixes; confirm they fail, then implement
- Evaluate before implementing — read the code first; push back with reasoning when the reviewer is wrong
- Scan by understanding, not grep — trace assumptions and data flow to find the same class of bug across the codebase
- Tests must pass — never commit broken code; run integration tests for behavioral changes
- Reply in thread — use
comments/{id}/replies, never top-level PR comments - Resolve after replying — only resolve threads already addressed
- GraphQL for thread detection — REST misses intra-thread replies
- Poll
requested_reviewers, not review count — prevents stuck loops - Never stop on transient errors — retry API calls, re-request reviews, recover and continue
References
references/gh-commands.md— Allgh apicommand snippets: check reviewers, find threads, poll completion, reply, resolve
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.

