/nexus-agents:reviewing-codefrom nexus-agents
Reviews code changes against project standards, security guidelines, and quality metrics including lint, type safety, test coverage, and security issues. Use for PR review, pre-merge pass, or auditing code.
Ships in nexus-agents. 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 skill is the post-hoc review gate — evaluating someone else's diff after it lands as a PR. The complementary pre-emit gate is self-critique, which the author runs on their own work before submitting:
| Skill | Reviews | When |
|---|---|---|
self-critique | Your own output | Before you emit anything |
reviewing-code (this) | Others' code (PRs, commits) | After someone else writes code |
Both use the same five-axis framework below. Both can apply to the same artifact at different lifecycle points — author self-critiques before PR; reviewer applies this skill on the resulting diff.
Evaluate every change across these dimensions. The order matters — correctness gates merge; the rest are quality.
CLAUDE.md "Canonical Paths") or introduce a new one? Module boundaries respected? No circular deps? Abstraction level appropriate?.rules/untrusted-input.md)? Secrets out of code/logs? Auth/authz where needed? Parameterized queries? See security-checklist.performance-optimization skill.Full documentation:
| Criterion | Limit |
|---|---|
| File | ≤ 400 lines |
| Function | ≤ 50 lines |
| Nesting | ≤ 4 levels |
any typesResult<T, E> for fallible opsSee SECURITY.md for full threat model.
# 1. Run quality gates
pnpm lint && pnpm typecheck && pnpm test
# 2. Check coverage
pnpm test:coverage
For any non-trivial PR, run one blind review by a fresh subagent after the local gates are green and before you merge — including when merging your own change. "Blind" = the reviewer gets the diff and the repo, not your reasoning for writing it; that's what catches the bugs your own mental model is blind to. In a 22-PR autonomous session this caught a real, merge-blocking bug on 6 of 22 PRs (27%) that green gates plus author self-review had missed (#3074).
Trigger: pnpm lint && pnpm typecheck && pnpm test green → before gh pr merge.
Mechanism:
code-reviewer (or Explore) subagent scoped to the diff
(git diff --stat <base> for the file list, then the changed files in full).
Give it the intended contract, not your implementation rationale.file:line and the observable
failure. Bound its output (≤ ~400 words) so it triages rather than dumps.Bug-shape classes to prime the reviewer on — shapes, not a frozen list; the specific instance varies by stack. Prime with the class, let the reviewer find the instance (a checklist of last session's bugs overfits and misses the next):
This pass is the same rubric as the rest of this skill, run by fresh eyes at the merge boundary — not a second taxonomy. Every finding it returns still passes the Verification Gate before it blocks anything.
A 2026-04-25 audit (#2225) found a 100% false-positive rate in second-pass code-review findings. Each false positive cost ~5min of triage. The fix is a stricter pre-file gate.
Before flagging any finding, run this checklist:
.slice(0, 20) cap on the line above.isValidCommand, Zod schema)
already filter the input?await between read and write —
JS is single-threaded; sync code is atomic at microtask levelNaN comparisons fail closed silently (no observable bad state)as Record<string, unknown> is safe IF every access has typeof
guards — read the whole function before flagging the castIf any check raises "wait, actually..." → drop the finding. Don't file, don't include in the report. False positives compound: pollute the backlog, train future agents on noise, erode trust in tooling.
| Excuse | Counter |
|---|---|
| "It's a small change, no need for thorough review" | Small changes hide subtle bugs: off-by-one, missed null check, type narrowing slipped. Apply the 4-point gate to every finding regardless of diff size. |
| "Tests pass, so it's correct" | Tests verify what was tested. Edge cases the tests don't cover are still bugs. Use the five-axis framework — correctness ≠ "tests green." |
| "I trust the author" | Trust is for the human relationship; the review is for the code. Apply the same gate to senior contributors as to first-timers. |
| "The CI gates would catch any real issue" | CI catches a known set of failure modes. Reviews catch the ones CI doesn't model — architecture drift, unclear naming, subtle security gaps, unintended public-API changes. |
| "I'd refactor this differently, but it works" | If the existing pattern is canonical (per CLAUDE.md), don't fight it. If your way is genuinely better, file a follow-up — don't gate the merge. |
| "I'll flag it; the author can decide" | Every flagged finding costs review-cycle time. Apply the 4-point gate first; only flag what passed all four. |
Every finding gets one of three tags. The bar matters — over-flagging dilutes the signal.
If you tag everything Critical, nothing is Critical. Three or more Critical findings on a non-emergency PR usually means the PR is too big — split it.
## Code Review: [File/PR]
### Critical (Must Fix)
- [ ] Issue at `file:line`
### Important (Should Fix)
- [ ] Issue
### Recommendation
[ ] APPROVE / [ ] REQUEST_CHANGES
See CODING_STANDARDS.md for common issues and patterns.
file:line citationsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-review, pr-review, security-review, quality-check, pre-merge-review
34 skills in this plugin
/api-and-interface-designDesign stable, hard-to-misuse interfaces — REST endpoints, MCP tool
schemas, module boundaries, type contracts. Apply when defining new
surfaces or evolving public ones. Triggers on "API design", "interface",
"schema", "contract", "module boundary", "type design".
/browser-testing-with-devtoolsTest UI in real browsers via Chrome DevTools MCP. Apply when debugging
rendering issues, console errors, network behavior, performance, or
accessibility — anywhere static code analysis can't see runtime state.
Triggers on "browser test", "DOM inspect", "console errors",
"network trace", "core web vitals in browser", "ui bug repro".
/bug-fixFix a bug following project standards.
Use when fixing defects, debugging issues, or resolving reported problems.
Triggers on "fix bug", "debug", "fix issue", "resolve bug".
/code-simplificationReduce nesting, extract names, eliminate redundancy without changing
behavior. Apply after features work and tests pass — never as a
drive-by during feature work. Triggers on "simplify", "refactor for clarity",
"this is hard to read", "code review flagged complexity".
/codex-delegatorDelegate code generation tasks to Codex CLI for optimal performance.
Use when implementing features, generating tests, refactoring code, or
making bulk code changes. Triggers on "delegate to codex", "route to codex",
"use codex", "code generation".
/context-engineeringCurate what the agent sees, when, and how it's structured. Apply when
starting a session, when output quality drifts, when fanning out
subagents, or when configuring rules files. Triggers on
"context engineering", "rules file", "agent context",
"subagent fan-out", "context budget".
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined; hooks.PreToolUse.1: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined; hooks.PreToolUse.1: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
Other plugins' skills for the same job