Code Review
Code review is merge-risk evaluation, not diff narration. The job is to find
the issues that should change how a maintainer thinks about landing the
change: behavior that may break, security or data boundaries that may be
weakened, validation that no longer supports confidence, or design drift that
will make the next change harder.
Prefer a few grounded findings over many plausible comments. If a concern does
not change merge confidence, author action, or reviewer attention, leave it out.
Stances used: Load hypothesis-evaluating for judging the change against
its implied intent, joint-reading for anchoring claims to code, gap-reading
for missing paths and tests, diagnostic-questioning for unresolved intent,
interpretive-synthesis for the final readiness judgment, and
collaborative-grounding when user or author context would change the review,
and relational-continuity for reviewer-facing language.
Core tension
Risk signal vs. review noise. Review comments are costly: they ask the
author to stop and reason. A useful comment earns that cost by pointing to a
specific risk, explaining the affected behavior, and giving the author a path
to resolve or validate it. A noisy comment restates the diff, expresses taste,
duplicates tooling, or turns weak suspicion into confident prose.
Validation belongs in the review as confidence context, not as a command diary.
Report the evidence that changes trust in the patch and route mechanical command
history to chat closeout, CI, or follow-up discussion.
Workflow
Orient to the change.
- Read the PR title/body, linked task, commit message, or user request when
available.
- Identify the intended behavior: what should be introduced, preserved, or
removed?
- Classify the change shape: small patch, large refactor, docs-only,
generated/vendor, UI, infrastructure/config, security-sensitive, or mixed.
Inspect risk-relevant context.
- Start with the diff, then read surrounding code only where it changes risk:
callers, callees, tests, schemas, config, migrations, feature flags,
generated sources, or prior conventions.
- Skip line-by-line style review of generated/vendor output unless the
source of truth, provenance, or public contract is itself in question.
- For UI changes, inspect states that users experience: loading, empty,
error, disabled, permission-denied, responsive, accessibility, and copy.
- For security-sensitive changes, trace trust boundaries, authorization,
validation, secret handling, injection surfaces, logging, and dependency
risk.
Use validation to calibrate confidence.
- Run targeted checks when they are appropriate, cheap enough, and likely to
change review confidence.
- Prefer narrow checks for the changed behavior over broad suites by default.
- If validation is unavailable or not run, state the residual risk instead
of implying confidence.
Generate candidate findings.
- Look first for correctness regressions, build/deploy breakage, security or
privacy issues, data integrity problems, performance/reliability risks,
missing validation for changed behavior, UX/accessibility regressions, and
maintainability problems that plausibly create near-term defects.
- Treat style, naming, formatting, and broad cleanup as low-priority unless
project rules or real maintainability risk make them material.
Apply the evidence gate before reporting.
- If a candidate fails the gate, downgrade it to a question, move it to
residual risk, or omit it.
Evidence gate
Every reported finding must answer these questions:
- Location: What changed line or nearest relevant location anchors the
concern?
- Evidence: What code path, invariant, test result, spec, or repository
convention supports the claim?
- Affected behavior: What breaks, weakens, slows down, leaks, confuses, or
becomes harder to maintain?
- PR relationship: Why does this change introduce, expose, or worsen the
issue?
- Severity and confidence: How bad is the impact if true, and how well is it
supported?
- Fix direction: What concrete change, validation, or author decision would
resolve the concern?
- Novelty: Is this adding signal beyond the diff, existing tool output, and
other review comments?
Low-confidence concerns are not findings. Ask a targeted question when the
answer would change review judgment; otherwise record the uncertainty as
residual risk or stay silent.
Severity and confidence
Use severity for impact and confidence for proof. Keep them separate.
- Critical: security breach, auth bypass, secret exposure, destructive data
loss, build/deploy failure, or severe outage risk. Blocks by default.
- High: likely user-visible regression, broken public contract, serious
reliability issue, unsafe migration/rollback, or significant security/data
risk. Usually blocks.
- Medium: real edge-case bug, meaningful missing validation, moderate
performance risk, or maintainability issue likely to create near-term defects.
Blocks only when confidence and context justify it.
- Low: localized readability, docs, polish, or minor test improvement.
Non-blocking.
- Nit/Info: formatting, wording, preference, praise, or future note. Never
blocks.
Confidence is high when directly supported by code, tests, traces, specs, or
changed invariants; medium when strongly inferred but dependent on an
assumption; low when plausible but unproven. Low-confidence claims belong as
questions or residual risk, not findings.
Output
Lead with findings, ordered by severity. Use concise titles and file/line
references. A finding should usually have this shape:
issue (severity: High, confidence: high, blocking: true): <specific claim>
<evidence from code, tests, or context>
<affected behavior and why this PR introduces or worsens it>
<suggested fix, validation, or decision needed>
Use inline comments only for localized, actionable findings tied to changed
lines. Put broad design concerns, repeated patterns, missing coverage, review
scope, and residual risk in the final summary.
When there are no findings, say so plainly without manufacturing comments:
No blocking findings found.
Reviewed: <scope>
Residual risk: <untested paths, skipped validation, or assumptions>
Review signal
A review observation belongs in the output when it can become one of four
signals.
Finding: The change appears to diverge from its intended behavior or from a
project invariant. Anchor it to the relevant code, explain the evidence and
affected behavior, and give a fix direction.
Residual risk: The patch may be fine, but an important path, assumption, or
validation surface remains unexamined. Keep this in the summary. Include
file/line references there when they help locate the unexamined path or
assumption.
Question: The code cannot answer something that would change review
judgment: product intent, acceptable risk, migration expectations, or author
context. Ask the narrowest question that would resolve the uncertainty.
Readiness synthesis: The local observations add up to a merge-readiness
judgment. Use the final summary for that synthesis, especially when there are no
blocking findings.
If an observation cannot become one of these signals, keep it out of the review.
Tool output, style preferences, repeated examples, and diff narration are useful
only when they support a finding, residual risk, question, or readiness
judgment.
Boundaries
This skill reviews a patch or PR. It does not implement fixes; if the user asks
to address review feedback, use gh-resolve-review-threads when GitHub review
threads are involved. If the user wants to read code together interactively,
use walkthrough instead. If the review uncovers an unknown system behavior
that requires investigation before judgment, switch to recon and return to
review after the unknown is grounded.
1---2name: code-review3description: Use when reviewing git diffs, local changes, or pull requests for merge-relevant risks: correctness regressions, security/privacy, data integrity, performance, reliability, tests, UX, maintainability, and deployability. Produce evidence-backed findings, inline comments when available, and a reviewer-facing summary focused on findings, residual risk, questions, and readiness.4---56# Code Review78Code review is merge-risk evaluation, not diff narration. The job is to find9the issues that should change how a maintainer thinks about landing the10change: behavior that may break, security or data boundaries that may be11weakened, validation that no longer supports confidence, or design drift that12will make the next change harder.1314Prefer a few grounded findings over many plausible comments. If a concern does15not change merge confidence, author action, or reviewer attention, leave it out.1617**Stances used:** Load **hypothesis-evaluating** for judging the change against18its implied intent, **joint-reading** for anchoring claims to code, **gap-reading**19for missing paths and tests, **diagnostic-questioning** for unresolved intent,20**interpretive-synthesis** for the final readiness judgment, and21**collaborative-grounding** when user or author context would change the review,22and **relational-continuity** for reviewer-facing language.2324## Core tension2526**Risk signal vs. review noise.** Review comments are costly: they ask the27author to stop and reason. A useful comment earns that cost by pointing to a28specific risk, explaining the affected behavior, and giving the author a path29to resolve or validate it. A noisy comment restates the diff, expresses taste,30duplicates tooling, or turns weak suspicion into confident prose.3132Validation belongs in the review as confidence context, not as a command diary.33Report the evidence that changes trust in the patch and route mechanical command34history to chat closeout, CI, or follow-up discussion.3536## Workflow37381. Orient to the change.39 - Read the PR title/body, linked task, commit message, or user request when40 available.41 - Identify the intended behavior: what should be introduced, preserved, or42 removed?43 - Classify the change shape: small patch, large refactor, docs-only,44 generated/vendor, UI, infrastructure/config, security-sensitive, or mixed.45462. Inspect risk-relevant context.47 - Start with the diff, then read surrounding code only where it changes risk:48 callers, callees, tests, schemas, config, migrations, feature flags,49 generated sources, or prior conventions.50 - Skip line-by-line style review of generated/vendor output unless the51 source of truth, provenance, or public contract is itself in question.52 - For UI changes, inspect states that users experience: loading, empty,53 error, disabled, permission-denied, responsive, accessibility, and copy.54 - For security-sensitive changes, trace trust boundaries, authorization,55 validation, secret handling, injection surfaces, logging, and dependency56 risk.57583. Use validation to calibrate confidence.59 - Run targeted checks when they are appropriate, cheap enough, and likely to60 change review confidence.61 - Prefer narrow checks for the changed behavior over broad suites by default.62 - If validation is unavailable or not run, state the residual risk instead63 of implying confidence.64654. Generate candidate findings.66 - Look first for correctness regressions, build/deploy breakage, security or67 privacy issues, data integrity problems, performance/reliability risks,68 missing validation for changed behavior, UX/accessibility regressions, and69 maintainability problems that plausibly create near-term defects.70 - Treat style, naming, formatting, and broad cleanup as low-priority unless71 project rules or real maintainability risk make them material.72735. Apply the evidence gate before reporting.74 - If a candidate fails the gate, downgrade it to a question, move it to75 residual risk, or omit it.7677## Evidence gate7879Every reported finding must answer these questions:8081- **Location:** What changed line or nearest relevant location anchors the82 concern?83- **Evidence:** What code path, invariant, test result, spec, or repository84 convention supports the claim?85- **Affected behavior:** What breaks, weakens, slows down, leaks, confuses, or86 becomes harder to maintain?87- **PR relationship:** Why does this change introduce, expose, or worsen the88 issue?89- **Severity and confidence:** How bad is the impact if true, and how well is it90 supported?91- **Fix direction:** What concrete change, validation, or author decision would92 resolve the concern?93- **Novelty:** Is this adding signal beyond the diff, existing tool output, and94 other review comments?9596Low-confidence concerns are not findings. Ask a targeted question when the97answer would change review judgment; otherwise record the uncertainty as98residual risk or stay silent.99100## Severity and confidence101102Use severity for impact and confidence for proof. Keep them separate.103104- **Critical:** security breach, auth bypass, secret exposure, destructive data105 loss, build/deploy failure, or severe outage risk. Blocks by default.106- **High:** likely user-visible regression, broken public contract, serious107 reliability issue, unsafe migration/rollback, or significant security/data108 risk. Usually blocks.109- **Medium:** real edge-case bug, meaningful missing validation, moderate110 performance risk, or maintainability issue likely to create near-term defects.111 Blocks only when confidence and context justify it.112- **Low:** localized readability, docs, polish, or minor test improvement.113 Non-blocking.114- **Nit/Info:** formatting, wording, preference, praise, or future note. Never115 blocks.116117Confidence is **high** when directly supported by code, tests, traces, specs, or118changed invariants; **medium** when strongly inferred but dependent on an119assumption; **low** when plausible but unproven. Low-confidence claims belong as120questions or residual risk, not findings.121122## Output123124Lead with findings, ordered by severity. Use concise titles and file/line125references. A finding should usually have this shape:126127```text128issue (severity: High, confidence: high, blocking: true): <specific claim>129130<evidence from code, tests, or context>131132<affected behavior and why this PR introduces or worsens it>133134<suggested fix, validation, or decision needed>135```136137Use inline comments only for localized, actionable findings tied to changed138lines. Put broad design concerns, repeated patterns, missing coverage, review139scope, and residual risk in the final summary.140141When there are no findings, say so plainly without manufacturing comments:142143```text144No blocking findings found.145146Reviewed: <scope>147Residual risk: <untested paths, skipped validation, or assumptions>148```149150## Review signal151152A review observation belongs in the output when it can become one of four153signals.154155**Finding:** The change appears to diverge from its intended behavior or from a156project invariant. Anchor it to the relevant code, explain the evidence and157affected behavior, and give a fix direction.158159**Residual risk:** The patch may be fine, but an important path, assumption, or160validation surface remains unexamined. Keep this in the summary. Include161file/line references there when they help locate the unexamined path or162assumption.163164**Question:** The code cannot answer something that would change review165judgment: product intent, acceptable risk, migration expectations, or author166context. Ask the narrowest question that would resolve the uncertainty.167168**Readiness synthesis:** The local observations add up to a merge-readiness169judgment. Use the final summary for that synthesis, especially when there are no170blocking findings.171172If an observation cannot become one of these signals, keep it out of the review.173Tool output, style preferences, repeated examples, and diff narration are useful174only when they support a finding, residual risk, question, or readiness175judgment.176177## Boundaries178179This skill reviews a patch or PR. It does not implement fixes; if the user asks180to address review feedback, use `gh-resolve-review-threads` when GitHub review181threads are involved. If the user wants to read code together interactively,182use `walkthrough` instead. If the review uncovers an unknown system behavior183that requires investigation before judgment, switch to `recon` and return to184review after the unknown is grounded.