agentleFS
mir-ammir-am/skills-agents-ai-coding/skills/gh-copilot-review-resolve/SKILL.md

gh-copilot-review-resolve

Skill2 starsChanged 43 days agoMITView on GitHub

Resolve selected GitHub Copilot PR review threads with cautious defaults using gh GraphQL mutations

The file

Show its rules and text

We split this skill into the rules it gives an agent

35 rules. About 0 are common, 19 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to a cautious review-first flow: inspect first, resolve only explicitly selected threads

    line 16
  2. Distinctive:

    Use this skill when:

    line 23
  3. Very specific:

    If given only a PR number, the current repository must have a GitHub origin remote

    line 32
  4. Very specific:

    If gh not installed -> error: Error: GitHub CLI not found.

    line 34
  5. Very specific:

    If not authenticated -> error: Error: Not authenticated with GitHub.

    line 35
  6. Distinctive:

    Use when the suggestion was implemented or otherwise handled in code or docs

    line 51
  7. Very specific:

    Default reply template: Addressed in <commit> (<subject>).

    line 52
  8. Distinctive:

    Use when the suggestion is intentionally not being applied right now

    line 54
  9. Distinctive:

    If input is a full PR URL:

    line 61
  10. Very specific:

    Use it directly with gh pr view <pr> and related gh commands.

    line 62
  11. Distinctive:

    If input is a PR number:

    line 63
  12. Distinctive:

    If the input is neither a valid URL nor a PR number:

    line 67
  13. Distinctive:

    Default to inspection first, action second

    line 72
  14. Distinctive:

    Only resolve explicitly selected Copilot threads by default

    line 73
  15. Distinctive:

    Do not bulk-resolve all unresolved Copilot threads unless the user explicitly asks for bulk mode

    line 74
  16. Distinctive:

    Do not resolve human-authored threads unless the user explicitly asks

    line 75
  17. Very specific:

    If a thread is marked ignored, still add a reply before resolving so the closure is explicit

    line 77
  18. Very specific:

    If a thread's comments connection has more pages, fetch the remaining comment pages with a dedicated per-thread query before deciding …

    line 142
  19. Very specific:

    If line metadata is missing, still show the thread using path and isOutdated.

    line 156
  20. Distinctive:

    If the user has not clearly identified thread actions yet, stop here and ask only for the missing thread/action mapping

    line 157
  21. Distinctive:

    If the user already provided the commit reference and subject, use it

    line 160
  22. Very specific:

    If the user does not want to supply a subject, fall back to Addressed in <commit>.

    line 162
  23. Distinctive:

    If the user provided custom wording, use it exactly

    line 169
  24. Distinctive:

    Treat a thread as Copilot feedback when at least one review-thread comment is authored by:

    line 223
  25. Distinctive:

    If multiple comments exist in the same thread, treat the thread as Copilot-authored if any comment clearly matches Copilot.

    line 230
  26. Distinctive:

    Keep replies short and explicit

    line 234
  27. Very specific:

    Prefer commit-specific replies for addressed threads when a commit is known

    line 235
  28. Distinctive:

    Do not claim a suggestion was fixed if the thread is actually being ignored

    line 236
  29. Very specific:

    Use this per-thread query when the nested comments connection reports more pages than the initial reviewThreads query returned.

    line 339
  30. Very specific:

    No GitHub remote for PR number mode -> Error: No GitHub remote found.

    line 381
  31. Very specific:

    No Copilot threads found -> No Copilot-authored review threads found on this pull request

    line 383
  32. Very specific:

    No unresolved Copilot threads found -> No unresolved Copilot review threads found on this pull request

    line 384
  33. Very specific:

    No explicit thread/action mapping in cautious default mode -> ask only for the missing thread ids and whether each is addressed or ignored

    line 385
  34. Very specific:

    Use gh CLI only; no separate GitHub SDK is required

    line 390
  35. Distinctive:

    Prefer explicit per-thread intent over aggressive automation

    line 393

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

What I do

  • Accept a GitHub pull request URL or PR number
  • Fetch PR review threads with GitHub GraphQL via gh api graphql
  • Detect Copilot-authored review threads and separate unresolved ones
  • Default to a cautious review-first flow: inspect first, resolve only explicitly selected threads
  • Post a reply for each selected thread, then resolve it on GitHub
  • Support two standard actions per thread: addressed and ignored
  • Return a compact action summary including thread ids, paths, and reply URLs when available

When to use me

Use this skill when:

  • User has already handled some Copilot review comments and wants those threads resolved
  • User wants to intentionally close selected Copilot suggestions as ignored with an explicit reply
  • User wants a repeatable gh + GraphQL workflow for Copilot review-thread cleanup
  • User wants to act on Copilot review threads without touching human reviewer threads by default

Prerequisites

  • GitHub CLI (gh) must be installed and authenticated
  • If given only a PR number, the current repository must have a GitHub origin remote
  • The target PR must be accessible with the current GitHub credentials
  • If gh not installed -> error: Error: GitHub CLI not found. Install: https://cli.github.com/
  • If not authenticated -> error: Error: Not authenticated with GitHub. Run: gh auth login

Input Handling

Accept either of these forms:

  • Full GitHub PR URL
    • Example: https://github.com/owner/repo/pull/123
  • PR number
    • Example: 123

The user must also identify which Copilot threads to act on and how to handle each one.

Supported Per-Thread Actions

  • addressed
    • Use when the suggestion was implemented or otherwise handled in code or docs
    • Default reply template: Addressed in <commit> (<subject>).
  • ignored
    • Use when the suggestion is intentionally not being applied right now
    • Default reply template: Ignoring this suggestion for now.

Custom reply text is allowed per thread, but these two action labels should be the default language.

Resolution Rules

  1. If input is a full PR URL:
    • Use it directly with gh pr view <pr> and related gh commands.
  2. If input is a PR number:
    • Resolve repository from git remote get-url origin
    • Derive owner/repo
    • Build the API path from that repository and PR number
  3. If the input is neither a valid URL nor a PR number:
    • Error: Error: Provide a GitHub PR URL or PR number

Cautious Default Behavior

  • Default to inspection first, action second
  • Only resolve explicitly selected Copilot threads by default
  • Do not bulk-resolve all unresolved Copilot threads unless the user explicitly asks for bulk mode
  • Do not resolve human-authored threads unless the user explicitly asks
  • Skip already resolved threads
  • If a thread is marked ignored, still add a reply before resolving so the closure is explicit

Workflow

  1. Validate GitHub access
    gh auth status
  2. Resolve PR and fetch metadata
    • For PR URL, use:
      gh pr view <pr> --json number,title,url,author,baseRefName,headRefName
    • For PR number in current repo, verify remote:
      git remote get-url origin
      gh pr view <number> --json number,title,url,author,baseRefName,headRefName
  3. Fetch review threads with GraphQL
    query=$(cat <<'EOF'
    query($owner: String!, $repo: String!, $number: Int!, $threadCursor: String) {
      repository(owner: $owner, name: $repo) {
        pullRequest(number: $number) {
          reviewThreads(first: 100, after: $threadCursor) {
            pageInfo {
              hasNextPage
              endCursor
            }
            nodes {
              id
              isResolved
              isOutdated
              path
              line
              startLine
              comments(first: 20) {
                pageInfo {
                  hasNextPage
                  endCursor
                }
                nodes {
                  id
                  body
                  url
                  createdAt
                  author {
                    login
                  }
                }
              }
            }
          }
        }
      }
    }
    EOF
    )
    
    gh api graphql -f query="$query" -F owner='<owner>' -F repo='<repo>' -F number=<number>
    • Include pageInfo { hasNextPage endCursor } for both reviewThreads and comments
    • Continue fetching reviewThreads with an after cursor until hasNextPage is false
    • If a thread's comments connection has more pages, fetch the remaining comment pages with a dedicated per-thread query before deciding whether the thread is Copilot-authored
  4. Identify Copilot-authored threads
    • Match exact known Copilot identities first, including Copilot, copilot-pull-request-reviewer, and copilot-pull-request-reviewer[bot]
    • Then match comment authors whose login contains copilot
    • Ignore human-only threads by default
  5. Preview unresolved Copilot threads before acting
    • Summarize each unresolved Copilot thread with:
      • thread id
      • path
      • line or startLine/line
      • isOutdated
      • latest Copilot comment excerpt
    • If line metadata is missing, still show the thread using path and isOutdated; do not fail preview just because the thread no longer has line coordinates
    • If the user has not clearly identified thread actions yet, stop here and ask only for the missing thread/action mapping
  6. Determine the reply wording source for addressed threads
    • If the user already provided the commit reference and subject, use it
    • Otherwise, ask the user for the commit reference before using the full template Addressed in <commit> (<subject>).
    • If the user does not want to supply a subject, fall back to Addressed in <commit>.
  7. Prepare replies for selected threads
    • For addressed, prefer a commit-aware reply such as:
      • Addressed in 66022de (fix: harden dataset scripts).
    • For ignored, prefer:
      • Ignoring this suggestion for now.
    • If the user provided custom wording, use it exactly
  8. Reply to each selected review thread
    query=$(cat <<'EOF'
    mutation($threadId: ID!, $body: String!) {
      addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: $threadId, body: $body}) {
        comment {
          url
        }
      }
    }
    EOF
    )
    
    gh api graphql -f query="$query" -F threadId='<thread-id>' -F body='<reply-body>'
  9. Resolve each selected thread after replying
    query=$(cat <<'EOF'
    mutation($threadId: ID!) {
      resolveReviewThread(input: {threadId: $threadId}) {
        thread {
          id
          isResolved
        }
      }
    }
    EOF
    )
    
    gh api graphql -f query="$query" -F threadId='<thread-id>'
  10. Report results
  • Return which threads were resolved as addressed
  • Return which threads were resolved as ignored
  • Include reply URLs when available
  • Note any partial failures clearly

Bulk Mode

Bulk mode is allowed only when the user explicitly asks for it.

  • Safe bulk example: resolve these Copilot threads with one shared addressed reply and these other Copilot threads with one shared ignored reply
  • Unsafe default to avoid: resolving every unresolved Copilot thread automatically with one generic message

Even in bulk mode, separate the actions into at least these groups:

  • threads marked addressed
  • threads marked ignored

Copilot Thread Detection

Treat a thread as Copilot feedback when at least one review-thread comment is authored by:

  • Copilot
  • copilot-pull-request-reviewer
  • copilot-pull-request-reviewer[bot]
  • a login containing copilot

If multiple comments exist in the same thread, treat the thread as Copilot-authored if any comment clearly matches Copilot.

Reply Message Guidelines

  • Keep replies short and explicit
  • Prefer commit-specific replies for addressed threads when a commit is known
  • Do not claim a suggestion was fixed if the thread is actually being ignored
  • For ignored, make the intentional choice clear without overexplaining

Examples:

  • Addressed in 66022de (fix: harden dataset scripts).
  • Addressed in 66022de.
  • Ignoring this suggestion for now.
  • Keeping the current behavior for now; not applying this suggestion in this PR.

Suggested Action Summary Format

Return a concise result like:

Resolved 3 Copilot threads on PR #1.

- addressed: PRRT_xxx `scripts/download_artifact_files.py` -> <reply-url>
- addressed: PRRT_yyy `scripts/resolve_maven_dependencies.py` -> <reply-url>
- ignored: PRRT_zzz `AGENTS.md` -> <reply-url>

GraphQL Operations Reference

List review threads

query=$(cat <<'EOF'
query($owner: String!, $repo: String!, $number: Int!, $threadCursor: String) {
  repository(owner: $owner, name: $repo) {
    pullRequest(number: $number) {
      reviewThreads(first: 100, after: $threadCursor) {
        pageInfo {
          hasNextPage
          endCursor
        }
        nodes {
          id
          isResolved
          isOutdated
          path
          line
          startLine
          comments(first: 20) {
            pageInfo {
              hasNextPage
              endCursor
            }
            nodes {
              id
              body
              url
              createdAt
              author {
                login
              }
            }
          }
        }
      }
    }
  }
}
EOF
)

gh api graphql -f query="$query" -F owner='<owner>' -F repo='<repo>' -F number=<number>

Repeat the reviewThreads query until thread pagination is exhausted, and fetch additional comment pages for any thread whose comments.pageInfo.hasNextPage is true before classifying it.

Fetch additional comments for one thread

query=$(cat <<'EOF'
query($threadId: ID!, $commentCursor: String) {
  node(id: $threadId) {
    ... on PullRequestReviewThread {
      id
      comments(first: 20, after: $commentCursor) {
        pageInfo {
          hasNextPage
          endCursor
        }
        nodes {
          id
          body
          url
          createdAt
          author {
            login
          }
        }
      }
    }
  }
}
EOF
)

gh api graphql -f query="$query" -F threadId='<thread-id>'

Use this per-thread query when the nested comments connection reports more pages than the initial reviewThreads query returned.

Reply to a review thread

query=$(cat <<'EOF'
mutation($threadId: ID!, $body: String!) {
  addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: $threadId, body: $body}) {
    comment {
      url
    }
  }
}
EOF
)

gh api graphql -f query="$query" -F threadId='<thread-id>' -F body='<reply-body>'

Resolve a review thread

query=$(cat <<'EOF'
mutation($threadId: ID!) {
  resolveReviewThread(input: {threadId: $threadId}) {
    thread {
      id
      isResolved
    }
  }
}
EOF
)

gh api graphql -f query="$query" -F threadId='<thread-id>'

Error Handling

  • Invalid input -> Error: Provide a GitHub PR URL or PR number
  • gh missing -> Error: GitHub CLI not found. Install: https://cli.github.com/
  • Not authenticated -> Error: Not authenticated with GitHub. Run: gh auth login
  • No GitHub remote for PR number mode -> Error: No GitHub remote found. Provide a full PR URL or set origin
  • PR not found or inaccessible -> Error: Unable to access the pull request with current GitHub credentials
  • No Copilot threads found -> No Copilot-authored review threads found on this pull request
  • No unresolved Copilot threads found -> No unresolved Copilot review threads found on this pull request
  • No explicit thread/action mapping in cautious default mode -> ask only for the missing thread ids and whether each is addressed or ignored
  • Reply succeeded but resolve failed -> report partial success and include the affected thread id

Notes

  • Use gh CLI only; no separate GitHub SDK is required
  • This skill changes GitHub review-thread state but does not edit repository files
  • This skill is intentionally the action companion to gh-copilot-review-read
  • Prefer explicit per-thread intent over aggressive automation

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.