/ai-dev-extensions:github-resolve-prfrom ai-dev-extensions
Use when the user asks to review, analyze, address, or resolve comments pushed on a GitHub pull request - fetches all unresolved review threads, judges each comment on its merits, applies a fix when the comment is valid, always replies to every thread (fix summary or rationale for not fixing), and resolves every thread after the reply is posted — whether the comment was fixed or declined with rationale
Ships in ai-dev-extensions. 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.
None: SKILL.md is the whole skill.
When a reviewer (human or bot such as Copilot, CodeRabbit, Sourcery) leaves comments on a PR, the author must close the loop on every comment — not just the ones that are trivially actionable. This skill defines a consistent workflow: fetch unresolved threads, judge each one on technical merit, apply a fix when warranted, and always leave an explicit reply (either a fix summary or a rationale for declining). Resolve every thread after the reply is posted — fixed ones once the commit is pushed, declined ones once the rationale is on the record. The reply is what preserves the conversational trail; resolution just hides the thread from the default view so remaining work is visible.
Silence is not acceptable. A thread with no reply leaves the reviewer guessing whether the feedback was seen, rejected, or forgotten. Resolving without replying is the same defect in disguise.
github-create-update-pr)github-complete-pr)Use the GraphQL API to get thread IDs alongside comment bodies — REST endpoints alone don't expose the isResolved state or the thread node ID needed to resolve later.
gh api graphql -f query='
query {
repository(owner: "<OWNER>", name: "<REPO>") {
pullRequest(number: <PR>) {
reviewThreads(first: 50) {
pageInfo { hasNextPage endCursor }
nodes {
id
isResolved
comments(first: 20) {
pageInfo { hasNextPage endCursor }
nodes {
databaseId
author { login }
path
originalLine
body
}
}
}
}
}
}
}'
Capture for each unresolved thread: thread.id (for the resolve mutation), the latest comment's databaseId (for replies via REST), the path and originalLine (for locating the code), and the body (the feedback itself).
Pagination matters on large PRs. The query above caps at 50 threads and 20 comments per thread. If reviewThreads.pageInfo.hasNextPage is true, you are missing threads — re-run with after: "<endCursor>" (via a $threadsCursor variable) and merge pages until hasNextPage is false. Likewise, if any thread's comments.pageInfo.hasNextPage is true, paginate that thread's comments before replying so you are seeing the latest turn of the conversation, not a stale mid-thread snapshot. See the paginated snippet in the Full Recipe below.
Some file paths are considered stable after definition and must not be auto-resolved. Comments on these paths should remain open for manual handling.
Protected paths:
docs/superpowers/**When an unresolved thread targets a file matching a protected path:
This path is protected (`docs/superpowers/**`), so I did not apply an automatic fix here. Leaving this thread open for manual review.
⏭️ Skipping thread <thread-id> — targets protected path docs/superpowers/<file>. Replied on the thread and left it open for manual review.
For every unresolved thread (that was not skipped in §2), make a deliberate decision:
Do not auto-accept bot suggestions just because they come from a bot. Do not auto-reject human feedback just because you disagree at first glance. Read the code around path:originalLine before deciding.
Every unresolved thread must receive a reply before being resolved — regardless of the decision. The reply must:
gh api -X POST \
repos/<OWNER>/<REPO>/pulls/<PR>/comments/<COMMENT_DATABASE_ID>/replies \
-f body='<reply text>'
Work on the PR's head branch. Confirm with git branch --show-current before editing. If you are on the default branch, check out the PR branch (gh pr checkout <PR>).
Use the git-commit skill. Prefer one commit per logically-distinct fix over a single "address review comments" mega-commit — but don't split trivial wording fixes across multiple commits either. A commit that covers two related typos is fine; a commit that covers a shell-logic fix and a documentation restructure is not.
Commit message examples:
fix(skills): use explicit if/else for remote branch deletion
fix(api): surface push errors instead of swallowing them as "already deleted"
docs(readme): clarify installation prerequisites per review feedback
Reference the reviewer concern in the commit body, not the title.
Replies carry the fix commit SHA. Push first, then reply — the SHA must resolve on the remote when the reviewer clicks it.
git push
Use the resolveReviewThread GraphQL mutation with the thread.id captured in step 1:
gh api graphql -f query='
mutation($id: ID!) {
resolveReviewThread(input: { threadId: $id }) {
thread { id isResolved }
}
}' -f id=<THREAD_NODE_ID>
Order matters:
fix → push → reply → resolve. Replying before pushing creates a broken SHA reference.reply (with rationale) → resolve. The rationale stays in the thread history; resolution just hides it from the default "unresolved" view so the remaining work is visible.Resolve every thread this way — fix or decline — as long as a substantive reply was posted first. Resolution without a reply is forbidden (see Rule §9); it looks like feedback is being silenced.
Exception: threads on protected paths (see §2) must not be resolved, even after replying. They stay open for manual handling.
Resolving a thread that has no author reply is silencing feedback, regardless of whether you intended to fix it or decline it. The reply is what makes the decision transparent to the reviewer; resolution just tidies the UI.
If you cannot articulate a rationale for declining, that is a signal the comment probably warrants a fix — do not resolve to avoid the conversation.
Reviewer-flagged disagreements. If the reviewer pushes back on your rationale and re-opens the thread (or posts a counter-argument), treat that as a fresh unresolved thread: read it, reply again with an updated decision, and only then resolve.
OWNER=<owner>
REPO=<repo>
PR=<number>
# 1. Fetch unresolved threads, paginating through all review-thread pages.
# If any thread reports comments.pageInfo.hasNextPage=true, paginate that
# thread's comments before replying so you see the latest turn.
THREADS_CURSOR=null
while :; do
page=$(gh api graphql \
-F owner="$OWNER" \
-F repo="$REPO" \
-F pr="$PR" \
-F threadsCursor="$THREADS_CURSOR" \
-f query='
query($owner: String!, $repo: String!, $pr: Int!, $threadsCursor: String) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 50, after: $threadsCursor) {
pageInfo { hasNextPage endCursor }
nodes {
id
isResolved
comments(first: 20) {
pageInfo { hasNextPage endCursor }
nodes { databaseId author { login } path originalLine body }
}
}
}
}
}
}')
echo "$page"
has_next=$(echo "$page" | jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.hasNextPage')
[ "$has_next" != "true" ] && break
THREADS_CURSOR=$(echo "$page" | jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.endCursor')
done
# 2. For each unresolved thread: read the body, inspect the code, decide valid/invalid.
# 3. Apply fixes on the PR branch.
gh pr checkout "$PR"
# ... edit files ...
# 4. Commit and push.
git add <files>
git commit -m "<conventional commit message referencing the review>"
git push
# 5. Reply to each thread (use the latest comment's databaseId).
gh api -X POST \
"repos/$OWNER/$REPO/pulls/$PR/comments/<COMMENT_DATABASE_ID>/replies" \
-f body="Fixed in <short-sha>. <one-sentence summary of the change>"
# 6. Resolve every thread for which you posted a reply (fix or decline).
# EXCEPTION: do NOT resolve threads on protected paths (docs/superpowers/**).
# Those stay open for manual handling even after replying.
gh api graphql -f query='
mutation($id: ID!) {
resolveReviewThread(input: { threadId: $id }) {
thread { id isResolved }
}
}' -f id=<THREAD_NODE_ID>
path before assuming the feedback is staledocs/superpowers/**) → skip it and leave the thread open for manual handlingWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub using-system/ai-dev-extensions --plugin ai-dev-extensions8 skills in this plugin
/aks-kubectlUse when running kubectl commands against an AKS cluster - enforces az aks command invoke for private cluster access, requires --file for complex commands, and persists cluster identity in memory/docs-englishUse when writing or editing documentation, code comments, docstrings, README files, CHANGELOG entries, PR descriptions, commit messages, or any committed textual artifact - enforces English as the sole language regardless of the language used in the conversation/git-commitUse when creating git commits - enforces Conventional Commits specification for semantic versioning compatibility