/pr-review:pr-reviewfrom pr-review
Deep-dive review of a teammate's GitHub pull request, for cases that deserve more than a skim: infra/Terraform changes, IAM or access changes, or anything where "looks fine" isn't good enough. Traces claims against the actual repo (usages, history, other consumers of the same code) instead of reasoning from the diff alone, runs local tools against scratch cases when a finding is about what a tool actually does, cross-checks against existing PR discussion so comments don't duplicate what's already been said, triages findings down to the single most important issue (rarely two), drafts that and runs it through the personify skill when installed, and stages it as a GitHub pending review for explicit approval before anything gets posted. Never posts, submits, or merges without the user's go-ahead at each checkpoint. Use for "/pr-review 123", "review PR 123", "take a look at PR 123", or similar requests to review someone else's PR (not your own working diff — for that, use /code-review).
Ships in pr-review. 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.
This is a slower, more skeptical alternative to a quick gh pr view skim. It
exists because surface-level review misses the interesting bugs: the ones
where the diff looks reasonable in isolation but is wrong (or already being
discussed, or actually fine) once you trace how the changed code is really
used. Budget for several tool calls per finding — that cost is the point.
The person receiving this review is (usually) a human, not another agent, and a wall of findings is a burden, not a service. Do the full investigation, but narrow what actually gets posted to the PR down to the one issue that matters most — see Phase 5. Investigation depth doesn't change; what changes is how much of it becomes a comment on someone else's PR.
metadata.version against the repo's SKILL.md, or just run
/plugin marketplace update if you installed it as a Claude Code plugin.
Not required, just cheap insurance against acting on stale instructions.Parse the invocation for a PR number and optionally an owner/repo. If no
repo is given, resolve it from the current directory's git remote
(git remote -v, parse owner/repo out of the SSH or HTTPS URL). If gh
can't resolve the repo ("Could not resolve to a Repository"), check
gh auth status for multiple logged-in accounts — the active account may
not have access — and gh auth switch --user <other-account> before retrying.
git pull on the default branch
first so local file reads reflect current main — you'll be cross-referencing
the PR against the rest of the repo, and stale local state produces wrong
conclusions.CLAUDE.md, AGENTS.md,
CONTRIBUTING.md, or a nearer-scoped AGENTS.md/README.md in the touched
directories. Repos with strict domain rules (e.g. a Terraform style guide,
a "security-critical change" checklist, a list of high-risk paths) define
what actually matters for that repo — apply those criteria, don't invent
generic ones.gh pr view <N> -R <owner/repo> --json title,author,body,files,additions,deletions,url,state,mergeable,reviewDecision,commitsgh pr diff <N> -R <owner/repo>gh api repos/<owner/repo>/pulls/<N>/comments --jq '.[] | {id,user:.user.login,created_at,path,in_reply_to_id,body}'gh api repos/<owner/repo>/issues/<N>/comments --jq '.[] | {user:.user.login,created_at,body}'in_reply_to_id. Note anything unresolved.For each changed file/hunk, decide what kind of change it is before judging it: narrow access grant, broad/shared surface (module, provider, boundary, CI config), pure refactor, docs, etc. If the repo's docs define "security-critical" or "high-risk path" categories, explicitly check the diff against them. This classification determines how much Phase 3 digging is warranted — a docs typo doesn't need it; a permission boundary change does. One exception: a finding about what a tool does is never exempt, whatever the file it lives in. A docs PR recommending a command still gets that command run, since the recommendation is the thing under review.
This is the phase that's easy to skip and most valuable to do. For every claim you're tempted to make about the PR's effect, ask "how would I know that's true?" and go check, rather than inferring it from the diff text alone:
--fix rewrites this", "this flag catches that"), reading its source or
docs is not evidence. Build a minimal case in a scratch directory and run
it. Reading the implementation correctly and still mapping the rule to the
wrong axis is a specific, common failure, and it produces a confident,
source-cited, wrong finding that the rest of this phase will happily wave
through.
gh api/git ls-remote call separates them.terraform plan.grep for other consumers of the changed
module/resource/policy across the whole repo, not just the touched files.
A change to a shared primitive (module, boundary, policy) may be consumed
by multiple roots/services with different blast radii.grep for distinctive strings (a SID name, a resource ARN
pattern), not just the filename.git log --oneline -- <file> and
gh pr list --search "<topic>" reveal whether a pattern (e.g. "only update
one of two copies") is new or an existing habit in the repo, which changes
whether it's worth raising and how you phrase it.Write down each candidate finding with the concrete evidence for it (file:line, the grep/log output that supports it) before moving to drafting. A finding you can't point to hard evidence for gets cut or turned into a question instead of an assertion.
Name the evidence class for each finding, because they don't carry equal weight: observed (you ran it and this is the output), traced (you followed the code or config to it), or inferred (it follows from what you read). A claim about tool behavior that is only traced or inferred is not ready to post — either run it per the first bullet above, or write it as a question. When you report the finding, say which one it is; "I ran this and got X" and "reading the source, I think X" invite very different replies, and collapsing them is how a wrong finding gets treated as settled.
Before drafting anything, go back over the candidate findings and actively look for the innocent explanation, per the standing instruction to distinguish real shortcomings from "something that might be intended on their side or misinterpreted on ours":
If the author or another reviewer responds to a posted finding with a reasonable explanation, verify it against the repo rather than accepting it at face value — check that referenced modules/paths actually exist in the state they describe. Report back honestly if you can't fully verify (e.g. the replacement doesn't exist yet), without treating that as grounds to re-litigate a settled, reasonable-sounding answer.
LGTM is a complete review body, not a placeholder for more
(Phase 6 still applies: it stays a pending, unsubmitted review either
way).LGTM on its own is a complete, acceptable review
body when there's nothing more worth saying.personify skill, if it's installed. If it
isn't, say so and show the plain draft instead of failing the whole
review — personify improves the prose, it isn't load-bearing for the
review's substance.
Never call gh pr review/gh pr comment directly and never set event on
the review (that would submit it immediately). Stage a pending review so
it stays private until the human submits it:
gh api --method POST /repos/<owner>/<repo>/pulls/<N>/reviews \
--input review.json
where review.json has body (the summary) and comments[] of
{path, line, side: "RIGHT", body}, anchored to added lines on the PR's
current head SHA, and no event field. When Phase 5 concluded "nothing
to flag," comments[] may be empty or hold just the positive callout — the
review still stages as pending, not as a submitted approval; the human
chooses and submits the actual verdict.
To edit a pending comment: the PATCH /pulls/comments/{id} endpoint 404s on
unpublished comments. Delete the whole pending review
(DELETE /pulls/<N>/reviews/<review_id>) and recreate it instead of trying
to patch in place.
review.json is written to whatever repo you're reviewing (it may contain
excerpts of that repo's code), not to this skill's own directory — delete it
right after the API call, whether it succeeded or failed, so it doesn't
linger and get swept into an unrelated commit there. On a retry, regenerate
it fresh rather than reusing a copy that may reference a stale head SHA.
Tell the human the review is staged and pending, and stop. Submitting the review, replying to follow-up comments, resolving threads, and merging are all separate, explicitly-authorized actions — do not chain into them.
/code-review for that.terraform plan/apply, cloud CLIs, or other live
validation unless the repo's own docs say agents may do so locally — rely
on static tracing and posted CI/plan output instead. This bars validation
that touches live infrastructure, costs money, or needs credentials you
shouldn't be using. It does not bar running a local tool against a scratch
file to check what that tool does; Phase 3 requires that, and the two are
not the same act.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub smartwatermelon/pr-review --plugin pr-review