/chidi-optimal-brain:two-axis-reviewfrom chidi-optimal-brain
Review a set of code changes against two separate axes, Standards (does it follow this repo's documented rules?) and Spec (does it do what the issue/PRD asked?), plus correctness, security, and test checks. Produces severity-ranked findings in conventional-comments style and a PASS/FAIL verdict usable as an agent-loop verification gate. Use when the user wants to review a branch, PR, diff, or work-in-progress, asks "review since X", "is this ready to merge", "check my changes against the issue", or when /implement, agent-loop, or /until-done needs a review gate before stopping.
Ships in chidi-optimal-brain. 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.
Read when SKILL.md points to them.
Inspired by Matt Pocock's draft review skill in mattpocock/skills.
Two axes, kept apart. Every finding labelled, ranked, and evidenced. One verdict.
A change can follow every rule and build the wrong thing, or build exactly the right thing and break the rules. Reviewing both in one pass lets one axis hide the other, so this skill runs them separately and never reranks across them.
HEAD~N. If the user gave none, use the merge-base with the default branch and say so. In a loop, the base is the commit the loop started from..agent/context/issue-tracker.md first (fallback: docs/agents/issue-tracker.md).interactive (default, human reading) or gate (called from /implement, agent-loop, /until-done; verdict drives the loop).Copy this checklist and tick it as you go:
- [ ] 1 Pin the diff
- [ ] 2 Find spec + standards
- [ ] 3 Run the axes (parallel if possible)
- [ ] 4 Run the cross-cutting checks
- [ ] 5 Rank, verdict, report
- [ ] 6 (optional) Log to vault
git rev-parse <base> must resolve, and git diff <base>...HEAD (three-dot: against the merge-base) must be non-empty. Include uncommitted work with git diff <base> when the user is reviewing WIP. Fail here, not inside subagents.git log <base>..HEAD --oneline and git diff --stat.Spec, first match wins: issue refs in commit messages or branch name (#123, Closes #45) → path the user passed → PRD/spec under docs/, specs/, .scratch/, .agent/context/ matching the feature → ask. If there is genuinely none, the Spec axis reports no spec and the verdict cannot be PASS on spec grounds alone; say so.
Standards: anything that documents how code here should be written: CODING_STANDARDS.md, CONTRIBUTING.md, CLAUDE.md/AGENTS.md rules, CONTEXT.md vocabulary, ADRs in docs/adr/, lint/format config (only to know what tooling already enforces, so you can skip it).
If your harness has subagents, send both in one message so they run in parallel with clean contexts. Otherwise run them sequentially and clear your head between them: finish and write down Standards before reading the spec.
Standards brief:
Diff:
<command>. Commits:<list>. Standards sources:<files>. Report every place the diff breaks a documented rule. Cite the rule (file + quote). Mark each asrule(written down) orjudgement(consistency with surrounding code, not written). Skip anything a linter/formatter enforces. Use the comment format in FINDINGS-FORMAT.md. Under 400 words.
Spec brief:
Diff:
<command>. Spec:<contents or path>. Build a requirement checklist from the spec first, then check the diff against it. Report (a) requirements missing or partial, (b) requirements implemented incorrectly, (c) behaviour nobody asked for (scope creep). Quote the spec line for each. Use the comment format in FINDINGS-FORMAT.md. Under 400 words.
Do these yourself (or as a third parallel subagent on big diffs), using CHECKS.md: correctness, security, tests, design and complexity. These are not a third axis to merge into the others; report them under their own heading.
If verifiers are configured (.agent/context/loops.md, fallback docs/agents/loops.md), run the fast verifier once and record the result. A red verifier is an automatic blocker.
Label and rank every finding using FINDINGS-FORMAT.md. Severity order: blocker > major > minor > nit. Every finding needs a location (file:line in the post-change file) and evidence (a quote of the rule, the spec line, or the code). No evidence, no finding: downgrade it to a question.
Verify every location before citing it. Open the post-change file and confirm the quoted code is on that line (grep -n '<snippet>' <file>, or read the file at that line). Use the working tree or git show HEAD:<file>. If you only have a .diff, apply it to a temp copy first (git apply or patch -p1) and look up the line there. Never cite a line's position inside the diff text. If you can't verify a line, cite the hunk (file @@ +start,len) and write line unverified. Don't guess.
Verdict:
blocker, or any major on Spec or Security.major (Standards/Design), minor, or nit.nit.Every finding must use this exact layout. No bullet or prose findings. Copy it as is:
<label> (<severity>[, <axis-tag>]): <subject> — `path/to/file.ts:42`
<evidence: quoted rule, spec line, or code>
<why it matters, one or two sentences>
<suggested fix>
<label> is issue, suggestion, question, nitpick, or praise (see FINDINGS-FORMAT.md). <severity> is blocker, major, minor, or nit. Leave one blank line between findings.
Report skeleton (fixed, so loops can parse it):
## Verdict: FAIL | PASS WITH NOTES | PASS
Base: <ref> (<sha>) · <N> files, +A/-D · Spec: <source or "none">
## Standards
<findings in the template above, worst first, or "None.">
## Spec
Requirements: <met>/<total>
<findings in the template above, worst first, or "None.">
## Checks (correctness · security · tests · design)
<findings in the template above, worst first, or "None.">
## Praise
<at least one sincere, specific thing done well; omit if there honestly is none>
## Summary
Standards: <n> (worst: …) · Spec: <n> (worst: …) · Checks: <n> (worst: …)
Next: <the one change that would flip the verdict, if FAIL>
Keep the axes separate in the summary: worst finding per axis, never a single overall winner.
Before you output the report, check every finding:
file:line was verified in step 5, or it is marked line unverified.question (minor), or drop it.When called from /implement, agent-loop, or /until-done:
FAIL like a failing verifier: feed the blocker/major findings into the next Act step as the fix list. Do not fix minor/nit inside the loop unless trivial; list them in the stop brief.agent-loop's STOP-RULES still apply. The same blocker surviving 2 fix attempts counts as no progress: stop and brief the human.If .agent/context/knowledge-vault.md exists (fallback docs/agents/knowledge-vault.md) and the review surfaced a decision (a tradeoff accepted, a rule clarified, a spec ambiguity resolved), write a short decision trace to vault Decision Traces/ using the template from /setup-knowledge-vault, linking the branch/PR and the finding. Routine nits never go to the vault.
nit (non-blocking) at most.See examples/ for a worked spec, diff, and the expected report. Research behind the design: REFERENCES.md.
Vault: when this finishes, update the vault per the ## Vault write-back block in AGENTS.md/CLAUDE.md, or run /vault-sync.
CHECKS.md (opens in a new tab)FINDINGS-FORMAT.md (opens in a new tab)README.md (opens in a new tab)REFERENCES.md (opens in a new tab)examples/README.md (opens in a new tab)examples/after/src/search.ts (opens in a new tab)examples/after/test/search.test.ts (opens in a new tab)examples/change.diff (opens in a new tab)examples/expected-review.md (opens in a new tab)examples/spec.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (chidiokoene/optimal-brain) — no native marketplace selected
npx claudepluginhub p/chidiokoene-mattpocock-skills36 skills in this plugin
/agent-loopAgentic loop discipline. Use when the user wants to loop until done, iterate until tests pass, keep fixing until green, run until verification passes, or mentions red-green-refactor in an iterative fix context./ask-brainRouter for the whole optimal-brain pack: given a task, picks the single best skill or an ordered chain of skills, says why, and says what to skip. Use when the user is unsure which skill to use, asks what to do next or where to start, or describes a task without naming a skill./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.