53 lines
1.9 KiB
Markdown
53 lines
1.9 KiB
Markdown
---
|
|
name: code-review
|
|
description: Review uncommitted changes with a read-only reviewer subagent, fix findings, and repeat with a new reviewer until approval.
|
|
---
|
|
|
|
# Code Review
|
|
|
|
Run a review loop over uncommitted changes. One round = review, fix,
|
|
verify. Repeat with a new reviewer until the verdict is approve.
|
|
|
|
## Reviewer brief
|
|
|
|
Spawn a read-only child agent with this objective: review the
|
|
uncommitted diff (`git diff HEAD --stat`, then `git diff HEAD`) for
|
|
type safety, KISS, code quality, and clarity, against the rules in
|
|
`AGENTS.md`. No edits, no long builds; `git diff` plus file reads are
|
|
enough.
|
|
|
|
Also check:
|
|
|
|
- Test redundancy: list each new test with its behavior and layer
|
|
(unit, integration, e2e). Search for existing tests of the same
|
|
behavior. Each duplicate test or markup-string assertion is a defect.
|
|
- Parallel surfaces: does the change add a second way to do an action
|
|
that already exists?
|
|
- Net size: report the lines added in each file. Can a deletion give
|
|
the same result?
|
|
|
|
The report must contain:
|
|
|
|
- Each criterion rated 1-10 with a one-line reason.
|
|
- Concrete issues with `file:line` references, or an explicit statement
|
|
that none were found.
|
|
- One verdict: approve, approve with nits, or request changes.
|
|
- Compact form. Short sentences.
|
|
|
|
## Fix round
|
|
|
|
- Fix the code for every reasonable finding. Add a test only for a new
|
|
behavior that no existing test covers. Prefer deletion to addition.
|
|
- Leave other workstreams' files alone. Decline taste-only churn with a
|
|
stated reason.
|
|
- Re-run the focused suites for the touched areas. All green before the
|
|
next round.
|
|
|
|
## Loop rule
|
|
|
|
- Each round uses a new reviewer. Carry prior findings as verified items
|
|
plus a request for a fresh general pass.
|
|
- Stop when a round returns approve with no defects. Approve-with-nits
|
|
needs one more round only when a nit flags a real edge case or a
|
|
wrong message. Otherwise record the declined nits and stop.
|