4.6 KiB
4.6 KiB
name, description
| name | description |
|---|---|
| code-review | Inspects git diffs, pull requests, and commit ranges across four independent axes: Spec & Scope, Standards & Smells, Seam & Test Integrity, and Defensive Invariants. Use when reviewing code changes before merge or verifying diff quality. Not for live runtime QA: use verify-slice. |
Code Review
Use when
- Reviewing a branch, pull request, work-in-progress diff, or commit range before merge.
- Evaluating code structure, defensive invariants, and test seam integrity.
- Not for live runtime browser or deployment testing: use
verify-slice. - Not for debugging an unknown symptom: use
diagnose.
Steps
- Pin the fixed point and scope. Resolve the base ref and record exact base and head commit SHAs (
git rev-parse <base> HEAD). Inspect working-tree state (git status --short, unstagedgit diff, stagedgit diff --cached, and relevant untracked files) alongside committed history (git diff <base>...HEADandgit log <base>..HEAD --oneline). Record the covered revisions and working-tree diff state (for example, clean tree or diff fingerprint) so downstream tools can verify whether the reviewed diff remained unchanged, and distinguish findings across committed, staged, and unstaged changes. - Select execution tier. Match the change to the risk tiers from axes (
Lightweight,Standard, orHigh-Assurance). Single-agent sequential pass for Lightweight; independent review passes for Standard; isolated subagents per axis for High-Assurance. - Inspect the four axes. Evaluate the diff against each axis independently using axes:
- Spec & Scope: originating requirements satisfied, aligned with canonical project direction (
ARCHITECTURE.md,ROADMAP.md, ADRs, active milestone) when present, minimal shared-file footprint, zero scope creep. - Standards & Smells: repository rules and Fowler smell diagnostics from smell-heuristics (evaluated as confirmed violations, potential smells, or contextual trade-offs).
- Seam & Test Integrity: tests verify public interface seams, assertions are non-tautological, negative/boundary paths covered, vertical slices prioritized over bulk imagined tests.
- Defensive Invariants: system properties from defensive-invariants (trust boundaries, authority, consistency, failure semantics, resource limits).
- Spec & Scope: originating requirements satisfied, aligned with canonical project direction (
- Record structured findings. Record every finding using the schema in finding-schema (
ID,Axis,Severity,Evidence,Invariant,Impact,Disposition). A strong pass on one axis never compensates for a failure on another. - Aggregate without silent resolution. When multiple reviewers or passes disagree, keep the disagreement visible under
Unresolveduntil evidence settles it. - Emit executable runtime checks. For stateful or high-risk paths that static inspection cannot prove, emit runnable fenced shell commands for
verify-slicefollowing the Step 6 contract in finding-schema (stating purpose,localvs.live-infrascope classification, explicit pass condition, and explicit failure signal). - Present the review summary. Group findings by axis and apply the decision matrix from axes:
Needs Rework(confirmed defects require changes),Blocked(unresolved Critical/High risks or unestablished scope), orReady(all four axes completed, no confirmed or unresolved blocking findings remain, and exact covered revisions plus working-tree state are recorded). Static review establishes static provenance for that diff only; never authorize release.
Your call
- Handling findings: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues.
- Adjudicating unresolved disagreements: resolve conflicting reviewer perspectives or accepted architectural trade-offs.
- Authorizing release: verification and review evidence inform decisions, but the human owner remains the sole release authority.
Done when
- All four axes have been inspected across working-tree and committed changes, every finding is recorded with evidence and disposition, executable Step 6 runtime checks are emitted for
verify-sliceif needed, and the human owner has reviewed the findings.
Hands off to
diagnose: when a finding exposes a root cause that requires deeper troubleshooting.verify-slice: to execute behavioral and runtime verification scenarios.git-manager: when branching, committing review fixes, or rebasing.