agents opus

Prompt-driven

Give a free-form prompt; the skill auto-selects a mode and tells you why. No keyword grammar.

What's new in 6.2.0

Agent and hook references were refreshed through Claude Code 2.1.285. They distinguish execution surfaces, plugin-ignored fields, and event-specific hook contracts — see Reference files.

Quick reference

FieldValue
Command/brewcode:agents
Inputfree-form prompt; empty defaults to read-only status
Specialistbrewcode:agent-creator
List source.claude/agents/, ~/.claude/agents/, ${CLAUDE_PLUGIN_ROOT}/agents/ (shipped, read-only)
Modelopus

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

  1. Input gate

    Reads the complete free-text prompt. Empty input defaults to read-only status. An explicitly requested menu opens the menu; other prompts resolve a mode and target.

  2. Auto-mode select

    Announces Mode: <mode> (agents) — chosen because … based on keywords, intent, and target presence in the prompt.

  3. Resolve material decisions once

    Reuse supplied prompt/history answers. Read-only runs ask nothing unless you request a menu. Before writes, bundle unresolved decisions that change scope or output into one AskUserQuestion call, with at most four questions.

  4. Dispatch

    Create, improve, and sync delegate through Agent to brewcode:agent-creator with bounded ownership and relevant context. Review uses the project’s reviewer or general-purpose fallback. Sync fans out one file per owner. After create/improve, the coordinator checks only the written file against the shared sync reference and applies verified corrections.

  5. 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.md toggle marker, model), overlaps and conflicts (same name shadowed across scopes, duplicate triggers or descriptions), and health flags (missing README or frontmatter, agents missing Bash in tools:).

  6. 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-plugins and a test invocation phrase.

Modes

ModeTriggerAction
statusdefault for any “show me” intent — “статус”, “что есть”, “состояние”Inventory by scope, state, overlaps, health flags
listexplicit 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
syncsync, синк, memory sync, актуализируй, обнови знания, приведи в соответствие с кодомMemory sync: rewrites agent files against ground truth via the shared reference; non-growth guaranteed
batchauto-detected fan-out flagNot a menu item — auto-detected from plural form, “все” / “all”, or multiple names/paths; triggers parallel delegation when creating or improving multiple agents

Reference files

agent-creator and hook-creator used to carry all of this inline; it now lives in this skill’s own references/ directory and each agent reads only the file it needs, on demand. 11 files, each under 200 lines.

FileUsed byHolds
agent-frontmatter-fields.mdagent-creatorAG file format, frontmatter field reference (incl. experimental.cacheTtl)
agent-scope-and-tools.mdagent-creatorAvailable tools, model precedence, scope rules
agent-context-and-execution.mdagent-creatorSubagent context inheritance, execution modes, resource limits
agent-template.mdagent-creatorDescription budget, system-prompt structure, guardrails, validation checklist
agent-known-issues.mdagent-creatorKnown bugs, limitations, version history, debugging
hooks-events.mdhook-creatorSession lifecycle order, 33-event table, matcher pattern syntax
hooks-io-contract.mdhook-creatorStdin fields, message-routing matrix, exit codes, output schemas
hooks-types-config.mdhook-creator5 hook types and their config fields, precedence
hooks-env.mdhook-creatorEnv vars, sensitive-path prompt, project-root resolution
hooks-templates.mdhook-creatorBash/JS hook skeletons, fail-safe design rules, pre-ship checklist
hooks-changes.mdhook-creatorChanges through 2.1.285 and known contract limits

Delegation

Ordinary subagents receive bounded context through the Agent prompt and cannot use AskUserQuestion; unresolved user decisions return to the main caller. Conversation forks retain parent history and tools. A skill’s context: fork is an ordinary subagent, not a conversation fork. Upstream nested-agent depth support does not override this project’s main-caller ownership of delegation, decisions, and acceptance. A partial maxTurns return is unfinished work, even when files were written; inspect checkpoint evidence before resuming or declaring completion.

Plugin agents ignore frontmatter hooks, mcpServers, permissionMode, and initialPrompt. Place plugin hooks in hooks/hooks.json; use the appropriate local/session surface when those agent fields are required. Local files and CLI JSON also have different supported fields. The hook references cover 33 events and five handler types with event-specific output and type support.

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:

FieldContent
GOALthe overall task and why it exists — the point beyond the file edit
ROLEwhat this agent owns; what it must NOT touch
SCOPEexact paths/commands in bounds + explicit out-of-bounds
CONTEXTwhat is already done, by whom, what runs in parallel — trimmed to what THIS agent needs
CONSUMERwho or what uses the result next, and the shape it must fit
DONEacceptance 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
ParameterOptionsNotes
ScopeProject / Global / PluginProject → .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/
Modelsonnet / opus / haiku / inherit, or a verified supported model idInherit uses the caller’s model; choose from the current supported catalog rather than an assumed alias
CLAUDE.md updateyes / noAdds or updates the agent row in the agents table; appends a new section if none exists
Improve focustriggers / system prompt / both / full reviewAsked for improve mode only
DescriptionCanonical budget ≤150 tokens, approximately 600 charactersDrives discovery; ≤100 characters is an optional brevity target, not a second required cap
Specialistbrewcode:agent-creatorHandles 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
ScopeMeaning
repo (default)Whole working tree
sessionThis conversation only — decisions, user corrections, bugs hit
commitgit 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.

VerdictAction
STALEFix to minimal true form
DEADDelete, plus anything that only existed to explain it
DUPLICATEKeep the single best location
OBVIOUSDelete
DRIFTCompress prose to a table row
MISSINGAdd <= 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

Sibling: manage project rules
✏️

skills

Sibling: manage skills
🔄

memory-sync-setup

Sibling: generates a project-local sync over memory files, CLAUDE.md, rules — same non-growth rule
🚀

brewcode

Plugin overview
🔗

GitHub source

SKILL.md

Updating plugins

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.