From pr-review
Process and critically evaluate code review comments on your PR. Use this skill when the user says 'handle PR comments', 'check review comments', 'address PR feedback', 'look at the review', 'handle review', or references PR/code review comments they've received. Also use when the user pastes a PR URL and asks about comments or feedback on it.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pr-review:handle-code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fetch all comments on a PR, critically evaluate each one, then help the user decide what to implement and how to respond.
Fetch all comments on a PR, critically evaluate each one, then help the user decide what to implement and how to respond.
Verify before implementing. Question before assuming. Technical correctness over social comfort.
Code review comments are suggestions to evaluate, not orders to follow. Reviewers may lack context, misunderstand the codebase, or suggest changes that break existing functionality. Your job is to be the user's technical partner — figure out which comments are right, which are wrong, and which need clarification — so the user can make informed decisions.
This matters because LLMs have a strong tendency toward performative agreement ("Great point! Let me fix that right away!"). That impulse is actively harmful here. A wrong "fix" costs more than pushing back on a reviewer.
Determine the PR to process:
gh pr view --json number,url,titleFetch all comment types. Resolved comment threads must be excluded — they have already been addressed and should not be evaluated or acted upon.
Use GraphQL to fetch review threads so you can filter by resolution status:
# Review threads with resolution status (paginate if needed)
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!, $cursor: String) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100, after: $cursor) {
pageInfo { hasNextPage endCursor }
nodes {
isResolved
isOutdated
path
line
comments(first: 50) {
nodes {
id
databaseId
author { login }
body
createdAt
path
line
}
}
}
}
}
}
}
' -f owner='{owner}' -f repo='{repo}' -F pr='{pr_number}'
From the GraphQL response:
isResolved: true — these are already addressedisOutdated: true threads (code has changed under them) — still evaluate but note they may be staleAlso fetch general PR comments and reviews via REST (these don't have thread resolution):
# Issue comments (general PR comments)
gh api repos/{owner}/{repo}/issues/{pr_number}/comments
# Reviews (review summaries with approve/request-changes/comment status)
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews
Also fetch the PR diff for context:
gh pr diff {pr_number}
For every comment, determine:
CLAUDE.md, and the PR's intentFor each comment, classify it:
Do not take comments at face value. For each non-trivial comment:
CLAUDE.md and project conventions — does the suggestion conflict with established patterns?When a reviewer suggests adding error handling, abstractions, or "proper implementation" for something, grep the codebase for actual usage. If the thing they're worried about can't actually happen given the current code, say so. Don't add defensive code for impossible scenarios just because a reviewer imagined them.
Present findings grouped by category, with the most important items first. For each comment:
Example format:
### Comment by @reviewer on `api/services/foo.py:42`
> "This should use a try/except for the database call"
**Evaluation: Valid**
The `get_listing()` call on line 42 hits the database without error handling.
The service layer convention (per CLAUDE.md) is to catch specific domain
exceptions here. Should wrap in `try/except ListingNotFoundError`.
---
### Comment by @reviewer on `api/adapters/bar.py:15`
> "You should add retry logic here"
**Evaluation: Questionable**
This adapter is called only from the batch service which already has its own
retry wrapper (`RetryPolicy` in `api/services/batch.py:28`). Adding retry
here would cause nested retries. The reviewer may not be aware of the
existing retry layer.
After presenting the analysis, offer the user two paths:
Ask the user which comments they want to implement. Then offer:
feature-dev skill for a more structured implementation with architecture analysis"Let the user pick. Don't start implementing without their go-ahead.
Offer to draft reply comments for the PR. Be explicit about this:
"I can draft replies to each comment. I'll show you what I'd write before posting — you can edit the tone and wording since AI-generated replies tend to sound overly formal."
For replies, follow these rules:
try/except ListingNotFoundError."RetryPolicy in batch.py:28) — adding it here would cause nested retries."Always show the drafted replies to the user before posting. The user knows the reviewer — they can adjust tone and phrasing.
To post replies, use the GitHub API to reply in the correct comment thread:
# Reply to a review comment (inline)
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies -f body="..."
# Reply to an issue comment (general)
gh api repos/{owner}/{repo}/issues/{pr_number}/comments -f body="..."
If the user left comments on their own PR (self-review notes, TODOs, questions for reviewers), surface these separately as "Your notes" — don't evaluate them the same way. They may be reminders the user wants to address or context they left for reviewers.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub himmelreich-it/agentic-development --plugin pr-review