Code Review
Parse invocation for:
- Effort:
low, medium default, high, max.
--fix: apply accepted findings.
--comment: post inline PR comments when possible.
- Target: PR number, branch, or file path; otherwise review the working
diff.
Review for correctness first, then reuse/simplification/efficiency/
altitude. Prefer precise actionable findings at low/medium; prefer
recall at high/max.
Scope
Gather the diff with git diff @{upstream}...HEAD, falling back to
main...HEAD, HEAD~1, and git diff HEAD when needed. If the user
named a target, review that instead.
Finder angles
Correctness:
- Line scan: read changed hunks plus enclosing functions; look for
wrong conditions, off-by-one, null/undefined paths, missing
await,
falsy-zero, copy-paste variables, swallowed errors, regex mistakes.
- Removed behavior: for each deleted guard/invariant, find where it
was re-established.
- Cross-file trace: check changed functions' callers and callees for
new preconditions, return shapes, exceptions, ordering, or timing.
- Language pitfalls (
max): scan for language/framework footguns.
- Wrapper/proxy correctness (
max): wrappers must call the wrapped
instance and forward methods callers use.
Cleanup:
- Reuse: use existing helpers instead of reimplementing.
- Simplification: remove redundant state, copy-paste, dead code,
deep nesting, or needless abstraction.
- Efficiency: avoid repeated I/O/computation, unnecessary serial
work, and hot-path blocking.
- Altitude: fix at the right depth; avoid fragile special cases on
top of shared infrastructure.
Verification
Dedup candidates by mechanism. Verify each survivor:
- CONFIRMED: concrete trigger and wrong output/crash.
- PLAUSIBLE: realistic trigger, but runtime/config confirmation
needed.
- REFUTED: contradicted by code, impossible by invariant, or already
handled.
Keep CONFIRMED and PLAUSIBLE. In recall mode, default uncertain but
realistic runtime issues to PLAUSIBLE; do not drop them for being
environment-dependent.
Effort recipes
low
One diff pass, no verifier, up to 4 findings. Skip test/fixture hunks.
Report only hunk-visible runtime bugs and obvious cleanup.
Output one line per finding:
path/to/file.ext:123 — problem and concrete failure. If none, output
(none).
medium
Default precision mode:
- Find up to 6 candidates from line scan, removed behavior, cross-file
trace, reuse, simplification, efficiency, and altitude.
- Verify once using CONFIRMED/PLAUSIBLE/REFUTED.
- Output JSON, up to 8 findings.
high
Recall mode:
- Same finder set and candidate caps as medium.
- Verify once, recall-biased.
- Output JSON, up to 10 findings.
max
Maximum recall:
- Find up to 8 candidates from all correctness and cleanup angles.
- Verify once, recall-biased.
- Sweep once for missed defects.
- Output JSON, up to 15 findings.
JSON format:
[
{
"file": "path/to/file.ext",
"line": 123,
"summary": "one-sentence statement of the bug",
"failure_scenario": "concrete inputs/state -> wrong output/crash"
}
]
Rank by severity. Return [] when no finding survives verification.
--comment
For GitHub PR targets, post each finding as an inline PR comment. Use the
available inline-comment MCP tool when present; otherwise use gh api or
print findings and say commenting was skipped. Include a suggestion block
only when it fully fixes the issue.
--fix
Apply findings directly when the fix is local and behavior-preserving.
Skip false positives, intended behavior changes, and fixes requiring work
well outside the reviewed diff. Report fixed and skipped items.
Source: noahkagan/skills — distributed by TomeVault.
1---2name: code-review-683description: Review the current diff or requested target for correctness bugs plus reuse, simplification, efficiency, and altitude issues. Use when the user invokes $code-review or /code-review, asks for a code review, asks to review a diff or PR, or asks for review findings with optional low, medium, high, max, --fix, or --comment controls. Use when this capability is needed.4---56# Code Review78Parse invocation for:910- Effort: `low`, `medium` default, `high`, `max`.11- `--fix`: apply accepted findings.12- `--comment`: post inline PR comments when possible.13- Target: PR number, branch, or file path; otherwise review the working14 diff.1516Review for correctness first, then reuse/simplification/efficiency/17altitude. Prefer precise actionable findings at `low`/`medium`; prefer18recall at `high`/`max`.1920## Scope2122Gather the diff with `git diff @{upstream}...HEAD`, falling back to23`main...HEAD`, `HEAD~1`, and `git diff HEAD` when needed. If the user24named a target, review that instead.2526## Finder angles2728Correctness:2930- **Line scan:** read changed hunks plus enclosing functions; look for31 wrong conditions, off-by-one, null/undefined paths, missing `await`,32 falsy-zero, copy-paste variables, swallowed errors, regex mistakes.33- **Removed behavior:** for each deleted guard/invariant, find where it34 was re-established.35- **Cross-file trace:** check changed functions' callers and callees for36 new preconditions, return shapes, exceptions, ordering, or timing.37- **Language pitfalls** (`max`): scan for language/framework footguns.38- **Wrapper/proxy correctness** (`max`): wrappers must call the wrapped39 instance and forward methods callers use.4041Cleanup:4243- **Reuse:** use existing helpers instead of reimplementing.44- **Simplification:** remove redundant state, copy-paste, dead code,45 deep nesting, or needless abstraction.46- **Efficiency:** avoid repeated I/O/computation, unnecessary serial47 work, and hot-path blocking.48- **Altitude:** fix at the right depth; avoid fragile special cases on49 top of shared infrastructure.5051## Verification5253Dedup candidates by mechanism. Verify each survivor:5455- **CONFIRMED:** concrete trigger and wrong output/crash.56- **PLAUSIBLE:** realistic trigger, but runtime/config confirmation57 needed.58- **REFUTED:** contradicted by code, impossible by invariant, or already59 handled.6061Keep CONFIRMED and PLAUSIBLE. In recall mode, default uncertain but62realistic runtime issues to PLAUSIBLE; do not drop them for being63environment-dependent.6465## Effort recipes6667### low6869One diff pass, no verifier, up to 4 findings. Skip test/fixture hunks.70Report only hunk-visible runtime bugs and obvious cleanup.7172Output one line per finding:73`path/to/file.ext:123 — problem and concrete failure`. If none, output74`(none)`.7576### medium7778Default precision mode:7980- Find up to 6 candidates from line scan, removed behavior, cross-file81 trace, reuse, simplification, efficiency, and altitude.82- Verify once using CONFIRMED/PLAUSIBLE/REFUTED.83- Output JSON, up to 8 findings.8485### high8687Recall mode:8889- Same finder set and candidate caps as medium.90- Verify once, recall-biased.91- Output JSON, up to 10 findings.9293### max9495Maximum recall:9697- Find up to 8 candidates from all correctness and cleanup angles.98- Verify once, recall-biased.99- Sweep once for missed defects.100- Output JSON, up to 15 findings.101102JSON format:103104```json105[106 {107 "file": "path/to/file.ext",108 "line": 123,109 "summary": "one-sentence statement of the bug",110 "failure_scenario": "concrete inputs/state -> wrong output/crash"111 }112]113```114115Rank by severity. Return `[]` when no finding survives verification.116117## `--comment`118119For GitHub PR targets, post each finding as an inline PR comment. Use the120available inline-comment MCP tool when present; otherwise use `gh api` or121print findings and say commenting was skipped. Include a suggestion block122only when it fully fixes the issue.123124## `--fix`125126Apply findings directly when the fix is local and behavior-preserving.127Skip false positives, intended behavior changes, and fixes requiring work128well outside the reviewed diff. Report fixed and skipped items.129130---131> Source: [noahkagan/skills](https://github.com/noahkagan/skills) — distributed by [TomeVault](https://tomevault.io).132<!-- tomevault:4.0:skill_md:2026-06-16 -->