/skills:review-prfrom skills
Review a GitHub pull request using the target repo's own review preferences, and post the findings as inline comments directly on the PR. Detects whether this is a first review or a re-review of a PR it already commented on — on re-review it checks whether each of its own prior comments was addressed, replies and resolves or leaves it open, then reviews for new issues. Approves the PR when no blocking issues remain (disable with -no-approve). Takes a GitHub PR URL, an optional focus area (security, performance, accessibility, code-quality, or plan-alignment), an optional -praise flag to also call out things done well, and an optional -no-approve flag. Use when the user invokes /review-pr, gives a GitHub PR URL and asks to review or re-review it, asks for inline PR comments, or asks to review a PR for a specific concern like security or performance.
Ships in skills. 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.
Read when SKILL.md points to them; scripts run unread.
Reviews one GitHub PR, honoring whatever review preferences the target repo defines for itself, and posts the findings as inline review comments on the PR. If it has reviewed this PR before, it first reconciles its own prior comments against what changed, then reviews for anything new. It approves the PR when nothing blocking remains. Severity and comment formatting follow ../../references/review-severity.md — read it before assigning severities or formatting comments.
/review-pr <github-pr-url> [focus] [-praise] [-no-approve]
gh returns 404 — PR, repo, or owner doesn't exist, or is misspelled.gh returns 403 — no access to the repo (private repo, no permission).state is MERGED or CLOSED (from step 1's gh pr view).security — only security flaws and vulnerabilities in the changes.performance — only performance and optimisation concerns.accessibility — only a11y (frontend changes).code-quality — maintainability and best practices; lean on whatever
style/architecture guidance the repo's own review preferences surface
(see step 3).plan-alignment — the PR is supposed to implement a specific plan or
spec doc. Ask the user where that doc lives if it isn't obvious from the
PR description, read it, and verify the code matches it.-praise (optional flag). Off by default. Only look for and post
per-line Praise findings (per ../../references/review-severity.md) when the
user passes -praise or otherwise explicitly asks for praise/positive
callouts. Without it, skip per-line Praise entirely — don't generate it
and don't post it. This is separate from the short praise summary an
approval always includes (see step 6) — that happens regardless of this
flag.-no-approve (optional flag). Off by default, meaning approval is
automatic whenever no blocking issues remain (step 6). Pass -no-approve
to disable that: post the same findings, but always use event COMMENT
and leave the PR pending for the user to approve themselves.Parse owner, repo, and pr_number from the URL (use these for all gh
calls; don't assume the current repo).
gh pr view <url> --json title,body,state,isDraft,headRefName,baseRefName,files
for metadata, description, and changed paths.404/403 from gh, or state of MERGED/CLOSED all mean stop
here and report to the user instead of continuing.gh pr diff <url> for the diff.Get the authenticated identity: gh api user --jq .login.
List existing review summaries: gh pr view <url> --json reviews.
Pull the PR's review threads with resolution state via GraphQL (REST alone can't resolve threads or tell you if one is already resolved), paginating both connections — a PR can have more than 100 threads, or a thread more than 50 comments:
gh api graphql -f query='
query($owner:String!, $repo:String!, $number:Int!, $after:String) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$number) {
reviewThreads(first: 100, after: $after) {
pageInfo { hasNextPage endCursor }
nodes {
id
isResolved
comments(first: 50) {
pageInfo { hasNextPage endCursor }
nodes { id databaseId author { login } body path line }
}
}
}
}
}
}' -f owner=<owner> -f repo=<repo> -F number=<pr_number>
Follow reviewThreads.pageInfo with after until hasNextPage is
false. If any thread's comments.pageInfo.hasNextPage is true, page
that thread's comments the same way — a truncated thread can hide the
human reply that determines its disposition in step 3.
This is a re-review if any prior review summary's author matches the
authenticated login and its body follows this skill's format (severity
emoji + bold severity label, e.g. 🟠 **Major** — see
../../references/review-severity.md), or any thread's first comment
is authored by that login and follows the same format. Checking only
review summaries can miss a prior run that left only inline comments.
Otherwise it's a first review — skip straight to step 4.
Only ever treat comments matching that fingerprint (same author + this skill's template) as "ours." Never touch, reply to, or resolve a comment or thread from a human reviewer or from any other tool, even if it's on the same PR.
../../references/review-severity.md. This is only valid for Major (needs
owner + rationale) and Minor (needs a follow-up reference) findings.
Critical findings can never be deferred this way — they stay open
until actually fixed, no matter what a reply says.gh api --method POST /repos/<owner>/<repo>/pulls/<pr_number>/comments/<databaseId>/replies -f body="✅ Resolved — <one-line reason: fixed / not applicable because X / deferred, tracked in Y>"mutation { resolveReviewThread(input: {threadId: "<thread id>"}) { thread { isResolved } } }gh api --method POST /repos/<owner>/<repo>/pulls/<pr_number>/comments/<databaseId>/replies -f body="⚠️ Not fully addressed — <what's still missing>"Critical/Major thread is
blocking regardless of how it was justified.Every repo you review may define its own review conventions, and if it does,
they take priority over your general judgment. Before reviewing, check the
target repo (via gh api/gh pr view file contents, or a local clone if one
exists) for review guidance in the usual places, roughly in this order:
AGENTS.md or CLAUDE.md at the repo root — often states review
priorities, what to look for in specific packages, and things to ignore.CONTEXT-MAP.md plus per-directory CONTEXT.md
files) — read the nearest one for each changed path before exploring
source, if present..github/instructions/*.md, docs/**review**, or similar dedicated
review-instruction files — some repos keep a path-to-instruction map and
scope exclusions here (e.g. paths that should never get inline comments).Follow whatever path-to-instruction mapping and scope exclusions these files define. If the repo has none of this, proceed with a general review using your own judgment — don't invent conventions it doesn't have.
../../references/review-severity.md (Critical
/ Major / Minor / Nit, plus per-line Praise only if -praise was
passed), each with file:line, evidence, risk/impact, and a concrete
remediation (per-finding format in that reference). De-duplicate to one
primary finding per root cause, and don't re-raise something already
covered by a thread you just reconciled in step 3.Critical or Major finding from step 5, or (on a
re-review) any prior thread from step 3 still "not fully addressed" whose
original severity (read from its own comment body) is Critical, or
Major without a valid deferral. A still-open Minor/Nit thread is
reported in step 8 but does not block.REQUEST_CHANGES. Never approve while
something blocking is open, regardless of the -no-approve flag — that
flag only affects the non-blocking branch below.Minor/Nit/Praise findings, or none at
all):
-no-approve not passed) → event APPROVE. Write a short
praise summary into the review body — what the PR does well, e.g. good
test coverage, a clean approach, sound edge-case handling. This is
always included on approval, independent of the -praise flag (which
only governs per-line inline Praise comments).-no-approve passed → event COMMENT, even though nothing is blocking.
Say explicitly in the body that the PR looks ready to approve, but is
left pending because -no-approve was set.Post all new findings as a single review via the GitHub API (one atomic review, not N separate comments) using the event decided in step 6:
{
"event": "COMMENT",
"body": "<overall summary: verdict, focus, counts by severity, re-review reconciliation summary if applicable, anything outside the diff>",
"comments": [
{
"path": "apps/backend/src/foo.service.ts",
"line": 42,
"side": "RIGHT",
"body": "🟠 **Major**\n\n...summary...\n\n...recommendation..."
},
{
"path": "apps/frontend/x.tsx",
"start_line": 10,
"start_side": "RIGHT",
"line": 14,
"side": "RIGHT",
"body": "🔵 **Minor**\n\n...summary..."
}
]
}
line is the file line number on side: RIGHT (added/context) or LEFT
(removed). For a span, add start_line and start_side (GitHub's API
rejects a multi-line comment that omits start_side).../../references/review-severity.md (emoji + severity, summary, and a
recommendation — omitted for Nit/Praise, per that template)."event" to whatever step 6 decided (REQUEST_CHANGES, APPROVE, or
COMMENT).skills/review-pr/scripts/post-pr-review.sh <owner> <repo> <pr_number> /tmp/pr-review-payload.json
or directly: gh api --method POST /repos/<owner>/<repo>/pulls/<pr_number>/reviews --input payload.json.
422 means a comment targets a line not in the diff — move that finding to
the summary body and re-post.Tell the user the review URL, the event posted (REQUEST_CHANGES/APPROVE/
COMMENT), how many inline comments were posted, and the severity breakdown. On a
re-review, also report how many prior comments were resolved vs. still open
and why. If no material issues were found, say so explicitly (per
../../references/review-severity.md, still post a short summary review and list
residual risks / testing gaps).
REQUEST_CHANGES,
COMMENT, or APPROVE, per step 6) on the named PR, and — on a re-review —
replying to and resolving threads that this tool itself created in a prior
run (per the fingerprint in step 2). REQUEST_CHANGES is used only when
Critical/Major findings warrant it, never as a default. Never merge,
close, or push.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shiggydoodah/skills --plugin skills24 skills in this plugin
/askRead-only discussion and consultation mode — answer questions, explain code, weigh trade-offs, and recommend improvements without implementing anything. Use when the user invokes /ask, asks "what does this do?", presents an idea for discussion, requests a recommendation or suggestion, critiques a feature ("I don't like X, can we improve it?"), or wants to think something through without entering plan mode or having the agent change code./auditReviews a specific area of the codebase for security, performance & scalability, code quality, or test coverage. Invoke with a path, e.g. /audit apps/backend/auth./brainstormShapes a raw, in-your-head idea into a scoped, non-technical concept brief (IDEA.md) through a collaborative one-question-at-a-time interview — the pre-planning step that comes before there is any plan to refine. Use when the user has an unformed idea to flesh out or scope, says "brainstorm", "help me scope/shape this idea", or "I have an idea", or wants a feature/product concept captured before planning. For stress-testing a plan or document that already exists, use grill-me instead.