Skip to main content
ClaudeWave
Skill349 repo starsupdated today

brainstorm

The brainstorm skill activates when users request exploratory problem-solving with fuzzy requirements, such as using `/swarm brainstorm` or phrases like "let's think through this." It runs seven structured phases including context scanning, optional council advisory input, dialogue to elicit requirements, constraint mapping, solution sketching, risk assessment, and specification drafting. Use brainstorm when requirements need to be drawn out through dialogue before committing to a detailed specification.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/zaxbysauce/opencode-swarm /tmp/brainstorm && cp -r /tmp/brainstorm/.opencode/skills/brainstorm ~/.claude/skills/brainstorm
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Brainstorm Protocol

This protocol is loaded on demand by the architect stub in src/agents/architect.ts. The architect prompt keeps only activation, action, and hard safety constraints; the full execution details live here.

### MODE: BRAINSTORM
Activates when: user invokes `/swarm brainstorm`; OR uses phrases like "brainstorm", "let's think through", "think this through with me", "workshop this idea"; OR the problem is fuzzy/exploratory and the user has not yet written (or does not want to directly dictate) a spec.

Use BRAINSTORM when requirements need to be drawn out through structured dialogue before committing to a spec. Use SPECIFY when the user has already articulated clear requirements.

MODE: BRAINSTORM runs seven phases in strict order. Do not skip phases. Do not collapse phases. Each phase has a clear entry signal and a clear exit signal.

**Phase 1: CONTEXT SCAN (architect + explorer, parallel).**
- Delegate to `the active swarm's explorer agent` to map the relevant portion of the codebase. Scope the explorer to the area most likely affected by the topic.
- In parallel, read any existing `.swarm/spec.md`, `.swarm/plan.md`, and `.swarm/knowledge.jsonl` entries that are relevant.
- Run CODEBASE REALITY CHECK on any claims the user made in their topic statement. Surface discrepancies before moving forward.
- Exit when you have a confident map of: (a) existing code and patterns, (b) relevant prior decisions, (c) what is actually unknown.

**Phase 1b: GENERAL COUNCIL ADVISORY (optional, architect).**
If `council.general.enabled` is true in the resolved opencode-swarm config AND a search API key is configured:
- Ask the user: "Enable General Council advisory input? The 3-agent council (generalist, skeptic, domain expert) will research the problem domain and provide diverse perspectives to inform the specification and plan. (default: no)"
- If the user declines or config is not enabled, skip to Phase 2.
- If the user accepts:
  1. Run the Research Phase: formulate 1-3 targeted `web_search` queries grounded in the topic.
  2. Dispatch `the active swarm's council_generalist agent`, `the active swarm's council_skeptic agent`, and `the active swarm's council_domain_expert agent` in PARALLEL with the RESEARCH CONTEXT.
  3. Collect responses, call `convene_general_council` with mode `general`.
  4. Carry the council's consensus and disagreements forward as context for subsequent phases.
- Exit with council input noted (or skipped).

**Phase 2: DIALOGUE (architect ↔ user).**
- Ask EXACTLY ONE focused question per message. Wait for the user's answer before asking the next.
- Prioritize questions that materially change scope, risk, or architecture. Skip questions whose answers can be responsibly defaulted — use informed defaults and say so.
- Hard cap: no more than SIX questions total in this phase. Stop sooner if uncertainty has collapsed.
- Each question must include: (a) why it matters, (b) the default you will use if the user doesn't answer, (c) the concrete options you're weighing.
- Exit when: remaining ambiguity can be defaulted safely, or the user explicitly says "good, move on" or equivalent.

**Phase 3: APPROACHES (architect, optionally with SME).**
- Produce 2-4 distinct candidate approaches. Each approach must have: name, one-paragraph summary, primary tradeoff it optimizes for, primary risk it accepts, rough integration surface.
- For high-risk domains (auth, payments, data mutation, public API, schema, concurrency, security-sensitive parsing), delegate to `the active swarm's sme agent` for domain research first.
- Present the approaches to the user and recommend one with explicit reasoning. The user can pick, modify, or reject.
- Exit when the user has chosen (or agreed to your recommended) approach.

**Phase 4: DESIGN SECTIONS (architect).**
- Draft the structural design of the chosen approach. Include: data model / entities, major components / modules, integration points, invariants, failure modes, rollout considerations.
- Keep design technology-aware (this is NOT the spec — BRAINSTORM design notes can reference frameworks and patterns).
- Name the design sections explicitly so you can reference them in the spec without duplicating.
- Exit with a design outline the user can skim in under two minutes.

**Phase 5: SPEC WRITE + SELF-REVIEW (architect + reviewer).**
    - Generate `.swarm/spec.md` following the same SPEC CONTENT RULES that MODE: SPECIFY uses: WHAT/WHY only, no tech stack, no implementation details, FR-### / SC-### numbering, Given/When/Then scenarios, `[NEEDS CLARIFICATION]` markers only for items that survive the clarification funnel: inventory all material uncertainties without numeric cap → classify each (self_resolved/critic_resolved/research_needed/user_decision/deferred_nonblocking) — **overconfidence guard:** if the default is not directly supported by user request, spec, or recorded context, classify as `user_decision` rather than `self_resolved` → consult critic_sounding_board — critic responds per SoundingBoardVerdict: UNNECESSARY→DROP, RESOLVE→RESOLVE, REPHRASE→REPHRASE, APPROVED→ASK_USER — **always-surface protection:** always-surface categories must not receive UNNECESSARY/DROP; override to APPROVED/ASK_USER → record resolved items as assumptions → surface only survivors as markers with decision packet format (grouped by category, recommended defaults, blocking vs optional markers).
- Cross-reference design sections by name where relevant context helps (but keep HOW out of the spec).
- Delegate to `the active swarm's reviewer agent` for an independent review of the draft spec. Reviewer must flag: requirements that encode HOW, untestable requirements, missing edge cases, silent assumptions.
- Apply reviewer feedback. If reviewer rejects, iterate once and re-review. After two rounds, surface remaining disagreements to the user.
- Write the final spec to `.swarm/spec.md`.
- Exit when reviewer signs off (or user explicitly accepts remaining disagreem