feed-the-machine 1.0.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.
Files changed (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +268 -0
  3. package/bin/generate-manifest.mjs +210 -0
  4. package/bin/install.mjs +114 -0
  5. package/ftm/SKILL.md +88 -0
  6. package/ftm-audit/SKILL.md +146 -0
  7. package/ftm-audit/references/protocols/PROJECT-PATTERNS.md +91 -0
  8. package/ftm-audit/references/protocols/RUNTIME-WIRING.md +66 -0
  9. package/ftm-audit/references/protocols/WIRING-CONTRACTS.md +135 -0
  10. package/ftm-audit/references/strategies/AUTO-FIX-STRATEGIES.md +69 -0
  11. package/ftm-audit/references/templates/REPORT-FORMAT.md +96 -0
  12. package/ftm-audit/scripts/run-knip.sh +23 -0
  13. package/ftm-audit.yml +2 -0
  14. package/ftm-brainstorm/SKILL.md +379 -0
  15. package/ftm-brainstorm/evals/evals.json +100 -0
  16. package/ftm-brainstorm/evals/promptfoo.yaml +109 -0
  17. package/ftm-brainstorm/references/agent-prompts.md +224 -0
  18. package/ftm-brainstorm/references/plan-template.md +121 -0
  19. package/ftm-brainstorm.yml +2 -0
  20. package/ftm-browse/SKILL.md +415 -0
  21. package/ftm-browse/daemon/browser-manager.ts +206 -0
  22. package/ftm-browse/daemon/bun.lock +30 -0
  23. package/ftm-browse/daemon/cli.ts +347 -0
  24. package/ftm-browse/daemon/commands.ts +410 -0
  25. package/ftm-browse/daemon/main.ts +357 -0
  26. package/ftm-browse/daemon/package.json +17 -0
  27. package/ftm-browse/daemon/server.ts +189 -0
  28. package/ftm-browse/daemon/snapshot.ts +519 -0
  29. package/ftm-browse/daemon/tsconfig.json +22 -0
  30. package/ftm-browse.yml +4 -0
  31. package/ftm-codex-gate/SKILL.md +302 -0
  32. package/ftm-codex-gate.yml +2 -0
  33. package/ftm-config/SKILL.md +310 -0
  34. package/ftm-config.default.yml +80 -0
  35. package/ftm-config.yml +2 -0
  36. package/ftm-council/SKILL.md +132 -0
  37. package/ftm-council/references/prompts/CLAUDE-INVESTIGATION.md +60 -0
  38. package/ftm-council/references/prompts/CODEX-INVESTIGATION.md +58 -0
  39. package/ftm-council/references/prompts/GEMINI-INVESTIGATION.md +58 -0
  40. package/ftm-council/references/prompts/REBUTTAL-TEMPLATE.md +57 -0
  41. package/ftm-council/references/protocols/PREREQUISITES.md +47 -0
  42. package/ftm-council/references/protocols/STEP-0-FRAMING.md +46 -0
  43. package/ftm-council.yml +2 -0
  44. package/ftm-dashboard.yml +4 -0
  45. package/ftm-debug/SKILL.md +146 -0
  46. package/ftm-debug/references/phases/PHASE-0-INTAKE.md +58 -0
  47. package/ftm-debug/references/phases/PHASE-1-TRIAGE.md +46 -0
  48. package/ftm-debug/references/phases/PHASE-2-WAR-ROOM-AGENTS.md +279 -0
  49. package/ftm-debug/references/phases/PHASE-3-TO-6-EXECUTION.md +436 -0
  50. package/ftm-debug/references/protocols/BLACKBOARD.md +86 -0
  51. package/ftm-debug/references/protocols/EDGE-CASES.md +103 -0
  52. package/ftm-debug.yml +2 -0
  53. package/ftm-diagram/SKILL.md +233 -0
  54. package/ftm-diagram.yml +2 -0
  55. package/ftm-executor/SKILL.md +657 -0
  56. package/ftm-executor/references/STYLE-TEMPLATE.md +73 -0
  57. package/ftm-executor/references/phases/PHASE-0-VERIFICATION.md +62 -0
  58. package/ftm-executor/references/phases/PHASE-2-AGENT-ASSEMBLY.md +34 -0
  59. package/ftm-executor/references/phases/PHASE-3-WORKTREES.md +38 -0
  60. package/ftm-executor/references/phases/PHASE-4-5-AUDIT.md +72 -0
  61. package/ftm-executor/references/phases/PHASE-4-DISPATCH.md +66 -0
  62. package/ftm-executor/references/phases/PHASE-5-5-CODEX-GATE.md +73 -0
  63. package/ftm-executor/references/protocols/DOCUMENTATION-BOOTSTRAP.md +36 -0
  64. package/ftm-executor/references/protocols/MODEL-PROFILE.md +44 -0
  65. package/ftm-executor/references/protocols/PROGRESS-TRACKING.md +66 -0
  66. package/ftm-executor/runtime/ftm-runtime.mjs +252 -0
  67. package/ftm-executor/runtime/package.json +8 -0
  68. package/ftm-executor.yml +2 -0
  69. package/ftm-git/SKILL.md +195 -0
  70. package/ftm-git/evals/evals.json +26 -0
  71. package/ftm-git/evals/promptfoo.yaml +75 -0
  72. package/ftm-git/hooks/post-commit-experience.sh +92 -0
  73. package/ftm-git/references/patterns/SECRET-PATTERNS.md +104 -0
  74. package/ftm-git/references/protocols/REMEDIATION.md +139 -0
  75. package/ftm-git/scripts/pre-commit-secrets.sh +110 -0
  76. package/ftm-git.yml +2 -0
  77. package/ftm-intent/SKILL.md +198 -0
  78. package/ftm-intent.yml +2 -0
  79. package/ftm-map.yml +2 -0
  80. package/ftm-mind/SKILL.md +986 -0
  81. package/ftm-mind/evals/promptfoo.yaml +142 -0
  82. package/ftm-mind/references/blackboard-schema.md +328 -0
  83. package/ftm-mind/references/complexity-guide.md +110 -0
  84. package/ftm-mind/references/event-registry.md +299 -0
  85. package/ftm-mind/references/mcp-inventory.md +296 -0
  86. package/ftm-mind/references/protocols/COMPLEXITY-SIZING.md +72 -0
  87. package/ftm-mind/references/protocols/MCP-HEURISTICS.md +32 -0
  88. package/ftm-mind/references/protocols/PLAN-APPROVAL.md +80 -0
  89. package/ftm-mind/references/reflexion-protocol.md +249 -0
  90. package/ftm-mind/references/routing/SCENARIOS.md +22 -0
  91. package/ftm-mind/references/routing-scenarios.md +35 -0
  92. package/ftm-mind.yml +2 -0
  93. package/ftm-pause/SKILL.md +133 -0
  94. package/ftm-pause/references/protocols/SKILL-RESTORE-PROTOCOLS.md +186 -0
  95. package/ftm-pause/references/protocols/VALIDATION.md +80 -0
  96. package/ftm-pause.yml +2 -0
  97. package/ftm-researcher.yml +2 -0
  98. package/ftm-resume/SKILL.md +166 -0
  99. package/ftm-resume/references/protocols/VALIDATION.md +172 -0
  100. package/ftm-resume.yml +2 -0
  101. package/ftm-retro/SKILL.md +189 -0
  102. package/ftm-retro/references/protocols/SCORING-RUBRICS.md +89 -0
  103. package/ftm-retro/references/templates/REPORT-FORMAT.md +109 -0
  104. package/ftm-retro.yml +2 -0
  105. package/ftm-routine.yml +4 -0
  106. package/ftm-state/blackboard/context.json +23 -0
  107. package/ftm-state/blackboard/experiences/index.json +9 -0
  108. package/ftm-state/blackboard/patterns.json +6 -0
  109. package/ftm-state/schemas/context.schema.json +130 -0
  110. package/ftm-state/schemas/experience-index.schema.json +77 -0
  111. package/ftm-state/schemas/experience.schema.json +78 -0
  112. package/ftm-state/schemas/patterns.schema.json +44 -0
  113. package/ftm-upgrade/SKILL.md +153 -0
  114. package/ftm-upgrade/scripts/check-version.sh +76 -0
  115. package/ftm-upgrade/scripts/upgrade.sh +143 -0
  116. package/ftm-upgrade.yml +2 -0
  117. package/ftm.yml +2 -0
  118. package/install.sh +102 -0
  119. package/package.json +74 -0
  120. package/uninstall.sh +25 -0
@@ -0,0 +1,96 @@
1
+ # Audit Report Format
2
+
3
+ The final output structure for a completed ftm-audit run.
4
+
5
+ ---
6
+
7
+ ## Summary Report
8
+
9
+ ```
10
+ ## FTM Audit Report — [YYYY-MM-DD HH:MM]
11
+
12
+ ### Layer 1: Static Analysis (knip)
13
+ - Findings: [N]
14
+ - [FINDING_TYPE] file:line — description
15
+ - [FINDING_TYPE] file:line — description
16
+
17
+ ### Layer 2: Adversarial Audit
18
+ - Findings: [N]
19
+ - [FINDING_TYPE] file:line — description (Dimension N FAIL)
20
+ - [FINDING_TYPE] file:line — description (Dimension N FAIL)
21
+
22
+ ### Layer 3: Auto-Fix Results
23
+ - Fixed: [N]
24
+ - Manual intervention needed: [N]
25
+ - [list each fix applied with result]
26
+
27
+ ### Final Status: PASS / FAIL
28
+ - Remaining issues: [list if any]
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Detailed Changelog
34
+
35
+ Produced alongside the summary report when Layer 3 runs.
36
+
37
+ ```
38
+ ### FTM Audit Changelog — [YYYY-MM-DD HH:MM]
39
+
40
+ #### Findings
41
+ | # | Type | Location | Description |
42
+ |---|------|----------|-------------|
43
+ | 1 | UNWIRED_COMPONENT | src/components/Widget.tsx | Imported but not rendered in Dashboard |
44
+ | 2 | ORPHAN_ROUTE | src/views/Settings.tsx | No route config entry |
45
+
46
+ #### Fixes Applied
47
+ | # | Finding | Fix | Verified |
48
+ |---|---------|-----|----------|
49
+ | 1 | UNWIRED_COMPONENT Widget | Added <Widget /> to Dashboard.tsx:47 | ✅ PASS |
50
+ | 2 | ORPHAN_ROUTE Settings | Added /settings route to router.tsx:23 | ✅ PASS |
51
+
52
+ #### Manual Intervention Required
53
+ | # | Finding | Reason | Suggested Action |
54
+ |---|---------|--------|-----------------|
55
+ | (none) | | | |
56
+
57
+ #### Final Status: PASS (0 remaining issues)
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Layer-by-Layer Finding Format
63
+
64
+ ### Layer 1 (knip) Finding Format
65
+
66
+ ```
67
+ Layer 1 findings:
68
+ - [UNUSED_FILE] src/components/OldWidget.tsx — not imported anywhere
69
+ - [UNUSED_EXPORT] src/utils/helpers.ts:42 — export `formatDate` not used
70
+ - [UNUSED_DEP] package.json — `lodash` listed but never imported
71
+ - [UNLISTED_DEP] src/api/client.ts — imports `axios` but it's not in package.json
72
+ ```
73
+
74
+ ### Layer 2 (Adversarial) Finding Format
75
+
76
+ ```
77
+ Layer 2 findings:
78
+ - [UNWIRED_COMPONENT] src/components/NewWidget.tsx — imported in Dashboard.tsx:5 but never rendered in JSX (Dimension 2 FAIL)
79
+ - [ORPHAN_ROUTE] src/views/SettingsView.tsx — no route in router config points to this view (Dimension 3 FAIL)
80
+ - [DEAD_STORE_FIELD] src/store/userSlice.ts:23 — `userPreferences` written in reducer but never read by any selector (Dimension 4 FAIL)
81
+ - [UNCALLED_API] src/api/billing.ts:15 — `fetchInvoices()` exported but never called (Dimension 5 FAIL)
82
+ ```
83
+
84
+ **Requirement:** Every finding must include file:line evidence. "I think this might be unused" is not acceptable — show the grep results or the missing link in the chain.
85
+
86
+ ### Phase 3 (Runtime) Finding Format
87
+
88
+ When runtime-only findings are present (passed Layers 1-2 but failed Phase 3):
89
+
90
+ ```
91
+ Phase 3 (Runtime) findings:
92
+ - [RUNTIME_FAIL] /analytics — page returns 404 despite route registered in router.tsx:18
93
+ - [RUNTIME_WARN] /settings — route renders but <UserPreferences /> missing from ARIA tree
94
+ ```
95
+
96
+ Label these as `runtime-only` so developers know they won't be caught by future static checks alone.
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env bash
2
+ # run-knip.sh — Run knip and return structured findings
3
+ # Exit 0 if clean, 1 if findings exist
4
+
5
+ set -euo pipefail
6
+
7
+ # Check for package.json
8
+ if [ ! -f "package.json" ]; then
9
+ echo '{"skipped": true, "reason": "No package.json found"}'
10
+ exit 0
11
+ fi
12
+
13
+ # Run knip with JSON reporter
14
+ OUTPUT=$(npx knip --reporter json 2>/dev/null || true)
15
+
16
+ # Check if output is empty or just '{}'
17
+ if [ -z "$OUTPUT" ] || [ "$OUTPUT" = "{}" ] || [ "$OUTPUT" = '{"files":[],"issues":[]}' ]; then
18
+ echo '{"clean": true, "files": [], "issues": []}'
19
+ exit 0
20
+ fi
21
+
22
+ echo "$OUTPUT"
23
+ exit 1
package/ftm-audit.yml ADDED
@@ -0,0 +1,2 @@
1
+ name: ftm-audit
2
+ description: Dual-purpose wiring audit that verifies all code is actually connected to the running application. Combines static analysis (knip) with adversarial LLM audit and auto-fixes anything it finds. Use when user says "audit", "wiring check", "verify wiring", "dead code", "check imports", "unused code", "find dead code", or "audit wiring". Also auto-invoked by ftm-executor after each task.
@@ -0,0 +1,379 @@
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
+ ## Research Sprint Dispatch
28
+
29
+ Each research sprint invokes ftm-researcher rather than dispatching agents directly.
30
+
31
+ Interface:
32
+ - Pass: { research_question: [derived from current turn], context_register: [all prior findings], depth_mode: [based on turn number] }
33
+ - Receive: { findings, disagreement_map, confidence_scores }
34
+
35
+ Depth mode mapping:
36
+ - Turns 1-2 (BROAD): ftm-researcher quick mode (3 finders)
37
+ - Turns 3-5 (FOCUSED): ftm-researcher standard mode (7 finders + reconciler)
38
+ - Turns 6+ (IMPLEMENTATION): ftm-researcher deep mode (full pipeline with council)
39
+
40
+ The brainstorm skill consumes the researcher's structured output and weaves it into:
41
+ - 3-5 numbered suggestions with evidence and source URLs
42
+ - A recommended option with rationale
43
+ - Challenges based on contested claims from the disagreement map
44
+ - Targeted questions based on research gaps
45
+
46
+ ## Blackboard Read
47
+
48
+ Before starting, load context from the blackboard:
49
+ 1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
50
+ 2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter by task_type "feature"/"investigation"
51
+ 3. Load top 3-5 matching experience files for past brainstorm lessons
52
+ 4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check execution_patterns and user_behavior
53
+
54
+ If missing or empty, proceed without.
55
+
56
+ ---
57
+
58
+ # THE CORE LOOP
59
+
60
+ 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."
61
+
62
+ ```
63
+ EVERY TURN (after initial intake):
64
+ 1. RESEARCH SPRINT — invoke ftm-researcher with context
65
+ 2. SYNTHESIZE — merge findings into suggestions with evidence
66
+ 3. CHALLENGE — push back on weak assumptions, surface trade-offs
67
+ 4. ASK — 1-2 targeted questions to extract more from the user
68
+ 5. >>> STOP <<< — wait for the user. Do NOT continue.
69
+ ```
70
+
71
+ 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.
72
+
73
+ **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.
74
+
75
+ **Research depth escalates automatically:**
76
+ - **Turns 1-2: BROAD** — map the landscape, major approaches, who's done this
77
+ - **Turns 3-5: FOCUSED** — drill into the user's chosen direction, real trade-offs, failure modes
78
+ - **Turns 6+: IMPLEMENTATION** — concrete libraries, code patterns, integration specifics
79
+
80
+ ---
81
+
82
+ # PHASE 0: REPO SCAN (automatic, silent)
83
+
84
+ Run this in the background before your first response. Do not ask.
85
+
86
+ Spawn an **Explore** agent (subagent_type: Explore):
87
+ ```
88
+ Analyze the current repository: project type, tech stack, architecture,
89
+ patterns in use, existing infrastructure, scale indicators.
90
+ Focus on what's relevant for proposing new features or architectural changes.
91
+ ```
92
+
93
+ Store as your project context. Reference throughout all phases. If not in a git repo, skip and ask about stack during intake.
94
+
95
+ ---
96
+
97
+ # PHASE 1: INTAKE
98
+
99
+ Detect which path you're on:
100
+
101
+ ## Path A: Fresh Idea (short/vague message)
102
+
103
+ **Turn 1 ONLY:** Ask 1-2 questions to understand the core idea. What is it, who is it for, what problem does it solve. One question at a time. If the opening message covers some of these, skip ahead.
104
+
105
+ **>>> STOP. Wait for response. <<<**
106
+
107
+ **Turn 2:** Take the user's answer. NOW run your first research sprint (3 agents, BROAD depth — see below). Synthesize, challenge, ask 1-2 more questions about architecture and constraints. Propose specific options from the research rather than open-ended questions.
108
+
109
+ **>>> STOP. Wait for response. <<<**
110
+
111
+ **Turn 3+:** You're now in the core loop. Every turn from here follows the cycle: research sprint -> synthesize -> challenge -> ask -> STOP.
112
+
113
+ ## Path B: Brain Dump (large paste, notes, transcript)
114
+
115
+ **Turn 1:** Parse the entire paste. Extract: decisions already made, open questions, assumptions to validate, contradictions, gaps. Present structured summary. Ask for confirmation + any gaps (success criteria, v1 scope, non-negotiables). Do NOT ask basic questions already answered in the paste.
116
+
117
+ **>>> STOP. Wait for confirmation. <<<**
118
+
119
+ **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, ask.
120
+
121
+ **>>> STOP. Wait for response. <<<**
122
+
123
+ **Turn 3+:** Core loop continues.
124
+
125
+ ---
126
+
127
+ # DISCUSS MODE
128
+
129
+ When the user provides a clear, specific spec or feature description (not a vague idea), skip broad research and go straight to targeted analysis.
130
+
131
+ ## Detection
132
+
133
+ Discuss mode activates when:
134
+ - The user's input is 200+ words with specific technical details
135
+ - The user says "I know what I want to build" or "here's my spec" or "discuss this"
136
+ - The input contains file paths, function names, or architecture details
137
+ - The user explicitly requests "discuss" rather than "brainstorm"
138
+
139
+ ## Flow
140
+
141
+ Instead of the standard brainstorm research → synthesis → suggestions flow:
142
+
143
+ 1. **Parse the spec** — Extract: what's being built, key components, tech stack, constraints
144
+ 2. **Identify gray areas** — Find the parts that aren't specified:
145
+ - Edge cases not mentioned
146
+ - Error handling not specified
147
+ - Performance implications not considered
148
+ - Security concerns not addressed
149
+ - Integration points not defined
150
+ 3. **Ask targeted questions** — Present 3-5 specific questions about the gray areas:
151
+ ```
152
+ Your spec is clear on [X, Y, Z]. A few gray areas to nail down:
153
+
154
+ 1. [Edge case question] — e.g., "What happens when the user submits while offline?"
155
+ 2. [Error handling question] — e.g., "Should failed API calls retry or show an error?"
156
+ 3. [Performance question] — e.g., "Expected data volume? 100 items or 100K?"
157
+ 4. [Security question] — e.g., "Who should have access to this endpoint?"
158
+ 5. [Integration question] — e.g., "Does this need to sync with the existing auth system?"
159
+ ```
160
+ 4. **Refine based on answers** — Each answer narrows the spec. After 2-3 rounds of Q&A, the spec should be implementation-ready.
161
+ 5. **Output: implementation-ready spec** — Not a brainstorm document, but a tight spec that can feed directly into plan generation.
162
+
163
+ ## Gray Area Categories by Feature Type
164
+
165
+ | Feature Type | Common Gray Areas |
166
+ |---|---|
167
+ | API endpoint | Auth, rate limiting, pagination, error codes, versioning |
168
+ | UI component | Loading states, empty states, error states, accessibility, responsive |
169
+ | Data pipeline | Failure modes, retry logic, idempotency, monitoring, backpressure |
170
+ | Integration | Auth flow, webhook handling, rate limits, data mapping, error recovery |
171
+ | Config change | Rollback plan, feature flags, gradual rollout, monitoring |
172
+
173
+ ---
174
+
175
+ # PHASE 2: RESEARCH + CHALLENGE LOOP
176
+
177
+ This is the heart of the skill. Unlimited turns. Each one follows the cycle.
178
+
179
+ ## Step 1: Dispatch Research Sprint
180
+
181
+ 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:
182
+
183
+ 1. **Project context** from Phase 0
184
+ 2. **Full context register** — everything learned across ALL prior turns
185
+ 3. **Research depth level** for this turn (broad/focused/implementation)
186
+ 4. **Previous findings summary** so they don't re-search
187
+ 5. **This turn's specific research question** — derived from what the user just said
188
+ 6. **Brain dump claims** if Path B
189
+
190
+ The 3 agents search from different vectors:
191
+ - **Web Researcher** — blog posts, case studies, architectural write-ups
192
+ - **GitHub Explorer** — repos, code patterns, open-source implementations
193
+ - **Competitive Analyst** — products, tools, market gaps, user complaints
194
+
195
+ 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.
196
+
197
+ ## Step 2: Synthesize into 3-5 Suggestions
198
+
199
+ Once agents return, merge findings into **3-5 numbered suggestions**. Lead with your recommendation.
200
+
201
+ Each suggestion needs:
202
+ 1. **The suggestion** — concrete and actionable
203
+ 2. **Real-world evidence** — which search results back this up, with URLs
204
+ 3. **Why this matters** — specific advantage for this project
205
+ 4. **Trade-off** — what you give up
206
+
207
+ Label suggestion #1 as **RECOMMENDED** with a "Why I'd pick this" rationale.
208
+
209
+ 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."
210
+
211
+ **Brain dump mode:** Present a **Novelty Map** table before suggestions:
212
+
213
+ | Brain Dump Claim | Verdict | Evidence |
214
+ |---|---|---|
215
+ | [claim] | Solved / Partially Solved / Novel | [link or explanation] |
216
+
217
+ ## Step 3: Challenge and Extract
218
+
219
+ After suggestions, challenge the user's thinking. Pick 2-3 challenge patterns:
220
+
221
+ - **"Have you considered..."** — surface a pattern they may not know about
222
+ - **"What happens when..."** — probe edge cases and scaling
223
+ - **"The evidence suggests..."** — when research contradicts an assumption
224
+ - **"A simpler approach might be..."** — when they're over-engineering
225
+ - **"Users of [product] complained about..."** — inject real feedback
226
+
227
+ **YAGNI instinct:** Actively look for scope to cut. If research shows successful products launched with less, argue for smaller v1 scope.
228
+
229
+ ## Step 4: Ask 1-2 Targeted Questions + Invite Continuation
230
+
231
+ Then ask **1-2 questions** that will make the next research sprint more productive. The questions should:
232
+ - Narrow scope based on what research surfaced
233
+ - Reveal constraints research can't discover
234
+ - Test commitment to specific approaches
235
+ - Uncover success criteria and non-negotiables
236
+
237
+ Prefer multiple-choice when the answer space is bounded. Each question should unlock a NEW research vector for next turn.
238
+
239
+ **After your questions, always signal that more depth is available.** Something like: "Answer these and I'll run another research sprint focused on [next topic]. Or if you feel we've covered enough ground, just say the word and we'll move to planning." The user should never feel like the brainstorm is wrapping up unless THEY decide it is. Your default posture is: there's always more to explore.
240
+
241
+ ## Step 5: STOP
242
+
243
+ **>>> STOP. Do NOT continue to the next turn. Wait for the user. <<<**
244
+
245
+ 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.
246
+
247
+ ---
248
+
249
+ ## Feature-Type Detection
250
+
251
+ When you learn enough to classify the feature, add type-specific questions. Pick 2-3 unknowns, don't dump everything.
252
+
253
+ | Type | Signals | Key Questions |
254
+ |---|---|---|
255
+ | UI/Frontend | "page", "component", "dashboard" | Layout density? Responsive approach? Loading/empty/error states? |
256
+ | API/Backend | "endpoint", "API", "service" | REST vs GraphQL? Auth mechanism? Pagination strategy? |
257
+ | Data/Storage | "database", "store", "persist" | SQL vs NoSQL? Read/write ratio? Consistency requirements? |
258
+ | Integration | "connect to", "sync with" | Push/pull/both? Real-time or batch? Retry handling? |
259
+ | Automation | "automate", "trigger", "schedule" | Trigger mechanism? Failure notification? Idempotency? |
260
+ | CLI Tool | "command", "CLI", "terminal" | Interactive or not? Output format? Config file approach? |
261
+ | AI/ML | "AI", "model", "generate", "LLM" | Which model? Latency tolerance? Fallback? Cost ceiling? |
262
+
263
+ ---
264
+
265
+ ## When to Suggest Phase 3
266
+
267
+ You may SUGGEST moving to plan generation when:
268
+ - User explicitly says "ok I think I know what I want", "let's plan", "I'm ready" or similar
269
+ - Research returns diminishing returns AND user seems satisfied (same patterns keep appearing across 2+ sprints)
270
+ - You've covered: core architecture, key technical decisions, data model, integrations AND the user isn't raising new questions
271
+
272
+ **Default posture: keep exploring.** Never suggest Phase 3 just because a certain number of turns have passed. Some ideas need 3 turns, some need 15. The user decides when they're done, not you. If research is thin on a topic, try reformulating the search before suggesting you've exhausted the space.
273
+
274
+ **HARD GATE: The user must explicitly approve.** Present a brief summary:
275
+
276
+ ```
277
+ Here's what I think we've landed on:
278
+
279
+ **Building:** [one sentence]
280
+ **Core approach:** [recommended architecture/pattern]
281
+ **Key decisions:** [2-3 bullets]
282
+ **Scope for v1:** [what's in, what's deferred]
283
+
284
+ Ready to turn this into an implementation plan, or more to explore?
285
+ ```
286
+
287
+ If they say yes, proceed. If they raise new questions, stay in Phase 2.
288
+
289
+ ---
290
+
291
+ # PHASE 3: PLAN GENERATION
292
+
293
+ Read `references/plan-template.md` for the full template and rules. Present the plan incrementally (vision -> tasks -> agents/waves), getting approval at each step.
294
+
295
+ ---
296
+
297
+ ## Relationship to superpowers:brainstorming
298
+
299
+ - **ftm-brainstorm** (this): Idea exploration with live research. User is figuring out WHAT to build.
300
+ - **superpowers:brainstorming**: Design/spec work. User knows what they're building, needs HOW.
301
+
302
+ If user already completed superpowers:brainstorming, point to ftm-executor instead. If user explicitly invokes this skill, always run it.
303
+
304
+ ---
305
+
306
+ ## Context Compression
307
+
308
+ After turn 5 in a brainstorm session, earlier turns start consuming significant context. Apply compression to maintain quality in later turns.
309
+
310
+ ### Trigger
311
+
312
+ - Turns 1-5: No compression. Full fidelity.
313
+ - Turn 6+: Compress turns 1 through (current - 3). Keep the 3 most recent turns at full fidelity.
314
+
315
+ ### Compression Strategy
316
+
317
+ For each compressed turn, replace the full content with a summary:
318
+
319
+ ```
320
+ [Turn N summary]
321
+ - Topic: [what was discussed]
322
+ - Key decisions: [bullet list of decisions made]
323
+ - Open questions resolved: [what was answered]
324
+ - Artifacts produced: [any specs, diagrams, code snippets referenced]
325
+ ```
326
+
327
+ ### What to Preserve in Summaries
328
+
329
+ - Decisions and their rationale (WHY something was decided)
330
+ - Constraints discovered
331
+ - Requirements confirmed by the user
332
+ - Technical choices made
333
+
334
+ ### What to Drop
335
+
336
+ - Exploratory tangents that were abandoned
337
+ - Research citations already synthesized
338
+ - Verbose explanations of options not chosen
339
+ - Repeated context that's already captured in later turns
340
+
341
+ ### Implementation
342
+
343
+ This is implemented at the skill level, not via hooks. When presenting a response at turn 6+:
344
+ 1. Mentally compress old turns using the strategy above
345
+ 2. Reference compressed summaries when needed
346
+ 3. Keep recent turns verbatim for conversational continuity
347
+ 4. If the user references something from a compressed turn, expand it on demand
348
+
349
+ ---
350
+
351
+ ## Session State (for ftm-pause/resume)
352
+
353
+ When paused, the following state must be capturable so ftm-resume can pick up exactly where you left off:
354
+
355
+ - **Phase tracking**: current phase (0/1/2/3), path (A/B), turn number, research depth level
356
+ - **Phase 0**: full repo scan results (or "skipped — no git repo")
357
+ - **Phase 1**: original idea (verbatim), brain dump extraction if Path B, all user answers per round
358
+ - **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
359
+ - **Phase 3**: which sections presented/approved, plan content so far, plan file path if saved
360
+
361
+ This state is what ftm-pause captures and ftm-resume restores. Keep it current as you go.
362
+
363
+ ## Blackboard Write
364
+
365
+ After completing, update:
366
+ 1. `~/.claude/ftm-state/blackboard/context.json`:
367
+ - Set current_task status to "complete"
368
+ - Append decision summary to recent_decisions (cap at 10)
369
+ - Update session_metadata.skills_invoked and last_updated
370
+ 2. Write experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json`:
371
+ - task_type: "feature" or "investigation"
372
+ - feature_type: detected type (UI, API, etc.)
373
+ - architectural_direction: the approach chosen
374
+ - research_quality: how useful the research sprints were (high/medium/low)
375
+ - turns_to_resolution: how many Phase 2 turns before Phase 3
376
+ - tags: keywords for future matching
377
+ 3. Update `experiences/index.json` with the new entry
378
+ 4. Emit `plan_generated` with `{ plan_path, plan_title, task_count, wave_count }` (if Phase 3 completed)
379
+ 5. Emit `task_completed` with `{ task_title, plan_path, duration_ms }`
@@ -0,0 +1,100 @@
1
+ {
2
+ "skill_name": "ftm-brainstorm",
3
+ "evals": [
4
+ {
5
+ "id": 0,
6
+ "name": "fresh-idea-intake",
7
+ "prompt": "I'm thinking about building an app that helps people find study buddies at their university. Like Tinder but for studying.",
8
+ "expected_output": "Phase 0 repo scan launched in background, 1-2 intake questions, hard STOP",
9
+ "files": [],
10
+ "assertions": [
11
+ {"name": "one_or_two_questions", "description": "Asks 1-2 questions max, not a wall of questions"},
12
+ {"name": "no_research_sprint_turn1", "description": "Does NOT dispatch research agents on the very first turn — intake only"},
13
+ {"name": "hard_stop", "description": "Ends with a question and waits — does NOT proceed to synthesize or generate suggestions"},
14
+ {"name": "repo_scan_launched", "description": "Mentions or silently launches a repo/codebase scan agent in background"}
15
+ ]
16
+ },
17
+ {
18
+ "id": 1,
19
+ "name": "fresh-idea-turn2-research",
20
+ "prompt": "It's for college students who want to find people in the same classes to study with. Matching based on courses, study style, and schedule availability.",
21
+ "expected_output": "First research sprint dispatched (3 agents), synthesized suggestions with citations, challenge, 1-2 questions, STOP",
22
+ "files": [],
23
+ "multi_turn_context": "Turn 2. Turn 1: user said 'building study buddy app like Tinder for studying', skill asked intake questions, user now responds with details.",
24
+ "assertions": [
25
+ {"name": "three_agents_dispatched", "description": "Dispatches 3 parallel research agents (web, github, competitive) — not fewer"},
26
+ {"name": "real_citations", "description": "At least 3 unique URLs to real repos/articles/products in the synthesis"},
27
+ {"name": "suggestions_with_evidence", "description": "Presents numbered suggestions (3-5) with real-world evidence backing each one"},
28
+ {"name": "recommendation_labeled", "description": "Suggestion #1 is labeled RECOMMENDED with rationale"},
29
+ {"name": "challenge_present", "description": "Includes at least one challenge/pushback after suggestions"},
30
+ {"name": "ends_with_question", "description": "Ends with 1-2 targeted questions to drive next research sprint"},
31
+ {"name": "hard_stop", "description": "Does NOT continue past the questions — waits for user response"},
32
+ {"name": "depth_is_broad", "description": "Research queries are landscape-level (major approaches, who's done this) not implementation-specific"}
33
+ ]
34
+ },
35
+ {
36
+ "id": 2,
37
+ "name": "turn3-deeper-research",
38
+ "prompt": "I like option 2 — the React Native approach with Firebase. But I'm worried about the matching algorithm complexity. Also we need to handle the cold-start problem when a new university joins.",
39
+ "expected_output": "Second research sprint (deeper, focused on RN+Firebase+matching), new suggestions building on prior, new challenges, new questions",
40
+ "files": [],
41
+ "multi_turn_context": "Turn 3. Prior turns: user described study buddy app, first research sprint found 5 approaches, user now picks one and raises two specific concerns.",
42
+ "assertions": [
43
+ {"name": "three_agents_dispatched", "description": "Dispatches 3 parallel research agents again — every turn gets a research sprint"},
44
+ {"name": "research_is_deeper", "description": "Search queries target matching algorithms and cold-start specifically, NOT broad 'study buddy app' landscape again"},
45
+ {"name": "builds_on_prior", "description": "References prior turn's findings — does not re-present the same 5 approaches"},
46
+ {"name": "new_citations", "description": "At least 2 URLs not seen in prior turns — fresh research, not recycled"},
47
+ {"name": "addresses_user_concerns", "description": "Suggestions specifically address matching algorithm complexity AND cold-start problem"},
48
+ {"name": "challenge_present", "description": "Challenges the user on at least one assumption or pushes back on scope"},
49
+ {"name": "ends_with_question", "description": "Ends with 1-2 questions that unlock the NEXT research vector"},
50
+ {"name": "hard_stop", "description": "Does NOT continue past the questions"}
51
+ ]
52
+ },
53
+ {
54
+ "id": 3,
55
+ "name": "brain-dump-intake",
56
+ "prompt": "help me build all the suggestions in this chat: [brain dump about eng-buddy]",
57
+ "expected_output": "Path B structured extraction with repo context, confirmation gate, no research yet",
58
+ "files": ["brain-dump-input.md"],
59
+ "assertions": [
60
+ {"name": "decided_section", "description": "Contains a 'Decided' or 'Decisions already made' section"},
61
+ {"name": "open_questions_section", "description": "Contains an 'Open questions' or 'Gaps' section"},
62
+ {"name": "no_basic_questions", "description": "Does NOT ask basic 'what are you building?' questions already answered by the paste"},
63
+ {"name": "confirmation_gate", "description": "Ends with a confirmation question before proceeding to research"},
64
+ {"name": "no_research_sprint", "description": "Does NOT dispatch research agents or present suggestions on this turn"},
65
+ {"name": "hard_stop", "description": "Stops after asking for confirmation — does not proceed"}
66
+ ]
67
+ },
68
+ {
69
+ "id": 4,
70
+ "name": "brain-dump-turn2-research",
71
+ "prompt": "Yeah that looks right, go ahead and research it",
72
+ "expected_output": "First research sprint in brain dump mode: novelty map, suggestions with citations, challenges",
73
+ "files": ["brain-dump-input.md"],
74
+ "multi_turn_context": "Turn 2 of brain dump. Turn 1: user pasted eng-buddy brain dump, skill extracted structured summary, user now confirms.",
75
+ "assertions": [
76
+ {"name": "three_agents_dispatched", "description": "Dispatches 3 parallel research agents searching for specific brain dump claims"},
77
+ {"name": "novelty_map_present", "description": "Contains a Novelty Map table with solved/partially solved/novel verdicts"},
78
+ {"name": "real_citations", "description": "At least 5 unique URLs to real repos/articles/products"},
79
+ {"name": "brain_dump_claims_researched", "description": "Agents searched for specific architectural claims from the dump, not just broad topic searches"},
80
+ {"name": "challenge_present", "description": "At least one challenge/pushback raised"},
81
+ {"name": "ends_with_question", "description": "Ends with 1-2 targeted questions"},
82
+ {"name": "hard_stop", "description": "Does NOT proceed past questions"}
83
+ ]
84
+ },
85
+ {
86
+ "id": 5,
87
+ "name": "phase3-gate",
88
+ "prompt": "Ok I think I know what I want. Let's turn this into a plan.",
89
+ "expected_output": "Vision summary for approval, NOT the full plan yet",
90
+ "files": [],
91
+ "multi_turn_context": "Turn 6+ of brainstorming. Previous turns explored study-buddy app, settled on React Native + Firebase, matching algorithm, cold-start solution. User now wants to move to planning.",
92
+ "assertions": [
93
+ {"name": "vision_summary", "description": "Presents a brief 'here's what we've landed on' summary before generating the full plan"},
94
+ {"name": "approval_gate", "description": "Asks for explicit confirmation before proceeding to full plan generation"},
95
+ {"name": "does_not_dump_full_plan", "description": "Does NOT generate the entire task breakdown, agent assignments, and wave structure in this message"},
96
+ {"name": "references_plan_template", "description": "Reads or references references/plan-template.md for plan generation"}
97
+ ]
98
+ }
99
+ ]
100
+ }