$npx -y skills add Borda/AI-Rig --skill brainstormIterative brainstorming skill for turning fuzzy ideas into approved tree documents. Diverges into branches, deepens and prunes them over many rounds, saves a tree doc. Run breakdown on the tree to distill it into a spec via guided questions.
| 1 | <objective> |
| 2 | |
| 3 | Turn unformed idea into branching exploration tree, then distill into spec. Idea mode = pure divergence — grow tree of directions, deepen promising branches, prune others, save result. No premature convergence. Run `breakdown` on tree when ready: asks distillation questions, writes spec section-by-section. |
| 4 | NOT for implementation or code-gen — see `develop` plugin (requires `develop` plugin). |
| 5 | |
| 6 | > **HARD GATE:** Do NOT take any implementation action — writing code, creating files, scaffolding — until user approves design (spec). Applies regardless of perceived simplicity. Simple idea can have short tree and spec, but process never skipped. |
| 7 | </objective> |
| 8 | |
| 9 | <inputs> |
| 10 | |
| 11 | - **$ARGUMENTS**: required — fuzzy idea, goal, or feature request in any form; one sentence enough |
| 12 | |
| 13 | - **`--tight`** — reduced-ceremony mode: see per-step caps below — 5/5/1 bounds vs default 10/10/2. Good for well-scoped ideas where problem already understood. |
| 14 | |
| 15 | - **`--deep`** — extended-ceremony mode: 15/15/3 bounds vs default 10/10/2. Good for ambiguous problems where more exploration valuable. |
| 16 | |
| 17 | - Default (no flag): behaviour unchanged — 10/10/2 bounds. |
| 18 | |
| 19 | - **`--type <type>`** — optional type hint for idea mode. One of: `application` (app/service with users/endpoints), `workflow` (automation, pipeline, script), `utility` (helper library, tool, CLI), `config` (`.claude/` agents/skills/rules), `research` (investigation, survey, experiment design). Affects Step 1 scan patterns and Step 2 question framing. Omit if unsure — skill works without it. |
| 20 | |
| 21 | - **`breakdown <tree-or-spec-file>`** — breakdown mode: read already-saved tree (`Status: tree`) or spec (`Status: draft`). For tree: ask distillation questions, write spec section-by-section. For spec: scan for blocking open questions then generate ordered action plan. Skips Steps 1–6 entirely. |
| 22 | |
| 23 | </inputs> |
| 24 | |
| 25 | <compaction> |
| 26 | Key boundary 1: end of Step 4 (tree doc saved to .plans/blueprint/), before Step 5 tree review. |
| 27 | Preserve at boundary 1: tree file path (.plans/blueprint/YYYY-MM-DD-<slug>.md), sidecar path (if viewer active). |
| 28 | Terminal path: Step 6 option (a) approval — suggest breakdown and stop. |
| 29 | </compaction> |
| 30 | |
| 31 | <workflow> |
| 32 | |
| 33 | **Task hygiene**: load and follow the protocol below. |
| 34 | ```bash |
| 35 | # loads: compaction-contract.md |
| 36 | # audit-skip: resilience-replication |
| 37 | _FS=$(python "${CLAUDE_PLUGIN_ROOT:-plugins/cc_foundry}/bin/resolve_shared_path.py" foundry skills/_shared 2>/dev/null || echo "plugins/cc_foundry/skills/_shared") # timeout: 5000 |
| 38 | cat "$_FS/task-hygiene.md" |
| 39 | ``` |
| 40 | |
| 41 | **Task tracking**: Before Step 1, create TaskCreate entries for all 6 steps (context scan, clarifying questions, build tree, save tree, tree review, present + gate). Then print session plan to user: |
| 42 | |
| 43 | > **Brainstorming: \<goal from $ARGUMENTS>** Plan: context scan → clarifying questions → build tree → save tree doc → review → approval gate. Starting with a codebase scan... |
| 44 | |
| 45 | ## Step 0: Parse flags |
| 46 | |
| 47 | ```bash |
| 48 | export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}" |
| 49 | KEEP_ITEMS="" |
| 50 | if [[ "$ARGUMENTS" =~ --keep[[:space:]]\"([^\"]+)\" ]]; then |
| 51 | KEEP_ITEMS="${BASH_REMATCH[1]}" |
| 52 | fi |
| 53 | ARGUMENTS=$(echo "$ARGUMENTS" | sed 's/--keep "[^"]*"//g') |
| 54 | rm -f .temp/state/skill-contract.md # clear stale contract (compaction-contract.md §Lifecycle) # timeout: 5000 |
| 55 | echo "$KEEP_ITEMS" > "${TMPDIR:-/tmp}/brainstorm-state-keep-items-${CSID}" |
| 56 | ``` |
| 57 | |
| 58 | ## Step 1: Context scan |
| 59 | |
| 60 | **Unsupported flag check** — after all supported flags extracted (`--tight`, `--deep`, `--type`, `--keep`), scan `$ARGUMENTS` for remaining `--<token>` tokens. If found: print `! Unknown flag(s): \`--<token>\`. Supported: \`--tight\`, \`--deep\`, \`--type\`, \`--keep\`.` then invoke `AskUserQuestion` — (a) **Abort** (stop, re-invoke with correct flags) · (b) **Continue ignoring** (skip unknown flags, proceed). On Abort: stop. |
| 61 | |
| 62 | Gather project context before asking anything: |
| 63 | |
| 64 | - Read `README.md` and relevant files under `docs/` |
| 65 | - Grep for keywords from `$ARGUMENTS` across `src/` or project root |
| 66 | - Identify: related code that already exists, stated non-goals in docs, prior design decisions |
| 67 | |
| 68 | **Type-aware scan patterns** (when `--type` declared): |
| 69 | |
| 70 | - `application`: look for existing routes, controllers, components, API endpoints, auth middleware |
| 71 | - `workflow`: look for existing scripts, pipelines, CI configs, scheduled jobs, automation files |
| 72 | - `utility`: look for existing utils/, helpers/, lib/ directories and similar functions |
| 73 | - `config`: look for `.claude/` agents, skills, r |