brewcode:teams
Creates and manages dynamic teams of domain-specific agents (5-20 agents) for a project. Analyzes codebase, proposes team, scaffolds with tracking framework. Modes: create, update, status, cleanup. Triggers: create team, agent team, domain agents, team of agents for project, update team, team status, cleanup team.
What this skill does
<instructions>
# Teams
Manage dynamic teams of domain-specific agents with tracking framework.
**Arguments:** `$ARGUMENTS`
---
## Phase 1: Parse Arguments
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKILL_DIR}/scripts/detect-mode.sh" "$ARGUMENTS" && echo "OK" || echo "FAILED"
```
Output: `MODE:`, `TEAM_NAME:`, `PROMPT:` (optional). Store all three.
---
## Universal Prelude (EVERY mode)
### Step 0: Init + Validate + Confirm
1. Output detection result:
```
Mode: {MODE}, Team: {TEAM_NAME}
```
2. Load environment:
| Action | Command / Path |
|--------|----------------|
| Read agent template | `${CLAUDE_SKILL_DIR}/references/agent-template.md` |
| Read framework templates | `${CLAUDE_SKILL_DIR}/references/framework-files.md` |
| Check team dir | `.claude/teams/{TEAM_NAME}/` -- exists? |
| Check existing agents | `.claude/agents/` -- list all |
| If team.md exists | Read, show current roster |
| If trace.jsonl exists | Show entry counts via `trace-ops.sh read` |
3. If team exists -- verify:
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKILL_DIR}/scripts/verify-team.sh" "TEAM_NAME_HERE" && echo "PASS" || echo "FAIL"
```
4. Formulate action plan for current mode.
5. Confirm via AskUserQuestion:
```
AskUserQuestion:
question: "Here's my plan: {plan}. Continue?"
options:
- "Yes, continue"
- "No, I want changes"
- "Cancel"
```
- "changes" -> AskUserQuestion for details, revise plan
- "Cancel" -> **STOP**
---
## Mode: CREATE (9 phases)
### C1: Project Analysis
Spawn 3-5 Explore agents in ONE message via Task tool:
| # | Agent | Focus |
|---|-------|-------|
| 1 | Explore | Code structure: modules, packages, domains, architectural layers |
| 2 | Explore | Existing agents (`.claude/agents/`, `brewcode/agents/`, `~/.claude/agents/`) + Claude Code infrastructure |
| 3 | Explore | Tech stack: build files, frameworks, dependencies, languages |
| 4 | Explore | CI/CD, testing, deploy, infrastructure |
| 5 | Explore (optional) | Domain boundaries: business logic, API, data layer, UI |
All via `Task(subagent_type="Explore")`. Consolidate results into a single analysis document.
### C2: Team Proposal (interactive)
Based on analysis + PROMPT (if provided), propose 3 variants:
```
AskUserQuestion:
question: |
Project analysis complete. {if PROMPT: "Noted: {PROMPT}"}
**Minimal (5 agents):**
| Agent | Domain | Mission |
| ... | ... | ... |
**Balanced (10-12 agents) -- Recommended:**
| Agent | Domain | Mission |
| ... | ... | ... |
**Maximum (15-20 agents):**
| Agent | Domain | Mission |
| ... | ... | ... |
options:
- "Minimal (5)"
- "Balanced (recommended)"
- "Maximum (15-20)"
- "Custom -- I'll specify"
```
If "Custom" -- second AskUserQuestion for free input.
Final confirmation of agent list via AskUserQuestion before proceeding.
### C2.5: Model Selection (AskUserQuestion)
Before creating agents, confirm model for the team:
```
AskUserQuestion:
question: |
Default model for domain agents: **Opus** (most reliable).
| Model | Best for | Cost |
| opus | Complex domains, architecture, critical logic | High |
| sonnet | Standard domains, CRUD, testing, utilities | Medium |
| haiku | Simple utility agents, formatting, validation | Low |
Choose default model for this team's agents:
options:
- "Opus (recommended)"
- "Sonnet"
- "Haiku"
- "Mixed -- I'll choose per agent"
```
If "Mixed" -- in C3, ask model per agent via AskUserQuestion.
Store as `DEFAULT_MODEL` (default: opus).
### C3: Agent Creation (agent-creator x N)
1. Read `${CLAUDE_SKILL_DIR}/references/agent-template.md` -- unified template
2. For each agent -- spawn `Task(subagent_type="brewcode:agent-creator")`:
| Parameter | Value |
|-----------|-------|
| Placement | `.claude/agents/` |
| Model | `DEFAULT_MODEL` (or per-agent if "Mixed") |
| Context | Template, mission, domain, character, project analysis, colleague list |
3. Batch 3-4 agents in parallel per message.
4. After each batch -- optimize created files:
```
Skill(skill="brewtools:text-optimize", args="-l .claude/agents/{agent-name}.md")
```
### C4: Framework Setup + Verification
1. Create team directory:
**EXECUTE** using Bash tool:
```bash
mkdir -p ".claude/teams/TEAM_NAME_HERE" && echo "OK" || echo "FAILED"
```
2. Write files from templates in `${CLAUDE_SKILL_DIR}/references/framework-files.md`:
- `team.md` -- fill with real agent data
- `touch trace.jsonl` -- empty file for trace data
3. Verify:
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKILL_DIR}/scripts/verify-team.sh" "TEAM_NAME_HERE" && echo "PASS" || echo "FAIL"
```
> **STOP if FAIL** -- fix missing files before continuing.
4. AskUserQuestion: final report + suggest running `/brewcode:teams status {TEAM_NAME}`
### C5: Quorum Review
Spawn 3 reviewer agents in ONE message via Task tool. Reviewers are domain experts matching the team's scope.
| # | Agent | Focus |
|---|-------|-------|
| 1 | brewcode:reviewer | Instruction quality: clarity, imperative form, completeness, word budget |
| 2 | brewcode:reviewer | Domain accuracy: correct scope, tool selection, model fit, description triggers |
| 3 | brewcode:reviewer | Architecture: consistency across agents, no domain overlaps, proper Task Acceptance Protocol |
Each reviewer reads ALL created agent files in `.claude/agents/` and outputs structured findings:
```
FILE: .claude/agents/{name}.md
SEVERITY: critical/important/minor
ISSUE: description
FIX: suggested fix
```
### C6: Consensus Filter
Compare findings from all 3 reviewers. Apply quorum threshold: **2/3 agreement** = confirmed.
| Match criteria | Rule |
|----------------|------|
| Same file | Exact match |
| Same area | +/- 5 lines or same section |
| Same category | instruction/domain/architecture/trigger |
| Outcome | Action |
|---------|--------|
| 2/3+ confirm | Mark as **confirmed**, keep severity from highest reporter |
| 1/3 only | Log as **unconfirmed**, skip |
| Minor severity (all reporters) | Log but **skip fix** |
Output: confirmed findings list with severity (critical > important > minor).
### C7: Verification
Spawn 1 verification agent via Task tool:
```
Task(subagent_type="brewcode:reviewer", prompt="
Verify these findings against actual agent files. For each:
1. Read the agent file
2. Check if the issue actually exists
3. Mark: VERIFIED or FALSE_POSITIVE
{confirmed_findings}
")
```
Filter out false positives. Final list = verified critical + important issues.
### C8: Fix
For each verified critical/important issue -- spawn agent-creator to fix:
```
Task(subagent_type="brewcode:agent-creator", prompt="
Fix this issue in {agent_file}:
ISSUE: {description}
FIX: {suggested_fix}
SEVERITY: {severity}
Read the file, apply the fix, validate.
")
```
Batch fixes: up to 3 parallel per message. Minor issues are **skipped**.
### C9: Re-verify
Spawn verification agent to check all fixes:
```
Task(subagent_type="brewcode:reviewer", prompt="
Re-verify these fixes. For each:
1. Read the fixed agent file
2. Check the original issue is resolved
3. Check no regression introduced
Mark: FIXED or REGRESSION
{fixes_applied}
")
```
| Outcome | Action |
|---------|--------|
| All FIXED | Pipeline complete, proceed to Epilogue |
| REGRESSION found | Return to C8 for that file (max 2 cycles) |
| Still failing after 2 cycles | Log as unresolved, proceed to Epilogue |
> To skip the review pipeline: add `--skip-review` to create arguments.
> To run review on existing team: `/brewcode:teams update {TEAM_NAME} --review`
---
## Mode: STATUS (read-only)
No modifications. Read + report only.
**Step 1:** Read `.claude/teams/{TEAM_NAME}/team.md`
**Step 2:** Read trace data:
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.