PLUGIN brewcode / Skills
On this page
Superreview Setup
opus generator human-invoked/brewcode:superreview-setup does not review code itself. It scans your project and writes a self-contained .claude/skills/superreview/ into it, plus the intent-guard agent. The emitted /superreview compares what was asked with what was delivered at every depth, and adds domain experts and scope discipline at EXTENDED depth.

Illustrative animation: generate a review skill, it wires domain experts and an intent guard, run it on a change, drift verdict and findings in a read-only report.
View README on GitHub (opens in a new tab)
Quick reference
| Field | Value |
|---|---|
| Command | /brewcode:superreview-setup [prompt] [status|install|upgrade|enable|disable|uninstall|purge] [scope] [--unattended] |
| Arguments | Free-text focus, an optional lifecycle verb anywhere in the prompt, an optional scope hint |
| Model | opus |
| Depth (emitted skill) | QUICK (default) or EXTENDED, read from the prompt at run time in any language; no flag |
| Output | .claude/skills/superreview/ and .claude/agents/intent-guard.md in the target project |
Modes
An explicit verb anywhere in the prompt wins. With no verb, prompt evidence decides; with none, status for an installed or parked skill, otherwise install. Status asks nothing; other modes bundle their write questions once.
| Mode | Does | Writes |
|---|---|---|
status | Reports emitted, enabled or parked, intent-guard.md present, then runs validate | nothing |
install | Full generation, Phase 0 to 4 | skill dir, agent |
upgrade | Refreshes a live install from the template baseline, keeps tailoring | live files via targeted Edit |
enable | Renames SKILL.md.disabled back to SKILL.md | one rename |
disable | Renames SKILL.md to SKILL.md.disabled; nothing deleted | one rename |
uninstall | Deletes the skill dir; keeps review reports and intent-guard.md. Confirms once | skill dir |
purge | uninstall plus every .claude/reports/*_superreview/; intent-guard.md still survives. Confirms once | skill dir, reports |
Under --unattended, upgrade skips when the emitted skill is parked or not installed; see how the flag works.
When to use
| Situation | Command |
|---|---|
| Check what this project has | /brewcode:superreview-setup status |
| Wire up deep review | /brewcode:superreview-setup install "default ordering" |
| Security is top concern | /brewcode:superreview-setup install "treat any security issue as P0" |
| Agents, rules, stack or tracker changed | /brewcode:superreview-setup upgrade |
Example
/brewcode:superreview-setup install "focus on reuse and duplicate-detection"
superreview generated -> .claude/skills/superreview/
Stack: Node/TypeScript (reference: typescript-react.md)
Domain experts: 3 wired (developer, tester, architect)
intent-guard: CREATED .claude/agents/intent-guard.md
Mechanical gates: npm run lint, npm run typecheck, npm test
Focus: 1 reuse 2 correctness 3 architecture 4 version-pins 5 business-reqs
Depth: QUICK (default) - EXTENDED spawns the full expert + scope fan-out
Run it: /superreview "<focus>" [scope: commit|branch|folder]
Run the emitted skill with /superreview "deep review of the auth refactor" for EXTENDED; a plain prompt runs QUICK.
How it works
- Load and scan
Phase 0 reads the emit templates; Phase 1 runs
generate.sh scanfor stack, agents, rules, source groups, gates and tracker. - Clarify
Phase 1.5 asks one
AskUserQuestionfor what the scan cannot resolve: baseline, shared surfaces, arbiter, gate commands. - Domain experts
Phase 1.6 spawns
brewcode:agent-creatorfor each uncovered source group; 1.6b creates or reusesintent-guard.md. - Emit or upgrade
Phase 2 runs
generate.sh emit; on a live install it refuses and Phase 2b runsupgradeinstead. - Fill and validate
Phase 3 fills block placeholders by Edit; Phase 4 runs
generate.sh validate. - Report
Phase 5 prints stack, experts,
intent-guardstatus, gates, focus order, depth and files written.
Good to know
QUICKis the intent pass alone: one agent, mechanical gates, no experts.EXTENDEDadds experts, two scope passes and adversarial validation.- The emitted skill needs no plugin and is read-only: it reports and recommends
/simplify, never edits code. - Run
convention-setupfirst so the generator can use your patterns. - Every run keeps scratch files in one private
mktemp -ddir, never/tmpdirectly.
Delegation
The generator fans out one brewcode:agent-creator per uncovered source group, in one message; the emitted skill routes file groups of about 5 files to domain owners, splitting oversized groups into two rows. Every spawn carries the six-field brief, also shipped in the emitted references/agent-prompt.md. Rule and fields: Delegation.
Technical details
Depth: QUICK vs EXTENDED #
The emitted skill scores whole-word matches against its QUICK and EXTENDED keyword tables; the higher score wins, ties and no match select QUICK. Depth is independent of file-selection mode and Git scope; both are announced before any review.
QUICK (default) | EXTENDED | |
|---|---|---|
| Triggered by | ”quick”, “fast”, or no depth word | ”deep”, “thorough”, “full review” |
| Spawns | 1 (intent-guard) | intent-guard + domain experts + scope passes A and B + {0,1,2} general |
| Mechanical gates, intent pass | yes | yes |
| Domain-expert findings, scope baseline + gate | no | yes |
| Adversarial validation | no, pool is self-verdicted | yes, per finding |
| Interrupt on more than 50 files | no | yes |
INCOMPLETE possible | intent pass failed or baseline unreadable | those, plus UNVALIDATED |
| Self-sync (Phase 4b) | no | yes |
/superreview "the auth refactor" -> QUICK
/superreview "deep review of the auth refactor" -> EXTENDED The intent-guard agent #
.claude/agents/intent-guard.md runs at both depths and is the whole QUICK review. It compares what was asked with what was delivered, read-only, tagging findings category: "intent". Evidence is cheap: transcript, file names, git diff --stat, manifest diff, doc headings; never a build, test run or whole-file read.
| Tier | Source |
|---|---|
| 1 | Governing request: ticket or verbatim request, with the latest explicit amendments |
| 2 | Local spec or design doc |
| 3 | Plan, task board or task graph |
| 4 | Project policy: root and nested CLAUDE.md, rules, conventions |
| 5 | Session transcript |
Tier 1 wins; a contradiction between tiers is itself a finding. Unreadable governing request: the guard returns not run - intent baseline unavailable and the coordinator marks the review INCOMPLETE. Empty findings mean ALIGNED only after comparing against a readable baseline.
It reports 12 drift classes: intent#scope|scale|indirection|files|tests|deps|arch|policy|skip|artifacts|naming|conflict, each with a verbatim quote, source tier and delivered evidence. Output opens with VERDICT: ALIGNED | MINOR DRIFT | MAJOR DRIFT and a Sources: T1..T5 line; the merged report restates it as DRIFT:. Long evidence goes to the coordinator, which persists it.
scripts/generate.sh is the only writer, through emit (full) and emit-agent (agent alone, used by /brewcode:teams-setup). It prints one line: INTENT_GUARD: CREATED|REUSE|MIGRATED <path>. A usable file (non-empty, name: intent-guard, no placeholders) is reused byte-untouched; an empty or placeholder-laden one is backed up to .bak-<ts> and recreated. MIGRATED restamps metadata of a retired-stamp or gate-failing file after a body byte-compare guard. Until Phase 3 adapts the three seeded blocks (invariants, drift examples, evidence commands), validate warns INTENT_GUARD: UNTAILORED.
An existing intent-guard.md does not gain new clauses
Reuse is byte-untouched, so upgrade never rewrites its body. validate warns on a current-stamped file missing the Return Contract marker; copy the three paragraphs after the cap line of references/intent-guard.md.template into its ## 5. Output by hand.
Emitted skill: execution shape #
- Mode is computed:
FULL_PROJECT(whole-project request),EXPLICIT(SHA, branch, folder or file),UNCOMMITTED(dirty tree),LAST_COMMITS(fallbackHEAD~2..HEAD). Git-ignored files are OUT, tracked-or-will-be-tracked are IN. - Gates first. Real build, lint, type and test commands run before the fan-out; output is
CONFIRMED-BY-EXECUTIONand shared with every agent. - Experts at runtime. The live
.claude/agents/**/*.mdroster is read each run; recon-only agents are excluded; an unowned surface falls back toExploreand is DEGRADED. - Scope baseline (task, issue, recorded decisions) is resolved read-only; none means
UNKNOWNand a permanent P2 cap. - One fan-out in one message: experts, scope pass A (diff side), scope pass B (baseline side), 0-2 general.
- Validation. A non-owning validator checks each candidate, at most 40 per spawn and 4 spawns. Unvalidatable findings are
UNVALIDATEDand the verdict gets- INCOMPLETE. - Scope gate. Phase 3b
AskUserQuestionon unsanctioned expansion or unproven absence; rewrites priorities only. - Report at
.claude/reports/{TIMESTAMP}_superreview/REPORT.mdwith a Scope Discipline / Blast Radius section and a verdict per finding. Read-only.
Emitted skill: self-sync (Phase 4b) #
EXTENDED only, coordinator only, after the report and before the chat summary, on data already in context. Writable paths: SKILL.md and references/scope.md.
| Action | Fires when | Edit |
|---|---|---|
| Roster refresh | Live roster differs from the routing tables | Add the new agent’s row; mark a vanished one MISSING -> Explore |
| Gate repair | A gate reported not run and command -v <bin> proves the binary absent | Fix the row or annotate not available in this project |
| Scope baseline | Baseline UNKNOWN, or tracker differs from TRACKER_LABEL | Correct references/scope.md section 1 |
| Shared-surface append | Pass A named a surface missing from section 2 | Append the row |
Non-growth is measured: wc -l before and after, printed as Self-sync: before -> after (delta); a positive delta is reverted and printed as a proposal. Depth semantics, corpus rule, UNKNOWN cap, focus order and the read-only invariant are decisions and stay untouched. DEGRADED groups and new intent-guard.md drift rows are only proposed.
Scope taxonomy #
| Creep shape | Severity |
|---|---|
| 1 foreign-surface | P0 |
| 2 unsanctioned-feature | P1 |
| 3 drive-by-refactor | P2 |
| 4 opportunistic-dependency | P2 |
| 5 silent-doc-mutation | P1 |
| 6 sanctioned-but-unrecorded | P2 |
| Gap | Meaning | Severity |
|---|---|---|
| D1 undelivered criterion | Acceptance criterion not met | P0, proof required |
| D2 partial | Met only partly or by a stub | P1 |
| D3 unprovable | Met, no evidence cited | P2 |
| D4 unrecorded reduction | Scope reduced with no named blocker | P0, proof required |
| C1 PR body | Omits what shipped, what was not built | P2 |
| C2 wrong Closes/Refs | Closes on an issue not fully owned | P1 |
| C3 missing closeout comment | Touched issue has no comment | P2 |
| C4 AI attribution | Left in a PR, commit or issue comment | P2 |
Correctness-driven and recorded overlap is not a finding; unrecorded is shape 6.
Re-generation: upgrade, not re-emit #
The emitted skill self-modifies (Phase 4b), so emit refuses on a live install: exit 1, already installed, nothing written, no INTENT_GUARD: line. That is the expected path.
| Command | Effect |
|---|---|
generate.sh upgrade | Writes no live file except restamped metadata. Stages a fresh emit under .upgrade-staging/, reports each asset against the pristine .template-baseline/ as IDENTICAL, DIFFERS (<n> template line(s)), MISSING -> restored RAW (NEEDS PHASE 3) or NO BASELINE - full diff, tailoring included. Port each delta by targeted Edit, then promote .upgrade-staging/.template to the new baseline |
SUPERREVIEW_FORCE=1 generate.sh emit | Overwrites the install and discards every tailored and self-synced edit; only for an explicit clean regeneration |
DIFFERS counts template lines, never your tailoring; never replace a live file with the staged copy. A MISSING file is a raw template: run Phase 3 on it. The per-stack reference is re-derived from the installed tree. .template-baseline/ and .upgrade-staging/ carry a .gitignore of *.
Re-run triggers #
Run upgrade, never re-emit, when an agent is added, removed or renamed; a rule or convention file is added; the stack changes; the tracker or branch convention changes; a spec, plan or policy location moves; a new always-shared surface appears; a source group boundary shifts; or this generator’s templates moved. Self-sync already tracks routing, gates, baseline and surfaces between runs. An existing intent-guard.md is left alone.
Setup-time placeholders #
| Kind | Names |
|---|---|
| Scalar (Phase 2, sed) | PROJECT_NAME, STACK_LABEL, STACK_REF, SOURCE_GLOB, PATHSPEC_GLOBS, ARBITER_AGENT, VALIDATOR_AGENT, SCOPE_AGENT_A, SCOPE_AGENT_B, TRACKER_LABEL |
Block, SKILL.md (Phase 3) | DOMAIN_AGENTS_TABLE, GENERAL_AGENTS_TABLE, RULE_POINTER_TABLE, RULE_PREFLIGHT_LIST, FILE_GROUP_MAP, GATE_COMMANDS, FOCUS_TABLE, FOCUS_EMPHASIS, SIMPLIFY_AGENTS |
Block, references/scope.md | TEAM_NOTE, BASELINE_RESOLUTION_BASH, SANCTION_PRECEDENCE_TABLE, OWNERSHIP_SIGNALS_BASH, SHARED_SURFACES_TABLE |
Runtime placeholders such as {MODE}, {COUNT}, {FILE_LIST} are allow-listed in validate and resolve on each /superreview run. The scanner strips ${VAR} shell expansions before matching.
Error handling #
| Situation | Resolution |
|---|---|
| No agents, or a group with no owner | Phase 1.6 offers brewcode:agent-creator; declining emits DEGRADED and needs SUPERREVIEW_ALLOW_NO_EXPERTS=1 at validate |
| Only recon agents match a group | Never routed to; treated as uncovered |
| No tracker or issues | TRACKER_LABEL="none"; scope reference still emitted; findings capped at P2 |
| Unknown or multi-stack | Generic reference, or one dominant-stack reference; warns to review |
| Unresolved placeholder after Phase 3 | Phase 4 blocks; re-run Phase 3 on that file |
| Unwritable target | Generator stops; check permissions on .claude/skills/ |
emit refuses | Expected; run upgrade |
Emitted file structure and generator files #
.claude/skills/superreview/
SKILL.md # emitted review skill (self-contained)
references/
agent-prompt.md # expert selection + domain-owner prompt contract
scope.md # baseline, ownership, taxonomy, delivery, closeout
report-template.md # merged P0-P3 report layout
{stack}.md # java-kotlin | typescript-react | python | go (one)
.template-baseline/ # pristine templates, git-ignored, upgrade's diff source
.upgrade-staging/ # fresh emit staged by upgrade, git-ignored
.claude/agents/
intent-guard.md # shared with /brewcode:teams-setupgenerate.sh <mode>:
| Subcommand | Phase | Effect |
|---|---|---|
scan | 1 | Reports stack, agents (recursive), rules, source and test dirs, gate candidates, tracker |
emit | 2 | Substitutes and copies templates, creates or reuses intent-guard.md, saves .template-baseline/; refuses on a live install |
upgrade | 2b | Stages and diffs against the baseline, writes no live file |
emit-agent | none | Writes only intent-guard.md |
validate | 4 | Fails on a leftover placeholder, unknown agent, missing asset or zero wired experts |
enable, disable, uninstall and purge map to the modes above.
Version and ownership #
Every artifact this skill writes (SKILL.md, references/agent-prompt.md, report-template.md, scope.md, intent-guard.md) carries the shared stamp described in Artifact metadata, with generated_by: "brewcode:superreview-setup". intent-guard.md also ends with a <!-- generated_by: brewcode:superreview-setup anchor. If no real X.Y.Z resolves, the writer refuses and the caller exits 1:
❌ cannot resolve the plugin version (X.Y.Z) from <plugin.json path> — refusing to stamp an artifact with a fake version/brewcode:setup-status reads the stamps back and reports an install made at an older plugin version as stale. enable and disable only rename the entry file: no version bump, no restamp.
Related
Brewcode overview
Plugin overview: hooks, all skills, all agents.
The emitted skill
What /superreview does once it lands in your repo.
Convention Setup
Establish coding, testing and architecture conventions first.
setup-status
Dashboard: installed or stale, from .template-baseline/; upgrade refreshes it.
Update: /brewtools:plugin-update, /reload-plugins, then /brewcode:setup-status upgrade - FAQ