nx/skills/code-review/SKILL.md
Use when code changes are ready for quality, security, or best practices review, before committing or creating a pull request
npx skillsauth add hellblazer/nexus code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Delegates to the code-review-expert agent.
Default: haiku. Escalate via model parameter on the Agent tool:
| Task Shape | Model | When | |-----------|-------|------| | Small diff, routine review | haiku (default) | <200 LOC, no security concerns | | Security-sensitive, >500 LOC, or architectural | sonnet | Auth code, crypto, API boundaries |
digraph review_flow {
"Code changes ready?" [shape=diamond];
"Run tests first" [shape=box];
"Invoke code-review-expert" [shape=box];
"Critical findings?" [shape=diamond];
"Fix and re-review" [shape=box];
"Invoke test-validator" [shape=doublecircle];
"Code changes ready?" -> "Run tests first" [label="yes"];
"Run tests first" -> "Invoke code-review-expert";
"Invoke code-review-expert" -> "Critical findings?";
"Critical findings?" -> "Fix and re-review" [label="yes"];
"Critical findings?" -> "Invoke test-validator" [label="no"];
"Fix and re-review" -> "Invoke code-review-expert";
}
If the review references an RDR or bead, seed link-context so any patterns the agent stores to T3 auto-link. See /nx:catalog for details. Skip if the review is purely ad-hoc.
Use the Agent tool to invoke code-review-expert:
## Relay: code-review-expert
**Task**: [what needs to be done]
**Bead**: [ID] or 'none'
### Input Artifacts
- Files: [relevant files]
### Deliverable
Structured code review with severity-rated findings
### Quality Criteria
- [ ] All changed files analyzed
- [ ] Security vulnerabilities flagged
- [ ] Specific remediation guidance provided
For full relay structure and optional fields, see RELAY_TEMPLATE.md.
The code-review-expert agent uses hypothesis-driven review:
REQUIRED BACKGROUND: Use /nx:receiving-review when acting on review output.
/beads:create "..." -t bug) for critical findings that require follow-up workSession Scratch (T1): Agent uses scratch tool for ephemeral working notes during the session. Flagged items auto-promote to T2 at session end.
On successful review completion, write a T1 scratch marker so the PreToolUse verification hook can confirm review happened this session:
nx scratch put "review-completed bead={bead-id} at={ISO-timestamp}" --tags "review,{bead-id}"
Replace {bead-id} with the bead ID from the relay (e.g., nexus-4yit). Replace {ISO-timestamp} with the current UTC time in ISO 8601 format (e.g., 2026-04-01T16:00:00Z).
No bead context: If invoked without a bead ID (ad-hoc review), write the marker with bead=none:
nx scratch put "review-completed bead=none at={ISO-timestamp}" --tags "review"
The --tags flag format is a comma-separated string: --tags "review,{bead-id}" (not --tags review --tags {bead-id}).
development
Use when critiquing / auditing / reviewing a change set against decision history — tries the review plan library first (catalog lookup → decision-evolution traversal → extract → compare), falls through to /nx:query if nothing matches
documentation
Use when doing design / architecture / planning work that walks from prose (RDRs, docs, knowledge) into the modules implementing a concept
development
Use when surveying the plan library's runtime metrics to propose plans for promotion to a higher scope — advisory-only; dispatches the plan-promote-propose meta-seed (no lifecycle ops — those ship in RDR-079)
business
Use when inspecting plan runtime metrics or enumerating dimension-registry usage — dispatches plan_match with dimensions={verb:plan-inspect}; strategy:default reports per-plan metrics, strategy:dimensions reports registry usage counts