feed-the-machine 1.3.0 → 1.4.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 (45) hide show
  1. package/ftm-audit/SKILL.md +383 -57
  2. package/ftm-brainstorm/SKILL.md +119 -51
  3. package/ftm-config/SKILL.md +1 -1
  4. package/ftm-council/SKILL.md +259 -31
  5. package/ftm-dashboard/SKILL.md +10 -10
  6. package/ftm-debug/SKILL.md +861 -54
  7. package/ftm-diagram/SKILL.md +1 -1
  8. package/ftm-executor/SKILL.md +6 -6
  9. package/ftm-git/SKILL.md +208 -22
  10. package/ftm-inbox/bin/start.sh +1 -1
  11. package/ftm-inbox/bin/status.sh +1 -1
  12. package/ftm-inbox/bin/stop.sh +1 -1
  13. package/ftm-intent/SKILL.md +0 -1
  14. package/ftm-map/SKILL.md +46 -14
  15. package/ftm-map/scripts/db.py +439 -118
  16. package/ftm-map/scripts/index.py +128 -54
  17. package/ftm-map/scripts/parser.py +89 -320
  18. package/ftm-map/scripts/queries/go-tags.scm +20 -0
  19. package/ftm-map/scripts/queries/javascript-tags.scm +19 -7
  20. package/ftm-map/scripts/queries/python-tags.scm +22 -8
  21. package/ftm-map/scripts/queries/ruby-tags.scm +19 -0
  22. package/ftm-map/scripts/queries/rust-tags.scm +37 -0
  23. package/ftm-map/scripts/queries/typescript-tags.scm +20 -8
  24. package/ftm-map/scripts/query.py +176 -24
  25. package/ftm-map/scripts/ranker.py +377 -0
  26. package/ftm-map/scripts/requirements.txt +3 -0
  27. package/ftm-map/scripts/setup.sh +11 -0
  28. package/ftm-map/scripts/test_db.py +355 -115
  29. package/ftm-map/scripts/test_parser.py +169 -101
  30. package/ftm-map/scripts/test_query.py +178 -61
  31. package/ftm-map/scripts/test_ranker.py +199 -0
  32. package/ftm-map/scripts/views.py +107 -61
  33. package/ftm-mind/SKILL.md +861 -11
  34. package/ftm-mind/references/event-registry.md +20 -0
  35. package/ftm-pause/SKILL.md +256 -37
  36. package/ftm-resume/SKILL.md +380 -75
  37. package/ftm-retro/SKILL.md +164 -27
  38. package/ftm-upgrade/SKILL.md +4 -4
  39. package/hooks/ftm-blackboard-enforcer.sh +2 -4
  40. package/install.sh +6 -1
  41. package/package.json +1 -1
  42. package/ftm-map/scripts/tests/fixtures/__init__.py +0 -0
  43. package/ftm-map/scripts/tests/fixtures/sample_project/api.ts +0 -16
  44. package/ftm-map/scripts/tests/fixtures/sample_project/auth.py +0 -15
  45. package/ftm-map/scripts/tests/fixtures/sample_project/utils.js +0 -16
@@ -24,6 +24,17 @@ Before dispatching any agents, read `~/.claude/ftm-config.yml`:
24
24
  - Example: if profile is `balanced`, agents get `model: opus`
25
25
  - If config missing, use session default
26
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
+
27
38
  ## Research Sprint Dispatch
28
39
 
29
40
  Each research sprint invokes ftm-researcher rather than dispatching agents directly.
@@ -43,15 +54,6 @@ The brainstorm skill consumes the researcher's structured output and weaves it i
43
54
  - Challenges based on contested claims from the disagreement map
44
55
  - Targeted questions based on research gaps
45
56
 
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
57
 
56
58
  ---
57
59
 
@@ -61,15 +63,28 @@ This skill is a **multi-turn research conversation**. Every single turn after th
61
63
 
62
64
  ```
63
65
  EVERY TURN (after initial intake):
64
- 1. RESEARCH SPRINT — invoke ftm-researcher with context
66
+ 1. RESEARCH SPRINT — 3 agents search in parallel from different vectors
65
67
  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
+ 3. CHALLENGE — observations that push back on assumptions (NOT questions)
69
+ 4. ASK VIA UI — use AskUserQuestion tool (1-4 questions, clickable options)
68
70
  5. >>> STOP <<< — wait for the user. Do NOT continue.
69
71
  ```
70
72
 
71
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.
72
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
+
73
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.
74
89
 
75
90
  **Research depth escalates automatically:**
@@ -100,27 +115,30 @@ Detect which path you're on:
100
115
 
101
116
  ## Path A: Fresh Idea (short/vague message)
102
117
 
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.
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.
104
119
 
105
120
  **>>> STOP. Wait for response. <<<**
106
121
 
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.
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.
108
123
 
109
124
  **>>> STOP. Wait for response. <<<**
110
125
 
111
- **Turn 3+:** You're now in the core loop. Every turn from here follows the cycle: research sprint -> synthesize -> challenge -> ask -> STOP.
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.
112
127
 
113
128
  ## Path B: Brain Dump (large paste, notes, transcript)
114
129
 
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.
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.
116
131
 
117
132
  **>>> STOP. Wait for confirmation. <<<**
118
133
 
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.
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.
120
135
 
121
136
  **>>> STOP. Wait for response. <<<**
122
137
 
123
- **Turn 3+:** Core loop continues.
138
+ **Turn 3+:** Core loop continues. One question per turn.
139
+
140
+ ---
141
+
124
142
 
125
143
  ---
126
144
 
@@ -138,7 +156,7 @@ Discuss mode activates when:
138
156
 
139
157
  ## Flow
140
158
 
141
- Instead of the standard brainstorm research synthesis suggestions flow:
159
+ Instead of the standard brainstorm research -> synthesis -> suggestions flow:
142
160
 
143
161
  1. **Parse the spec** — Extract: what's being built, key components, tech stack, constraints
144
162
  2. **Identify gray areas** — Find the parts that aren't specified:
@@ -170,8 +188,6 @@ Instead of the standard brainstorm research → synthesis → suggestions flow:
170
188
  | Integration | Auth flow, webhook handling, rate limits, data mapping, error recovery |
171
189
  | Config change | Rollback plan, feature flags, gradual rollout, monitoring |
172
190
 
173
- ---
174
-
175
191
  # PHASE 2: RESEARCH + CHALLENGE LOOP
176
192
 
177
193
  This is the heart of the skill. Unlimited turns. Each one follows the cycle.
@@ -214,29 +230,77 @@ If research was thin, present fewer suggestions. Quality over quantity. If all 3
214
230
  |---|---|---|
215
231
  | [claim] | Solved / Partially Solved / Novel | [link or explanation] |
216
232
 
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.
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
+ ```
228
296
 
229
- ## Step 4: Ask 1-2 Targeted Questions + Invite Continuation
297
+ Some questions will become unnecessary as earlier answers clarify things — drop them from the queue when that happens.
230
298
 
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
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.
236
300
 
237
- Prefer multiple-choice when the answer space is bounded. Each question should unlock a NEW research vector for next turn.
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.
238
302
 
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.
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.
240
304
 
241
305
  ## Step 5: STOP
242
306
 
@@ -248,7 +312,7 @@ This is non-negotiable. The user's response is the input for the next research s
248
312
 
249
313
  ## Feature-Type Detection
250
314
 
251
- When you learn enough to classify the feature, add type-specific questions. Pick 2-3 unknowns, don't dump everything.
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.
252
316
 
253
317
  | Type | Signals | Key Questions |
254
318
  |---|---|---|
@@ -257,21 +321,26 @@ When you learn enough to classify the feature, add type-specific questions. Pick
257
321
  | Data/Storage | "database", "store", "persist" | SQL vs NoSQL? Read/write ratio? Consistency requirements? |
258
322
  | Integration | "connect to", "sync with" | Push/pull/both? Real-time or batch? Retry handling? |
259
323
  | Automation | "automate", "trigger", "schedule" | Trigger mechanism? Failure notification? Idempotency? |
260
- | CLI Tool | "command", "CLI", "terminal" | Interactive or not? Output format? Config file approach? |
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? |
261
325
  | AI/ML | "AI", "model", "generate", "LLM" | Which model? Latency tolerance? Fallback? Cost ceiling? |
262
326
 
263
327
  ---
264
328
 
265
329
  ## When to Suggest Phase 3
266
330
 
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
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.
271
334
 
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.
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.
273
336
 
274
- **HARD GATE: The user must explicitly approve.** Present a brief summary:
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:
275
344
 
276
345
  ```
277
346
  Here's what I think we've landed on:
@@ -280,11 +349,9 @@ Here's what I think we've landed on:
280
349
  **Core approach:** [recommended architecture/pattern]
281
350
  **Key decisions:** [2-3 bullets]
282
351
  **Scope for v1:** [what's in, what's deferred]
283
-
284
- Ready to turn this into an implementation plan, or more to explore?
285
352
  ```
286
353
 
287
- If they say yes, proceed. If they raise new questions, stay in Phase 2.
354
+ Then proceed to Phase 3. If they raise corrections, address them before proceeding.
288
355
 
289
356
  ---
290
357
 
@@ -303,6 +370,7 @@ If user already completed superpowers:brainstorming, point to ftm-executor inste
303
370
 
304
371
  ---
305
372
 
373
+
306
374
  ## Context Compression
307
375
 
308
376
  After turn 5 in a brainstorm session, earlier turns start consuming significant context. Apply compression to maintain quality in later turns.
@@ -188,7 +188,7 @@ At the beginning of any ftm skill execution:
188
188
 
189
189
  ### Mapping Stages to FTM Skills
190
190
 
191
- | Stage | Config Key | FTM Skills That Use It |
191
+ | Stage | Config Key | Panda Skills That Use It |
192
192
  |-------|-----------|--------------------------|
193
193
  | **Planning** | `profiles.<active>.planning` | ftm-brainstorm, ftm (research/plan generation phase) |
194
194
  | **Execution** | `profiles.<active>.execution` | ftm-executor (all spawned task agents) |