review
Two-axis review (Standards and Spec) of a diff against a fixed point, run as parallel sub-agents. Use after building, or when the user asks to review a branch, PR, or changes since X.
- License 许可
- MIT
- 最近更新
- 2026-10-21
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- review
- description
- Two-axis review (Standards and Spec) of a diff against a fixed point, run as parallel sub-agents. Use after building, or when the user asks to review a branch, PR, or changes since X.
02 资源文件 6
- 参考文档CODE-REVIEW.md532 B
- 参考文档LEDGER.md2.1 KB
- 脚本new-branch.sh1.3 KB
- 参考文档SMELLS.md2.2 KB
- 参考文档SPEC.md3.1 KB
- 参考文档STANDARDS.md2.1 KB
03 SKILL.md 正文
Review the diff between HEAD and a fixed point on two axes:
- Standards: does the code conform to this repo's documented coding standards?
- Spec: does the code faithfully implement the originating spec?
A change can pass one axis and fail the other, so each runs as one of two parallel sub-agents and reports separately. Only proven defects are findings; unproven concerns are residual risks.
1. Pin the fixed point
Use the fixed point the caller or user gave (a SHA, branch, tag, HEAD~5), else the Base: SHA of the spec under docs/specs/ whose Branch: matches the current branch, else ask. Confirm git rev-parse <fixed-point> resolves and git diff <fixed-point>...HEAD (three-dot) is non-empty, so a bad ref fails here, not in the sub-agents. Note the diff command and git log <fixed-point>..HEAD --oneline. In the same call, print the branch's ledger if it has one (step 6).
2. Identify the spec source
What the caller passed (a spec path, the G1 summary in inline mode, or a bug's boundary decision with its report and confirmed hypothesis), else the docs/specs/<slug>/ whose Branch: or slug matches the current branch (its spec.md and every file under tickets/), else ask. With no spec at all, skip the Spec sub-agent and report "no spec available".
3. Identify the standards sources
Every file that documents how code should be written here, always including CODING_STANDARDS.md and CONTRIBUTING.md when they exist.
4. Spawn both sub-agents in parallel
Issue both calls together, in the foreground. Each prompt names its brief by absolute path and adds only the inputs below; never restate, summarise or trim a brief.
- Standards: "Read
<this skill's dir>/STANDARDS.mdand follow it." Then the diff command, the commit list and the standards files. - Spec: "Read
<this skill's dir>/SPEC.mdand follow it." Then the diff command, the commit list, and the spec: its paths, or the G1 summary or boundary decision text.
Claude Code's bundled /code-review runs only on the user's ask; then read CODE-REVIEW.md and follow it.
5. Aggregate
Present the reports under ## Standards and ## Spec, verbatim or lightly cleaned, then ## Code review if it ran. Gather both axes' residual risks under one ## Residual risks heading, each tagged with its axis. Move any finding without its probe or quoted line there.
End with a one-line summary: findings per axis and the worst issue within each axis (if any), the residual risk count, then the code review's count if it ran. Never pick one winner across axes or rank the code review against them: the separation exists to prevent that reranking.
Number every finding: S<n> Standards, P<n> Spec, C<n> code review, continuing any ids already in the ledger. Residual risks get no id.
6. Ledger
A branch keel created has a ledger, "$(git rev-parse --git-common-dir)/keel/<branch>"; a branch with none is not keel's, so create none. Append lines, never rewrite them, in exactly these forms, which the merge guard parses:
-
Review:
review <short sha>: <summary line>, thenfinding <id>: <title>per id, all in one append (printf '%s\n' 'review ...' 'finding S1: ...' >> "$ledger"). -
Fix step: one disposition per id, all in one append, in the same Bash call as the fix commit (after it, so a red suite writes nothing; with nothing to commit, after the suite alone):
<id> fixed: <commit or what changed>,<id> refuted: <evidence>, or<id> escalated: <the question put to the user>. The latest line for an id wins; only fixed or refuted closes it. -
Waived:
waived: "<the user's words>", only when the user explicitly tells you to skip review. -
fixed: the reviewer's suggested fix as written, or the line says why not; the regression test gains the finding's failing input. On the changed path, a finding that the code breaks the boundary decision or the spec, or accepts what the input's own rule rejects, is fixed, and a Spec (c) finding is fixed or escalated even when the spec or G1 pinned that behaviour.
-
escalated: a decision the spec doesn't settle. Ask the user, recommending the fix; deferral is the option that carries the cost, so a reply taking the recommendation fixes it. Write the answer as its fixed or refuted line.
-
refuted: read LEDGER.md first for what counts as evidence.
Done when both axes have reported (or the Spec axis is skipped), the summary line names a count and a worst issue per axis, and a branch with a ledger holds the review line and every finding line.
04 同仓库更多 Skills
tickets
Split an approved spec into tracer-bullet vertical-slice tickets with blocking edges. Use right after a spec is approved, or when the user asks to break work into tickets.
tdd
Test-driven development, one red-green slice at a time at pre-agreed seams. Use when building a feature or fixing a bug test-first, or when writing tests.
spec
Turn the aligned conversation into a spec file under docs/specs/. Use after grilling reaches alignment (G1) on a multi-slice feature, or when the user asks for a spec/PRD.
retro
Retrospective that improves the agent's environment (checks, standards, navigation), not the code. Use when a build finishes, a session went sideways, or the user asks for a retro.
prototype
Throwaway prototype that answers one design question: does this logic or state model hold up, or what should this UI look like. Use when a grilling question can't be settled on paper.
pr
The shape of a PR body: smallest visual, before/after evidence, merge danger. Use whenever writing or editing a pull request description.