review-pr-comments
Automatically addresses pull request comments and resolves them once tasks are completed.
Install
mkdir -p .claude/skills/review-pr-comments && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12024" && unzip -o skill.zip -d .claude/skills/review-pr-comments && rm skill.zipInstalls to .claude/skills/review-pr-comments
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Check a PR for unresolved review comments, assess each one, apply fixes where needed, and resolve addressed threads via the GitHub API. Use this skill whenever the user mentions PR comments, review threads, unresolved feedback, or addressing reviewer suggestions — even if they just say "fix the comments", "close out the review threads", or "address the feedback".Key capabilities
- →Identify unresolved review threads on a PR
- →Fetch review comments using GitHub GraphQL API
- →Apply code fixes where needed for comments
- →Resolve addressed threads via GitHub API
- →Summarize actions taken on PR comments
How it works
This skill identifies unresolved PR comments, reads the relevant code, triages each comment, applies necessary fixes, and then resolves the threads via the GitHub GraphQL API.
Inputs & outputs
When to use review-pr-comments
- →Address pull request feedback
- →Resolve open review threads
- →Fix PR comments automatically
About this skill
Review & Resolve PR Comments
Fetch every unresolved review thread on a PR, decide for each whether a code
fix is needed, apply the fix (or confirm it's already done), then resolve the
thread via gh GraphQL. Ask the user whenever a decision is genuinely
ambiguous.
When to Use This Skill
- User says "address the PR comments" or "fix the review comments"
- User says "resolve comments on PR #N" or pastes a PR URL
- User says "check the open comments on my PR"
Steps
Execute in order. Stop and report if any step fails.
Step 1: Identify the PR
If the user provided a PR number or URL, extract the number.
Otherwise, try to detect the PR automatically from the current branch/worktree:
gh pr view --json number,url,headRefName 2>/dev/null
If that returns a PR, use it and inform the user which PR was detected (number
- title) before continuing.
If no PR is found automatically, ask:
Which PR number (or URL) should I review?
Derive OWNER, REPO, PR_NUMBER from the URL or from the current repo's
git remote get-url origin. Handle both HTTPS (https://github.com/OWNER/REPO.git)
and SSH ([email protected]:OWNER/REPO.git) remote formats.
Step 2: Switch gh to the repo owner account (if needed)
Extract the currently active GitHub username:
gh api user --jq '.login'
If that username does not match OWNER (derived in Step 1), switch:
gh auth switch --user <OWNER>
Note the original username so you can restore it at the end. Do NOT rely on
gh auth status to determine the active user — its output format is harder to
parse reliably. Use gh api user --jq '.login' instead.
Step 3: Fetch ALL unresolved review threads
Use the GitHub GraphQL API to get every thread — paginate if needed. The REST endpoint can truncate output; always use GraphQL:
gh api graphql -f query='
{
repository(owner:"OWNER", name:"REPO") {
pullRequest(number:PR_NUMBER) {
reviewThreads(first:100) {
nodes {
id
isResolved
isOutdated
comments(first:20) {
nodes {
databaseId
path
line
body
}
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved == false)
| {
threadId: .id,
outdated: .isOutdated,
commentId: .comments.nodes[0].databaseId,
path: .comments.nodes[0].path,
line: .comments.nodes[0].line,
body: .comments.nodes[0].body
}'
Record the full list. If there are zero unresolved threads, report that and stop.
Step 4: Read the current file for each thread
For every unresolved thread, read the relevant file at the commented line to understand the current state of the code:
- If the thread is outdated (
isOutdated: true), the code has already changed. Read the file to confirm the concern is addressed. - If the thread is not outdated (
isOutdated: false), the commented line still exists. Read it and decide:- Is the issue already fixed (e.g. a test was added in a new file, or the change was applied elsewhere)?
- Does it still need a fix?
- Is the suggestion wrong / inapplicable (stale logic, wrong assumption)?
Step 5: Triage each thread
Categorise every thread into one of three buckets:
| Bucket | Meaning | Action |
|---|---|---|
| already-fixed | The code concern is addressed; comment is just not resolved | Resolve the thread, no code change |
| needs-fix | The issue is real and present in the current code | Apply the fix, then resolve |
| not-applicable | The suggestion is wrong, stale, or intentionally not followed | Post a reply explaining why, then resolve |
When in doubt, pause and ask the user before placing a thread in any bucket. Never silently skip a thread.
Step 6: Apply fixes
For threads in the needs-fix bucket:
- Make the minimal correct change to the file.
- Build and run tests using the project's standard commands (e.g.
pnpm buildandpnpm vitest runfor pnpm projects;npm testoryarn testfor others — checkpackage.jsonscripts if unsure) to confirm nothing breaks. - If tests fail, fix them or pause and ask the user.
- Commit the fix:
git add <files>
git commit -m "fix: <short description of what was fixed>
Addresses PR review comment: <comment body summary>"
git push
Collect the thread IDs of all fixed threads.
Step 7: Resolve threads
For threads in not-applicable, first post a reply comment explaining why the suggestion wasn't followed, so the reviewer isn't left wondering:
gh api repos/OWNER/REPO/pulls/PR_NUMBER/comments \
--method POST \
-f in_reply_to=COMMENT_DATABASE_ID \
-f body="<brief explanation: e.g. 'This is intentional — X because Y'>"
Then, for every thread in already-fixed, needs-fix (now fixed), and not-applicable, resolve via GraphQL:
gh api graphql -f query="
mutation {
resolveReviewThread(input: {threadId: \"THREAD_ID\"}) {
thread { isResolved }
}
}
" --jq '.data.resolveReviewThread.thread.isResolved'
Verify the result is true before moving to the next thread.
Step 8: Restore original gh account
If the active account was switched in Step 2, restore it:
gh auth switch --user <ORIGINAL_ACCOUNT>
Step 9: Report
Summarise what was done:
- How many threads were found
- How many were already-fixed (just resolved)
- How many needed and received a fix
- How many were not-applicable (resolved with explanation)
- Any that were skipped pending user input (list them explicitly)
Important Notes
- Never resolve a thread without first confirming the underlying concern is addressed — either in the current code or with a new commit.
- Outdated ≠ resolved. An outdated thread may still represent a real issue in refactored code.
- Ask the user for anything that involves a design choice, trade-off, or intentional deviation from the reviewer's suggestion.
- This skill resolves threads under the repo owner's account. Always restore
the original
ghaccount at the end.
When not to use it
- →When there are no unresolved review comments
- →When the user does not want to address PR comments
- →When the user wants to manually resolve comments
Limitations
- →Requires user input for ambiguous decisions
- →Cannot resolve threads without confirming the underlying concern is addressed
- →Does not automatically handle design choices or trade-offs
How it compares
This workflow automates the process of triaging, fixing, and resolving PR comments, reducing manual effort and ensuring all feedback is addressed.
Compared to similar skills
review-pr-comments side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| review-pr-comments (this skill) | 0 | 4mo | Review | Intermediate |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| dependency-upgrade | 26 | 5mo | Review | Intermediate |
| git-commits | 21 | 4mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
git-commits
bonny
Create well-structured git commits in logical chunks following best practices
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
github-multi-repo
ruvnet
Multi-repository coordination, synchronization, and architecture management with AI swarm orchestration
git-workflow-enforcer
CrazyDubya
Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.