/olko-github-pr:copilotloopfrom olko-github-pr
Iteratively satisfy GitHub Copilot's code review on a GitHub PR, but treat every Copilot comment SKEPTICALLY: verify each finding against the real code first, fix ONLY the genuinely-correct ones, and rebut + resolve false positives WITHOUT changing correct code. Repeat until no unresolved Copilot comments remain. Use when the user says "satisfy Copilot", "clear the Copilot review", "fix Copilot comments", "Copilot loop", or wants to iterate on Copilot PR feedback.
Ships in olko-github-pr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Drive a GitHub PR until Copilot has no unresolved review comments, but do not cargo-cult its suggestions. Every comment is a claim to verify, not an instruction to obey. A wrong suggestion applied is worse than the comment itself.
copilot-pull-request-reviewer[bot] through the pull request reviewers endpoint. A
repository may also be configured to review new pushes automatically.codexloop, geminiloop,
coderabbitloop, and qodoloop; for CI failures rather than review comments, use
ci-fix-loop.The bot login is normally stable, but confirm it from the PR rather than assuming it:
gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate --jq '.[].user.login' | sort -u
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate --jq '.[].user.login' | sort -u
Use copilot-pull-request-reviewer[bot] as BOT. Confirm it appears after the first requested
review; if GitHub uses a different login for the installation, use the exact Copilot-looking login
returned by the probe rather than guessing.
Finding nothing here is NOT a stop condition. On a PR Copilot has never reviewed there is no bot login to find yet. Fall through to step A, request the reviewer, and re-run this probe once a review lands. Only conclude Copilot is unavailable after the bounded wait expires with no review.
scripts/pr-review-state.sh reads the PR and prints one JSON object: the current head, whether
Copilot has acted on that head (a review of it, or any comment after it was pushed), and every
unresolved review thread with its author. Every "is there work / are we done" decision in this
loop comes from its exit code, never from what you remember resolving. The script lives in this
skill's directory, SKILL_ROOT: the directory holding this SKILL.md (Claude Code prints it as the
skill's base directory when the skill loads; in Codex, derive it from the selected SKILL.md path).
| Exit | verdict | Meaning | Do |
|---|---|---|---|
| 0 | clean | Copilot acted on the current head and no bot thread is unresolved | exit check: done |
| 10 | findings | unresolved threads from Copilot or any other review bot | run an iteration |
| 20 | pending | Copilot has not acted on the current head yet | trigger if needed, then wait |
| 30 | limited | a rate-limit or paused notice from Copilot after the current head | stop, report blocked: rate-limited |
Resolving the last thread does not make a PR clean: Copilot has not reviewed your push yet. Earlier
versions of this loop exited at exactly that moment, while the next round of comments was still on
its way. Human threads are listed in .unresolved (is_bot: false) and counted in .counts.humans;
they never block clean, and this loop never resolves them.
gh pr view --json number,headRefName,headRefOid -q '{number,branch:.headRefName,head:.headRefOid}'
Switch to the PR branch if not already on it. Capture OWNER/REPO (gh repo view --json owner,name).
Keep an explicit iteration counter and stop at 5: the cap is a real bound to enforce, not a figure of speech. Each pass through A–G is one iteration; on hitting the cap, go straight to the report and list what is still unresolved rather than starting a sixth.
One read answers both "is there work?" and "has Copilot seen my last push?". SINCE is the
timestamp you took right before your last push (step E); leave it empty on iteration 1. Right
after a push, add --wait 600 straight away: the wait ends only once the bot has acted on the new
head, so threads left open on purpose cannot make the push look reviewed.
"$SKILL_ROOT/scripts/pr-review-state.sh" --repo OWNER/REPO --pr <PR> --bot copilot-pull-request-reviewer --since "$SINCE"
10 (findings): go to B. On iteration 1 this is whatever Copilot (or another bot)
already posted.20 (pending): request it through the reviewers endpoint (gh api --method POST repos/{owner}/{repo}/pulls/<PR>/requested_reviewers -f 'reviewers[]=copilot-pull-request-reviewer[bot]'). Then wait with the same command plus --wait 600. Run the
wait in the background where the host allows it (Claude Code: Bash run_in_background; you are
re-invoked when it exits) so ten minutes of polling never sits in the conversation. Still 20
after the wait: say so out loud, request the reviewer once more, and wait once more. Still 20 after that: stop and
report the timeout honestly; never claim success.0 (clean): go to the exit check. A --wait call returns clean only after a settle
re-read 60 seconds later, so a comment landing right behind the review is still caught. A bare
read (no --wait) that says clean is good enough only when you have not pushed since Copilot's
last review.30 (limited): stop now and report blocked: rate-limited; nothing more is coming.1: the read itself failed (often a transient GitHub 502). Retry once; if it fails again,
stop and report it. An unknown state is not a clean one.The working set is every unresolved thread in the state JSON with is_bot: true: Copilot's
own (is_target: true) and any other review bot's (Greptile, for example). A
fix for one bot often draws a comment from another, and leaving those open is how a "finished" loop
leaves a PR that is not clean. Treat another bot's thread with exactly the same verify-first rules
below. Never act on a human's thread (is_bot: false); list it in the report.
.body, including all matching reviews
for the current head. Extract and classify actionable claims even when they have no inline thread;
an approval assessment or lack of inline comments does not make those findings complete.
Track each body finding across iterations by source review/comment ID and item, with its
classification, fix commit or evidence-based rebuttal, PR-level reply URL, and completion status.
Link duplicates to the same finding so they are counted once; retain pending findings after a push..unresolved[] | select(.is_bot) in step A's state JSON lists
each thread's thread_id, comment_id, path, line and a short excerpt, across every page of
threads. Read the full comment before judging it:gh api repos/{owner}/{repo}/pulls/comments/<COMMENT_ID> --jq '{user: .user.login, path, line, body}'
Mark each unresolved inline comment as seen, so the bot and a watching human can tell it is being
handled. GitHub's reaction set is fixed; eyes is the only "looking at it" value:
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=eyes
Body findings (no inline thread) have no comment to react to; track them in step B's register and give each a PR-level reply in step F instead.
For every inline or body finding, verify the claim against the actual code and repo conventions before touching anything. Read the whole file, not just the diff hunk Copilot saw, plus the types and the call sites. Then classify:
Hard rules:
Copilot's common failure modes to watch for (default these to category 2):
Make the minimal correct change. Re-run the local gate if the repo has one (typecheck/tests) before moving on.
Order matters. A resolved thread is a claim that the fix is on the branch, so the push has to succeed before the claim is made: otherwise a failed commit or push leaves the PR unfixed with the finding marked resolved, and nobody looks at it again.
If step D changed code:
# Stage ONLY the files your fixes touched: never `git add -A`, which sweeps up
# unrelated work and untracked secrets sitting in the worktree.
git status --short # look before you stage
git add <path> [<path>...] # the files named in the findings you fixed
git commit -m "address Copilot review feedback (copilotloop iteration N)"
SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ) # step A reads bot activity after this
git push
Author the commit per the repo's norms (e.g. the user's identity; no AI attribution if that is the convention). Confirm the push actually landed before continuing:
git rev-parse HEAD
gh pr view <PR> --json headRefOid -q .headRefOid # must match
If they differ, stop: the fix is not on the PR, so nothing may be resolved yet.
Only now, with the fixes pushed, reply and resolve. Take thread and comment ids from step A's state
JSON (.unresolved[]): the script already follows pagination, so do not hand-roll a threads query.
Reply on a thread's comment via gh api repos/{owner}/{repo}/pulls/<PR>/comments -f body="..." -F in_reply_to=<comment_id>,
then resolve:
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
Then record the disposition of each inline finding as a reaction on Copilot's own comment: the learning signal, and a visible marker for a human scanning the PR:
+1): the finding was accepted and fixed.-1): the finding was rebutted as a false positive. This is the correction signal.gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=+1
# rebutted finding:
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=-1
Reply first, then react, then resolve: the reaction is not a substitute for the reply, and a resolved thread with no reply loses the reasoning.
Resolve a thread only for a bot comment in your working set (this bot's or another review bot's) that you have fixed or rebutted: never blanket-resolve, and never resolve a human reviewer's thread.
Threads you are rebutting need no push, so they may be replied to and resolved regardless of whether step D changed code.
For each body finding, post a PR-level reply (for example, using
gh pr comment <PR> --body-file <reply-file>) identifying the source review/comment and item.
Record the pushed fix commit and validation, or an evidence-based rebuttal, including the reason
for declining an out-of-scope finding. Record the reply URL in the tracking entry before marking
it complete. One reply may cover multiple explicitly identified findings. Fixed body findings
require the same successful push check as fixed threads; rebuttals need no push. If a finding also
has an inline thread, that thread still requires a reply and resolution.
Go back to A. After a push, A waits for Copilot's review of the new head (pushing re-triggers
it when auto-review is on; otherwise A triggers it). If this iteration changed no code (every finding
rebutted), there is no new head to wait for: A's fresh read says clean or shows what is still open.
Decide from a fresh state read, never from what you remember resolving.
Stop when any is true:
pr-review-state.sh --wait 600 call, made after your last push, exited 0
(clean); with no push since the bot's last review, a bare read that exits 0 is enough, and the body-finding register from step B has no pending entries. Open human threads do not block this; list them in the report.pending after the retry in step A. Report it honestly; do not claim success.30. Report blocked: rate-limited./loop or a scheduled
wakeup), offer one re-check about 20 minutes later for bots that comment late.Copilotloop complete.
PR: #<n>
Bot login: <resolved $BOT>
Iterations: N
Findings fixed: N (inline + body findings, deduplicated)
Findings rebutted: N (inline + body findings, with recorded evidence-based replies)
Remaining: N (unresolved inline + pending body findings, deduplicated)
Human threads: N (open, listed below; this loop never resolves them)
Final state: clean | timeout | rate-limited | iteration cap
If it stopped at max iterations, list the remaining threads and body findings with your current assessment (fix-pending vs disputed) so a human can arbitrate.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub oleg-koval/agent-skills --plugin olko-github-pr14 skills in this plugin
/ci-fix-loopDiagnose GitHub Actions CI failures in a loop: fetch the failing check logs, identify the root cause, apply a targeted fix, push, and wait for the next run: repeating until all checks are green or a real blocker needs a human. Use when CI is red after a push, when the user says "fix CI", "make tests pass", "diagnose CI failures", or "drive this to green". Direct analog of qodoloop / coderabbitloop for automated test and lint failures.
/coderabbitloopIteratively drives a GitHub PR to zero unresolved CodeRabbit (coderabbitai[bot]) findings. Reads each inline comment's own "Prompt for AI Agents" block (CodeRabbit's ready-made fix spec per issue), applies the fix, replies to the thread explaining what was done, resolves it, pushes, and re-triggers CodeRabbit. Repeats until clean or a real blocker needs a human. Use when the user wants a PR fully addressed against CodeRabbit's review, or says "run coderabbitloop" / "satisfy CodeRabbit" / "resolve CodeRabbit comments".
Other plugins' skills for the same job
/codexloopIteratively satisfy OpenAI Codex's code review on a GitHub PR, but treat every Codex comment SKEPTICALLY: verify each finding against the real code first, fix ONLY the genuinely-correct ones, and rebut + resolve false positives WITHOUT changing correct code. Repeat until Codex has reviewed the latest push and nothing is left unresolved. Use when the user says "satisfy codex", "clear the codex review", "fix codex comments", "codex loop", or wants to iterate on Codex PR review feedback.