feed-the-machine 1.3.0 → 1.3.1

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.
@@ -256,6 +256,33 @@ Guidelines for writing clear declarations:
256
256
 
257
257
  ---
258
258
 
259
+ ### capture_complete
260
+ - **Description**: ftm-capture finished processing and persisting a captured item (snippet, link, thought, or known issue)
261
+ - **Emitted by**: ftm-capture
262
+ - **Listened to by**: ftm-mind (log capture on blackboard, optionally surface to user)
263
+ - **Fast-path**: no
264
+ - **Payload**: `{ capture_type, title, file_path, timestamp }`
265
+
266
+ ---
267
+
268
+ ### known_issue_recorded
269
+ - **Description**: A known issue was captured and recorded for future reference, avoiding repeated investigation of the same problem
270
+ - **Emitted by**: ftm-capture
271
+ - **Listened to by**: ftm-mind (index known issue on blackboard for dedup during future debug sessions)
272
+ - **Fast-path**: no
273
+ - **Payload**: `{ issue_title, issue_description, file_path, tags: [string], timestamp }`
274
+
275
+ ---
276
+
277
+ ### push_requested
278
+ - **Description**: A git push was requested — triggers ftm-git pre-push validation (secret scanning, branch policy checks)
279
+ - **Emitted by**: git-workflow, external systems
280
+ - **Listened to by**: ftm-git (run pre-push secret scan and branch policy validation)
281
+ - **Fast-path**: no
282
+ - **Payload**: `{ branch, remote, commit_range, task_number }`
283
+
284
+ ---
285
+
259
286
  ## Fast-Path Summary
260
287
 
261
288
  | Event | Always triggers |
@@ -296,4 +323,7 @@ Use this table to quickly look up which skills are involved when an event fires:
296
323
  | secrets_found | git | executor, mind |
297
324
  | secrets_clear | git | executor, mind |
298
325
  | secrets_remediated | git | executor, mind |
326
+ | capture_complete | capture | mind |
327
+ | known_issue_recorded | capture | mind |
328
+ | push_requested | git-workflow, external systems | git |
299
329
  | map_updated | map | mind, intent, diagram |
@@ -14,9 +14,15 @@ description: Save the current ftm skill session state so work can be resumed in
14
14
 
15
15
  # FTM Pause — Session State Capture
16
16
 
17
- Save the full state of any active ftm skill session to disk so it can be resumed in a new conversation with zero context loss.
17
+ Save the full state of any active ftm skill session to disk so it can be resumed in a new conversation with zero context loss. This skill understands the internal structure of every ftm skill and captures exactly what's needed to pick up where you left off.
18
18
 
19
- ## Step 1: Detect the Active FTM Skill
19
+ ## Why This Exists
20
+
21
+ FTM skills — brainstorm, executor, debug, council, audit — are multi-phase, multi-turn workflows that accumulate significant context over time. Research findings, agent results, user decisions, worktree branches, plan progress — all of this lives in the conversation and dies when the conversation ends. A brainstorm session 8 turns deep with 3 completed research sprints and 2 rounds of questioning is hours of work that evaporates if the user needs to stop.
22
+
23
+ This skill captures that state to a structured file that ftm-resume can read to reconstruct the session in a fresh conversation. The user loses nothing.
24
+
25
+ ## Step 1: Detect the Active Panda Skill
20
26
 
21
27
  Scan the current conversation context to determine which ftm skill is active. Look for these signals:
22
28
 
@@ -34,9 +40,150 @@ If multiple skills have been invoked in the same conversation (e.g., brainstorm
34
40
 
35
41
  ## Step 2: Capture State by Skill Type
36
42
 
37
- Read `references/protocols/SKILL-RESTORE-PROTOCOLS.md` for the full per-skill capture specification. Each skill section defines exactly which fields must be captured and what is required for reliable restoration.
38
-
39
- Capture every field listed for the detected skill. Do not omit fields because a phase hasn't been reached yet — record those as "not started" or "N/A" so ftm-resume knows the session stopped before that phase.
43
+ ### ftm-brainstorm
44
+
45
+ Capture all of the following that exist in the current session:
46
+
47
+ **Phase tracking:**
48
+ - Current phase (0, 1, 2, or 3)
49
+ - If Phase 1: which round (1, 2, or 3), which path (A: Fresh Idea or B: Brain Dump)
50
+ - If Phase 2: how many research+challenge turns have been completed
51
+ - If Phase 3: which section of the plan has been presented (Vision, Tasks, Agents, or complete)
52
+
53
+ **Phase 0 context:**
54
+ - The full repo scan results (project type, tech stack, architecture, patterns, infrastructure, scale)
55
+ - Whether the scan was skipped (no git repo) and any stack info gathered from the user instead
56
+
57
+ **Phase 1 — Intake:**
58
+ - The user's original idea/request (verbatim if short, summarized if long)
59
+ - If Path B: the full brain dump extraction (decisions made, open questions, assumptions, contradictions, gaps)
60
+ - All user answers from each completed round
61
+ - Research Sprint 1 results (landscape context) — all findings from Web Researcher, GitHub Explorer, Competitive Analyst
62
+ - Research Sprint 2 results (constraint-scoped research) — all findings from all three agents
63
+ - If Path B: the novelty map (which claims are solved/partially solved/novel)
64
+
65
+ **Phase 2 — Research + Challenge Loop:**
66
+ - Every completed turn's 5 suggestions (or fewer if weak results) with evidence and links
67
+ - Every challenge posed and the user's response
68
+ - Every question asked and the user's answer
69
+ - Accumulated decisions and direction chosen
70
+ - Research agent results from each turn (summarized — full URLs and key findings, not raw agent output)
71
+ - The current "direction" the brainstorm is heading (architecture chosen, scope narrowed, etc.)
72
+
73
+ **Phase 3 — Plan Generation:**
74
+ - Which sections have been presented and approved (Vision, Tasks, Agents/Waves)
75
+ - The plan content generated so far
76
+ - The plan file path if it's been saved
77
+ - User feedback on each section
78
+
79
+ ### ftm-executor
80
+
81
+ **Plan context:**
82
+ - Plan file path (absolute)
83
+ - Plan title and summary
84
+ - Total task count
85
+ - Agent team composition (agent names, roles, task assignments)
86
+
87
+ **Execution progress:**
88
+ - Current wave number
89
+ - For each task: status (pending / in-progress / complete / failed / blocked)
90
+ - For completed tasks: commit hashes, audit results (pass/fail/auto-fixed), brief summary of what was done
91
+ - For in-progress tasks: which agent is working on it, what's been done so far
92
+ - For failed/blocked tasks: what went wrong, error details
93
+
94
+ **Worktree state:**
95
+ - List of all worktree branches and their paths
96
+ - Which worktrees are active vs merged vs abandoned
97
+ - Any merge results or conflicts encountered
98
+ - The main/working branch name
99
+
100
+ **Verification state:**
101
+ - Post-task audit results for each completed task
102
+ - Any manual intervention items outstanding
103
+ - Full test suite status (last run result)
104
+
105
+ ### ftm-debug
106
+
107
+ **Problem context:**
108
+ - The original problem statement (symptom, expected behavior, what's been tried, when it started, reproduction steps)
109
+ - Codebase reconnaissance results (entry points, call graph, state flow, dependencies, recent changes, test coverage, config, error handling)
110
+ - The investigation plan (likely category, which agents deployed, worktree strategy)
111
+
112
+ **Phase 1 — Investigation results:**
113
+ - Instrumenter report: what was instrumented, log point locations, DEBUG-INSTRUMENTATION.md content
114
+ - Researcher report: findings with sources, relevance, solutions, confidence, RESEARCH-FINDINGS.md content
115
+ - Reproducer report: trigger command, consistency, boundaries, minimal test path, REPRODUCTION.md content
116
+ - Hypothesizer report: all hypotheses ranked with claims, mechanisms, code paths, evidence, HYPOTHESES.md content
117
+
118
+ **Phase 2 — Synthesis & Solve:**
119
+ - Cross-reference analysis (how findings align or conflict)
120
+ - Recommended fix approach
121
+ - Solver attempts: which hypotheses tried, what was implemented, commit hashes
122
+ - FIX-SUMMARY.md content if fix was applied
123
+
124
+ **Phase 3 — Review & Verify:**
125
+ - Reviewer verdict (APPROVED / APPROVED WITH CHANGES / NEEDS REWORK)
126
+ - REVIEW-VERDICT.md content
127
+ - How many solver-reviewer iterations completed
128
+ - Outstanding issues from review
129
+
130
+ **Worktree state:**
131
+ - debug-instrumentation branch and path
132
+ - debug-reproduction branch and path
133
+ - debug-fix branch and path (including any fix attempt sub-branches)
134
+ - Which worktrees still exist vs cleaned up
135
+
136
+ ### ftm-council
137
+
138
+ **Council setup:**
139
+ - The council prompt (the framed problem statement)
140
+ - Whether the user confirmed/edited the prompt
141
+ - Prerequisites check result (codex and gemini available?)
142
+
143
+ **Deliberation state:**
144
+ - Current round number (1-5)
145
+ - For each completed round, each model's full response:
146
+ - Research summary (what files examined, what was found)
147
+ - Position (their stance)
148
+ - Reasoning (with code references)
149
+ - Concerns
150
+ - Confidence level
151
+ - For rebuttal rounds: each model's updated position, new evidence, responses to other models, remaining disagreements
152
+ - Alignment analysis after each round (agreement areas, divergence points, different research paths, majority forming?)
153
+
154
+ **Outcome:**
155
+ - Whether consensus has been reached (and if so, which 2 models agreed)
156
+ - The verdict if delivered (decision, agreed by, dissent, evidence basis)
157
+ - If no consensus after 5 rounds: the synthesis and options presented
158
+
159
+ ### ftm-audit
160
+
161
+ **Trigger context:**
162
+ - What triggered the audit (manual invocation, post-task from executor, specific files/scope)
163
+ - Scope (full project, specific files, specific task's changes)
164
+
165
+ **Phase 0 — Project patterns:**
166
+ - Detected framework, router, state management, API layer, build tool
167
+ - Active dimensions (D1-D5) and their configuration
168
+ - Any unusual patterns noted
169
+
170
+ **Layer 1 — knip results:**
171
+ - Full knip output (categorized: unused files, unused exports, unused deps, unlisted deps, unresolved imports)
172
+ - Each finding with file:line
173
+
174
+ **Layer 2 — Adversarial audit results:**
175
+ - Each finding with type, location, evidence, and which dimension failed
176
+ - Wiring contract checks if applicable (which checks passed, which failed)
177
+
178
+ **Layer 3 — Auto-fix results:**
179
+ - Fixes applied (finding, fix description, verification result)
180
+ - Manual intervention items (finding, reason auto-fix skipped, suggested action)
181
+ - Re-verification results
182
+ - Current iteration count (of max 3)
183
+
184
+ **Final status:**
185
+ - PASS or FAIL
186
+ - Remaining issues count and details
40
187
 
41
188
  ## Step 3: Gather Artifacts
42
189
 
@@ -57,80 +204,152 @@ Create the directory if it doesn't exist:
57
204
  mkdir -p ~/.claude/ftm-state
58
205
  ```
59
206
 
60
- Write the state file to `~/.claude/ftm-state/STATE.md`. Required structure:
207
+ Write the state file to `~/.claude/ftm-state/STATE.md`:
61
208
 
62
209
  ```markdown
63
210
  ---
64
- skill: <skill-name>
65
- phase: <phase-number-or-name>
66
- phase_detail: "<human-readable one-liner: exactly where the session stopped>"
67
- timestamp: <ISO-8601>
68
- project_dir: <absolute-path>
69
- git_branch: <branch> # omit if no git repo
70
- git_commit: <short-hash> # omit if no git repo
211
+ skill: ftm-brainstorm
212
+ phase: 2
213
+ phase_detail: "Research+Challenge turn 5, user chose microservices direction"
214
+ timestamp: 2026-03-16T23:50:00
215
+ project_dir: /Users/path/to/project
216
+ git_branch: main
217
+ git_commit: abc1234
71
218
  ---
72
219
 
73
220
  # FTM Session State
74
221
 
75
222
  ## Active Skill
76
- [One paragraph: skill, phase, path, turn, and current direction]
223
+ ftm-brainstorm, Phase 2 (Research + Challenge Loop), Turn 5 of unlimited.
224
+ Path A (Fresh Idea). User chose microservices direction in turn 3, currently exploring
225
+ service mesh options.
77
226
 
78
227
  ## Context Snapshot
79
- [Full state for this skill per references/protocols/SKILL-RESTORE-PROTOCOLS.md]
228
+
229
+ ### Phase 0: Repo Scan
230
+ [paste the full repo scan results here — project type, stack, architecture, patterns]
231
+
232
+ ### Phase 1: Intake Summary
233
+ **Round 1 answers:**
234
+ - Core idea: [user's answer]
235
+ - Target users: [user's answer]
236
+ - Problem solved: [user's answer]
237
+
238
+ **Research Sprint 1 (Landscape):**
239
+ - Web Researcher: [key findings with URLs]
240
+ - GitHub Explorer: [key repos with URLs]
241
+ - Competitive Analyst: [key products/tools]
242
+
243
+ **Round 2 answers:**
244
+ - Architecture preference: [user's choice from Sprint 1 options]
245
+ - Integration requirements: [user's answer]
246
+ - Scale/environment: [user's answer]
247
+
248
+ **Research Sprint 2 (Constraint-Scoped):**
249
+ - [findings, more targeted than Sprint 1]
250
+
251
+ **Round 3 answers:**
252
+ - Success criteria: [user's answer]
253
+ - v1 scope: [user's answer]
254
+ - Non-negotiables: [user's answer]
255
+
256
+ ### Phase 2: Research + Challenge Turns
257
+ **Turn 1:**
258
+ - Suggestions presented: [titles of 5 suggestions with brief summaries]
259
+ - Challenges posed: [what was challenged]
260
+ - User response: [what they said, what direction they chose]
261
+
262
+ **Turn 2:**
263
+ [same structure]
264
+
265
+ [...repeat for each turn...]
266
+
267
+ **Current direction:**
268
+ [the accumulated picture of what's being built, architecture chosen, scope, key decisions]
80
269
 
81
270
  ## Decisions Made
82
- [Every decision the user confirmed — use real content, not placeholders]
271
+ - Architecture: microservices with gRPC
272
+ - Database: PostgreSQL with read replicas
273
+ - Auth: OAuth2 with Okta integration
274
+ - Scope: 3 core services for v1, defer analytics service
275
+ - [every decision the user confirmed during the session]
83
276
 
84
277
  ## Open Questions
85
- [Anything unresolved or about to be explored]
278
+ - Service mesh: Istio vs Linkerd — research presented, user hasn't decided
279
+ - Deployment: Kubernetes vs ECS — not yet discussed
280
+ - [anything that was about to be explored]
86
281
 
87
282
  ## Next Step
88
- [Specific and actionable: what ftm-resume does first, what the user needs to respond to,
89
- what research runs next. Must be specific enough to resume without "where were we?"]
283
+ Phase 2, Turn 6. The user was presented with service mesh options (Istio vs Linkerd)
284
+ in Turn 5 and needs to respond. After their response, research should focus on
285
+ deployment strategy (Kubernetes vs ECS) as this is the last major architecture
286
+ decision before the brainstorm can move to Phase 3.
287
+
288
+ Research agents for next turn should query:
289
+ - Web Researcher: "[chosen service mesh] production gotchas [stack]"
290
+ - GitHub Explorer: "[chosen service mesh] example configurations"
291
+ - Competitive Analyst: "companies using [chosen mesh] at [user's scale]"
90
292
 
91
293
  ## Artifacts
92
- [Absolute path for each artifact, or "none on disk"]
294
+ - ~/.claude/plans/ no plan generated yet (still in Phase 2)
295
+ - No worktrees active (brainstorm doesn't use worktrees)
296
+ - Research findings accumulated in conversation only (not saved to disk)
93
297
  ```
94
298
 
95
- **Rules:**
96
- - `git_commit`: run `git rev-parse --short HEAD`. `git_branch`: run `git branch --show-current`.
97
- - Include actual content real URLs, real decisions, real findings. No placeholders.
98
- - Omit raw agent prompts (the skill files have them) and full file contents (reference by path).
299
+ **Formatting rules:**
300
+ - Use the YAML frontmatter exactly as shown ftm-resume parses it
301
+ - The `phase_detail` field should be a human-readable one-liner about exactly where in the phase the user stopped
302
+ - `git_commit` should be the current HEAD commit hash (run `git rev-parse --short HEAD`)
303
+ - `git_branch` should be the current branch (run `git branch --show-current`)
304
+ - The "Next Step" section is the most important — it must be specific enough that a fresh conversation can pick up without asking "where were we?"
305
+ - Include actual content, not placeholders — paste real findings, real decisions, real URLs
99
306
 
100
- See `references/protocols/VALIDATION.md` for the full pre-write and post-write validation checklist.
307
+ **What to omit:**
308
+ - Raw agent prompts (the skill files already have these)
309
+ - Full file contents that were read during the session (reference by path instead)
310
+ - Conversation pleasantries or back-and-forth that doesn't carry information
101
311
 
102
312
  ## Step 5: Confirm to User
103
313
 
104
- After saving, present a brief confirmation:
314
+ After saving, present a confirmation:
105
315
 
106
316
  ```
107
317
  Session saved to ~/.claude/ftm-state/STATE.md
108
318
 
109
319
  Captured:
110
- - Skill: <skill-name>
111
- - Phase: <phase and detail>
112
- - <skill-specific counts: decisions, tasks, rounds, findings, etc.>
113
- - Artifacts: <count and locations, or "none on disk">
320
+ - Skill: ftm-brainstorm
321
+ - Phase: 2 (Research + Challenge Loop, Turn 5)
322
+ - Decisions locked: 4 (architecture, database, auth, v1 scope)
323
+ - Open questions: 2 (service mesh, deployment)
324
+ - Research sprints completed: 2 (landscape + constraint-scoped)
325
+ - Challenge turns completed: 5
326
+ - Artifacts: none on disk (research in state file)
114
327
 
115
328
  To resume in a new conversation:
116
329
  /ftm-resume
117
330
  ```
118
331
 
119
- Tailor the counts to the skill: brainstorm shows decisions + turns, executor shows task completion, debug shows investigation agents, council shows round count + consensus status, audit shows layer completion + finding counts.
332
+ Adjust the "Captured" summary to match the actual skill. For ftm-executor, show task completion counts. For ftm-debug, show which investigation agents completed. For ftm-council, show round count and consensus status. For ftm-audit, show layer completion and finding counts.
120
333
 
121
334
  ## Edge Cases
122
335
 
123
- **Multiple skills active:** Ask which to save. If "both," save most recent to STATE.md and the other to STATE-[skill].md.
336
+ ### Multiple ftm skills in one conversation
337
+ If the user ran brainstorm and then executor in the same conversation, ask which one to save. If they say "both," save the most recent one to STATE.md and the other to STATE-[skill].md in the same directory.
124
338
 
125
- **Very early session:** Save what exists — even a Phase 0 scan is worth capturing. "Next Step" should say the user needs to answer the first intake question.
339
+ ### Very early in a session
340
+ If the user pauses in Phase 0 or the first step of a skill, there may be almost nothing to capture. That's fine — save what exists. Even a Phase 0 repo scan result saves the user from re-scanning.
126
341
 
127
- **State file already exists:** Overwrite it. Prior state was either consumed or abandoned. FTM-resume archives before loading if the user needs the old one.
342
+ ### State file already exists
343
+ Overwrite it. The previous state was either already resumed (and thus consumed) or abandoned. If the user wants to keep the old state, ftm-resume archives it before loading.
128
344
 
129
- **No git repo:** Omit `git_branch` and `git_commit` fields. Record `project_dir` only.
345
+ ### No git repo
346
+ Skip the git_branch and git_commit fields. Note `project_dir` only.
130
347
 
131
- **Skill invoked, no user interaction yet:** Save what exists (Phase 0 scan, initial question). "Next Step" notes that the user hasn't answered yet.
348
+ ### Skill invoked but no user interaction yet
349
+ If the skill was just invoked (e.g., the user said "/ftm-brainstorm" and Claude responded with the first question, but the user hasn't answered yet), save what exists — the Phase 0 scan and the initial question. The "Next Step" should note that the user needs to answer the first intake question.
132
350
 
133
- **Large state:** Do not truncate. Some sessions produce massive state files. Completeness is required for reliable restoration.
351
+ ### Large state
352
+ Some sessions accumulate substantial state — 8+ brainstorm turns with full research results, or an executor session with 20+ tasks. Don't truncate. The state file can be large. FTM-resume needs all of it to reconstruct properly. If a single research finding has 5 URLs and detailed analysis, include all of it.
134
353
 
135
354
  ## Requirements
136
355