From pr-review
Processes all open GitHub Copilot code-review comments on a PR in one automated pass. Use this skill whenever the user asks to "check copilot comments", "process copilot suggestions", "review and implement copilot feedback", or says something like "gehe durch die copilot kommentare" / "bearbeite die copilot reviews". Trigger even when the user just says "copilot pr" or "apply copilot" without further detail. The skill fetches all Copilot-bot review threads via the GitHub GraphQL API, analyses each suggestion against the actual code, then for accepted suggestions: implements the code change + resolves the thread + adds a 👍 reaction. For rejected suggestions: posts a reply explaining why. Ends with a summary table of all decisions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pr-review:review-copilot-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
1. Detects the current PR (or uses a user-supplied PR number)
# Get owner/repo slug
gh repo view --json owner,name --jq '"\(.owner.login)/\(.name)"'
# Auto-detect PR from current branch (if no PR number was given)
gh pr view --json number --jq '.number'
If the user passed a number as an argument (e.g. /review-copilot-pr 42), use that directly.
If no PR exists for the current branch, tell the user and stop.
Use the GraphQL API to get review threads with their thread IDs (needed for resolution later). The REST API does not expose thread IDs, so GraphQL is required here.
gh api graphql -f query='
{
repository(owner: "OWNER", name: "REPO") {
pullRequest(number: PR_NUMBER) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 10) {
nodes {
databaseId
body
author { login }
path
line
originalLine
outdated
}
}
}
}
}
}
}'
Replace OWNER, REPO, and PR_NUMBER with the values from Step 1.
Filter criteria:
comments.nodes[0].author.login contains "copilot" (case-insensitive)
— this catches copilot[bot], copilot-pull-request-reviewer[bot], etc.isResolved: true (already handled)comments.nodes[0].outdated: true (code already changed, suggestion stale)For each remaining thread:
path field from the commentline or originalLineDecision criteria — accept if:
any/as castDecision criteria — reject if:
Write down your decision and a 1-sentence reason for each thread before taking any action.
Print this table to the user before making any changes:
## Copilot Review Summary — PR #<number>
| File | Line | Suggestion (brief) | Decision | Reason |
|------|------|--------------------|----------|--------|
| src/foo.ts | 42 | Add null check before access | ✅ Implement | Prevents NPE on missing optional field |
| src/bar.ts | 17 | Rename `data` to `userData` | ❌ Skip | `data` matches the API response shape by convention |
Do NOT take any actions (edits, API calls) before printing this summary.
For each accepted thread, do these three things in order:
Apply the code change described in the Copilot comment. Read the file first to understand the exact context, then make the minimal edit that satisfies the suggestion. Do not refactor surrounding code.
gh api graphql -f query='
mutation {
resolveReviewThread(input: {threadId: "THREAD_NODE_ID"}) {
thread { isResolved }
}
}'
THREAD_NODE_ID is the id field from the GraphQL thread node (base64, e.g. PRT_kwDO...).
gh api -X POST /repos/OWNER/REPO/pulls/comments/COMMENT_DB_ID/reactions \
-f content=+1
COMMENT_DB_ID is the integer databaseId of the first comment in the thread.
For each rejected thread, post a reply explaining why you did not implement it:
gh api -X POST /repos/OWNER/REPO/pulls/PR_NUMBER/comments \
-f body="Thanks for the suggestion! Skipping this one: <1-sentence reason>." \
-F in_reply_to_id=COMMENT_DB_ID
COMMENT_DB_ID is the integer databaseId of the first comment in the thread.
Keep the reply short and factual — one sentence max.
After all actions are done, print a brief completion message:
Done. Processed N Copilot threads:
- X implemented (code changed, thread resolved, 👍 reacted)
- Y skipped (reply posted with reason)
reviewThreads array or no Copilot threads match,
tell the user: "No open Copilot review comments found on PR #."Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub assetbird/claude-tools --plugin pr-review