PLUGIN brewcode / Skills

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.

Terminal animation: a review skill is generated for a repo, wires domain experts and an intent guard, runs on a payments refund flow, and ends with a minor-drift verdict from a read-only report.
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

FieldValue
Command/brewcode:superreview-setup [prompt] [status|install|upgrade|enable|disable|uninstall|purge] [scope] [--unattended]
ArgumentsFree-text focus, an optional lifecycle verb anywhere in the prompt, an optional scope hint
Modelopus
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.

ModeDoesWrites
statusReports emitted, enabled or parked, intent-guard.md present, then runs validatenothing
installFull generation, Phase 0 to 4skill dir, agent
upgradeRefreshes a live install from the template baseline, keeps tailoringlive files via targeted Edit
enableRenames SKILL.md.disabled back to SKILL.mdone rename
disableRenames SKILL.md to SKILL.md.disabled; nothing deletedone rename
uninstallDeletes the skill dir; keeps review reports and intent-guard.md. Confirms onceskill dir
purgeuninstall plus every .claude/reports/*_superreview/; intent-guard.md still survives. Confirms onceskill dir, reports

Under --unattended, upgrade skips when the emitted skill is parked or not installed; see how the flag works.

When to use

SituationCommand
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

  1. Load and scan

    Phase 0 reads the emit templates; Phase 1 runs generate.sh scan for stack, agents, rules, source groups, gates and tracker.

  2. Clarify

    Phase 1.5 asks one AskUserQuestion for what the scan cannot resolve: baseline, shared surfaces, arbiter, gate commands.

  3. Domain experts

    Phase 1.6 spawns brewcode:agent-creator for each uncovered source group; 1.6b creates or reuses intent-guard.md.

  4. Emit or upgrade

    Phase 2 runs generate.sh emit; on a live install it refuses and Phase 2b runs upgrade instead.

  5. Fill and validate

    Phase 3 fills block placeholders by Edit; Phase 4 runs generate.sh validate.

  6. Report

    Phase 5 prints stack, experts, intent-guard status, gates, focus order, depth and files written.

Good to know

  • QUICK is the intent pass alone: one agent, mechanical gates, no experts. EXTENDED adds 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-setup first so the generator can use your patterns.
  • Every run keeps scratch files in one private mktemp -d dir, never /tmp directly.

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”
Spawns1 (intent-guard)intent-guard + domain experts + scope passes A and B + {0,1,2} general
Mechanical gates, intent passyesyes
Domain-expert findings, scope baseline + gatenoyes
Adversarial validationno, pool is self-verdictedyes, per finding
Interrupt on more than 50 filesnoyes
INCOMPLETE possibleintent pass failed or baseline unreadablethose, plus UNVALIDATED
Self-sync (Phase 4b)noyes
/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.

TierSource
1Governing request: ticket or verbatim request, with the latest explicit amendments
2Local spec or design doc
3Plan, task board or task graph
4Project policy: root and nested CLAUDE.md, rules, conventions
5Session 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 (fallback HEAD~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-EXECUTION and shared with every agent.
  • Experts at runtime. The live .claude/agents/**/*.md roster is read each run; recon-only agents are excluded; an unowned surface falls back to Explore and is DEGRADED.
  • Scope baseline (task, issue, recorded decisions) is resolved read-only; none means UNKNOWN and 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 UNVALIDATED and the verdict gets - INCOMPLETE.
  • Scope gate. Phase 3b AskUserQuestion on unsanctioned expansion or unproven absence; rewrites priorities only.
  • Report at .claude/reports/{TIMESTAMP}_superreview/REPORT.md with 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.

ActionFires whenEdit
Roster refreshLive roster differs from the routing tablesAdd the new agent’s row; mark a vanished one MISSING -> Explore
Gate repairA gate reported not run and command -v <bin> proves the binary absentFix the row or annotate not available in this project
Scope baselineBaseline UNKNOWN, or tracker differs from TRACKER_LABELCorrect references/scope.md section 1
Shared-surface appendPass A named a surface missing from section 2Append 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 shapeSeverity
1 foreign-surfaceP0
2 unsanctioned-featureP1
3 drive-by-refactorP2
4 opportunistic-dependencyP2
5 silent-doc-mutationP1
6 sanctioned-but-unrecordedP2
GapMeaningSeverity
D1 undelivered criterionAcceptance criterion not metP0, proof required
D2 partialMet only partly or by a stubP1
D3 unprovableMet, no evidence citedP2
D4 unrecorded reductionScope reduced with no named blockerP0, proof required
C1 PR bodyOmits what shipped, what was not builtP2
C2 wrong Closes/RefsCloses on an issue not fully ownedP1
C3 missing closeout commentTouched issue has no commentP2
C4 AI attributionLeft in a PR, commit or issue commentP2

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.

CommandEffect
generate.sh upgradeWrites 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 emitOverwrites 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 #
KindNames
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.mdTEAM_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 #
SituationResolution
No agents, or a group with no ownerPhase 1.6 offers brewcode:agent-creator; declining emits DEGRADED and needs SUPERREVIEW_ALLOW_NO_EXPERTS=1 at validate
Only recon agents match a groupNever routed to; treated as uncovered
No tracker or issuesTRACKER_LABEL="none"; scope reference still emitted; findings capped at P2
Unknown or multi-stackGeneric reference, or one dominant-stack reference; warns to review
Unresolved placeholder after Phase 3Phase 4 blocks; re-run Phase 3 on that file
Unwritable targetGenerator stops; check permissions on .claude/skills/
emit refusesExpected; 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-setup

generate.sh <mode>:

SubcommandPhaseEffect
scan1Reports stack, agents (recursive), rules, source and test dirs, gate candidates, tracker
emit2Substitutes and copies templates, creates or reuses intent-guard.md, saves .template-baseline/; refuses on a live install
upgrade2bStages and diffs against the baseline, writes no live file
emit-agentnoneWrites only intent-guard.md
validate4Fails 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.

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