agentleFS
craigspatersoncraigspaterson/agent-skills/skills/resolve-copilot-review/SKILL.md

resolve-copilot-review

Skill1 starsChanged 3 months agoMITView on GitHub

Triage GitHub Copilot's automated PR review comments, fix the confirmed issues, and resolve the review threads. Use when the user mentions Copilot review findings/comments, asks to address or clear PR feedback, or wants Copilot's review threads resolved.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If there are zero open Copilot threads, say so and stop here.

    line 43
  2. Distinctive:

    Commit the fixes (skip if none were needed) and push to the PR's branch, so the diff Copilot reviewed actually reflects the fixes.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Resolve Copilot Review

Step 1 — Identify the PR

Get owner/repo from the base repository (where the PR and its threads live — gh pr view only exposes the head repo, which differs on fork PRs):

gh repo view --json owner,name -q '.owner.login + "/" + .name'

Then get the PR number — the one the user named, or the open PR for the current branch:

gh pr view --json number,url,headRefName

Completion: you have owner, repo, and PR number.

Step 2 — Fetch Copilot's review threads

REST's pulls/{n}/comments endpoint carries neither thread-resolution state nor a resolvable thread id — both only exist via GraphQL's reviewThreads. Fetch threads there:

gh api graphql -f query='
  query($owner:String!,$repo:String!,$pr:Int!){
    repository(owner:$owner,name:$repo){
      pullRequest(number:$pr){
        reviewThreads(first:100){
          nodes{
            id isResolved path line
            comments(first:10){nodes{id databaseId author{login} body path line}}
          }
        }
      }
    }
  }' -f owner=OWNER -f repo=REPO -F pr=NUMBER

Filter to threads where isResolved is false and the first comment's author.login contains "copilot" (case-insensitive — the exact login string has varied). Completion: for every open Copilot thread you have the GraphQL thread id, the file path/line, the finding text, and the first comment's databaseId.

id (GraphQL node id, used to resolve the thread) and databaseId (REST numeric id, used to reply) are different id spaces for the same comment — don't cross them.

If there are zero open Copilot threads, say so and stop here.

Step 3 — Triage every finding before touching code

For each open thread, read the referenced file at that line and judge it: valid (a real defect) or not applicable (already handled, out of scope, or the bot is wrong). Report the full list with a one-line verdict and reason per finding — this is the "tell me if they're valid" step, and it happens before any edit.

Completion: every open thread has a stated verdict, reported to the user.

Step 4 — Fix, reply, resolve

For each thread, in verdict order:

  1. Valid — make the fix. Reply on the thread naming what changed: gh api repos/OWNER/REPO/pulls/NUMBER/comments/DATABASE_ID/replies -f body="..."
  2. Not applicable — reply explaining why, same endpoint, no code change.
  3. Resolve the thread either way: gh api graphql -f query='mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}' -f id=THREAD_ID

Completion: every thread from Step 3 has a reply and is resolved; every valid fix is staged.

Step 5 — Commit and push

Commit the fixes (skip if none were needed) and push to the PR's branch, so the diff Copilot reviewed actually reflects the fixes.

Completion: working tree clean, branch pushed, PR updated.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.