PLUGIN brewcode / Skills
On this page
teams-setup opus generator
A generic agent takes any task and is expert at none, and a frontend task routed to the wrong specialist loses domain context and picks the wrong tools. A domain team gives each area its own owner. /brewcode:teams-setup install analyzes the codebase, proposes a team (Minimal / Balanced / Maximum), creates each agent with quorum-reviewed scaffolding, and writes a trace.jsonl log that upgrade uses to tune the team.

Illustrative animation: install a team, describe a task, owning agents take it in parallel, status shows health per agent. Project and agent names are invented.
View README on GitHub (opens in a new tab)
Quick reference
| Field | Value |
|---|---|
| Command | /brewcode:teams-setup |
| Arguments | [prompt] [status|install|upgrade|enable|disable|uninstall|purge] [name] [--unattended] |
| No-arg default | status of the first existing team; install of a team named default when none exists |
| Model | opus |
| Output | .claude/agents/*.md + .claude/teams/<name>/ (team.md, trace.jsonl, trace-ops.sh) |
[name] is positional after the canonical modes. In a bare mode [name] pair the verb comes first, so install enable creates a team named enable; in a sentence the name comes from the text (“disable the payments team” names payments).
When to use
| Scenario | Command |
|---|---|
| New project onboarding | /brewcode:teams-setup install my-team |
| A domain keeps producing poor results | /brewcode:teams-setup upgrade my-team |
| Check team health | /brewcode:teams-setup status my-team |
| Pause or remove a team | disable, uninstall, purge |
Modes
| Mode | Does |
|---|---|
status | Read-only health report: success rates, open issues, insights |
install | Analyze, propose, create agents, review, set up framework |
upgrade | Read trace data, tune or replace underperformers |
enable | Restore parked <agent>.md.disabled files |
disable | Park agent files; nothing deleted |
uninstall | Archive trace entries, remove inactive agents |
purge | Delete agents and .claude/teams/<name>/; one confirmation |
Under --unattended, upgrade does plumbing only (migration, re-copied scripts, header restamp, verify) and leaves tuning interactive (note="tuning not run"); see how the flag works.
Example
/brewcode:teams-setup install api-team "focus on REST API, auth and database layers"
/brewcode:teams-setup status api-team
/brewcode:teams-setup upgrade api-team
install ends with the full Team Status table: agents, tasks tracked, success rate, open issues.
How it works
- Parse + confirm
Mode, name and prompt are extracted; the plan is shown before any change.
- Analyze
3-5 Explore agents map structure, stack, CI/CD and domain boundaries in parallel.
- Propose
Pick Minimal (5), Balanced (10-12) or Maximum (15-20) and a model for the domain agents.
- Create
One
agent-creatorper agent file, in batches of 3-4; oneintent-guardis added outside the batches. - Review
3 reviewers, 2/3 quorum, verification, fix, re-verify. Skip with
--skip-review. - Framework + status
team.md,trace.jsonlandtrace-ops.share written and checked byverify-team.sh.
Good to know
- Each domain profile has six ordered headings:
Mission,Owned surfaces,Exclusions,Must-load references,Unique invariants,Unique verification. team.mdstoresintent_guard_policy=required|legacy-absent. A new team gets exactly one review-onlyintent-guard;upgradenever adds it to alegacy-absentroster.enableanddisabletake effect next session, because agent discovery is read at session start.- Team names use ASCII letters, digits,
-and_, with no leading dash; accented letters are rejected. upgradeon a team with no tracking data classifies every agent Inactive: run some tasks first.statuson an unknown name stops withTeam not found.- The
-setupsuffix marks a skill that installs a mechanism (a roster in.claude/agents/) you use afterwards instead of the skill. All seven canonical modes are implemented. - Delegation: see Delegation.
Technical details
Mode details: enable, disable, purge #
disable renames each roster member’s .claude/agents/<agent>.md to <agent>.md.disabled. Claude Code stops discovering it; the body stays byte-identical and trace data are untouched. In team.md the parked rows get Status: disabled and the header is restamped by a script that also updates the cells verify-team.sh pins to it (Agent defaults, the intent-guard Updated and Version). verify-team.sh reports DISABLED per parked member and still passes. enable reverses it: the rows return to active and the header is restamped. When the header has a missing or out-of-order row, the restamp writes nothing and the skill suggests upgrade.
intent-guard is skipped (SKIP:intent-guard (shared with superreview-setup)), as is any agent another generator owns. disable hard-fails when it cannot parse the ## Agents table, and roster ids must match ^[a-z0-9][a-z0-9-]*$.
purge removes <agent>.md and <agent>.md.disabled, then .claude/teams/<name>/ including trace-archive.jsonl. It keeps .claude/agents/intent-guard.md (shared with /brewcode:superreview-setup) and stops when the team name does not exist. Mode keywords are guarded: purge is never read as a team name.
Flow details and step codes #
| Code | Step |
|---|---|
| C1 | Project analysis, 3-5 Explore agents |
| C2 / C2.5 | Proposal, 3 variants, user confirmation; model choice (opus / sonnet / haiku / mixed) |
| C2.6 | team.md + trace.jsonl + trace-ops.sh, before any agent |
| C3 | agent-creator x N, batches of 3-4; then brewtools:text-optimize in light mode (-l --allow-dirty) on each batch when brewtools is available, keeping the six headings, never on intent-guard.md |
| C3-IG | required: emit or reuse intent-guard; legacy-absent: nothing |
| C4 | Final roster + verify-team.sh; copies trace-ops.sh, stops if the copy fails |
| C5-C9 | Quorum review, 2/3 consensus, cross-check against files, fix critical and important findings, re-verify (max 2 cycles) |
| E1 / E2 | Optional CLAUDE.md Teams section; final status (purge: summary) |
Run the review alone with /brewcode:teams-setup upgrade <name> --review.
intent-guard #
A fixed review-only member outside the domain-agent count; choosing “Custom” cannot drop it. It is an anti-drift check: it compares what was ASKED with what was DELIVERED and reports the delta. It is not a code reviewer.
| Policy | Roster | Upgrade |
|---|---|---|
required | Exactly one intent-guard row | Preserve it, never duplicate |
legacy-absent | Zero rows | Preserve absence, never create |
| Property | Value |
|---|---|
| Tools | Read-only: Read, Glob, Grep, Bash |
| Model | sonnet, fixed by its template |
| Invocation | Explicit, by name, at review time only; never an implementation owner |
| Sources | Five tiers; tier 1 (ticket, thread, verbatim request) wins; sources are never invented |
| Evidence | Transcript, file names, git diff --stat, manifests, doc headings; no builds or tests |
| Output | ALIGNED / MINOR DRIFT / MAJOR DRIFT plus up to 10 findings |
teams-setup never writes the file. It runs superreview-setup/scripts/generate.sh emit-agent, which prints INTENT_GUARD: CREATED|REUSE|MIGRATED <path>. A usable existing file (non-empty, name: intent-guard, no unresolved placeholders) is reused untouched; on CREATED, one agent-creator pass tailors three seeded blocks (project invariants, drift examples, evidence commands).
It is excluded from quorum review, implementation ownership, the uninstall inactive sweep (it writes no trace) and text-optimize. verify-team.sh only warns on a legacy team missing the row; a listed row with no file is a FAIL.
Agents owned by another generator #
.claude/agents/ is project-global, so a roster can list an agent another setup generated. The owner comes from the generated_by stamp; the name task-tracker always belongs to /brewtools:task-board-setup.
| Step | Behavior |
|---|---|
install | Name dropped from every variant; an agent owned by another team is reported as taken and a distinct name is proposed |
enable / disable | Skipped, never moved |
verify-team.sh | FOREIGN warning, counted in FOREIGN_AGENTS:<N>, still passes |
upgrade | Drops the roster row; the file is never touched |
purge | Keeps the file (kept: owned by <plugin>:<skill>) |
A legacy roster that lists task-tracker: run upgrade <name> once to remove the row.
Tracing and upgrading old teams #
Every agent logs what it took, refused, completed or failed to .claude/teams/<name>/trace.jsonl; status and upgrade read nothing else. Agents call a project-local tracer:
bash ".claude/teams/<name>/trace-ops.sh" add ".claude/teams/<name>" "$SID" "<agent>" "track" "took" "<task>"The path is repo-relative because ${CLAUDE_PLUGIN_ROOT} is not substituted in .claude/agents/ files.
Teams created before 4.0.0 trace nothing
Their agents point at a dead plugin path, so status reports 0 tasks and upgrade classifies the roster as Inactive. Run /brewcode:teams-setup upgrade <name> once: the copy of trace-ops.sh is idempotent. verify-team.sh warns and prints the fix.
Guardrails in every team agent #
| Guardrail | Applies to | Says |
|---|---|---|
| Return Contract | Every team agent | Verdict first, at most 30 lines, path:line, no bodies or logs; bulk goes to .claude/reports/<YYYYMMDD-HHMMSS>_<name>/. /brewtools:agent-return-setup enforces it by token budget |
| Scope Fit | Code, script, SQL, schema, infra domains | Build for today’s scale; one simplicity pass at the end |
| Etalon-first | Same domains | Copy the closest well-built counterpart in the repo, in addition to conventions |
| Anti-drift review | intent-guard only | See intent-guard |
agent-creator removes Scope Fit and Etalon-first together for research, docs and review-only members. verify-team.sh warns, never fails, on a legacy team missing the Return Contract; upgrade re-adds it.
Framework files, versions, health #
| File | Purpose |
|---|---|
team.md | Roster, domains, missions, status. At most 2800 characters and 700 o200k_base tokens for 13 domain rows; each row past 13 adds 80 characters and 20 tokens (20 agents: 3360 / 840). intent-guard not counted |
trace.jsonl | Append-only JSONL: tasks, issues, insights |
trace-ops.sh | Tracer copied at install, re-copied on upgrade; deleted by purge, kept by uninstall |
trace-archive.jsonl | Written by uninstall; deleted by purge |
Version stamps: team.md rows Version, Content version, Generated by, Last update (rewritten by one restamp script in upgrade, enable and disable, together with the cells verify-team.sh pins to them); agent frontmatter doc_type, version, generated_by, last_updated. detect-mode.sh reads .claude-plugin/plugin.json and exits 1 (ERROR:cannot resolve plugin version) rather than stamping a fake value. /brewcode:setup-status flags older stamps.
| Health | Criteria | Action |
|---|---|---|
| Green | >70% success, active | None |
| Yellow | 30-70% success or many refusals | Tune via upgrade |
| Red | under 30% success or inactive | Replace or remove via upgrade |
Agents accept a task only after three checks (domain, duplicate, best fit) and refuse with a colleague suggestion otherwise. Name and base role are immutable (delete and recreate); character and instructions are tunable. Other skills resolve agents in this order: team agent > project agent > plugin specialist > system agent (Explore, Plan, general-purpose). A refusing agent is re-delegated to the next level, max 2 retries, then system agents. intent-guard is outside this chain under required.
Related
agents
Create individual domain agents with the same scaffolding.
setup-status
Dashboard across every -setup skill; upgrade brings the stale ones current.
Brewcode overview
All brewcode skills.
Update: /brewtools:plugin-update, /reload-plugins, then /brewcode:setup-status upgrade - FAQ