feed-the-machine 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +170 -170
- package/bin/generate-manifest.mjs +463 -463
- package/bin/install.mjs +491 -491
- package/docs/HOOKS.md +243 -243
- package/docs/INBOX.md +233 -233
- package/ftm/SKILL.md +122 -122
- package/ftm-audit/SKILL.md +623 -541
- package/ftm-audit/references/protocols/PROJECT-PATTERNS.md +91 -91
- package/ftm-audit/references/protocols/RUNTIME-WIRING.md +66 -66
- package/ftm-audit/references/protocols/WIRING-CONTRACTS.md +135 -135
- package/ftm-audit/references/strategies/AUTO-FIX-STRATEGIES.md +69 -69
- package/ftm-audit/references/templates/REPORT-FORMAT.md +96 -96
- package/ftm-audit/scripts/run-knip.sh +23 -23
- package/ftm-audit.yml +2 -2
- package/ftm-brainstorm/SKILL.md +498 -498
- package/ftm-brainstorm/evals/evals.json +100 -100
- package/ftm-brainstorm/evals/promptfoo.yaml +109 -109
- package/ftm-brainstorm/references/agent-prompts.md +224 -224
- package/ftm-brainstorm/references/plan-template.md +121 -121
- package/ftm-brainstorm.yml +2 -2
- package/ftm-browse/SKILL.md +454 -454
- package/ftm-browse/daemon/browser-manager.ts +206 -206
- package/ftm-browse/daemon/bun.lock +30 -30
- package/ftm-browse/daemon/cli.ts +347 -347
- package/ftm-browse/daemon/commands.ts +410 -410
- package/ftm-browse/daemon/main.ts +357 -357
- package/ftm-browse/daemon/package.json +17 -17
- package/ftm-browse/daemon/server.ts +189 -189
- package/ftm-browse/daemon/snapshot.ts +519 -519
- package/ftm-browse/daemon/tsconfig.json +22 -22
- package/ftm-browse.yml +4 -4
- package/ftm-capture/SKILL.md +370 -370
- package/ftm-capture.yml +4 -4
- package/ftm-codex-gate/SKILL.md +361 -361
- package/ftm-codex-gate.yml +2 -2
- package/ftm-config/SKILL.md +345 -345
- package/ftm-config.default.yml +82 -80
- package/ftm-config.yml +2 -2
- package/ftm-council/SKILL.md +416 -416
- package/ftm-council/references/prompts/CLAUDE-INVESTIGATION.md +60 -60
- package/ftm-council/references/prompts/CODEX-INVESTIGATION.md +58 -58
- package/ftm-council/references/prompts/GEMINI-INVESTIGATION.md +58 -58
- package/ftm-council/references/prompts/REBUTTAL-TEMPLATE.md +57 -57
- package/ftm-council/references/protocols/PREREQUISITES.md +47 -47
- package/ftm-council/references/protocols/STEP-0-FRAMING.md +46 -46
- package/ftm-council.yml +2 -2
- package/ftm-dashboard/SKILL.md +163 -163
- package/ftm-dashboard.yml +4 -4
- package/ftm-debug/SKILL.md +1037 -1037
- package/ftm-debug/references/phases/PHASE-0-INTAKE.md +58 -58
- package/ftm-debug/references/phases/PHASE-1-TRIAGE.md +46 -46
- package/ftm-debug/references/phases/PHASE-2-WAR-ROOM-AGENTS.md +279 -279
- package/ftm-debug/references/phases/PHASE-3-TO-6-EXECUTION.md +436 -436
- package/ftm-debug/references/protocols/BLACKBOARD.md +86 -86
- package/ftm-debug/references/protocols/EDGE-CASES.md +103 -103
- package/ftm-debug.yml +2 -2
- package/ftm-diagram/SKILL.md +277 -277
- package/ftm-diagram.yml +2 -2
- package/ftm-executor/SKILL.md +777 -767
- package/ftm-executor/references/STYLE-TEMPLATE.md +73 -73
- package/ftm-executor/references/phases/PHASE-0-VERIFICATION.md +62 -62
- package/ftm-executor/references/phases/PHASE-2-AGENT-ASSEMBLY.md +34 -34
- package/ftm-executor/references/phases/PHASE-3-WORKTREES.md +38 -38
- package/ftm-executor/references/phases/PHASE-4-5-AUDIT.md +72 -72
- package/ftm-executor/references/phases/PHASE-4-DISPATCH.md +66 -66
- package/ftm-executor/references/phases/PHASE-5-5-CODEX-GATE.md +73 -73
- package/ftm-executor/references/protocols/DOCUMENTATION-BOOTSTRAP.md +36 -36
- package/ftm-executor/references/protocols/MODEL-PROFILE.md +59 -44
- package/ftm-executor/references/protocols/PROGRESS-TRACKING.md +66 -66
- package/ftm-executor/runtime/ftm-runtime.mjs +252 -252
- package/ftm-executor/runtime/package.json +8 -8
- package/ftm-executor.yml +2 -2
- package/ftm-git/SKILL.md +441 -441
- package/ftm-git/evals/evals.json +26 -26
- package/ftm-git/evals/promptfoo.yaml +75 -75
- package/ftm-git/hooks/post-commit-experience.sh +92 -92
- package/ftm-git/references/patterns/SECRET-PATTERNS.md +104 -104
- package/ftm-git/references/protocols/REMEDIATION.md +139 -139
- package/ftm-git/scripts/pre-commit-secrets.sh +110 -110
- package/ftm-git.yml +2 -2
- package/ftm-inbox/backend/adapters/_retry.py +64 -64
- package/ftm-inbox/backend/adapters/base.py +230 -230
- package/ftm-inbox/backend/adapters/freshservice.py +104 -104
- package/ftm-inbox/backend/adapters/gmail.py +125 -125
- package/ftm-inbox/backend/adapters/jira.py +136 -136
- package/ftm-inbox/backend/adapters/registry.py +192 -192
- package/ftm-inbox/backend/adapters/slack.py +110 -110
- package/ftm-inbox/backend/db/connection.py +54 -54
- package/ftm-inbox/backend/db/schema.py +78 -78
- package/ftm-inbox/backend/executor/__init__.py +7 -7
- package/ftm-inbox/backend/executor/engine.py +149 -149
- package/ftm-inbox/backend/executor/step_runner.py +98 -98
- package/ftm-inbox/backend/main.py +103 -103
- package/ftm-inbox/backend/models/__init__.py +1 -1
- package/ftm-inbox/backend/models/unified_task.py +36 -36
- package/ftm-inbox/backend/planner/__init__.py +6 -6
- package/ftm-inbox/backend/planner/generator.py +127 -127
- package/ftm-inbox/backend/planner/schema.py +34 -34
- package/ftm-inbox/backend/requirements.txt +5 -5
- package/ftm-inbox/backend/routes/execute.py +186 -186
- package/ftm-inbox/backend/routes/health.py +52 -52
- package/ftm-inbox/backend/routes/inbox.py +68 -68
- package/ftm-inbox/backend/routes/plan.py +271 -271
- package/ftm-inbox/bin/launchagent.mjs +91 -91
- package/ftm-inbox/bin/setup.mjs +188 -188
- package/ftm-inbox/bin/start.sh +10 -10
- package/ftm-inbox/bin/status.sh +17 -17
- package/ftm-inbox/bin/stop.sh +8 -8
- package/ftm-inbox/config.example.yml +55 -55
- package/ftm-inbox/package-lock.json +2898 -2898
- package/ftm-inbox/package.json +26 -26
- package/ftm-inbox/postcss.config.js +6 -6
- package/ftm-inbox/src/app.css +199 -199
- package/ftm-inbox/src/app.html +18 -18
- package/ftm-inbox/src/lib/api.ts +166 -166
- package/ftm-inbox/src/lib/components/ExecutionLog.svelte +81 -81
- package/ftm-inbox/src/lib/components/InboxFeed.svelte +143 -143
- package/ftm-inbox/src/lib/components/PlanStep.svelte +271 -271
- package/ftm-inbox/src/lib/components/PlanView.svelte +206 -206
- package/ftm-inbox/src/lib/components/StreamPanel.svelte +99 -99
- package/ftm-inbox/src/lib/components/TaskCard.svelte +190 -190
- package/ftm-inbox/src/lib/components/ui/EmptyState.svelte +63 -63
- package/ftm-inbox/src/lib/components/ui/KawaiiCard.svelte +86 -86
- package/ftm-inbox/src/lib/components/ui/PillButton.svelte +106 -106
- package/ftm-inbox/src/lib/components/ui/StatusBadge.svelte +67 -67
- package/ftm-inbox/src/lib/components/ui/StreamDrawer.svelte +149 -149
- package/ftm-inbox/src/lib/components/ui/ThemeToggle.svelte +80 -80
- package/ftm-inbox/src/lib/theme.ts +47 -47
- package/ftm-inbox/src/routes/+layout.svelte +76 -76
- package/ftm-inbox/src/routes/+page.svelte +401 -401
- package/ftm-inbox/svelte.config.js +12 -12
- package/ftm-inbox/tailwind.config.ts +63 -63
- package/ftm-inbox/tsconfig.json +13 -13
- package/ftm-inbox/vite.config.ts +6 -6
- package/ftm-intent/SKILL.md +241 -241
- package/ftm-intent.yml +2 -2
- package/ftm-manifest.json +3794 -3794
- package/ftm-map/SKILL.md +291 -291
- package/ftm-map/scripts/db.py +712 -712
- package/ftm-map/scripts/index.py +415 -415
- package/ftm-map/scripts/parser.py +224 -224
- package/ftm-map/scripts/queries/go-tags.scm +20 -20
- package/ftm-map/scripts/queries/javascript-tags.scm +35 -35
- package/ftm-map/scripts/queries/python-tags.scm +31 -31
- package/ftm-map/scripts/queries/ruby-tags.scm +19 -19
- package/ftm-map/scripts/queries/rust-tags.scm +37 -37
- package/ftm-map/scripts/queries/typescript-tags.scm +41 -41
- package/ftm-map/scripts/query.py +301 -301
- package/ftm-map/scripts/ranker.py +377 -377
- package/ftm-map/scripts/requirements.txt +5 -5
- package/ftm-map/scripts/setup-hooks.sh +27 -27
- package/ftm-map/scripts/setup.sh +56 -56
- package/ftm-map/scripts/test_db.py +364 -364
- package/ftm-map/scripts/test_parser.py +174 -174
- package/ftm-map/scripts/test_query.py +183 -183
- package/ftm-map/scripts/test_ranker.py +199 -199
- package/ftm-map/scripts/views.py +591 -591
- package/ftm-map.yml +2 -2
- package/ftm-mind/SKILL.md +1943 -1943
- package/ftm-mind/evals/promptfoo.yaml +142 -142
- package/ftm-mind/references/blackboard-schema.md +328 -328
- package/ftm-mind/references/complexity-guide.md +110 -110
- package/ftm-mind/references/event-registry.md +319 -319
- package/ftm-mind/references/mcp-inventory.md +296 -296
- package/ftm-mind/references/protocols/COMPLEXITY-SIZING.md +72 -72
- package/ftm-mind/references/protocols/MCP-HEURISTICS.md +32 -32
- package/ftm-mind/references/protocols/PLAN-APPROVAL.md +80 -80
- package/ftm-mind/references/reflexion-protocol.md +249 -249
- package/ftm-mind/references/routing/SCENARIOS.md +22 -22
- package/ftm-mind/references/routing-scenarios.md +35 -35
- package/ftm-mind.yml +2 -2
- package/ftm-pause/SKILL.md +395 -395
- package/ftm-pause/references/protocols/SKILL-RESTORE-PROTOCOLS.md +186 -186
- package/ftm-pause/references/protocols/VALIDATION.md +80 -80
- package/ftm-pause.yml +2 -2
- package/ftm-researcher/SKILL.md +275 -275
- package/ftm-researcher/evals/agent-diversity.yaml +17 -17
- package/ftm-researcher/evals/synthesis-quality.yaml +12 -12
- package/ftm-researcher/evals/trigger-accuracy.yaml +39 -39
- package/ftm-researcher/references/adaptive-search.md +116 -116
- package/ftm-researcher/references/agent-prompts.md +193 -193
- package/ftm-researcher/references/council-integration.md +193 -193
- package/ftm-researcher/references/output-format.md +203 -203
- package/ftm-researcher/references/synthesis-pipeline.md +165 -165
- package/ftm-researcher/scripts/score_credibility.py +234 -234
- package/ftm-researcher/scripts/validate_research.py +92 -92
- package/ftm-researcher.yml +2 -2
- package/ftm-resume/SKILL.md +518 -518
- package/ftm-resume/references/protocols/VALIDATION.md +172 -172
- package/ftm-resume.yml +2 -2
- package/ftm-retro/SKILL.md +380 -380
- package/ftm-retro/references/protocols/SCORING-RUBRICS.md +89 -89
- package/ftm-retro/references/templates/REPORT-FORMAT.md +109 -109
- package/ftm-retro.yml +2 -2
- package/ftm-routine/SKILL.md +170 -170
- package/ftm-routine.yml +4 -4
- package/ftm-state/blackboard/capabilities.json +5 -5
- package/ftm-state/blackboard/capabilities.schema.json +27 -27
- package/ftm-state/blackboard/context.json +23 -23
- package/ftm-state/blackboard/experiences/index.json +9 -9
- package/ftm-state/blackboard/patterns.json +6 -6
- package/ftm-state/schemas/context.schema.json +130 -130
- package/ftm-state/schemas/experience-index.schema.json +77 -77
- package/ftm-state/schemas/experience.schema.json +78 -78
- package/ftm-state/schemas/patterns.schema.json +44 -44
- package/ftm-upgrade/SKILL.md +194 -194
- package/ftm-upgrade/scripts/check-version.sh +76 -76
- package/ftm-upgrade/scripts/upgrade.sh +143 -143
- package/ftm-upgrade.yml +2 -2
- package/ftm-verify.yml +2 -2
- package/ftm.yml +2 -2
- package/hooks/ftm-blackboard-enforcer.sh +93 -93
- package/hooks/ftm-discovery-reminder.sh +90 -90
- package/hooks/ftm-drafts-gate.sh +61 -61
- package/hooks/ftm-event-logger.mjs +107 -107
- package/hooks/ftm-map-autodetect.sh +79 -79
- package/hooks/ftm-pending-sync-check.sh +22 -22
- package/hooks/ftm-plan-gate.sh +92 -92
- package/hooks/ftm-post-commit-trigger.sh +57 -57
- package/hooks/settings-template.json +81 -81
- package/install.sh +363 -363
- package/package.json +84 -84
- package/uninstall.sh +25 -25
package/ftm-brainstorm/SKILL.md
CHANGED
|
@@ -1,498 +1,498 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ftm-brainstorm
|
|
3
|
-
description: Research-powered Socratic brainstorming that dispatches parallel agents to search the web and GitHub for real-world patterns, then synthesizes findings into actionable suggestions with citations. Use this skill whenever the user wants to brainstorm, explore ideas, think through a feature, plan a project, or flesh out a concept before building. Also triggers when the user pastes a large block of text (notes, prior brainstorm, meeting transcript, spec draft, stream-of-consciousness dump) and wants to turn it into something buildable — phrases like "help me build this", "turn this into a plan", "here's what I've been thinking", or just a big paste followed by "what do you think?" or "go". Triggers on "brainstorm", "help me think through", "I have an idea for", "how should I approach", "let's explore", "what if we built", "I'm thinking about", "help me figure out", or any conversation where the user has a concept they want to develop before writing code. Even vague ideas like "I want to build something that..." or "what's the best way to..." should trigger this skill.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Events
|
|
7
|
-
|
|
8
|
-
### Emits
|
|
9
|
-
- `plan_generated` — when Phase 3 completes and plan is saved
|
|
10
|
-
- Payload: `{ plan_path, plan_title, task_count, wave_count }`
|
|
11
|
-
- `task_completed` — when the full brainstorm-to-plan cycle finishes
|
|
12
|
-
- Payload: `{ task_title, plan_path, duration_ms }`
|
|
13
|
-
|
|
14
|
-
### Listens To
|
|
15
|
-
- `task_received` — begin ideation when ftm-mind routes an incoming task for exploration
|
|
16
|
-
- Expected payload: `{ task_description, plan_path, wave_number, task_number }`
|
|
17
|
-
- `research_complete` — consume structured findings from ftm-researcher for the current research sprint
|
|
18
|
-
- Expected payload: `{ query, mode, findings_count, consensus_count, contested_count, unique_count, sources_count, council_used, duration_ms }`
|
|
19
|
-
|
|
20
|
-
## Config Read
|
|
21
|
-
|
|
22
|
-
Before dispatching any agents, read `~/.claude/ftm-config.yml`:
|
|
23
|
-
- Use the `planning` model from the active profile for all research agents
|
|
24
|
-
- Example: if profile is `balanced`, agents get `model: opus`
|
|
25
|
-
- If config missing, use session default
|
|
26
|
-
|
|
27
|
-
## Blackboard Read
|
|
28
|
-
|
|
29
|
-
Before starting, load context from the blackboard:
|
|
30
|
-
1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
|
|
31
|
-
2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter by task_type "feature"/"investigation"
|
|
32
|
-
3. Load top 3-5 matching experience files for past brainstorm lessons
|
|
33
|
-
4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check execution_patterns and user_behavior
|
|
34
|
-
|
|
35
|
-
If missing or empty, proceed without.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Research Sprint Dispatch
|
|
39
|
-
|
|
40
|
-
Each research sprint invokes ftm-researcher rather than dispatching agents directly.
|
|
41
|
-
|
|
42
|
-
Interface:
|
|
43
|
-
- Pass: { research_question: [derived from current turn], context_register: [all prior findings], depth_mode: [based on turn number] }
|
|
44
|
-
- Receive: { findings, disagreement_map, confidence_scores }
|
|
45
|
-
|
|
46
|
-
Depth mode mapping:
|
|
47
|
-
- Turns 1-2 (BROAD): ftm-researcher quick mode (3 finders)
|
|
48
|
-
- Turns 3-5 (FOCUSED): ftm-researcher standard mode (7 finders + reconciler)
|
|
49
|
-
- Turns 6+ (IMPLEMENTATION): ftm-researcher deep mode (full pipeline with council)
|
|
50
|
-
|
|
51
|
-
The brainstorm skill consumes the researcher's structured output and weaves it into:
|
|
52
|
-
- 3-5 numbered suggestions with evidence and source URLs
|
|
53
|
-
- A recommended option with rationale
|
|
54
|
-
- Challenges based on contested claims from the disagreement map
|
|
55
|
-
- Targeted questions based on research gaps
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
# THE CORE LOOP
|
|
61
|
-
|
|
62
|
-
This skill is a **multi-turn research conversation**. Every single turn after the first follows the same cycle. There are no shortcuts, no collapsing turns, no "let me just generate the plan now."
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
EVERY TURN (after initial intake):
|
|
66
|
-
1. RESEARCH SPRINT — 3 agents search in parallel from different vectors
|
|
67
|
-
2. SYNTHESIZE — merge findings into suggestions with evidence
|
|
68
|
-
3. CHALLENGE — observations that push back on assumptions (NOT questions)
|
|
69
|
-
4. ASK VIA UI — use AskUserQuestion tool (1-4 questions, clickable options)
|
|
70
|
-
5. >>> STOP <<< — wait for the user. Do NOT continue.
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
The research sprints get progressively deeper. The questions get progressively sharper. Each cycle builds on everything before it. The goal is to extract the user's complete vision AND ground it in real-world evidence before generating any plan.
|
|
74
|
-
|
|
75
|
-
**Use `AskUserQuestion` for all questions.** This gives the user a clickable selection UI instead of making them type answers. Format every question with 2-4 labeled options, each with a short description of the trade-off. The user clicks their choice (or picks "Other" to type a custom answer). This is faster, less friction, and prevents answers from getting lost.
|
|
76
|
-
|
|
77
|
-
**Batching rules:** `AskUserQuestion` supports 1-4 questions per call. Use this intelligently:
|
|
78
|
-
- **Batch independent questions together** (up to 4) when the answer to one doesn't affect the options for another. Example: "Output format?" and "Config file approach?" are independent — batch them.
|
|
79
|
-
- **Ask sequentially** when answers are dependent — if the answer to question 1 changes what you'd ask for question 2, don't batch them. Ask question 1 first, process the answer, then ask question 2 on the next turn.
|
|
80
|
-
- **After each batch, run a research sprint** before asking the next batch. The answers may open new research directions.
|
|
81
|
-
|
|
82
|
-
**Use previews for concrete comparisons.** When options involve code patterns, file structures, or architectural layouts, use the `preview` field to show the user what each option looks like. Example: showing a flat transcript format vs a timestamped JSON format side by side.
|
|
83
|
-
|
|
84
|
-
**Use `multiSelect: true`** when choices aren't mutually exclusive. Example: "Which meeting apps should we support?" — the user might want both Zoom and Meet.
|
|
85
|
-
|
|
86
|
-
**Track what's been answered.** Before asking anything, check your context register. If the user already addressed a topic (even as an aside in a longer message), mark it answered and move on. Never re-ask something the user has already addressed, even if they answered it in a different format than you expected.
|
|
87
|
-
|
|
88
|
-
**You maintain a CONTEXT REGISTER** — a running mental document of everything learned so far. Every research sprint receives this register so agents don't re-search old ground. After each turn, append what you learned.
|
|
89
|
-
|
|
90
|
-
**Research depth escalates automatically:**
|
|
91
|
-
- **Turns 1-2: BROAD** — map the landscape, major approaches, who's done this
|
|
92
|
-
- **Turns 3-5: FOCUSED** — drill into the user's chosen direction, real trade-offs, failure modes
|
|
93
|
-
- **Turns 6+: IMPLEMENTATION** — concrete libraries, code patterns, integration specifics
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
# PHASE 0: REPO SCAN (automatic, silent)
|
|
98
|
-
|
|
99
|
-
Run this in the background before your first response. Do not ask.
|
|
100
|
-
|
|
101
|
-
Spawn an **Explore** agent (subagent_type: Explore):
|
|
102
|
-
```
|
|
103
|
-
Analyze the current repository: project type, tech stack, architecture,
|
|
104
|
-
patterns in use, existing infrastructure, scale indicators.
|
|
105
|
-
Focus on what's relevant for proposing new features or architectural changes.
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Store as your project context. Reference throughout all phases. If not in a git repo, skip and ask about stack during intake.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
# PHASE 1: INTAKE
|
|
113
|
-
|
|
114
|
-
Detect which path you're on:
|
|
115
|
-
|
|
116
|
-
## Path A: Fresh Idea (short/vague message)
|
|
117
|
-
|
|
118
|
-
**Turn 1 ONLY:** Ask ONE question to understand the core idea — the single most important unknown. If the opening message covers basics (what, who, problem), skip to the first research sprint.
|
|
119
|
-
|
|
120
|
-
**>>> STOP. Wait for response. <<<**
|
|
121
|
-
|
|
122
|
-
**Turn 2:** Take the user's answer. NOW run your first research sprint (3 agents, BROAD depth — see below). Synthesize, challenge (observations only), then ask ONE question — the single most important decision point that research surfaced. Frame it with specific options from the research.
|
|
123
|
-
|
|
124
|
-
**>>> STOP. Wait for response. <<<**
|
|
125
|
-
|
|
126
|
-
**Turn 3+:** You're now in the core loop. Every turn from here follows the cycle: research sprint -> synthesize -> challenge (observations) -> ask ONE question -> STOP.
|
|
127
|
-
|
|
128
|
-
## Path B: Brain Dump (large paste, notes, transcript)
|
|
129
|
-
|
|
130
|
-
**Turn 1:** Parse the entire paste. Extract: decisions already made, open questions, assumptions to validate, contradictions, gaps. Present structured summary. Then ask ONE confirmation question — the single biggest gap or ambiguity. Do NOT ask basic questions already answered in the paste. Do NOT list all open questions — pick the most critical one.
|
|
131
|
-
|
|
132
|
-
**>>> STOP. Wait for confirmation. <<<**
|
|
133
|
-
|
|
134
|
-
**Turn 2:** Take the confirmation. Run first research sprint in BRAIN DUMP MODE (agents search for each specific architectural claim from the paste). Present novelty map. Synthesize, challenge (observations only), then ask ONE question about the most important decision point the research surfaced.
|
|
135
|
-
|
|
136
|
-
**>>> STOP. Wait for response. <<<**
|
|
137
|
-
|
|
138
|
-
**Turn 3+:** Core loop continues. One question per turn.
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
# DISCUSS MODE
|
|
146
|
-
|
|
147
|
-
When the user provides a clear, specific spec or feature description (not a vague idea), skip broad research and go straight to targeted analysis.
|
|
148
|
-
|
|
149
|
-
## Detection
|
|
150
|
-
|
|
151
|
-
Discuss mode activates when:
|
|
152
|
-
- The user's input is 200+ words with specific technical details
|
|
153
|
-
- The user says "I know what I want to build" or "here's my spec" or "discuss this"
|
|
154
|
-
- The input contains file paths, function names, or architecture details
|
|
155
|
-
- The user explicitly requests "discuss" rather than "brainstorm"
|
|
156
|
-
|
|
157
|
-
## Flow
|
|
158
|
-
|
|
159
|
-
Instead of the standard brainstorm research -> synthesis -> suggestions flow:
|
|
160
|
-
|
|
161
|
-
1. **Parse the spec** — Extract: what's being built, key components, tech stack, constraints
|
|
162
|
-
2. **Identify gray areas** — Find the parts that aren't specified:
|
|
163
|
-
- Edge cases not mentioned
|
|
164
|
-
- Error handling not specified
|
|
165
|
-
- Performance implications not considered
|
|
166
|
-
- Security concerns not addressed
|
|
167
|
-
- Integration points not defined
|
|
168
|
-
3. **Ask targeted questions** — Present 3-5 specific questions about the gray areas:
|
|
169
|
-
```
|
|
170
|
-
Your spec is clear on [X, Y, Z]. A few gray areas to nail down:
|
|
171
|
-
|
|
172
|
-
1. [Edge case question] — e.g., "What happens when the user submits while offline?"
|
|
173
|
-
2. [Error handling question] — e.g., "Should failed API calls retry or show an error?"
|
|
174
|
-
3. [Performance question] — e.g., "Expected data volume? 100 items or 100K?"
|
|
175
|
-
4. [Security question] — e.g., "Who should have access to this endpoint?"
|
|
176
|
-
5. [Integration question] — e.g., "Does this need to sync with the existing auth system?"
|
|
177
|
-
```
|
|
178
|
-
4. **Refine based on answers** — Each answer narrows the spec. After 2-3 rounds of Q&A, the spec should be implementation-ready.
|
|
179
|
-
5. **Output: implementation-ready spec** — Not a brainstorm document, but a tight spec that can feed directly into plan generation.
|
|
180
|
-
|
|
181
|
-
## Gray Area Categories by Feature Type
|
|
182
|
-
|
|
183
|
-
| Feature Type | Common Gray Areas |
|
|
184
|
-
|---|---|
|
|
185
|
-
| API endpoint | Auth, rate limiting, pagination, error codes, versioning |
|
|
186
|
-
| UI component | Loading states, empty states, error states, accessibility, responsive |
|
|
187
|
-
| Data pipeline | Failure modes, retry logic, idempotency, monitoring, backpressure |
|
|
188
|
-
| Integration | Auth flow, webhook handling, rate limits, data mapping, error recovery |
|
|
189
|
-
| Config change | Rollback plan, feature flags, gradual rollout, monitoring |
|
|
190
|
-
|
|
191
|
-
# PHASE 2: RESEARCH + CHALLENGE LOOP
|
|
192
|
-
|
|
193
|
-
This is the heart of the skill. Unlimited turns. Each one follows the cycle.
|
|
194
|
-
|
|
195
|
-
## Step 1: Dispatch Research Sprint
|
|
196
|
-
|
|
197
|
-
Every turn, read `references/agent-prompts.md` and spawn **3 parallel agents** (subagent_type: general-purpose, model: from ftm-config `planning` profile). Each agent gets:
|
|
198
|
-
|
|
199
|
-
1. **Project context** from Phase 0
|
|
200
|
-
2. **Full context register** — everything learned across ALL prior turns
|
|
201
|
-
3. **Research depth level** for this turn (broad/focused/implementation)
|
|
202
|
-
4. **Previous findings summary** so they don't re-search
|
|
203
|
-
5. **This turn's specific research question** — derived from what the user just said
|
|
204
|
-
6. **Brain dump claims** if Path B
|
|
205
|
-
|
|
206
|
-
The 3 agents search from different vectors:
|
|
207
|
-
- **Web Researcher** — blog posts, case studies, architectural write-ups
|
|
208
|
-
- **GitHub Explorer** — repos, code patterns, open-source implementations
|
|
209
|
-
- **Competitive Analyst** — products, tools, market gaps, user complaints
|
|
210
|
-
|
|
211
|
-
Each turn's research question should be DIFFERENT from the last. The user's response reveals new angles, constraints, or decisions — use those to formulate new, more specific search queries. If the user chose approach A over B, this turn's research digs into A's implementation details, not the broad landscape again.
|
|
212
|
-
|
|
213
|
-
## Step 2: Synthesize into 3-5 Suggestions
|
|
214
|
-
|
|
215
|
-
Once agents return, merge findings into **3-5 numbered suggestions**. Lead with your recommendation.
|
|
216
|
-
|
|
217
|
-
Each suggestion needs:
|
|
218
|
-
1. **The suggestion** — concrete and actionable
|
|
219
|
-
2. **Real-world evidence** — which search results back this up, with URLs
|
|
220
|
-
3. **Why this matters** — specific advantage for this project
|
|
221
|
-
4. **Trade-off** — what you give up
|
|
222
|
-
|
|
223
|
-
Label suggestion #1 as **RECOMMENDED** with a "Why I'd pick this" rationale.
|
|
224
|
-
|
|
225
|
-
If research was thin, present fewer suggestions. Quality over quantity. If all 3 agents returned weak results, be honest: "Research didn't surface strong prior art — this might be genuinely novel, or we should reframe the search."
|
|
226
|
-
|
|
227
|
-
**Brain dump mode:** Present a **Novelty Map** table before suggestions:
|
|
228
|
-
|
|
229
|
-
| Brain Dump Claim | Verdict | Evidence |
|
|
230
|
-
|---|---|---|
|
|
231
|
-
| [claim] | Solved / Partially Solved / Novel | [link or explanation] |
|
|
232
|
-
|
|
233
|
-
## Step 3: Challenge (Observations, NOT Questions)
|
|
234
|
-
|
|
235
|
-
After suggestions, share 2-3 observations that challenge or refine the user's thinking. These are STATEMENTS, not questions. The user can respond to them if they want, but they don't create answer obligations.
|
|
236
|
-
|
|
237
|
-
Good challenge formats (declarative):
|
|
238
|
-
- **"Worth noting that..."** — surface a pattern they may not know about
|
|
239
|
-
- **"At scale, X typically becomes a bottleneck because..."** — flag edge cases
|
|
240
|
-
- **"The evidence suggests X contradicts the assumption about Y..."** — when research contradicts something
|
|
241
|
-
- **"Successful implementations of this (e.g., [product]) launched with only..."** — YAGNI signal
|
|
242
|
-
- **"Users of [product] reported frustration with..."** — inject real feedback
|
|
243
|
-
|
|
244
|
-
Bad challenge formats (these are disguised questions — do NOT use):
|
|
245
|
-
- ~~"Have you considered..."~~ — this demands a yes/no answer
|
|
246
|
-
- ~~"What happens when..."~~ — this demands the user think through a scenario
|
|
247
|
-
- ~~"How would you handle..."~~ — this is just a question with extra steps
|
|
248
|
-
|
|
249
|
-
**YAGNI instinct:** Actively look for scope to cut. If research shows successful products launched with less, state it as an observation.
|
|
250
|
-
|
|
251
|
-
## Step 4: Ask Questions via AskUserQuestion
|
|
252
|
-
|
|
253
|
-
Use the `AskUserQuestion` tool for every question. Never just type a question in chat — always use the tool so the user gets the clickable selection UI.
|
|
254
|
-
|
|
255
|
-
**Maintain a question queue internally.** Prioritize by:
|
|
256
|
-
1. Which question unlocks the most downstream decisions (answering it resolves or narrows others)
|
|
257
|
-
2. Which requires the user's judgment (can't be answered by more research)
|
|
258
|
-
3. Which has the highest impact on the architecture
|
|
259
|
-
|
|
260
|
-
**Batch independent questions (up to 4 per call).** Review your queue — if the top 2-3 questions don't depend on each other's answers, send them in a single `AskUserQuestion` call. The user clicks through them quickly in the UI. If answers ARE dependent, send only the blocking question and save the rest.
|
|
261
|
-
|
|
262
|
-
**Format each question well:**
|
|
263
|
-
- `header`: Short tag, max 12 chars (e.g., "Output", "Trigger", "Auth")
|
|
264
|
-
- `options`: 2-4 choices, each with a clear `label` (1-5 words) and `description` (trade-off explanation)
|
|
265
|
-
- Put your recommended option first with "(Recommended)" in the label
|
|
266
|
-
- `multiSelect: true` when choices aren't exclusive
|
|
267
|
-
- `preview` for code/config/layout comparisons
|
|
268
|
-
|
|
269
|
-
**Example AskUserQuestion call:**
|
|
270
|
-
```json
|
|
271
|
-
{
|
|
272
|
-
"questions": [
|
|
273
|
-
{
|
|
274
|
-
"question": "How should recordings be triggered?",
|
|
275
|
-
"header": "Trigger",
|
|
276
|
-
"multiSelect": true,
|
|
277
|
-
"options": [
|
|
278
|
-
{"label": "Manual CLI (Recommended)", "description": "Simple start/stop command. Fastest to build, most reliable."},
|
|
279
|
-
{"label": "Process detection", "description": "Auto-detect when Zoom/Meet launches. More complex but hands-free."},
|
|
280
|
-
{"label": "Calendar-aware", "description": "Watch your calendar and auto-start at meeting time. Requires calendar API integration."}
|
|
281
|
-
]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"question": "What output format for transcripts?",
|
|
285
|
-
"header": "Output",
|
|
286
|
-
"multiSelect": false,
|
|
287
|
-
"options": [
|
|
288
|
-
{"label": "Markdown (Recommended)", "description": "Human-readable .md files with meeting metadata header."},
|
|
289
|
-
{"label": "Plain text", "description": "Simple .txt, no formatting overhead."},
|
|
290
|
-
{"label": "JSON with timestamps", "description": "Structured data with word-level timing. Good for building on top of."}
|
|
291
|
-
]
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
|
-
}
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
Some questions will become unnecessary as earlier answers clarify things — drop them from the queue when that happens.
|
|
298
|
-
|
|
299
|
-
**When your initial question queue runs dry, DO NOT suggest wrapping up.** Instead, run a fresh research sprint using EVERYTHING you've learned so far. This sprint should go deeper than any previous one because now you have the user's full picture. The research will surface new unknowns, edge cases, failure modes, and implementation details that generate NEW questions. Present the findings with new suggestions and observations, then ask ONE question from the new unknowns the research surfaced. The loop keeps going — research always generates more questions if you dig deep enough.
|
|
300
|
-
|
|
301
|
-
**Research-driven question generation:** After each research sprint, actively mine the findings for questions the user hasn't considered yet. Examples: "The research surfaced that CoreAudio Taps require re-granting permissions weekly on Sonoma — how do you want to handle that UX?" or "Three of the repos I found use a daemon model instead of start/stop — worth considering?" The best brainstorms surface things the user didn't know to ask about. If your research isn't generating new questions, your research queries aren't specific enough — reformulate and go deeper.
|
|
302
|
-
|
|
303
|
-
**After your question, signal what's next.** Something like: "Answer this and I'll dig into [next topic area]." Do NOT offer to move to planning — let the user tell you when they're ready. The user should never feel like the brainstorm is wrapping up unless THEY decide it is.
|
|
304
|
-
|
|
305
|
-
## Step 5: STOP
|
|
306
|
-
|
|
307
|
-
**>>> STOP. Do NOT continue to the next turn. Wait for the user. <<<**
|
|
308
|
-
|
|
309
|
-
This is non-negotiable. The user's response is the input for the next research sprint. Without it, the next sprint has nothing new to search for.
|
|
310
|
-
|
|
311
|
-
---
|
|
312
|
-
|
|
313
|
-
## Feature-Type Detection
|
|
314
|
-
|
|
315
|
-
When you learn enough to classify the feature, use the type-specific questions below to inform your internal question queue. Pick the single most impactful unknown from the relevant type as your ONE question for that turn.
|
|
316
|
-
|
|
317
|
-
| Type | Signals | Key Questions |
|
|
318
|
-
|---|---|---|
|
|
319
|
-
| UI/Frontend | "page", "component", "dashboard" | Layout density? Responsive approach? Loading/empty/error states? |
|
|
320
|
-
| API/Backend | "endpoint", "API", "service" | REST vs GraphQL? Auth mechanism? Pagination strategy? |
|
|
321
|
-
| Data/Storage | "database", "store", "persist" | SQL vs NoSQL? Read/write ratio? Consistency requirements? |
|
|
322
|
-
| Integration | "connect to", "sync with" | Push/pull/both? Real-time or batch? Retry handling? |
|
|
323
|
-
| Automation | "automate", "trigger", "schedule" | Trigger mechanism? Failure notification? Idempotency? |
|
|
324
|
-
| CLI Tool | "command", "CLI", "terminal" | Interactive or not? Output format? Config file approach? Installation/distribution method? Dependency management? Update strategy? Shell completions? Daemon vs one-shot? Error recovery (what happens mid-recording if crash)? Config file vs flags vs env vars? Logging/verbosity levels? |
|
|
325
|
-
| AI/ML | "AI", "model", "generate", "LLM" | Which model? Latency tolerance? Fallback? Cost ceiling? |
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## When to Suggest Phase 3
|
|
330
|
-
|
|
331
|
-
**Depth is dynamic, not counted.** Don't track a minimum question number. Instead, measure whether your research is still producing new, useful information. The brainstorm is deep enough when research sprints stop surfacing unknowns — not when you've hit some arbitrary question count. A simple CLI wrapper might genuinely need 3-4 questions. A distributed system with multiple integration points might need 15. Let the research tell you.
|
|
332
|
-
|
|
333
|
-
**How to judge depth: the "new information" test.** After each research sprint, ask yourself: did this sprint surface anything the user hasn't already addressed or that I couldn't have inferred from prior answers? If yes, there's more to explore — formulate a question from the new finding. If two consecutive sprints return the same repos, same patterns, and no new unknowns, the research is saturated for this idea.
|
|
334
|
-
|
|
335
|
-
**The key behavior change: when your question queue empties, don't offer to wrap up — run another research sprint first.** The sprint might surface new angles (failure modes, deployment concerns, maintenance patterns, edge cases from similar projects) that generate fresh questions. Only when the sprint comes back dry should you consider the brainstorm naturally complete.
|
|
336
|
-
|
|
337
|
-
**Never proactively suggest Phase 3.** Don't say "Ready to turn this into an implementation plan?" or "Want to move to planning?" or any variation. Instead, when research is genuinely saturated, just ask your next research-driven question. If there truly isn't one, present your latest findings and observations — the user will tell you when they're ready to move on. The user controls the pace, not you.
|
|
338
|
-
|
|
339
|
-
**The one exception:** If research has been genuinely dry across 2+ consecutive sprints AND you have no new questions, you may say something like: "I've dug into [X, Y, Z areas] and the research is converging — happy to keep exploring if there's anything else on your mind, or we can shape this up." This is a status update, not a push. Say it once. If the user asks anything, go back to the research loop.
|
|
340
|
-
|
|
341
|
-
**Before Phase 3, scan your context register.** Every question you've asked should have an answer recorded. If any are unanswered, ask them ONE AT A TIME in subsequent turns before Phase 3. Do NOT re-ask questions the user already answered — even if their answer was embedded in a longer message or phrased differently than expected.
|
|
342
|
-
|
|
343
|
-
**HARD GATE: The user must explicitly say they're ready.** When they do, present a brief summary:
|
|
344
|
-
|
|
345
|
-
```
|
|
346
|
-
Here's what I think we've landed on:
|
|
347
|
-
|
|
348
|
-
**Building:** [one sentence]
|
|
349
|
-
**Core approach:** [recommended architecture/pattern]
|
|
350
|
-
**Key decisions:** [2-3 bullets]
|
|
351
|
-
**Scope for v1:** [what's in, what's deferred]
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
Then proceed to Phase 3. If they raise corrections, address them before proceeding.
|
|
355
|
-
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
# PHASE 3: PLAN GENERATION
|
|
359
|
-
|
|
360
|
-
Read `references/plan-template.md` for the full template and rules. Present the plan incrementally (vision -> tasks -> agents/waves), getting approval at each step.
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
## Relationship to superpowers:brainstorming
|
|
365
|
-
|
|
366
|
-
- **ftm-brainstorm** (this): Idea exploration with live research. User is figuring out WHAT to build.
|
|
367
|
-
- **superpowers:brainstorming**: Design/spec work. User knows what they're building, needs HOW.
|
|
368
|
-
|
|
369
|
-
If user already completed superpowers:brainstorming, point to ftm-executor instead. If user explicitly invokes this skill, always run it.
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
## Context Compression
|
|
375
|
-
|
|
376
|
-
After turn 5 in a brainstorm session, earlier turns start consuming significant context. Apply compression to maintain quality in later turns.
|
|
377
|
-
|
|
378
|
-
### Trigger
|
|
379
|
-
|
|
380
|
-
- Turns 1-5: No compression. Full fidelity.
|
|
381
|
-
- Turn 6+: Compress turns 1 through (current - 3). Keep the 3 most recent turns at full fidelity.
|
|
382
|
-
|
|
383
|
-
### Compression Strategy
|
|
384
|
-
|
|
385
|
-
For each compressed turn, replace the full content with a summary:
|
|
386
|
-
|
|
387
|
-
```
|
|
388
|
-
[Turn N summary]
|
|
389
|
-
- Topic: [what was discussed]
|
|
390
|
-
- Key decisions: [bullet list of decisions made]
|
|
391
|
-
- Open questions resolved: [what was answered]
|
|
392
|
-
- Artifacts produced: [any specs, diagrams, code snippets referenced]
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
### What to Preserve in Summaries
|
|
396
|
-
|
|
397
|
-
- Decisions and their rationale (WHY something was decided)
|
|
398
|
-
- Constraints discovered
|
|
399
|
-
- Requirements confirmed by the user
|
|
400
|
-
- Technical choices made
|
|
401
|
-
|
|
402
|
-
### What to Drop
|
|
403
|
-
|
|
404
|
-
- Exploratory tangents that were abandoned
|
|
405
|
-
- Research citations already synthesized
|
|
406
|
-
- Verbose explanations of options not chosen
|
|
407
|
-
- Repeated context that's already captured in later turns
|
|
408
|
-
|
|
409
|
-
### Implementation
|
|
410
|
-
|
|
411
|
-
This is implemented at the skill level, not via hooks. When presenting a response at turn 6+:
|
|
412
|
-
1. Mentally compress old turns using the strategy above
|
|
413
|
-
2. Reference compressed summaries when needed
|
|
414
|
-
3. Keep recent turns verbatim for conversational continuity
|
|
415
|
-
4. If the user references something from a compressed turn, expand it on demand
|
|
416
|
-
|
|
417
|
-
---
|
|
418
|
-
|
|
419
|
-
## Session State (for ftm-pause/resume)
|
|
420
|
-
|
|
421
|
-
When paused, the following state must be capturable so ftm-resume can pick up exactly where you left off:
|
|
422
|
-
|
|
423
|
-
- **Phase tracking**: current phase (0/1/2/3), path (A/B), turn number, research depth level
|
|
424
|
-
- **Phase 0**: full repo scan results (or "skipped — no git repo")
|
|
425
|
-
- **Phase 1**: original idea (verbatim), brain dump extraction if Path B, all user answers per round
|
|
426
|
-
- **Phase 2**: every completed turn's suggestions with evidence/URLs, every challenge and response, every question and answer, accumulated decisions, the current direction, context register contents
|
|
427
|
-
- **Phase 3**: which sections presented/approved, plan content so far, plan file path if saved
|
|
428
|
-
|
|
429
|
-
This state is what ftm-pause captures and ftm-resume restores. Keep it current as you go.
|
|
430
|
-
|
|
431
|
-
## Blackboard Write
|
|
432
|
-
|
|
433
|
-
After completing, update:
|
|
434
|
-
1. `~/.claude/ftm-state/blackboard/context.json`:
|
|
435
|
-
- Set current_task status to "complete"
|
|
436
|
-
- Append decision summary to recent_decisions (cap at 10)
|
|
437
|
-
- Update session_metadata.skills_invoked and last_updated
|
|
438
|
-
2. Write experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json`:
|
|
439
|
-
- task_type: "feature" or "investigation"
|
|
440
|
-
- feature_type: detected type (UI, API, etc.)
|
|
441
|
-
- architectural_direction: the approach chosen
|
|
442
|
-
- research_quality: how useful the research sprints were (high/medium/low)
|
|
443
|
-
- turns_to_resolution: how many Phase 2 turns before Phase 3
|
|
444
|
-
- tags: keywords for future matching
|
|
445
|
-
3. Update `experiences/index.json` with the new entry
|
|
446
|
-
4. Emit `plan_generated` with `{ plan_path, plan_title, task_count, wave_count }` (if Phase 3 completed)
|
|
447
|
-
5. Emit `task_completed` with `{ task_title, plan_path, duration_ms }`
|
|
448
|
-
|
|
449
|
-
## Requirements
|
|
450
|
-
|
|
451
|
-
- config: `~/.claude/ftm-config.yml` | optional | model profile for planning agents
|
|
452
|
-
- reference: `references/agent-prompts.md` | required | research agent prompt templates
|
|
453
|
-
- reference: `references/plan-template.md` | required | plan document generation template
|
|
454
|
-
- reference: `~/.claude/ftm-state/blackboard/context.json` | optional | session state and active constraints
|
|
455
|
-
- reference: `~/.claude/ftm-state/blackboard/experiences/index.json` | optional | past brainstorm lessons
|
|
456
|
-
- reference: `~/.claude/ftm-state/blackboard/patterns.json` | optional | execution and user behavior patterns
|
|
457
|
-
|
|
458
|
-
## Risk
|
|
459
|
-
|
|
460
|
-
- level: low_write
|
|
461
|
-
- scope: writes plan documents to ~/.claude/plans/; writes blackboard context and experience files; does not modify project source code
|
|
462
|
-
- rollback: delete generated plan file; blackboard writes can be reverted by editing JSON files
|
|
463
|
-
|
|
464
|
-
## Approval Gates
|
|
465
|
-
|
|
466
|
-
- trigger: Phase 3 plan generation ready | action: present "Here's what I think we've landed on" summary and wait for explicit user approval before generating plan
|
|
467
|
-
- trigger: plan document generated | action: present plan incrementally (vision → tasks → agents/waves) and get approval at each step
|
|
468
|
-
- trigger: research returns thin results on all agents | action: note research gaps, present fewer suggestions, do not fabricate citations
|
|
469
|
-
- complexity_routing: micro → auto | small → auto | medium → plan_first | large → plan_first | xl → always_ask
|
|
470
|
-
|
|
471
|
-
## Fallbacks
|
|
472
|
-
|
|
473
|
-
- condition: ftm-researcher not available | action: dispatch 3 direct parallel research agents (web/github/competitive) using built-in prompts from references/agent-prompts.md
|
|
474
|
-
- condition: no git repo detected in Phase 0 | action: skip repo scan, ask about tech stack during intake
|
|
475
|
-
- condition: blackboard missing or empty | action: proceed without experience-informed shortcuts, rely on direct analysis
|
|
476
|
-
- condition: ftm-config.yml missing | action: use session default model for all agents
|
|
477
|
-
|
|
478
|
-
## Capabilities
|
|
479
|
-
|
|
480
|
-
- mcp: `WebSearch` | optional | web research agents use for blog posts and case studies
|
|
481
|
-
- mcp: `WebFetch` | optional | GitHub exploration and competitive analysis
|
|
482
|
-
- mcp: `sequential-thinking` | optional | complex trade-off analysis during synthesis
|
|
483
|
-
- env: none required
|
|
484
|
-
|
|
485
|
-
## Event Payloads
|
|
486
|
-
|
|
487
|
-
### plan_generated
|
|
488
|
-
- skill: string — "ftm-brainstorm"
|
|
489
|
-
- plan_path: string — absolute path to generated plan file
|
|
490
|
-
- plan_title: string — human-readable plan title
|
|
491
|
-
- task_count: number — total tasks in the plan
|
|
492
|
-
- wave_count: number — number of parallel execution waves
|
|
493
|
-
|
|
494
|
-
### task_completed
|
|
495
|
-
- skill: string — "ftm-brainstorm"
|
|
496
|
-
- task_title: string — title of the brainstorm topic
|
|
497
|
-
- plan_path: string | null — path to generated plan if Phase 3 completed
|
|
498
|
-
- duration_ms: number — total session duration
|
|
1
|
+
---
|
|
2
|
+
name: ftm-brainstorm
|
|
3
|
+
description: Research-powered Socratic brainstorming that dispatches parallel agents to search the web and GitHub for real-world patterns, then synthesizes findings into actionable suggestions with citations. Use this skill whenever the user wants to brainstorm, explore ideas, think through a feature, plan a project, or flesh out a concept before building. Also triggers when the user pastes a large block of text (notes, prior brainstorm, meeting transcript, spec draft, stream-of-consciousness dump) and wants to turn it into something buildable — phrases like "help me build this", "turn this into a plan", "here's what I've been thinking", or just a big paste followed by "what do you think?" or "go". Triggers on "brainstorm", "help me think through", "I have an idea for", "how should I approach", "let's explore", "what if we built", "I'm thinking about", "help me figure out", or any conversation where the user has a concept they want to develop before writing code. Even vague ideas like "I want to build something that..." or "what's the best way to..." should trigger this skill.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Events
|
|
7
|
+
|
|
8
|
+
### Emits
|
|
9
|
+
- `plan_generated` — when Phase 3 completes and plan is saved
|
|
10
|
+
- Payload: `{ plan_path, plan_title, task_count, wave_count }`
|
|
11
|
+
- `task_completed` — when the full brainstorm-to-plan cycle finishes
|
|
12
|
+
- Payload: `{ task_title, plan_path, duration_ms }`
|
|
13
|
+
|
|
14
|
+
### Listens To
|
|
15
|
+
- `task_received` — begin ideation when ftm-mind routes an incoming task for exploration
|
|
16
|
+
- Expected payload: `{ task_description, plan_path, wave_number, task_number }`
|
|
17
|
+
- `research_complete` — consume structured findings from ftm-researcher for the current research sprint
|
|
18
|
+
- Expected payload: `{ query, mode, findings_count, consensus_count, contested_count, unique_count, sources_count, council_used, duration_ms }`
|
|
19
|
+
|
|
20
|
+
## Config Read
|
|
21
|
+
|
|
22
|
+
Before dispatching any agents, read `~/.claude/ftm-config.yml`:
|
|
23
|
+
- Use the `planning` model from the active profile for all research agents
|
|
24
|
+
- Example: if profile is `balanced`, agents get `model: opus`
|
|
25
|
+
- If config missing, use session default
|
|
26
|
+
|
|
27
|
+
## Blackboard Read
|
|
28
|
+
|
|
29
|
+
Before starting, load context from the blackboard:
|
|
30
|
+
1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
|
|
31
|
+
2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter by task_type "feature"/"investigation"
|
|
32
|
+
3. Load top 3-5 matching experience files for past brainstorm lessons
|
|
33
|
+
4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check execution_patterns and user_behavior
|
|
34
|
+
|
|
35
|
+
If missing or empty, proceed without.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Research Sprint Dispatch
|
|
39
|
+
|
|
40
|
+
Each research sprint invokes ftm-researcher rather than dispatching agents directly.
|
|
41
|
+
|
|
42
|
+
Interface:
|
|
43
|
+
- Pass: { research_question: [derived from current turn], context_register: [all prior findings], depth_mode: [based on turn number] }
|
|
44
|
+
- Receive: { findings, disagreement_map, confidence_scores }
|
|
45
|
+
|
|
46
|
+
Depth mode mapping:
|
|
47
|
+
- Turns 1-2 (BROAD): ftm-researcher quick mode (3 finders)
|
|
48
|
+
- Turns 3-5 (FOCUSED): ftm-researcher standard mode (7 finders + reconciler)
|
|
49
|
+
- Turns 6+ (IMPLEMENTATION): ftm-researcher deep mode (full pipeline with council)
|
|
50
|
+
|
|
51
|
+
The brainstorm skill consumes the researcher's structured output and weaves it into:
|
|
52
|
+
- 3-5 numbered suggestions with evidence and source URLs
|
|
53
|
+
- A recommended option with rationale
|
|
54
|
+
- Challenges based on contested claims from the disagreement map
|
|
55
|
+
- Targeted questions based on research gaps
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
# THE CORE LOOP
|
|
61
|
+
|
|
62
|
+
This skill is a **multi-turn research conversation**. Every single turn after the first follows the same cycle. There are no shortcuts, no collapsing turns, no "let me just generate the plan now."
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
EVERY TURN (after initial intake):
|
|
66
|
+
1. RESEARCH SPRINT — 3 agents search in parallel from different vectors
|
|
67
|
+
2. SYNTHESIZE — merge findings into suggestions with evidence
|
|
68
|
+
3. CHALLENGE — observations that push back on assumptions (NOT questions)
|
|
69
|
+
4. ASK VIA UI — use AskUserQuestion tool (1-4 questions, clickable options)
|
|
70
|
+
5. >>> STOP <<< — wait for the user. Do NOT continue.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The research sprints get progressively deeper. The questions get progressively sharper. Each cycle builds on everything before it. The goal is to extract the user's complete vision AND ground it in real-world evidence before generating any plan.
|
|
74
|
+
|
|
75
|
+
**Use `AskUserQuestion` for all questions.** This gives the user a clickable selection UI instead of making them type answers. Format every question with 2-4 labeled options, each with a short description of the trade-off. The user clicks their choice (or picks "Other" to type a custom answer). This is faster, less friction, and prevents answers from getting lost.
|
|
76
|
+
|
|
77
|
+
**Batching rules:** `AskUserQuestion` supports 1-4 questions per call. Use this intelligently:
|
|
78
|
+
- **Batch independent questions together** (up to 4) when the answer to one doesn't affect the options for another. Example: "Output format?" and "Config file approach?" are independent — batch them.
|
|
79
|
+
- **Ask sequentially** when answers are dependent — if the answer to question 1 changes what you'd ask for question 2, don't batch them. Ask question 1 first, process the answer, then ask question 2 on the next turn.
|
|
80
|
+
- **After each batch, run a research sprint** before asking the next batch. The answers may open new research directions.
|
|
81
|
+
|
|
82
|
+
**Use previews for concrete comparisons.** When options involve code patterns, file structures, or architectural layouts, use the `preview` field to show the user what each option looks like. Example: showing a flat transcript format vs a timestamped JSON format side by side.
|
|
83
|
+
|
|
84
|
+
**Use `multiSelect: true`** when choices aren't mutually exclusive. Example: "Which meeting apps should we support?" — the user might want both Zoom and Meet.
|
|
85
|
+
|
|
86
|
+
**Track what's been answered.** Before asking anything, check your context register. If the user already addressed a topic (even as an aside in a longer message), mark it answered and move on. Never re-ask something the user has already addressed, even if they answered it in a different format than you expected.
|
|
87
|
+
|
|
88
|
+
**You maintain a CONTEXT REGISTER** — a running mental document of everything learned so far. Every research sprint receives this register so agents don't re-search old ground. After each turn, append what you learned.
|
|
89
|
+
|
|
90
|
+
**Research depth escalates automatically:**
|
|
91
|
+
- **Turns 1-2: BROAD** — map the landscape, major approaches, who's done this
|
|
92
|
+
- **Turns 3-5: FOCUSED** — drill into the user's chosen direction, real trade-offs, failure modes
|
|
93
|
+
- **Turns 6+: IMPLEMENTATION** — concrete libraries, code patterns, integration specifics
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
# PHASE 0: REPO SCAN (automatic, silent)
|
|
98
|
+
|
|
99
|
+
Run this in the background before your first response. Do not ask.
|
|
100
|
+
|
|
101
|
+
Spawn an **Explore** agent (subagent_type: Explore):
|
|
102
|
+
```
|
|
103
|
+
Analyze the current repository: project type, tech stack, architecture,
|
|
104
|
+
patterns in use, existing infrastructure, scale indicators.
|
|
105
|
+
Focus on what's relevant for proposing new features or architectural changes.
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Store as your project context. Reference throughout all phases. If not in a git repo, skip and ask about stack during intake.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
# PHASE 1: INTAKE
|
|
113
|
+
|
|
114
|
+
Detect which path you're on:
|
|
115
|
+
|
|
116
|
+
## Path A: Fresh Idea (short/vague message)
|
|
117
|
+
|
|
118
|
+
**Turn 1 ONLY:** Ask ONE question to understand the core idea — the single most important unknown. If the opening message covers basics (what, who, problem), skip to the first research sprint.
|
|
119
|
+
|
|
120
|
+
**>>> STOP. Wait for response. <<<**
|
|
121
|
+
|
|
122
|
+
**Turn 2:** Take the user's answer. NOW run your first research sprint (3 agents, BROAD depth — see below). Synthesize, challenge (observations only), then ask ONE question — the single most important decision point that research surfaced. Frame it with specific options from the research.
|
|
123
|
+
|
|
124
|
+
**>>> STOP. Wait for response. <<<**
|
|
125
|
+
|
|
126
|
+
**Turn 3+:** You're now in the core loop. Every turn from here follows the cycle: research sprint -> synthesize -> challenge (observations) -> ask ONE question -> STOP.
|
|
127
|
+
|
|
128
|
+
## Path B: Brain Dump (large paste, notes, transcript)
|
|
129
|
+
|
|
130
|
+
**Turn 1:** Parse the entire paste. Extract: decisions already made, open questions, assumptions to validate, contradictions, gaps. Present structured summary. Then ask ONE confirmation question — the single biggest gap or ambiguity. Do NOT ask basic questions already answered in the paste. Do NOT list all open questions — pick the most critical one.
|
|
131
|
+
|
|
132
|
+
**>>> STOP. Wait for confirmation. <<<**
|
|
133
|
+
|
|
134
|
+
**Turn 2:** Take the confirmation. Run first research sprint in BRAIN DUMP MODE (agents search for each specific architectural claim from the paste). Present novelty map. Synthesize, challenge (observations only), then ask ONE question about the most important decision point the research surfaced.
|
|
135
|
+
|
|
136
|
+
**>>> STOP. Wait for response. <<<**
|
|
137
|
+
|
|
138
|
+
**Turn 3+:** Core loop continues. One question per turn.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
# DISCUSS MODE
|
|
146
|
+
|
|
147
|
+
When the user provides a clear, specific spec or feature description (not a vague idea), skip broad research and go straight to targeted analysis.
|
|
148
|
+
|
|
149
|
+
## Detection
|
|
150
|
+
|
|
151
|
+
Discuss mode activates when:
|
|
152
|
+
- The user's input is 200+ words with specific technical details
|
|
153
|
+
- The user says "I know what I want to build" or "here's my spec" or "discuss this"
|
|
154
|
+
- The input contains file paths, function names, or architecture details
|
|
155
|
+
- The user explicitly requests "discuss" rather than "brainstorm"
|
|
156
|
+
|
|
157
|
+
## Flow
|
|
158
|
+
|
|
159
|
+
Instead of the standard brainstorm research -> synthesis -> suggestions flow:
|
|
160
|
+
|
|
161
|
+
1. **Parse the spec** — Extract: what's being built, key components, tech stack, constraints
|
|
162
|
+
2. **Identify gray areas** — Find the parts that aren't specified:
|
|
163
|
+
- Edge cases not mentioned
|
|
164
|
+
- Error handling not specified
|
|
165
|
+
- Performance implications not considered
|
|
166
|
+
- Security concerns not addressed
|
|
167
|
+
- Integration points not defined
|
|
168
|
+
3. **Ask targeted questions** — Present 3-5 specific questions about the gray areas:
|
|
169
|
+
```
|
|
170
|
+
Your spec is clear on [X, Y, Z]. A few gray areas to nail down:
|
|
171
|
+
|
|
172
|
+
1. [Edge case question] — e.g., "What happens when the user submits while offline?"
|
|
173
|
+
2. [Error handling question] — e.g., "Should failed API calls retry or show an error?"
|
|
174
|
+
3. [Performance question] — e.g., "Expected data volume? 100 items or 100K?"
|
|
175
|
+
4. [Security question] — e.g., "Who should have access to this endpoint?"
|
|
176
|
+
5. [Integration question] — e.g., "Does this need to sync with the existing auth system?"
|
|
177
|
+
```
|
|
178
|
+
4. **Refine based on answers** — Each answer narrows the spec. After 2-3 rounds of Q&A, the spec should be implementation-ready.
|
|
179
|
+
5. **Output: implementation-ready spec** — Not a brainstorm document, but a tight spec that can feed directly into plan generation.
|
|
180
|
+
|
|
181
|
+
## Gray Area Categories by Feature Type
|
|
182
|
+
|
|
183
|
+
| Feature Type | Common Gray Areas |
|
|
184
|
+
|---|---|
|
|
185
|
+
| API endpoint | Auth, rate limiting, pagination, error codes, versioning |
|
|
186
|
+
| UI component | Loading states, empty states, error states, accessibility, responsive |
|
|
187
|
+
| Data pipeline | Failure modes, retry logic, idempotency, monitoring, backpressure |
|
|
188
|
+
| Integration | Auth flow, webhook handling, rate limits, data mapping, error recovery |
|
|
189
|
+
| Config change | Rollback plan, feature flags, gradual rollout, monitoring |
|
|
190
|
+
|
|
191
|
+
# PHASE 2: RESEARCH + CHALLENGE LOOP
|
|
192
|
+
|
|
193
|
+
This is the heart of the skill. Unlimited turns. Each one follows the cycle.
|
|
194
|
+
|
|
195
|
+
## Step 1: Dispatch Research Sprint
|
|
196
|
+
|
|
197
|
+
Every turn, read `references/agent-prompts.md` and spawn **3 parallel agents** (subagent_type: general-purpose, model: from ftm-config `planning` profile). Each agent gets:
|
|
198
|
+
|
|
199
|
+
1. **Project context** from Phase 0
|
|
200
|
+
2. **Full context register** — everything learned across ALL prior turns
|
|
201
|
+
3. **Research depth level** for this turn (broad/focused/implementation)
|
|
202
|
+
4. **Previous findings summary** so they don't re-search
|
|
203
|
+
5. **This turn's specific research question** — derived from what the user just said
|
|
204
|
+
6. **Brain dump claims** if Path B
|
|
205
|
+
|
|
206
|
+
The 3 agents search from different vectors:
|
|
207
|
+
- **Web Researcher** — blog posts, case studies, architectural write-ups
|
|
208
|
+
- **GitHub Explorer** — repos, code patterns, open-source implementations
|
|
209
|
+
- **Competitive Analyst** — products, tools, market gaps, user complaints
|
|
210
|
+
|
|
211
|
+
Each turn's research question should be DIFFERENT from the last. The user's response reveals new angles, constraints, or decisions — use those to formulate new, more specific search queries. If the user chose approach A over B, this turn's research digs into A's implementation details, not the broad landscape again.
|
|
212
|
+
|
|
213
|
+
## Step 2: Synthesize into 3-5 Suggestions
|
|
214
|
+
|
|
215
|
+
Once agents return, merge findings into **3-5 numbered suggestions**. Lead with your recommendation.
|
|
216
|
+
|
|
217
|
+
Each suggestion needs:
|
|
218
|
+
1. **The suggestion** — concrete and actionable
|
|
219
|
+
2. **Real-world evidence** — which search results back this up, with URLs
|
|
220
|
+
3. **Why this matters** — specific advantage for this project
|
|
221
|
+
4. **Trade-off** — what you give up
|
|
222
|
+
|
|
223
|
+
Label suggestion #1 as **RECOMMENDED** with a "Why I'd pick this" rationale.
|
|
224
|
+
|
|
225
|
+
If research was thin, present fewer suggestions. Quality over quantity. If all 3 agents returned weak results, be honest: "Research didn't surface strong prior art — this might be genuinely novel, or we should reframe the search."
|
|
226
|
+
|
|
227
|
+
**Brain dump mode:** Present a **Novelty Map** table before suggestions:
|
|
228
|
+
|
|
229
|
+
| Brain Dump Claim | Verdict | Evidence |
|
|
230
|
+
|---|---|---|
|
|
231
|
+
| [claim] | Solved / Partially Solved / Novel | [link or explanation] |
|
|
232
|
+
|
|
233
|
+
## Step 3: Challenge (Observations, NOT Questions)
|
|
234
|
+
|
|
235
|
+
After suggestions, share 2-3 observations that challenge or refine the user's thinking. These are STATEMENTS, not questions. The user can respond to them if they want, but they don't create answer obligations.
|
|
236
|
+
|
|
237
|
+
Good challenge formats (declarative):
|
|
238
|
+
- **"Worth noting that..."** — surface a pattern they may not know about
|
|
239
|
+
- **"At scale, X typically becomes a bottleneck because..."** — flag edge cases
|
|
240
|
+
- **"The evidence suggests X contradicts the assumption about Y..."** — when research contradicts something
|
|
241
|
+
- **"Successful implementations of this (e.g., [product]) launched with only..."** — YAGNI signal
|
|
242
|
+
- **"Users of [product] reported frustration with..."** — inject real feedback
|
|
243
|
+
|
|
244
|
+
Bad challenge formats (these are disguised questions — do NOT use):
|
|
245
|
+
- ~~"Have you considered..."~~ — this demands a yes/no answer
|
|
246
|
+
- ~~"What happens when..."~~ — this demands the user think through a scenario
|
|
247
|
+
- ~~"How would you handle..."~~ — this is just a question with extra steps
|
|
248
|
+
|
|
249
|
+
**YAGNI instinct:** Actively look for scope to cut. If research shows successful products launched with less, state it as an observation.
|
|
250
|
+
|
|
251
|
+
## Step 4: Ask Questions via AskUserQuestion
|
|
252
|
+
|
|
253
|
+
Use the `AskUserQuestion` tool for every question. Never just type a question in chat — always use the tool so the user gets the clickable selection UI.
|
|
254
|
+
|
|
255
|
+
**Maintain a question queue internally.** Prioritize by:
|
|
256
|
+
1. Which question unlocks the most downstream decisions (answering it resolves or narrows others)
|
|
257
|
+
2. Which requires the user's judgment (can't be answered by more research)
|
|
258
|
+
3. Which has the highest impact on the architecture
|
|
259
|
+
|
|
260
|
+
**Batch independent questions (up to 4 per call).** Review your queue — if the top 2-3 questions don't depend on each other's answers, send them in a single `AskUserQuestion` call. The user clicks through them quickly in the UI. If answers ARE dependent, send only the blocking question and save the rest.
|
|
261
|
+
|
|
262
|
+
**Format each question well:**
|
|
263
|
+
- `header`: Short tag, max 12 chars (e.g., "Output", "Trigger", "Auth")
|
|
264
|
+
- `options`: 2-4 choices, each with a clear `label` (1-5 words) and `description` (trade-off explanation)
|
|
265
|
+
- Put your recommended option first with "(Recommended)" in the label
|
|
266
|
+
- `multiSelect: true` when choices aren't exclusive
|
|
267
|
+
- `preview` for code/config/layout comparisons
|
|
268
|
+
|
|
269
|
+
**Example AskUserQuestion call:**
|
|
270
|
+
```json
|
|
271
|
+
{
|
|
272
|
+
"questions": [
|
|
273
|
+
{
|
|
274
|
+
"question": "How should recordings be triggered?",
|
|
275
|
+
"header": "Trigger",
|
|
276
|
+
"multiSelect": true,
|
|
277
|
+
"options": [
|
|
278
|
+
{"label": "Manual CLI (Recommended)", "description": "Simple start/stop command. Fastest to build, most reliable."},
|
|
279
|
+
{"label": "Process detection", "description": "Auto-detect when Zoom/Meet launches. More complex but hands-free."},
|
|
280
|
+
{"label": "Calendar-aware", "description": "Watch your calendar and auto-start at meeting time. Requires calendar API integration."}
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"question": "What output format for transcripts?",
|
|
285
|
+
"header": "Output",
|
|
286
|
+
"multiSelect": false,
|
|
287
|
+
"options": [
|
|
288
|
+
{"label": "Markdown (Recommended)", "description": "Human-readable .md files with meeting metadata header."},
|
|
289
|
+
{"label": "Plain text", "description": "Simple .txt, no formatting overhead."},
|
|
290
|
+
{"label": "JSON with timestamps", "description": "Structured data with word-level timing. Good for building on top of."}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Some questions will become unnecessary as earlier answers clarify things — drop them from the queue when that happens.
|
|
298
|
+
|
|
299
|
+
**When your initial question queue runs dry, DO NOT suggest wrapping up.** Instead, run a fresh research sprint using EVERYTHING you've learned so far. This sprint should go deeper than any previous one because now you have the user's full picture. The research will surface new unknowns, edge cases, failure modes, and implementation details that generate NEW questions. Present the findings with new suggestions and observations, then ask ONE question from the new unknowns the research surfaced. The loop keeps going — research always generates more questions if you dig deep enough.
|
|
300
|
+
|
|
301
|
+
**Research-driven question generation:** After each research sprint, actively mine the findings for questions the user hasn't considered yet. Examples: "The research surfaced that CoreAudio Taps require re-granting permissions weekly on Sonoma — how do you want to handle that UX?" or "Three of the repos I found use a daemon model instead of start/stop — worth considering?" The best brainstorms surface things the user didn't know to ask about. If your research isn't generating new questions, your research queries aren't specific enough — reformulate and go deeper.
|
|
302
|
+
|
|
303
|
+
**After your question, signal what's next.** Something like: "Answer this and I'll dig into [next topic area]." Do NOT offer to move to planning — let the user tell you when they're ready. The user should never feel like the brainstorm is wrapping up unless THEY decide it is.
|
|
304
|
+
|
|
305
|
+
## Step 5: STOP
|
|
306
|
+
|
|
307
|
+
**>>> STOP. Do NOT continue to the next turn. Wait for the user. <<<**
|
|
308
|
+
|
|
309
|
+
This is non-negotiable. The user's response is the input for the next research sprint. Without it, the next sprint has nothing new to search for.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Feature-Type Detection
|
|
314
|
+
|
|
315
|
+
When you learn enough to classify the feature, use the type-specific questions below to inform your internal question queue. Pick the single most impactful unknown from the relevant type as your ONE question for that turn.
|
|
316
|
+
|
|
317
|
+
| Type | Signals | Key Questions |
|
|
318
|
+
|---|---|---|
|
|
319
|
+
| UI/Frontend | "page", "component", "dashboard" | Layout density? Responsive approach? Loading/empty/error states? |
|
|
320
|
+
| API/Backend | "endpoint", "API", "service" | REST vs GraphQL? Auth mechanism? Pagination strategy? |
|
|
321
|
+
| Data/Storage | "database", "store", "persist" | SQL vs NoSQL? Read/write ratio? Consistency requirements? |
|
|
322
|
+
| Integration | "connect to", "sync with" | Push/pull/both? Real-time or batch? Retry handling? |
|
|
323
|
+
| Automation | "automate", "trigger", "schedule" | Trigger mechanism? Failure notification? Idempotency? |
|
|
324
|
+
| CLI Tool | "command", "CLI", "terminal" | Interactive or not? Output format? Config file approach? Installation/distribution method? Dependency management? Update strategy? Shell completions? Daemon vs one-shot? Error recovery (what happens mid-recording if crash)? Config file vs flags vs env vars? Logging/verbosity levels? |
|
|
325
|
+
| AI/ML | "AI", "model", "generate", "LLM" | Which model? Latency tolerance? Fallback? Cost ceiling? |
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## When to Suggest Phase 3
|
|
330
|
+
|
|
331
|
+
**Depth is dynamic, not counted.** Don't track a minimum question number. Instead, measure whether your research is still producing new, useful information. The brainstorm is deep enough when research sprints stop surfacing unknowns — not when you've hit some arbitrary question count. A simple CLI wrapper might genuinely need 3-4 questions. A distributed system with multiple integration points might need 15. Let the research tell you.
|
|
332
|
+
|
|
333
|
+
**How to judge depth: the "new information" test.** After each research sprint, ask yourself: did this sprint surface anything the user hasn't already addressed or that I couldn't have inferred from prior answers? If yes, there's more to explore — formulate a question from the new finding. If two consecutive sprints return the same repos, same patterns, and no new unknowns, the research is saturated for this idea.
|
|
334
|
+
|
|
335
|
+
**The key behavior change: when your question queue empties, don't offer to wrap up — run another research sprint first.** The sprint might surface new angles (failure modes, deployment concerns, maintenance patterns, edge cases from similar projects) that generate fresh questions. Only when the sprint comes back dry should you consider the brainstorm naturally complete.
|
|
336
|
+
|
|
337
|
+
**Never proactively suggest Phase 3.** Don't say "Ready to turn this into an implementation plan?" or "Want to move to planning?" or any variation. Instead, when research is genuinely saturated, just ask your next research-driven question. If there truly isn't one, present your latest findings and observations — the user will tell you when they're ready to move on. The user controls the pace, not you.
|
|
338
|
+
|
|
339
|
+
**The one exception:** If research has been genuinely dry across 2+ consecutive sprints AND you have no new questions, you may say something like: "I've dug into [X, Y, Z areas] and the research is converging — happy to keep exploring if there's anything else on your mind, or we can shape this up." This is a status update, not a push. Say it once. If the user asks anything, go back to the research loop.
|
|
340
|
+
|
|
341
|
+
**Before Phase 3, scan your context register.** Every question you've asked should have an answer recorded. If any are unanswered, ask them ONE AT A TIME in subsequent turns before Phase 3. Do NOT re-ask questions the user already answered — even if their answer was embedded in a longer message or phrased differently than expected.
|
|
342
|
+
|
|
343
|
+
**HARD GATE: The user must explicitly say they're ready.** When they do, present a brief summary:
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
Here's what I think we've landed on:
|
|
347
|
+
|
|
348
|
+
**Building:** [one sentence]
|
|
349
|
+
**Core approach:** [recommended architecture/pattern]
|
|
350
|
+
**Key decisions:** [2-3 bullets]
|
|
351
|
+
**Scope for v1:** [what's in, what's deferred]
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Then proceed to Phase 3. If they raise corrections, address them before proceeding.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
# PHASE 3: PLAN GENERATION
|
|
359
|
+
|
|
360
|
+
Read `references/plan-template.md` for the full template and rules. Present the plan incrementally (vision -> tasks -> agents/waves), getting approval at each step.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Relationship to superpowers:brainstorming
|
|
365
|
+
|
|
366
|
+
- **ftm-brainstorm** (this): Idea exploration with live research. User is figuring out WHAT to build.
|
|
367
|
+
- **superpowers:brainstorming**: Design/spec work. User knows what they're building, needs HOW.
|
|
368
|
+
|
|
369
|
+
If user already completed superpowers:brainstorming, point to ftm-executor instead. If user explicitly invokes this skill, always run it.
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
## Context Compression
|
|
375
|
+
|
|
376
|
+
After turn 5 in a brainstorm session, earlier turns start consuming significant context. Apply compression to maintain quality in later turns.
|
|
377
|
+
|
|
378
|
+
### Trigger
|
|
379
|
+
|
|
380
|
+
- Turns 1-5: No compression. Full fidelity.
|
|
381
|
+
- Turn 6+: Compress turns 1 through (current - 3). Keep the 3 most recent turns at full fidelity.
|
|
382
|
+
|
|
383
|
+
### Compression Strategy
|
|
384
|
+
|
|
385
|
+
For each compressed turn, replace the full content with a summary:
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
[Turn N summary]
|
|
389
|
+
- Topic: [what was discussed]
|
|
390
|
+
- Key decisions: [bullet list of decisions made]
|
|
391
|
+
- Open questions resolved: [what was answered]
|
|
392
|
+
- Artifacts produced: [any specs, diagrams, code snippets referenced]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### What to Preserve in Summaries
|
|
396
|
+
|
|
397
|
+
- Decisions and their rationale (WHY something was decided)
|
|
398
|
+
- Constraints discovered
|
|
399
|
+
- Requirements confirmed by the user
|
|
400
|
+
- Technical choices made
|
|
401
|
+
|
|
402
|
+
### What to Drop
|
|
403
|
+
|
|
404
|
+
- Exploratory tangents that were abandoned
|
|
405
|
+
- Research citations already synthesized
|
|
406
|
+
- Verbose explanations of options not chosen
|
|
407
|
+
- Repeated context that's already captured in later turns
|
|
408
|
+
|
|
409
|
+
### Implementation
|
|
410
|
+
|
|
411
|
+
This is implemented at the skill level, not via hooks. When presenting a response at turn 6+:
|
|
412
|
+
1. Mentally compress old turns using the strategy above
|
|
413
|
+
2. Reference compressed summaries when needed
|
|
414
|
+
3. Keep recent turns verbatim for conversational continuity
|
|
415
|
+
4. If the user references something from a compressed turn, expand it on demand
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Session State (for ftm-pause/resume)
|
|
420
|
+
|
|
421
|
+
When paused, the following state must be capturable so ftm-resume can pick up exactly where you left off:
|
|
422
|
+
|
|
423
|
+
- **Phase tracking**: current phase (0/1/2/3), path (A/B), turn number, research depth level
|
|
424
|
+
- **Phase 0**: full repo scan results (or "skipped — no git repo")
|
|
425
|
+
- **Phase 1**: original idea (verbatim), brain dump extraction if Path B, all user answers per round
|
|
426
|
+
- **Phase 2**: every completed turn's suggestions with evidence/URLs, every challenge and response, every question and answer, accumulated decisions, the current direction, context register contents
|
|
427
|
+
- **Phase 3**: which sections presented/approved, plan content so far, plan file path if saved
|
|
428
|
+
|
|
429
|
+
This state is what ftm-pause captures and ftm-resume restores. Keep it current as you go.
|
|
430
|
+
|
|
431
|
+
## Blackboard Write
|
|
432
|
+
|
|
433
|
+
After completing, update:
|
|
434
|
+
1. `~/.claude/ftm-state/blackboard/context.json`:
|
|
435
|
+
- Set current_task status to "complete"
|
|
436
|
+
- Append decision summary to recent_decisions (cap at 10)
|
|
437
|
+
- Update session_metadata.skills_invoked and last_updated
|
|
438
|
+
2. Write experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json`:
|
|
439
|
+
- task_type: "feature" or "investigation"
|
|
440
|
+
- feature_type: detected type (UI, API, etc.)
|
|
441
|
+
- architectural_direction: the approach chosen
|
|
442
|
+
- research_quality: how useful the research sprints were (high/medium/low)
|
|
443
|
+
- turns_to_resolution: how many Phase 2 turns before Phase 3
|
|
444
|
+
- tags: keywords for future matching
|
|
445
|
+
3. Update `experiences/index.json` with the new entry
|
|
446
|
+
4. Emit `plan_generated` with `{ plan_path, plan_title, task_count, wave_count }` (if Phase 3 completed)
|
|
447
|
+
5. Emit `task_completed` with `{ task_title, plan_path, duration_ms }`
|
|
448
|
+
|
|
449
|
+
## Requirements
|
|
450
|
+
|
|
451
|
+
- config: `~/.claude/ftm-config.yml` | optional | model profile for planning agents
|
|
452
|
+
- reference: `references/agent-prompts.md` | required | research agent prompt templates
|
|
453
|
+
- reference: `references/plan-template.md` | required | plan document generation template
|
|
454
|
+
- reference: `~/.claude/ftm-state/blackboard/context.json` | optional | session state and active constraints
|
|
455
|
+
- reference: `~/.claude/ftm-state/blackboard/experiences/index.json` | optional | past brainstorm lessons
|
|
456
|
+
- reference: `~/.claude/ftm-state/blackboard/patterns.json` | optional | execution and user behavior patterns
|
|
457
|
+
|
|
458
|
+
## Risk
|
|
459
|
+
|
|
460
|
+
- level: low_write
|
|
461
|
+
- scope: writes plan documents to ~/.claude/plans/; writes blackboard context and experience files; does not modify project source code
|
|
462
|
+
- rollback: delete generated plan file; blackboard writes can be reverted by editing JSON files
|
|
463
|
+
|
|
464
|
+
## Approval Gates
|
|
465
|
+
|
|
466
|
+
- trigger: Phase 3 plan generation ready | action: present "Here's what I think we've landed on" summary and wait for explicit user approval before generating plan
|
|
467
|
+
- trigger: plan document generated | action: present plan incrementally (vision → tasks → agents/waves) and get approval at each step
|
|
468
|
+
- trigger: research returns thin results on all agents | action: note research gaps, present fewer suggestions, do not fabricate citations
|
|
469
|
+
- complexity_routing: micro → auto | small → auto | medium → plan_first | large → plan_first | xl → always_ask
|
|
470
|
+
|
|
471
|
+
## Fallbacks
|
|
472
|
+
|
|
473
|
+
- condition: ftm-researcher not available | action: dispatch 3 direct parallel research agents (web/github/competitive) using built-in prompts from references/agent-prompts.md
|
|
474
|
+
- condition: no git repo detected in Phase 0 | action: skip repo scan, ask about tech stack during intake
|
|
475
|
+
- condition: blackboard missing or empty | action: proceed without experience-informed shortcuts, rely on direct analysis
|
|
476
|
+
- condition: ftm-config.yml missing | action: use session default model for all agents
|
|
477
|
+
|
|
478
|
+
## Capabilities
|
|
479
|
+
|
|
480
|
+
- mcp: `WebSearch` | optional | web research agents use for blog posts and case studies
|
|
481
|
+
- mcp: `WebFetch` | optional | GitHub exploration and competitive analysis
|
|
482
|
+
- mcp: `sequential-thinking` | optional | complex trade-off analysis during synthesis
|
|
483
|
+
- env: none required
|
|
484
|
+
|
|
485
|
+
## Event Payloads
|
|
486
|
+
|
|
487
|
+
### plan_generated
|
|
488
|
+
- skill: string — "ftm-brainstorm"
|
|
489
|
+
- plan_path: string — absolute path to generated plan file
|
|
490
|
+
- plan_title: string — human-readable plan title
|
|
491
|
+
- task_count: number — total tasks in the plan
|
|
492
|
+
- wave_count: number — number of parallel execution waves
|
|
493
|
+
|
|
494
|
+
### task_completed
|
|
495
|
+
- skill: string — "ftm-brainstorm"
|
|
496
|
+
- task_title: string — title of the brainstorm topic
|
|
497
|
+
- plan_path: string | null — path to generated plan if Phase 3 completed
|
|
498
|
+
- duration_ms: number — total session duration
|