ai-brainstorm
$
npx mdskill add arcasilesgroup/ai-engineering/ai-brainstormDesign interrogation skill. Forces rigorous thinking BEFORE any code is written. Produces an approved spec that becomes the contract for `/ai-plan`.
SKILL.md
.github/skills/ai-brainstormView on GitHub ↗
--- name: ai-brainstorm description: "Forces rigorous design interrogation BEFORE any code: explores approaches, surfaces ambiguity, gathers evidence, produces an approved spec that becomes the contract for /ai-plan. Trigger for 'lets add X', 'how should we handle Y', 'whats the best approach', 'I am thinking about', 'what should we build for'. Not for existing approved specs; use /ai-plan instead. Not for execution; use /ai-build instead." effort: mid argument-hint: "[feature or problem description] [work item ID] | --consolidate-spec <slug>" mode: agent model_tier: sonnet mirror_family: copilot-skills generated_by: ai-eng sync canonical_source: .claude/skills/ai-brainstorm/SKILL.md edit_policy: generated-do-not-edit --- # Brainstorm ## Purpose Design interrogation skill. Forces rigorous thinking BEFORE any code is written. Produces an approved spec that becomes the contract for `/ai-plan`. HARD GATE: this skill produces a spec. No implementation happens until the user explicitly approves it. ## When to Use - User says "I want to build...", "how should we...", "let's design..." - New feature, architecture change, or ambiguous requirement - The spec depends on evidence scattered across multiple repo or governance surfaces - Any work where jumping straight to code would be premature ## Process 0a. **Fast-path — `--consolidate-spec <slug>`**: when invoked with the `--consolidate-spec` flag, read `.github/skills/_shared/consolidate-spec.md` and execute the shared handler (resolve record, append `_history.md` row via `spec_lifecycle.py mark_shipped`, clear `spec.md`/`plan.md` to placeholders). STOP after consolidation — no interrogation runs. Fail-open on missing script. 0b. **Auto-spec gate** — follow `handlers/auto-spec-gate.md`. Classify the working-tree diff via `ai_engineering.brainstorm.auto_spec_gate.classify_diff` BEFORE interrogation begins. If any hard trigger fires, OR any threshold is exceeded, route to full interrogation (continue to Step 1). Otherwise, take the condensed-spec path: draft the minimum-viable spec from the diff, present it for one-shot approval, STOP at Step 7. Honor `manifest.brainstorm.auto_spec_gate.enabled: false` as a no-op (fail-open to full interrogation). 0. **Spec lifecycle bootstrap** (before evidence sweep) — call `python .ai-engineering/scripts/spec_lifecycle.py start_new <slug> <title>` to mint (or no-op refresh) the DRAFT record under `.ai-engineering/state/specs/<slug>.json`. **Fail-open**: if the script exits non-zero (missing dependency, locked sidecar), log the failure and continue — interrogation must not be blocked by lifecycle plumbing. 1. **Work item context** (only when a work item ID is provided, e.g., `AB#100` or `#45`): a. Read `.ai-engineering/manifest.yml` `work_items` section for active provider and team config b. Fetch work item and its hierarchy from the provider: - **GitHub**: `gh issue view <number> --json title,body,labels,milestone,assignees` - **Azure DevOps**: `az boards work-item show --id <number> --expand relations -o json` c. Walk the hierarchy: Feature → User Story → Tasks (follow parent/child relations) d. Use all standard and custom fields the platform provides e. Pre-fill `refs` section in the generated spec frontmatter f. Invoke `/ai-board sync refinement <work-item-ref>` to transition the work item to refinement state (fail-open: do not block brainstorm if this fails) 2. **Enhance input** -- follow `handlers/prompt-enhance.md` to evaluate and optimize user input for clarity and specificity before interrogation 3. **Evidence sweep** -- when the current state spans multiple repo or governance surfaces, dispatch parallel read-only `ai-explore` passes first, summarize the findings, and use that evidence to sharpen the next question or spec boundary 4. **Interrogate** -- follow `handlers/interrogate.md` for the questioning flow 5. **Propose approaches** -- present 2-3 options with trade-offs (never just one). Scope classification is already settled at Step 0b — there is no post-interrogation file-count heuristic. 6. **Draft spec** -- write spec to `.ai-engineering/specs/spec.md`. Then run the **Step 0.5 — Section pre-flight** (deterministic gate) **before** any LLM validation pass: invoke `ai-eng spec verify --sections .ai-engineering/specs/spec.md` (spec-139 M7). The CLI runs a regex/string-contains scan for the five required headers (`## Summary`, `## Goals`, `## Non-Goals`, `## Decisions`, `## Risks`) and emits JSON with `valid`, `missing_sections`, `present_sections`. Exit 1 short-circuits the LLM validation — patch the missing headers and re-run before continuing. Only when the script reports `valid=true` proceed to the LLM-driven schema validation against `.ai-engineering/reference/spec-schema.md`. 7. **Board sync (ready)** -- if a work item ID was provided in step 1, invoke `/ai-board sync ready <work-item-ref>` to transition the work item to ready state (fail-open: do not block brainstorm if this fails) 8. **Review spec** -- follow `handlers/spec-review.md` for the review loop (max 3 iterations) 9. **STOP** -- present the spec for approval. At the moment the operator approves, call `python .ai-engineering/scripts/spec_lifecycle.py approve <spec_id>` (read `<spec_id>` from the spec frontmatter `spec:`, fallback `slug:`) to transition the canonical sidecar DRAFT→APPROVED, which also mirrors `status: approved` into `spec.md` frontmatter. **Fail-open** (D-161-08): a non-zero exit logs and does NOT block the STOP. Then present the approved spec — User runs `/ai-plan` to continue. ## Questioning Rules - ONE question at a time. Never batch. - Prefer multiple choice (A/B/C) over open-ended. - Challenge vague language: "improve", "optimize", "clean up" are not requirements. - Push back on scope creep. Ask: "Is this in scope for v1?" - Explore edge cases the user has not mentioned. - Max 10 questions per session. If you need more, the problem is too big -- split it. - When the user's input requires research to understand the current state (e.g., audits, "is this working?", "how is X organized?"), gather data first, present findings, THEN interrogate. Research is not interrogation -- it precedes it. ## Common Mistakes - Skipping interrogation and jumping to the spec. - Proposing only one approach (always propose 2-3). - Writing implementation details in the spec (specs describe WHAT, not HOW). - Not challenging the user's assumptions. - Producing a spec without the review loop. ## Integration - **Called by**: user directly, or `/ai-plan` when requirements are unclear - **Calls**: `handlers/auto-spec-gate.md` (Step 0b trivial-vs-spec classifier via `ai_engineering.brainstorm.auto_spec_gate.classify_diff`), `handlers/prompt-enhance.md`, `handlers/interrogate.md`, `handlers/spec-review.md`, `/ai-board sync` (refinement + ready transitions), `.ai-engineering/scripts/spec_lifecycle.py start_new` (fail-open lifecycle bootstrap), `.ai-engineering/scripts/spec_lifecycle.py approve` (Step 9 DRAFT→APPROVED on operator approval, fail-open) - **Transitions to**: `/ai-plan` (ONLY -- never directly to `ai-build` or `/ai-build`) ## Examples ### Example 1 — design a new feature from a vague request User: "lets add multi-tenant support" ``` /ai-brainstorm "multi-tenant support" ``` Interrogates: what's the isolation model? per-row, per-schema, per-database? What about data residency? Existing user migration? Produces an approved spec at `.ai-engineering/specs/spec.md` with decisions recorded. ### Example 2 — resolve ambiguity in a work item User: "AB#456 says 'improve search performance' — what does that even mean?" ``` /ai-brainstorm AB#456 ``` Pulls the work item, surfaces ambiguity, drives the user to specific measurable acceptance criteria, links the spec to the work item. $ARGUMENTS
More from arcasilesgroup/ai-engineering
- ai-adviseProactive governance advisor — checks standards, decisions, and quality trends during development. Always advisory, NEVER blocks. Three modes: `advise` (post-edit), `gate` (pre-dispatch), `drift` (on-demand decision audit). Trigger for 'governance check', 'advise on this change', 'check for drift', 'is this aligned with active decisions', 'shift-left advisory'. Not for blocking gates — use /ai-verify. Not for narrative code review — use /ai-review.
- ai-analyze-permissionsUse when Claude Code keeps asking to approve commands you have already approved, when settings.local.json has grown large, or when you want to consolidate permission grants into wildcard patterns. Trigger for 'too many permission prompts', 'clean up permissions', 'audit my settings', 'consolidate allow rules'. Claude Code only — not available in GitHub Copilot, Antigravity, or Codex.
- ai-animationDesigns motion, transitions, and micro-interactions for UI components: spring animations, gestures, easing, staggers — taste-driven detail compounding. Trigger for 'animate this', 'add transitions', 'micro-interactions for', 'gesture design', 'swipe to dismiss', 'easing for this', 'stagger the'. Not for design systems; use /ai-design instead. Not for visual art; use /ai-visual instead. Not for testing animation code; use /ai-test instead.
- ai-autopilotDelivers large multi-concern specs and backlog runs autonomously: decomposes specs into sub-specs (or normalizes work items into a backlog DAG), deep-plans with parallel agents, builds a dependency DAG, implements in waves, runs a single final quality loop with one bounded quality-remediation pass (verify+guard+review on full changeset), delivers via PR. Trigger for 'implement spec-NNN end to end', 'autopilot this', 'autonomous delivery', 'decompose and ship', 'run the backlog', 'execute these GitHub issues', 'process the sprint backlog'. Invocation is the approval gate. Not for small or single-concern tasks; use /ai-build instead. Not for ambiguous requirements; use /ai-brainstorm first.
- ai-boardOperates the project board (GitHub Projects v2 or Azure DevOps): discovers configuration after install (fields, state mappings, process templates) and syncs work-item state at lifecycle transitions. Trigger for 'set up the board', 'configure our ADO board', 'discover board fields', 'move this issue to in-review', 'update the board', 'mark as in progress', 'sync the work item state'. Two subcommands: `discover` (post-install configuration write) and `sync` (lifecycle state transitions). Auto-invoked via `sync` by /ai-brainstorm, /ai-build, and /ai-pr; fail-open. Not for backlog execution; use /ai-autopilot --backlog instead.
- ai-branch-cleanupCleans branches safely: switches to the default branch, prunes merged and squash-merged branches, syncs to remote, sweeps stale specs, rotates `.ai-engineering/runtime/` per retention policy. Trigger for 'tidy up', 'tidy branches', 'sync to main', 'delete old branches', 'start fresh', 'rotate runtime'. Auto-invoked by /ai-pr after merge. Not for committing changes; use /ai-commit instead. Not for code-level dead-code removal; use /ai-simplify instead.
- ai-buildCanonical implementation gateway: reads approved plan.md, resolves stack from manifest, deterministic-routes each task to its adapter, dispatches the build agent in an isolated worktree, runs TDD self-validation per task, then a single final quality loop with one bounded quality-remediation pass on the full changeset before /ai-pr. Trigger for 'go', 'start building', 'execute the plan', 'implement it', 'lets do this', 'build the plan', 'resume', 'continue'. Not without an approved plan; run /ai-plan first. Not for multi-concern specs needing decomposition; use /ai-autopilot instead. Not for a single function or subcomponent; use /ai-code.
- ai-codeWrites production code that satisfies stack-context standards on the first pass: interface-first design, backward-compatibility checks, lightweight self-review. Trigger for 'implement this', 'write the code for', 'add X to Y', 'build this function', 'make this work'. Not for tests; use /ai-test instead. Not for debugging; use /ai-debug instead. Not for refactoring; use /ai-simplify instead. Not for executing an approved plan end-to-end; use /ai-build (the gateway).
- ai-commitRuns the governed commit pipeline: auto-branches from protected, stages selectively, formats and lints, scans for secrets, gates docs, composes a conventional message, pushes. Trigger for 'commit my changes', 'save my work', 'push this to remote', 'stage these files', 'ship it'. Not for opening a PR; use /ai-pr instead. Not for branch hygiene; use /ai-branch-cleanup instead.
- ai-constitutionInterviews the operator to produce a project-identity CONSTITUTION.md (Mission / Stakeholders / Vocabulary / Prohibitions / Compliance gates / Anti-goals / Boundaries / Escalation / Language / Lifecycle phase). Trigger for 'set up the constitution', 'define project identity', 'who is this project for', 'what does this project never do', 'amend the constitution'. Not for AI-behaviour rules — those live in CANONICAL.md / AGENTS.md. Not for spec governance; use /ai-governance instead.