brewtools:debate
Runs evidence-based multi-agent debates with mandatory Discovery phase (codebase + web research). Three modes: Challenge picks best variant from options, Strategy produces independent proposals via deep analysis, Critic finds all weaknesses. Triggers: debate, challenge this, compare options, strategy analysis, critique, find weaknesses, second opinion, pros and cons, evaluate alternatives.
What this skill does
# Multi-Agent Debate
Orchestrates sequential multi-agent debates. Dynamic agents (2-5) with unique characters debate, main session acts as judge, secretary summarizes, judge writes final decisions.
---
## Phase 0: Validation
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKILL_DIR}/scripts/validate.sh" && echo "VALID" || echo "FAILED"
```
> **STOP if FAILED** — fix missing files before continuing.
Read archetypes into context:
Read file: `${CLAUDE_SKILL_DIR}/agents/archetypes.md`
---
## Phase 1: Parse Arguments
**Arguments:** `$ARGUMENTS`
| Flag | Default | Description |
|------|---------|-------------|
| `-m` | ask user | Mode: `challenge`, `strategy`, `critic` |
| `-n` | 3 | Agent count: 2-5 |
| `-r` | 5 | Max debate rounds |
| `--review` | off | Run `/brewcode:review` on output |
| (positional) | — | Topic text or file path |
### Mode not specified (when `-m` omitted)
If mode is NOT explicitly provided via `-m` flag or clearly stated in the topic text, **do NOT auto-detect**. Ask user using AskUserQuestion:
> **Which debate mode?**
>
> 1. **Challenge** — generate/receive variants, debate to select the best one
> 2. **Strategy** — each agent proposes independently, then debate to converge
> 3. **Critic** — all agents attack the given solution to find weaknesses/risks
>
> Reply with mode name or number.
Only proceed after explicit user choice.
If topic is a file path (exists on disk) — read file content as topic.
---
## Phase 2: Init + Display
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKILL_DIR}/scripts/init-log.sh" && echo "INIT_OK" || echo "INIT_FAILED"
```
> **STOP if INIT_FAILED** — cannot create report directory.
Capture output — it prints:
```
REPORT_DIR=<path>
LOG_FILE=<path>
```
Store `REPORT_DIR` and `LOG_FILE` for all subsequent phases.
Display to user:
```
Debate Setup
Mode: {detected_mode}
Agents: {n}
Max rounds: {r}
Report: {REPORT_DIR}
Log: {LOG_FILE}
Topic: {topic_summary}
```
---
## Phase 3: User Interview
Ask user using AskUserQuestion tool:
> **Debate configuration:**
>
> Mode: **{mode}** | Agents: **{n}** | Max rounds: **{r}**
> Topic: {topic_first_100_chars}
>
> Options:
> 1. Proceed with these settings
> 2. Change mode (challenge/strategy/critic)
> 3. Change agent count (2-5)
> 4. Change max rounds
> 5. Describe custom agent profiles (instead of auto-generated)
Apply any user changes. If user provides custom profiles — skip auto-generation in Phase 4 and use their descriptions.
---
## Phase 4: Agent Profiles
Read reference for agent generation:
Read file: `${CLAUDE_SKILL_DIR}/references/setup-flow.md`
Follow setup-flow.md to generate agent profiles. Result: a table of agents with name, role, character archetype, perspective, and WHY chosen.
Display agent table to user. Ask confirmation using AskUserQuestion:
> **Agent Team:**
>
> | # | Name | Role | Archetype | Perspective |
> |---|------|------|-----------|-------------|
> | ... | ... | ... | ... | ... |
>
> Options:
> 1. Proceed
> 2. Swap an agent (specify which)
> 3. Regenerate all
---
## Phase 5: Discovery (Mandatory)
Research phase — gather current, verified information before debate begins.
Read file: `${CLAUDE_SKILL_DIR}/references/discovery-flow.md`
Follow discovery-flow.md to spawn parallel research agents:
1. **Codebase Explorer** — searches project for relevant code, patterns, dependencies
2. **Web Researcher** — searches internet for current best practices, official docs, recent changes
All findings saved to `{REPORT_DIR}/discovery.md` with sources.
> **Every debate argument in Phase 6 MUST reference findings from discovery.md.**
> Unsourced claims are not valid arguments.
Display discovery summary to user before proceeding to debate.
---
## Phase 6: Debate
Load mode-specific flow reference and execute debate.
| Mode | Reference |
|------|-----------|
| challenge | `${CLAUDE_SKILL_DIR}/references/challenge-flow.md` |
| strategy | `${CLAUDE_SKILL_DIR}/references/strategy-flow.md` |
| critic | `${CLAUDE_SKILL_DIR}/references/critic-flow.md` |
Read the matching reference file and follow its instructions exactly.
**Agent spawning:** Use Task tool with `subagent_type: "general-purpose"`. Build each agent's prompt dynamically by combining:
1. Base template from `${CLAUDE_SKILL_DIR}/agents/debater-template.md`
2. Role overlay from `${CLAUDE_SKILL_DIR}/agents/{role}-template.md`
3. Agent's character traits from archetypes
4. Discovery findings from `{REPORT_DIR}/discovery.md` (injected as Evidence Base)
5. Current debate context (recent JSONL entries)
**After each agent turn**, append to log:
**EXECUTE** using Bash tool:
```bash
bash "${CLAUDE_SKILL_DIR}/scripts/append-log.sh" "LOG_FILE_PATH" '{"ts":"...","from":"agent-name","to":["targets"],"what":"<20 words","why":"<40 words (include [Source: #N] refs)","type":"argument","mode":"MODE"}'
```
**Judge interventions** (main session): After each round, evaluate if consensus emerging, redirect if stuck, end early if unanimous agreement.
---
## Phase 7: Summary
Read file: `${CLAUDE_SKILL_DIR}/references/summary-flow.md`
Follow summary-flow.md:
1. Read full debate log and `{REPORT_DIR}/discovery.md`
2. Spawn secretary agent to write `summary.md` in REPORT_DIR
---
## Phase 8: Decision
Judge (main session) writes `decisions.md`:
- Winning position or synthesized result
- Key arguments that decided the outcome
- Minority opinions worth noting
- Confidence level: high / medium / low
- Recommended next steps
Write to: `{REPORT_DIR}/decisions.md`
---
## Phase 9: Final Output
Display final status:
```
Debate Complete
Mode: {mode}
Rounds: {actual_rounds}/{max_rounds}
Outcome: {consensus | partial | no-consensus}
Agents: {agent_table_brief}
Decisions (top 3-5):
- {bullet_1}
- {bullet_2}
- {bullet_3}
Artifacts:
- {REPORT_DIR}/discovery.md
- {REPORT_DIR}/decisions.md
- {REPORT_DIR}/summary.md
- {REPORT_DIR}/debate-log.jsonl
```
If `--review` flag was set:
Invoke: `Skill(skill="brewcode:standards-review", args="{REPORT_DIR}")`
Related 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.