Reviews PRs, addresses feedback, and comments. Supports automated fix/merge and deliberate triage modes with rebase and worktree isolation.
Ships in caliper. 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.
Dispatch PR review, address feedback, and comment on the PR.
Prerequisite: A PR created by /pr-create.
Review principle: Verify each suggestion against the codebase before implementing. Push back on incorrect ones with technical reasoning — no performative agreement.
Identify the PR from argument, current branch (gh pr view), or gh pr list --author @me --state open. If multiple candidates, ask the user. Store PR number, branch, URL.
Detect: BASE_BRANCH from gh pr view --json baseRefName, DEFAULT_BRANCH from refs/remotes/origin/HEAD (fallback for BASE_BRANCH), WORKTREE_PATH from git worktree list matching branch.
If not on PR branch: use existing worktree if found (cd into it), otherwise gh pr checkout.
If --automated-fix/-A passed, use automated-fix mode. If --automated-merge/-M passed, use automated-merge mode. If --deliberate/-D passed, use deliberate mode (skip the settings lookup and prompt below). More than one mode flag together is invalid — fail fast. Either automated flag + --skip-fixes is also invalid — fail fast.
If no mode flag, read the user's preference:
mode=$(caliper-settings get review_mode)
automated-fix, automated-merge, or deliberate): the user explicitly configured this. Use it.PROMPT_REQUIRED: no explicit preference — use AskUserQuestion to ask:
git fetch origin
git merge-base --is-ancestor origin/<BASE_BRANCH> HEAD
If behind (non-zero exit): git rebase origin/<BASE_BRANCH>, then git push -u origin HEAD --force-with-lease. <BASE_BRANCH> is written in as a literal — the worktree-isolation guard refuses a $VAR git argument not assigned in the same call (See: skills/design/worktree-isolation.md).
Use bare git fetch origin (no branch arg) so the remote-tracking ref refs/remotes/origin/<BASE_BRANCH> actually advances. git fetch origin <BASE_BRANCH> only updates FETCH_HEAD, leaving origin/<BASE_BRANCH> stale — which silently widens the reviewer's diff scope when other PRs merge during the session.
If rebased, log it. If conflicts, stop and ask user. After force-push, only process comments posted after the push timestamp.
Skip if --skip-review passed or caliper-settings get skip_review returns true.
Read PR reviewer model: caliper-settings get pr_reviewer_model — substitute into reviewer-prompt.md's model: field.
Read reviewer-prompt.md and dispatch with run_in_background: true:
{DIFF_RANGE} = origin/$BASE_BRANCH...HEAD (three-dot — merge-base diff, matches GitHub's PR view; two-dot includes phantom-reverts of base commits when the branch is behind){REPO_PATH} = repository root{PR_NUMBER} = PR number{HEAD_SHA} = git rev-parse HEAD — anchors the review to the exact commit the subagent saw, so line numbers stay valid even if anything pushes during the background windowSubagent posts findings as inline review comments via the GitHub reviews API, then returns the Findings table (with each finding's Comment ID) for Step 6.
Every inline thread — a subagent finding or an external bot's inline comment — gets a reply in its own thread once its disposition is decided, so the reasoning (e.g. why a fix took a different shape, or which way two conflicting suggestions went) lives where the issue was raised, not only in the Step 9 summary. Same reply endpoint for both; only the id source differs:
Comment ID from the returned table (— = body-only, no thread → Step 9)..id from the Step 5 source-2 REST collection (already fetched and self-filtered).gh api "repos/{owner}/{repo}/pulls/$PR_NUMBER/comments/$COMMENT_ID/replies" \
-f body="Fixed in <short-sha> — <what changed>."
# or: -f body="Dismissed — <technical reasoning>."
Read <short-sha> from git rev-parse --short HEAD in its own call — a quoted $(git …) gets the reply refused under worktree isolation.
Post replies after the fix commits are pushed — a reply citing a local-only SHA is unresolvable and unverifiable. So post all inline replies (external + subagent) at the step that pushes: Step 6 in automated mode (or Step 5 if --skip-review, where Step 5 is itself the push), Step 8 in deliberate mode. Replying to subagent threads (your own $GH_USER comments) is intended, separate from the Step 5 self-filter that only prevents re-ingesting findings. Conversation comments (source 1) and review bodies (source 3) have no thread → Step 9. The skill does not resolve threads (a separate GraphQL resolveReviewThread call); the author resolves them after confirming the fixes.
Verify no root thread is left unanswered (after every reply is posted):
gh api repos/{owner}/{repo}/pulls/$PR_NUMBER/comments --paginate --jq '.[]' \
| jq -s '[.[] | select(.in_reply_to_id == null)] as $roots
| [.[] | select(.in_reply_to_id != null) | .in_reply_to_id] as $replied
| $roots[] | select(.id as $i | ($replied | index($i)) | not)
| "\(.user.login)\t\(.id)\t\(.path)"'
Empty output = every root thread has a reply. Flatten pages with --paginate --jq '.[]', then aggregate the whole set with jq -s; the cross-reference run inside --paginate --jq evaluates per page and misses a reply that lands on a later page.
Wait for CI and bots with the shared poller — hand-rolled loops are refused under worktree isolation and hang on states they miss (a conflicting PR never starts its checks):
caliper-wait-pr $PR_NUMBER --timeout-min <review_wait_minutes> --min-wait-s 30
Minutes from caliper-settings get review_wait_minutes (default 5). Run it with run_in_background: true: it's minutes of idle polling that would pin a foreground call (capped at 10 min), and the harness re-invokes you when it exits — don't poll its output. Its last line opens with the state named in the table. If the Step 4 subagent finishes first, hold its result for Step 6 and keep waiting. --min-wait-s 30 lets checks register after a fresh push; drop it for an untouched head. Only checks are awaited: --require-check <name> covers a bot check that registers late; when a bot with no check (e.g. gemini-code-assist) is active on the PR, set --min-wait-s to the whole window.
| Exit | Then |
|---|---|
0 GREEN · 4 NO_CHECKS (mergeable) | Collect below |
1 FAILED | Failed checks are Actionable findings (gh run view <run-id> --log-failed); collect below |
2 CONFLICT | Step 3's rebase path, then rerun the wait |
3 TIMEOUT | Collect what arrived; name the pending checks in Step 9 |
5 MERGED · 6 CLOSED | Stop and report |
Collect from all three sources, dropping self-authored entries. The Step 4 reviewer subagent runs under the same gh identity as the parent and posts to sources 2-3, so re-ingesting its own findings would double-count against the Findings table returned in Step 6. Capture the identity once, then filter:
GH_USER=$(gh api user -q .login)
gh pr view --json commentsgh api repos/{owner}/{repo}/pulls/$PR_NUMBER/commentsgh pr view --json reviewsThe author field shape differs by API — gh pr view --json reshapes to .author.login (sources 1 and 3), while the raw REST endpoint uses .user.login (source 2). Filter with a fallback so one expression works on all three:
jq --arg me "$GH_USER" '[.[] | select((.user.login // .author.login) != $me)]'
After filtering, sources 2-3 are bot-only.
Categorize:
| Category | Action |
|---|---|
| Actionable — bug, security, correctness | Fix |
| Suggestion — style, refactor | Fix if improves code, dismiss with reason if not |
| Informational — praise, explanation | Acknowledge |
| False positive | Dismiss with reasoning |
Automated (fix or merge): Fix actionable items, run tests. If --skip-review (no wave 2): commit and push, then reply in each external inline thread with its disposition and run the verification check (see Replying to findings) — Step 6 is skipped in this mode, so this is the only place it runs. Otherwise: commit locally only (wave 2 may touch same files) — the external inline replies are posted in Step 6 after that push.
Deliberate: Collect and report. No fixes yet.
Wait for background subagent (Step 4). Skip if --skip-review.
Automated (fix or merge): Dismiss findings already fixed in wave 1. Fix remaining actionable items, run tests, commit and push (covers both waves). After the push, reply inline to each subagent finding's thread and each external inline thread (Step 5 source 2) with its disposition, then run the verification check (see Replying to findings).
Deliberate: Merge with Step 5 findings into unified set. Proceed to Step 7.
Show summary table (source, category, action, counts). AskUserQuestion:
Skip if --skip-fixes. Fix each item, run tests (fail = stop), commit and push. After the push, reply inline to each subagent finding's thread and each external inline thread with its disposition, then run the verification check (see Replying to findings).
Post gh pr comment: what was fixed, dismissed (with reasons), no-action. Omit empty sections. Anything answered in its own inline thread (subagent findings, and external inline comments from Step 5/6/8) needs only a roll-up count here plus a restatement of the dismissals — the per-item reasoning lives in the threads, but dismissals are what a human is most likely to re-litigate, so name them. The summary still fully covers conversation-level comments (source 1), review bodies (source 3), and any body-only findings that had no thread.
Automated-fix mode: reach the bar. Ready to merge means every bot comment is addressed and CI is green. Automated-fix ends there, or reports that it's stuck; it doesn't stop at "one round done". If this run pushed, rerun the Step 5 wait first. Then run caliper-pr-at-bar $PR_NUMBER (add --allow-no-checks only when the repo's CLAUDE.md says it has no CI).
checks failed: the failed checks are Actionable findings (gh run view <run-id> --log-failed). Fix, test, push.checks pending: a check or bot is still running, so rerun the wait. Rerunning the wait alone doesn't use up a round.threads: collect the new external comments (Step 5's sources), fix or dismiss each, push any fixes, and reply in every thread.up_to_date, or mergeable CONFLICTING: take Step 3's rebase path, and re-run the repo's post-rebase steps, such as a version bump.checks with total 0: if the JSON has a hint, push the empty commit it suggests, once. Otherwise the repo has no CI it declared, so stop and report.state not OPEN: stop and report.If the PR is still not at the bar after 2 extra rounds, stop and report stuck with the failing criteria and the JSON. If the extra rounds fixed anything, post one follow-up comment summarizing those fixes. Always name any waived checks: broken_names (they also fail on the base branch) and cancelled_bot_names (cancelled checks from apps outside Actions). Nothing vouched for those.
Report PR URL and item counts. Automated-merge mode: invoke pr-merge. Automated-fix mode: report "at bar" (with any waived checks) or "stuck" (with the reason), and tell the user to run /pr-merge when ready. Deliberate mode: offer merge or tell user to run /pr-merge when ready.
| Arg | Effect |
|---|---|
<PR number> | Target specific PR |
| (none) | Detect from current branch |
--skip-review / -R | Skip subagent review (Steps 4, 6) |
--skip-fixes / -S | Skip fixing — just comment (invalid with automated modes) |
--automated-fix / -A | Fix all actionable, no interaction |
--automated-merge / -M | Fix all actionable, then auto-merge |
--deliberate / -D | Force deliberate mode — skip settings lookup and prompt |
| Mistake | Why |
|---|---|
| Blindly implementing suggestions | Verify against codebase, push back on incorrect ones |
| Skipping PR comment | Always post what was addressed |
| Pushing between wave 1 and 2 | Wave 1 commits locally, wave 2 pushes |
| Polling for a bot comment naming HEAD | Bots may post nothing for a no-op push (e.g. rebase-only), so the wait never ends. Wait on check completion (caliper-wait-pr) instead |
Preceded by: pr-create | Followed by: pr-merge
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/caliper:pr-reviewfrom caliper
npx claudepluginhub nikhilsitaram/claude-caliper --plugin caliper19 skills in this plugin
/caliper-settingsUse when the user wants to view, change, or reset their persistent preferences, or when triggered by "/caliper-settings", "my settings", "change defaults"./codebase-reviewUse when asked to audit a codebase, find DRY/YAGNI/complexity issues repo-wide, or perform periodic code quality review/conversateUse when the user invokes /conversate, or asks to talk a change through with you — your recommendations, their decisions, open questions — before anything gets built./coordinateUse when the user wants a queue of issues worked in parallel handoff panes, one PR each, with you as coordinator — "/coordinate", "run these issues in parallel panes", "coordinate issues X, Y and Z", "be the coordinator", "start a release train"./designUse when creating features, building components, adding functionality, or modifying behavior - before any creative or implementation work begins/design-reviewUse when a design doc has been written and before draft-plan is dispatchedOther plugins' skills for the same job