agents opus
Prompt-driven
Quick reference
| Field | Value |
|---|---|
| Command | /brewcode:agents |
| Input | free-form prompt or empty |
| Specialist | brewcode:agent-creator |
| List source | .claude/agents/, ~/.claude/agents/, ${CLAUDE_PLUGIN_ROOT}/agents/ (shipped, read-only) |
| Model | opus |
When to use
- Check the status of all agents across project and global scopes
- Create a new agent from a plain-English description
- Improve an existing agent’s trigger phrases or system prompt
- Review an agent for quality, focus, and trigger coverage
- Sync agent files against real code/CLAUDE.md/rules after a repo, session, or commit changed (memory sync)
- Batch-create or batch-improve a set of agents in one pass
Examples
/brewcode:agents
/brewcode:agents status of my agents
/brewcode:agents create a backend validator agent
/brewcode:agents improve reviewer
/brewcode:agents sync
/brewcode:agents синк по текущей сессии
How it works
- Input gate
Reads
$ARGUMENTS. An empty prompt skips analysis and jumps directly to the No-prompt menu; a non-empty prompt proceeds to mode selection. - Auto-mode select
Announces
Mode: <mode> (agents) — chosen because …based on keywords, intent, and target presence in the prompt. - No-prompt menu
Sends a single AskUserQuestion with options:
Status (agents)(recommended),Status (all: agents+rules+skills),Create,Improve,Review,Sync agents (memory sync),List (plain),Cancel. The skill continues with the chosen mode. - Dispatch
Routes to the appropriate handler. Create, improve and sync delegate to the
brewcode:agent-creatorspecialist via Task tool, passing full context — description, scope, model, and improvement focus; review goes instead to the project’s reviewer agent from.claude/agents/(falling back togeneral-purpose), two-phase. Sync mode reads the sharedmode-sync.mdreference (also used by/brewcode:skills) and fans out oneagent-creatorsubagent per target file. After create/improve completes, the coordinator re-runs that same reference itself, scoped to only the file just written — no extraagent-creatorspawn — and applies the verdicts directly with targeted edits. - Real status
Four blocks, never a flat list: inventory by scope (shipped plugin, read-only / plugin source, workspace-only / project / global — counts, names, load path), state (enabled or disabled via the
_name.mdtoggle marker, model), overlaps and conflicts (same name shadowed across scopes, duplicate triggers or descriptions), and health flags (missing README or frontmatter, agents missingBashintools:). - Final output
Prints a detection + result table: mode chosen, target, file path, model, scope, and CLAUDE.md update status. Suggests next steps such as
/reload-pluginsand a test invocation phrase.
Modes
| Mode | Trigger | Action |
|---|---|---|
| status | default for any “show me” intent — “статус”, “что есть”, “состояние” | Inventory by scope, state, overlaps, health flags |
| list | explicit only — “list” / “список” / “перечисли” | Globs *.md across .claude/agents/, ~/.claude/agents/, ${CLAUDE_PLUGIN_ROOT}/agents/ (shipped, read-only), plus brewcode/agents/ only inside the plugin workspace (test -d brewcode/.claude-plugin) |
| create | ”создай” / “create” / “new” / “добавь” / “scaffold” | Scaffolds a new agent file via agent-creator; asks scope, model, CLAUDE.md update |
| improve | ”улучши” / “improve” / “refactor” / “fix” / “почини”, or a bare existing <name|path> | Tunes description triggers and system prompt quality |
| review | ”ревью” / “review” / “validate” / “проверь корректность” | Single reviewer — the project’s agent from .claude/agents/, else general-purpose — two-phase: review, then double-check the findings |
| sync | sync, синк, memory sync, актуализируй, обнови знания, приведи в соответствие с кодом | Memory sync: rewrites agent files against ground truth via the shared reference; non-growth guaranteed |
| batch | auto-detected fan-out flag | Not a menu item — auto-detected from plural form, “все” / “all”, or multiple names/paths; triggers parallel delegation when creating or improving multiple agents |
Delegation
Why the rule exists
A big task handed to one agent = an agent gone for an hour: you cannot observe it, cannot correct it, and it usually drifts off-target.
One subagent = ONE bounded unit — here, ONE agent definition: roughly 5 files, roughly 10 steps. “Create the whole roster” is never one task; a batch is split into N spawns fired in ONE message, one agent-creator per agent file.
Every spawn prompt carries six fields. A bare one-line task is never enough:
| Field | Content |
|---|---|
| GOAL | the overall task and why it exists — the point beyond the file edit |
| ROLE | what this agent owns; what it must NOT touch |
| SCOPE | exact paths/commands in bounds + explicit out-of-bounds |
| CONTEXT | what is already done, by whom, what runs in parallel — trimmed to what THIS agent needs |
| CONSUMER | who or what uses the result next, and the shape it must fit |
| DONE | acceptance criteria + the exact report shape you want back |
For create, that means the specialist is told the scope and model were already decided (do not re-ask), which agents already exist and must not be duplicated, how many siblings run in parallel, and that its description line drops verbatim into the CLAUDE.md agents table row written right after it finishes.
Create / improve parameters
| Parameter | Options | Notes |
|---|---|---|
| Scope | Project / Global / Plugin | Project → .claude/agents/; Global → ~/.claude/agents/; Plugin → brewcode/agents/, offered only when test -d brewcode/.claude-plugin succeeds (the dev/plugin workspace) — elsewhere the option is dropped, since it would write a stray <cwd>/brewcode/agents/ |
| Model | sonnet (recommended) / opus or fable / haiku / inherit | inherit omits the model: field entirely, so the agent runs on the calling session’s model |
| CLAUDE.md update | yes / no | Adds or updates the agent row in the agents table; appends a new section if none exists |
| Improve focus | triggers / system prompt / both / full review | Asked for improve mode only |
| Description | free-form, aim ≤100 chars | Used as the agent description frontmatter — drives LLM auto-invocation |
| Specialist | brewcode:agent-creator | Handles file scaffolding and prompt engineering; never writes under ${CLAUDE_PLUGIN_ROOT} — the installed plugin copy is read-only |
improve resolves the target across the writable scopes (project / global / plugin workspace) only.
A name that only matches under the shipped, read-only ${CLAUDE_PLUGIN_ROOT}/agents/ is reported and
the skill stops — it is never copied or edited.
Sync mode
| Scope | Meaning |
|---|---|
repo (default) | Whole working tree |
session | This conversation only — decisions, user corrections, bugs hit |
commit | git show/git diff <ref>, default HEAD |
Announced as Sync scope: <scope> — <evidence> | targets: <N> agents. Implemented in brewcode/skills/skills/references/mode-sync.md (steps S1-S6) via the constant SYNC_REF = ${CLAUDE_SKILL_DIR}/../skills/references/mode-sync.md — the same file /brewcode:skills sync runs, so the two rosters cannot drift apart.
Non-growth directive: each synced file ends <= its original line count; total delta <= 0. Any positive delta needs per-line justification. Order: DELETE first, then FIX, then ADD last.
Auto-dispatch after create/improve: once a create or improve completes, the same reference runs again scoped to only the file just written — S3 ground truth through S5 verdicts, folded into one row of the final report. No second agent-creator spawn: the coordinator applies every verdict itself with targeted Edit calls, since S4 fan-out is skipped for this scoped pass. A clean file reports one line: sync: no drift.
| Verdict | Action |
|---|---|
| STALE | Fix to minimal true form |
| DEAD | Delete, plus anything that only existed to explain it |
| DUPLICATE | Keep the single best location |
| OBVIOUS | Delete |
| DRIFT | Compress prose to a table row |
| MISSING | Add <= 1 line, only if verified against a real source and its absence costs a real failure |
Report: per-target table (File | Lines before → after | Fixed | Deleted | Added | Key change), stale facts corrected, added items with source, skipped agents, total delta.
rules
skills
memory-sync-setup
brewcode
GitHub source
Updating plugins
/brewtools:plugin-update to check and update the brewcode plugin suite in one command.
See the FAQ for details.