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.
- package/LICENSE +21 -0
- package/README.md +268 -0
- package/bin/generate-manifest.mjs +210 -0
- package/bin/install.mjs +114 -0
- package/ftm/SKILL.md +88 -0
- package/ftm-audit/SKILL.md +146 -0
- package/ftm-audit/references/protocols/PROJECT-PATTERNS.md +91 -0
- package/ftm-audit/references/protocols/RUNTIME-WIRING.md +66 -0
- package/ftm-audit/references/protocols/WIRING-CONTRACTS.md +135 -0
- package/ftm-audit/references/strategies/AUTO-FIX-STRATEGIES.md +69 -0
- package/ftm-audit/references/templates/REPORT-FORMAT.md +96 -0
- package/ftm-audit/scripts/run-knip.sh +23 -0
- package/ftm-audit.yml +2 -0
- package/ftm-brainstorm/SKILL.md +379 -0
- package/ftm-brainstorm/evals/evals.json +100 -0
- package/ftm-brainstorm/evals/promptfoo.yaml +109 -0
- package/ftm-brainstorm/references/agent-prompts.md +224 -0
- package/ftm-brainstorm/references/plan-template.md +121 -0
- package/ftm-brainstorm.yml +2 -0
- package/ftm-browse/SKILL.md +415 -0
- package/ftm-browse/daemon/browser-manager.ts +206 -0
- package/ftm-browse/daemon/bun.lock +30 -0
- package/ftm-browse/daemon/cli.ts +347 -0
- package/ftm-browse/daemon/commands.ts +410 -0
- package/ftm-browse/daemon/main.ts +357 -0
- package/ftm-browse/daemon/package.json +17 -0
- package/ftm-browse/daemon/server.ts +189 -0
- package/ftm-browse/daemon/snapshot.ts +519 -0
- package/ftm-browse/daemon/tsconfig.json +22 -0
- package/ftm-browse.yml +4 -0
- package/ftm-codex-gate/SKILL.md +302 -0
- package/ftm-codex-gate.yml +2 -0
- package/ftm-config/SKILL.md +310 -0
- package/ftm-config.default.yml +80 -0
- package/ftm-config.yml +2 -0
- package/ftm-council/SKILL.md +132 -0
- package/ftm-council/references/prompts/CLAUDE-INVESTIGATION.md +60 -0
- package/ftm-council/references/prompts/CODEX-INVESTIGATION.md +58 -0
- package/ftm-council/references/prompts/GEMINI-INVESTIGATION.md +58 -0
- package/ftm-council/references/prompts/REBUTTAL-TEMPLATE.md +57 -0
- package/ftm-council/references/protocols/PREREQUISITES.md +47 -0
- package/ftm-council/references/protocols/STEP-0-FRAMING.md +46 -0
- package/ftm-council.yml +2 -0
- package/ftm-dashboard.yml +4 -0
- package/ftm-debug/SKILL.md +146 -0
- package/ftm-debug/references/phases/PHASE-0-INTAKE.md +58 -0
- package/ftm-debug/references/phases/PHASE-1-TRIAGE.md +46 -0
- package/ftm-debug/references/phases/PHASE-2-WAR-ROOM-AGENTS.md +279 -0
- package/ftm-debug/references/phases/PHASE-3-TO-6-EXECUTION.md +436 -0
- package/ftm-debug/references/protocols/BLACKBOARD.md +86 -0
- package/ftm-debug/references/protocols/EDGE-CASES.md +103 -0
- package/ftm-debug.yml +2 -0
- package/ftm-diagram/SKILL.md +233 -0
- package/ftm-diagram.yml +2 -0
- package/ftm-executor/SKILL.md +657 -0
- package/ftm-executor/references/STYLE-TEMPLATE.md +73 -0
- package/ftm-executor/references/phases/PHASE-0-VERIFICATION.md +62 -0
- package/ftm-executor/references/phases/PHASE-2-AGENT-ASSEMBLY.md +34 -0
- package/ftm-executor/references/phases/PHASE-3-WORKTREES.md +38 -0
- package/ftm-executor/references/phases/PHASE-4-5-AUDIT.md +72 -0
- package/ftm-executor/references/phases/PHASE-4-DISPATCH.md +66 -0
- package/ftm-executor/references/phases/PHASE-5-5-CODEX-GATE.md +73 -0
- package/ftm-executor/references/protocols/DOCUMENTATION-BOOTSTRAP.md +36 -0
- package/ftm-executor/references/protocols/MODEL-PROFILE.md +44 -0
- package/ftm-executor/references/protocols/PROGRESS-TRACKING.md +66 -0
- package/ftm-executor/runtime/ftm-runtime.mjs +252 -0
- package/ftm-executor/runtime/package.json +8 -0
- package/ftm-executor.yml +2 -0
- package/ftm-git/SKILL.md +195 -0
- package/ftm-git/evals/evals.json +26 -0
- package/ftm-git/evals/promptfoo.yaml +75 -0
- package/ftm-git/hooks/post-commit-experience.sh +92 -0
- package/ftm-git/references/patterns/SECRET-PATTERNS.md +104 -0
- package/ftm-git/references/protocols/REMEDIATION.md +139 -0
- package/ftm-git/scripts/pre-commit-secrets.sh +110 -0
- package/ftm-git.yml +2 -0
- package/ftm-intent/SKILL.md +198 -0
- package/ftm-intent.yml +2 -0
- package/ftm-map.yml +2 -0
- package/ftm-mind/SKILL.md +986 -0
- package/ftm-mind/evals/promptfoo.yaml +142 -0
- package/ftm-mind/references/blackboard-schema.md +328 -0
- package/ftm-mind/references/complexity-guide.md +110 -0
- package/ftm-mind/references/event-registry.md +299 -0
- package/ftm-mind/references/mcp-inventory.md +296 -0
- package/ftm-mind/references/protocols/COMPLEXITY-SIZING.md +72 -0
- package/ftm-mind/references/protocols/MCP-HEURISTICS.md +32 -0
- package/ftm-mind/references/protocols/PLAN-APPROVAL.md +80 -0
- package/ftm-mind/references/reflexion-protocol.md +249 -0
- package/ftm-mind/references/routing/SCENARIOS.md +22 -0
- package/ftm-mind/references/routing-scenarios.md +35 -0
- package/ftm-mind.yml +2 -0
- package/ftm-pause/SKILL.md +133 -0
- package/ftm-pause/references/protocols/SKILL-RESTORE-PROTOCOLS.md +186 -0
- package/ftm-pause/references/protocols/VALIDATION.md +80 -0
- package/ftm-pause.yml +2 -0
- package/ftm-researcher.yml +2 -0
- package/ftm-resume/SKILL.md +166 -0
- package/ftm-resume/references/protocols/VALIDATION.md +172 -0
- package/ftm-resume.yml +2 -0
- package/ftm-retro/SKILL.md +189 -0
- package/ftm-retro/references/protocols/SCORING-RUBRICS.md +89 -0
- package/ftm-retro/references/templates/REPORT-FORMAT.md +109 -0
- package/ftm-retro.yml +2 -0
- package/ftm-routine.yml +4 -0
- package/ftm-state/blackboard/context.json +23 -0
- package/ftm-state/blackboard/experiences/index.json +9 -0
- package/ftm-state/blackboard/patterns.json +6 -0
- package/ftm-state/schemas/context.schema.json +130 -0
- package/ftm-state/schemas/experience-index.schema.json +77 -0
- package/ftm-state/schemas/experience.schema.json +78 -0
- package/ftm-state/schemas/patterns.schema.json +44 -0
- package/ftm-upgrade/SKILL.md +153 -0
- package/ftm-upgrade/scripts/check-version.sh +76 -0
- package/ftm-upgrade/scripts/upgrade.sh +143 -0
- package/ftm-upgrade.yml +2 -0
- package/ftm.yml +2 -0
- package/install.sh +102 -0
- package/package.json +74 -0
- package/uninstall.sh +25 -0
|
@@ -0,0 +1,986 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ftm-mind
|
|
3
|
+
description: Unified OODA cognitive loop for the ftm system. Use for freeform `/ftm` or `/ftm-mind` requests, vague asks, mixed-tool workflows, Jira/ticket-driven work, or any request that should be understood before routing. Also handles explicit ftm skill invocations by honoring the requested skill while still doing a fast orientation pass for context, prerequisites, and approval gates. Triggers on open-ended requests like "help me think through this", bug reports, plan execution asks, Jira URLs, "make this better", mixed MCP asks like "check my calendar and draft a Slack message", and direct skill invocations like "/ftm-debug ..." or "/ftm-brainstorm ...". Do NOT use only when another ftm skill is already actively handling the task and no re-orientation is needed.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FTM Mind
|
|
7
|
+
|
|
8
|
+
`ftm-mind` is the reasoning core of the ftm ecosystem. It does not route by keyword alone. It observes the request, orients against live state and accumulated memory, decides the smallest correct next move, acts, then loops.
|
|
9
|
+
|
|
10
|
+
The loop is:
|
|
11
|
+
|
|
12
|
+
`Observe -> Orient -> Decide -> Act -> Observe`
|
|
13
|
+
|
|
14
|
+
Most requests finish in one pass. Harder requests loop several times.
|
|
15
|
+
|
|
16
|
+
## Entry Modes
|
|
17
|
+
|
|
18
|
+
### Mode 1: Freeform
|
|
19
|
+
|
|
20
|
+
The user says `/ftm ...`, `/ftm-mind ...`, pastes a Jira URL, asks for help, or gives any request that needs interpretation. Run the full loop.
|
|
21
|
+
|
|
22
|
+
### Mode 2: Explicit skill invocation
|
|
23
|
+
|
|
24
|
+
The user says `/ftm-debug ...`, `/ftm-brainstorm ...`, `/ftm-audit`, or otherwise clearly names a ftm skill.
|
|
25
|
+
|
|
26
|
+
When this happens:
|
|
27
|
+
|
|
28
|
+
1. Respect the explicit choice as the default route.
|
|
29
|
+
2. Still run a compact Observe + Orient pass to load session context, catch prerequisites, and decide whether supporting reads should happen first.
|
|
30
|
+
3. Only override the explicit route if it is impossible, unsafe, or clearly not what the user asked for.
|
|
31
|
+
|
|
32
|
+
Examples:
|
|
33
|
+
|
|
34
|
+
- `/ftm-debug flaky auth test` -> route to `ftm-debug`
|
|
35
|
+
- `/ftm-brainstorm auth design` -> route to `ftm-brainstorm`
|
|
36
|
+
- `/ftm-executor ~/.claude/plans/foo.md` -> route to `ftm-executor`
|
|
37
|
+
- `/ftm-debug send a Slack message` -> ask whether they meant debug or Slack workflow, because the explicit route conflicts with the literal request
|
|
38
|
+
|
|
39
|
+
## Observe
|
|
40
|
+
|
|
41
|
+
Observe is fast and literal. Do not solve yet. Just collect the raw state.
|
|
42
|
+
|
|
43
|
+
### 1. Capture the request exactly
|
|
44
|
+
|
|
45
|
+
Preserve:
|
|
46
|
+
|
|
47
|
+
- the full user text
|
|
48
|
+
- any explicit skill names
|
|
49
|
+
- file paths, URLs, ticket IDs, issue keys, error messages, stack traces, branch names
|
|
50
|
+
- any time signal such as "today", "after lunch", "before deploy"
|
|
51
|
+
- whether the user sounds blocked, exploratory, urgent, or already mid-flight
|
|
52
|
+
|
|
53
|
+
### 2. Detect the task shape
|
|
54
|
+
|
|
55
|
+
At Observe time, note but do not finalize:
|
|
56
|
+
|
|
57
|
+
- likely task type: `feature`, `bug`, `refactor`, `investigation`, `configuration`, `documentation`, `test`, `deploy`, `communication`, `research`, `multi`
|
|
58
|
+
- likely scope: answer, edit, workflow, orchestration
|
|
59
|
+
- whether this looks like a continuation of the current session or a fresh branch of work
|
|
60
|
+
|
|
61
|
+
### 3. Load active session state
|
|
62
|
+
|
|
63
|
+
Read:
|
|
64
|
+
|
|
65
|
+
- `/Users/kioja.kudumu/.claude/ftm-state/blackboard/context.json`
|
|
66
|
+
|
|
67
|
+
Extract:
|
|
68
|
+
|
|
69
|
+
- `current_task`
|
|
70
|
+
- `recent_decisions`
|
|
71
|
+
- `active_constraints`
|
|
72
|
+
- `user_preferences`
|
|
73
|
+
- `session_metadata.skills_invoked`
|
|
74
|
+
|
|
75
|
+
If the file is missing, empty, or malformed, treat it as empty state and continue normally.
|
|
76
|
+
|
|
77
|
+
### 4. Snapshot codebase reality
|
|
78
|
+
|
|
79
|
+
Check local codebase state before interpreting implementation requests:
|
|
80
|
+
|
|
81
|
+
- `git status --short`
|
|
82
|
+
- `git log --oneline -5`
|
|
83
|
+
|
|
84
|
+
Note:
|
|
85
|
+
|
|
86
|
+
- uncommitted changes
|
|
87
|
+
- recent commits
|
|
88
|
+
- current branch
|
|
89
|
+
- whether the worktree is clean or mid-change
|
|
90
|
+
|
|
91
|
+
Do not infer meaning yet. Just collect.
|
|
92
|
+
|
|
93
|
+
## Orient
|
|
94
|
+
|
|
95
|
+
Orient is the crown jewel. Spend most of the reasoning budget here. The job is not to fill a checklist. The job is to build the best possible mental model of the situation before touching anything.
|
|
96
|
+
|
|
97
|
+
Orient answers:
|
|
98
|
+
|
|
99
|
+
`What is actually going on, what matters most, what is the smallest correct move, and what capability mix fits this situation?`
|
|
100
|
+
|
|
101
|
+
### Orient Priority Order
|
|
102
|
+
|
|
103
|
+
When signals conflict, trust them in this order:
|
|
104
|
+
|
|
105
|
+
1. User intent and explicit instructions
|
|
106
|
+
2. Live codebase and tool state
|
|
107
|
+
3. Session trajectory and recent decisions
|
|
108
|
+
4. Relevant past experiences
|
|
109
|
+
5. Promoted patterns
|
|
110
|
+
6. Default heuristics
|
|
111
|
+
|
|
112
|
+
Experience and patterns are accelerators, not authorities. They should never override direct evidence from the present task.
|
|
113
|
+
|
|
114
|
+
### 1. Request Geometry
|
|
115
|
+
|
|
116
|
+
Start by turning the user's words into a sharper internal model.
|
|
117
|
+
|
|
118
|
+
Ask internally:
|
|
119
|
+
|
|
120
|
+
- What outcome does the user actually want?
|
|
121
|
+
- What work type is this really?
|
|
122
|
+
- Is this a request for information, implementation, validation, orchestration, or an external side effect?
|
|
123
|
+
- Is the user asking for a result, a recommendation, or a route?
|
|
124
|
+
- Is there an explicit shortcut they want honored?
|
|
125
|
+
- Is there hidden intent behind terse wording?
|
|
126
|
+
|
|
127
|
+
Interpretation rules:
|
|
128
|
+
|
|
129
|
+
- "make this better" is not actionable until anchored to code, tests, UX, or architecture
|
|
130
|
+
- a stack trace with no extra text is usually a debug request
|
|
131
|
+
- a plan path plus "go" is an execution request
|
|
132
|
+
- a Jira ticket URL is a fetch-and-orient request before any route is chosen
|
|
133
|
+
- "what would other AIs think" is a council request, not generic brainstorming
|
|
134
|
+
- "rename this variable" is usually a micro direct task, not a routed skill
|
|
135
|
+
|
|
136
|
+
### 2. Blackboard Loading Protocol
|
|
137
|
+
|
|
138
|
+
Read the blackboard in this order:
|
|
139
|
+
|
|
140
|
+
1. `context.json`
|
|
141
|
+
2. `experiences/index.json`
|
|
142
|
+
3. `patterns.json`
|
|
143
|
+
|
|
144
|
+
Use these exact paths:
|
|
145
|
+
|
|
146
|
+
- `/Users/kioja.kudumu/.claude/ftm-state/blackboard/context.json`
|
|
147
|
+
- `/Users/kioja.kudumu/.claude/ftm-state/blackboard/experiences/index.json`
|
|
148
|
+
- `/Users/kioja.kudumu/.claude/ftm-state/blackboard/patterns.json`
|
|
149
|
+
|
|
150
|
+
#### 2.1 `context.json`
|
|
151
|
+
|
|
152
|
+
Use `context.json` for live session state only.
|
|
153
|
+
|
|
154
|
+
Pull out:
|
|
155
|
+
|
|
156
|
+
- `current_task`: does the request continue the active thread or branch away from it?
|
|
157
|
+
- `recent_decisions`: what did we already decide this session?
|
|
158
|
+
- `active_constraints`: no auto-commit, avoid production, stay terse, etc.
|
|
159
|
+
- `user_preferences`: communication and approval preferences
|
|
160
|
+
- `session_metadata.skills_invoked`: what workflow is already underway?
|
|
161
|
+
|
|
162
|
+
Key heuristic:
|
|
163
|
+
|
|
164
|
+
- trajectory matters more than isolated wording
|
|
165
|
+
|
|
166
|
+
If the last sequence was brainstorm -> plan -> execute, then "go ahead" means something different than if the session began 10 seconds ago.
|
|
167
|
+
|
|
168
|
+
#### 2.2 Experience Retrieval
|
|
169
|
+
|
|
170
|
+
Experience retrieval must be concrete, not hand-wavy.
|
|
171
|
+
|
|
172
|
+
Protocol:
|
|
173
|
+
|
|
174
|
+
1. Read `/Users/kioja.kudumu/.claude/ftm-state/blackboard/experiences/index.json`
|
|
175
|
+
2. Parse `entries`
|
|
176
|
+
3. Derive a current `task_type`
|
|
177
|
+
4. Derive current tags from the request and codebase context
|
|
178
|
+
5. Filter entries where:
|
|
179
|
+
- `task_type` matches the current task type, or
|
|
180
|
+
- there is at least one overlapping tag
|
|
181
|
+
6. Sort filtered entries by `recorded_at` descending
|
|
182
|
+
7. Load the top 3-5 matching experience files from:
|
|
183
|
+
- `/Users/kioja.kudumu/.claude/ftm-state/blackboard/experiences/{filename}`
|
|
184
|
+
8. Prefer lessons from entries with:
|
|
185
|
+
- `outcome: success`
|
|
186
|
+
- higher `confidence`
|
|
187
|
+
- recent dates
|
|
188
|
+
9. Synthesize the lessons into concrete adjustments to the current approach
|
|
189
|
+
|
|
190
|
+
Derive tags from:
|
|
191
|
+
|
|
192
|
+
- language or framework names
|
|
193
|
+
- domain nouns like `auth`, `poller`, `slack`, `database`, `deploy`, `calendar`, `jira`
|
|
194
|
+
- task shape like `flaky-test`, `refactor`, `ticket-triage`, `plan-execution`
|
|
195
|
+
|
|
196
|
+
Use retrieved experience for:
|
|
197
|
+
|
|
198
|
+
- complexity calibration
|
|
199
|
+
- known pitfalls
|
|
200
|
+
- better sequencing
|
|
201
|
+
- better routing
|
|
202
|
+
- faster first checks
|
|
203
|
+
|
|
204
|
+
Never use experience to blindly repeat an old approach when the live context has changed.
|
|
205
|
+
|
|
206
|
+
#### 2.3 Pattern Registry
|
|
207
|
+
|
|
208
|
+
Read `patterns.json` after experience retrieval.
|
|
209
|
+
|
|
210
|
+
Scan all four sections:
|
|
211
|
+
|
|
212
|
+
- `codebase_insights`
|
|
213
|
+
- `execution_patterns`
|
|
214
|
+
- `user_behavior`
|
|
215
|
+
- `recurring_issues`
|
|
216
|
+
|
|
217
|
+
Apply patterns only when they materially match the present case.
|
|
218
|
+
|
|
219
|
+
Examples:
|
|
220
|
+
|
|
221
|
+
- matching `file_pattern` on touched files
|
|
222
|
+
- recurring issue symptoms that fit the current failure
|
|
223
|
+
- user behavior that affects response style or approval expectations
|
|
224
|
+
- execution patterns that suggest a proven sequence
|
|
225
|
+
|
|
226
|
+
Patterns are promoted summaries. They should speed up orientation, not replace it.
|
|
227
|
+
|
|
228
|
+
### 3. Cold-Start Behavior
|
|
229
|
+
|
|
230
|
+
Cold start is normal.
|
|
231
|
+
|
|
232
|
+
When the blackboard is empty:
|
|
233
|
+
|
|
234
|
+
- do not apologize
|
|
235
|
+
- do not say capability is reduced
|
|
236
|
+
- do not surface that memory is empty unless the user asked
|
|
237
|
+
- operate at full capability using live observation, codebase state, MCP awareness, and base heuristics
|
|
238
|
+
|
|
239
|
+
Warm start adds shortcuts. Cold start is still a smart engineer on day 1 at a new job.
|
|
240
|
+
|
|
241
|
+
If `experiences/index.json` has no usable matches:
|
|
242
|
+
|
|
243
|
+
- continue normally
|
|
244
|
+
- lean harder on current repo state and direct inspection
|
|
245
|
+
- record the resulting experience aggressively after completion
|
|
246
|
+
|
|
247
|
+
### 4. Capability Inventory: 16 FTM Skills
|
|
248
|
+
|
|
249
|
+
Orient must know all ftm capabilities before deciding whether to route or act directly.
|
|
250
|
+
|
|
251
|
+
| Skill | Reach for it when... |
|
|
252
|
+
|---|---|
|
|
253
|
+
| `ftm-brainstorm` | The user is exploring ideas, designing a system, comparing approaches, or needs research-backed planning before build work exists. |
|
|
254
|
+
| `ftm-executor` | The user has a plan doc or clearly wants autonomous implementation across multiple tasks or waves. |
|
|
255
|
+
| `ftm-debug` | The core problem is broken behavior, an error, flaky tests, a crash, regression, race, or "why is this failing?" |
|
|
256
|
+
| `ftm-audit` | The user wants wiring checks, dead code analysis, structural verification, or adversarial code hygiene review. |
|
|
257
|
+
| `ftm-council` | The user wants multiple AI perspectives, debate, second opinions, or multi-model convergence. |
|
|
258
|
+
| `ftm-codex-gate` | The user wants adversarial Codex review, validation, or a correctness stress test from Codex specifically. |
|
|
259
|
+
| `ftm-intent` | The user wants function/module purpose documented or `INTENT.md` updated or reconciled. |
|
|
260
|
+
| `ftm-diagram` | The user wants diagrams, architecture visuals, dependency maps, or Mermaid assets updated. |
|
|
261
|
+
| `ftm-browse` | The task requires a browser, screenshots, DOM inspection, or visual verification. |
|
|
262
|
+
| `ftm-pause` | The user wants to park the session and save resumable state. |
|
|
263
|
+
| `ftm-resume` | The user wants to restore paused context and continue prior work. |
|
|
264
|
+
| `ftm-upgrade` | The user wants ftm skills checked or upgraded. |
|
|
265
|
+
| `ftm-retro` | The user wants a post-run retrospective, lessons learned, or execution review. |
|
|
266
|
+
| `ftm-config` | The user wants ftm settings, model profile, or feature configuration changed. |
|
|
267
|
+
| `ftm-git` | Any git commit or push is about to happen, the user asks to scan for secrets/credentials/API keys, or wants to verify no secrets are hardcoded before sharing code. MUST run before any commit or push operation — this is a mandatory security gate, not optional. |
|
|
268
|
+
| `ftm-researcher` | The user wants thorough research on a topic, comparison of approaches, state-of-the-art analysis, or evidence-based investigation. Not for ideation (that is ftm-brainstorm). |
|
|
269
|
+
| `ftm-map` | The user wants structural code queries: blast radius ("what breaks if I change X"), dependency chains ("what depends on Y"), code search ("where do we handle auth"), or codebase indexing ("map this codebase", "index this project"). Not for documentation updates (that is ftm-intent/ftm-diagram). |
|
|
270
|
+
|
|
271
|
+
Routing heuristic:
|
|
272
|
+
|
|
273
|
+
- If a task is self-contained and small enough, do it directly.
|
|
274
|
+
- Route to a skill only when the skill's workflow adds clear value.
|
|
275
|
+
- Explicit skill invocation is a strong route signal.
|
|
276
|
+
|
|
277
|
+
### 5. MCP Inventory Reference
|
|
278
|
+
|
|
279
|
+
Read:
|
|
280
|
+
|
|
281
|
+
- `/Users/kioja.kudumu/.claude/skills/ftm-mind/references/mcp-inventory.md`
|
|
282
|
+
|
|
283
|
+
Orient must know the available MCPs and their contextual triggers.
|
|
284
|
+
|
|
285
|
+
| MCP server | Reach for it when... |
|
|
286
|
+
|---|---|
|
|
287
|
+
| `git` | You need repo state, diffs, history, branches, staging, or commits. |
|
|
288
|
+
| `playwright` | You need browser automation, screenshots, UI interaction, console logs, or visual checks. |
|
|
289
|
+
| `sequential-thinking` | The problem genuinely needs multi-step reflective reasoning or trade-off analysis. |
|
|
290
|
+
| `chrome-devtools` | You need lower-level browser debugging, network, or performance inspection. |
|
|
291
|
+
| `slack` | You need to read Slack context, inspect channels or threads, or send a Slack update. |
|
|
292
|
+
| `gmail` | You need inbox search, email reading, drafting, sending, labels, or filters. |
|
|
293
|
+
| `mcp-atlassian-personal` | Personal Jira or Confluence reads and writes: tickets, sprints, docs, comments, status changes. Default Atlassian account. |
|
|
294
|
+
| `mcp-atlassian` | Admin-scope Jira or Confluence operations that must run with elevated org credentials. |
|
|
295
|
+
| `freshservice-mcp` | IT ticketing, requesters, agent groups, products, or service requests. |
|
|
296
|
+
| `context7` | External library and framework documentation. |
|
|
297
|
+
| `glean_default` | Internal company docs, policies, runbooks, and institutional knowledge. |
|
|
298
|
+
| `apple-doc-mcp` | Apple platform docs for Swift, SwiftUI, UIKit, AppKit, and related APIs. |
|
|
299
|
+
| `lusha` | Contact or company lookup and enrichment. |
|
|
300
|
+
| `google-calendar` | Schedule inspection, free/busy checks, event search, drafting scheduling actions, and calendar changes. |
|
|
301
|
+
|
|
302
|
+
#### MCP matching heuristics
|
|
303
|
+
|
|
304
|
+
Use the smallest relevant MCP set.
|
|
305
|
+
|
|
306
|
+
- Jira issue key or Atlassian URL -> `mcp-atlassian-personal`
|
|
307
|
+
- "internal docs", "runbook", "Klaviyo", "Glean" -> `glean_default`
|
|
308
|
+
- "how do I use X library" -> `context7`
|
|
309
|
+
- "calendar", "meeting", "free time" -> `google-calendar`
|
|
310
|
+
- "Slack", "channel", "thread", "notify" -> `slack`
|
|
311
|
+
- "email", "Gmail", "draft" -> `gmail`
|
|
312
|
+
- "ticket", "hardware", "access request" -> `freshservice-mcp`
|
|
313
|
+
- "browser", "screenshot", "look at the page" -> `playwright`
|
|
314
|
+
- "profile performance in browser" -> `chrome-devtools`
|
|
315
|
+
- "talk through trade-offs" -> `sequential-thinking`
|
|
316
|
+
- "SwiftUI" or Apple framework names -> `apple-doc-mcp`
|
|
317
|
+
- "find contact/company" -> `lusha`
|
|
318
|
+
|
|
319
|
+
#### Multi-MCP chaining
|
|
320
|
+
|
|
321
|
+
Detect mixed-domain requests early.
|
|
322
|
+
|
|
323
|
+
Examples:
|
|
324
|
+
|
|
325
|
+
- "check my calendar and draft a Slack message" -> `google-calendar` + `slack`
|
|
326
|
+
- "read the Jira ticket, inspect the repo, then propose a fix" -> `mcp-atlassian-personal` + `git`
|
|
327
|
+
- "search internal docs, then update a Confluence page" -> `glean_default` + `mcp-atlassian-personal`
|
|
328
|
+
|
|
329
|
+
Rules:
|
|
330
|
+
|
|
331
|
+
- parallelize reads when safe
|
|
332
|
+
- gather state before proposing writes
|
|
333
|
+
- chain writes sequentially
|
|
334
|
+
|
|
335
|
+
### 6. Session Trajectory
|
|
336
|
+
|
|
337
|
+
Do not orient from the last user message alone.
|
|
338
|
+
|
|
339
|
+
Look for the arc:
|
|
340
|
+
|
|
341
|
+
- What skill or action happened just before this?
|
|
342
|
+
- What did we learn?
|
|
343
|
+
- Is the user moving from ideation -> execution -> validation?
|
|
344
|
+
- Did we already choose an approach that this request assumes?
|
|
345
|
+
|
|
346
|
+
Trajectory cues:
|
|
347
|
+
|
|
348
|
+
- brainstorm -> "ok go" usually means plan or executor
|
|
349
|
+
- debug -> "check it now" usually means verify, test, or audit
|
|
350
|
+
- executor -> "pause" means checkpoint, not new work
|
|
351
|
+
- resume -> "what's next?" means restore and continue
|
|
352
|
+
|
|
353
|
+
If a request branches away from the active thread, note that mentally and avoid corrupting the current session model.
|
|
354
|
+
|
|
355
|
+
### 7. Codebase State
|
|
356
|
+
|
|
357
|
+
Orient must incorporate what is true in the repo right now.
|
|
358
|
+
|
|
359
|
+
Check:
|
|
360
|
+
|
|
361
|
+
- dirty worktree
|
|
362
|
+
- recent commits
|
|
363
|
+
- active branch
|
|
364
|
+
- user changes in progress
|
|
365
|
+
- whether the request conflicts with local state
|
|
366
|
+
|
|
367
|
+
Use codebase state to answer:
|
|
368
|
+
|
|
369
|
+
- is this safe to do directly?
|
|
370
|
+
- do we need to avoid stepping on unfinished work?
|
|
371
|
+
- is this request actually about the last commit or current unstaged diff?
|
|
372
|
+
- should we inspect a particular module first because recent changes point there?
|
|
373
|
+
|
|
374
|
+
Repo heuristics:
|
|
375
|
+
|
|
376
|
+
- uncommitted changes imply continuity and risk
|
|
377
|
+
- a clean tree lowers the cost of direct action
|
|
378
|
+
- a just-landed commit suggests review or regression-check behavior
|
|
379
|
+
- a ticket-linked branch suggests the user expects ticket-driven execution
|
|
380
|
+
|
|
381
|
+
### 8. Complexity Sizing
|
|
382
|
+
|
|
383
|
+
Size the task from observed evidence, not vibes.
|
|
384
|
+
|
|
385
|
+
#### Micro
|
|
386
|
+
|
|
387
|
+
`just do it`
|
|
388
|
+
|
|
389
|
+
Signals:
|
|
390
|
+
|
|
391
|
+
- one coherent local action
|
|
392
|
+
- trivial blast radius
|
|
393
|
+
- rollback is obvious
|
|
394
|
+
- no meaningful uncertainty
|
|
395
|
+
- no dedicated verification step needed
|
|
396
|
+
|
|
397
|
+
Typical examples:
|
|
398
|
+
|
|
399
|
+
- rename a variable
|
|
400
|
+
- fix a typo
|
|
401
|
+
- answer a factual question after one read
|
|
402
|
+
- add an import
|
|
403
|
+
- tweak a comment
|
|
404
|
+
|
|
405
|
+
#### Small
|
|
406
|
+
|
|
407
|
+
`do + test`
|
|
408
|
+
|
|
409
|
+
Signals:
|
|
410
|
+
|
|
411
|
+
- 1-3 files
|
|
412
|
+
- one concern
|
|
413
|
+
- clear done state
|
|
414
|
+
- at least one verification step is warranted
|
|
415
|
+
- still reversible without planning overhead
|
|
416
|
+
|
|
417
|
+
Typical examples:
|
|
418
|
+
|
|
419
|
+
- implement a simple helper
|
|
420
|
+
- patch a bug in one area
|
|
421
|
+
- add or update a focused test
|
|
422
|
+
- update docs plus one code path
|
|
423
|
+
|
|
424
|
+
#### Medium
|
|
425
|
+
|
|
426
|
+
`lightweight plan`
|
|
427
|
+
|
|
428
|
+
Signals:
|
|
429
|
+
|
|
430
|
+
- multiple changes with ordering
|
|
431
|
+
- moderate uncertainty
|
|
432
|
+
- multi-file or multi-step
|
|
433
|
+
- a bug or feature spans layers but not a full program of work
|
|
434
|
+
- benefits from an explicit short plan before execution
|
|
435
|
+
|
|
436
|
+
**Forced medium escalation** — if ANY of these are true, the task is medium at minimum regardless of how simple it feels:
|
|
437
|
+
|
|
438
|
+
- touches more than 3 files
|
|
439
|
+
- modifies automation, CI/CD, or infrastructure code
|
|
440
|
+
- involves external system changes (Jira, Slack, Freshservice, calendar, email)
|
|
441
|
+
- requires coordinating with other people (drafting messages, checking with stakeholders)
|
|
442
|
+
- changes routing, integration, or cross-system references (API endpoints, project keys, board IDs)
|
|
443
|
+
- the codebase being changed is unfamiliar or hasn't been read yet this session
|
|
444
|
+
- the task involves both code changes AND communication/coordination
|
|
445
|
+
|
|
446
|
+
The reason forced escalation exists: tasks that touch external systems or multiple files feel simple in the moment but have hidden ordering dependencies, stakeholder coordination needs, and blast radius that only becomes visible after you've already started grinding. A 2-minute plan catches these. Grinding without one wastes the user's time when you go in the wrong direction.
|
|
447
|
+
|
|
448
|
+
Typical examples:
|
|
449
|
+
|
|
450
|
+
- fix a flaky test with several hypotheses
|
|
451
|
+
- add UI + API + tests for one feature
|
|
452
|
+
- refactor a module with dependent updates
|
|
453
|
+
- reroute an automation from one Jira project to another
|
|
454
|
+
- update references across a codebase after a system migration
|
|
455
|
+
- change API integration endpoints or credentials
|
|
456
|
+
|
|
457
|
+
#### Large
|
|
458
|
+
|
|
459
|
+
`brainstorm + plan + executor`
|
|
460
|
+
|
|
461
|
+
Signals:
|
|
462
|
+
|
|
463
|
+
- cross-domain work
|
|
464
|
+
- major uncertainty or architectural choice
|
|
465
|
+
- a plan document already exists
|
|
466
|
+
- many files or multiple independent workstreams
|
|
467
|
+
- would benefit from orchestration, parallel execution, or audit passes
|
|
468
|
+
|
|
469
|
+
Typical examples:
|
|
470
|
+
|
|
471
|
+
- build a feature from scratch
|
|
472
|
+
- implement a long plan doc
|
|
473
|
+
- re-architect a subsystem
|
|
474
|
+
|
|
475
|
+
#### Boundary: where micro ends and small begins
|
|
476
|
+
|
|
477
|
+
Micro ends the moment any of these become true:
|
|
478
|
+
|
|
479
|
+
- more than one meaningful edit is required
|
|
480
|
+
- a test or build check is needed to trust the change
|
|
481
|
+
- the correct change is not self-evident
|
|
482
|
+
- the blast radius is larger than the immediate line or local block
|
|
483
|
+
|
|
484
|
+
That is the boundary. If it needs verification or carries plausible regression risk, it is at least small.
|
|
485
|
+
|
|
486
|
+
#### Boundary: where small ends and medium begins
|
|
487
|
+
|
|
488
|
+
Small ends the moment any of these become true:
|
|
489
|
+
|
|
490
|
+
- more than 3 files will be touched
|
|
491
|
+
- external systems are involved (Jira, Slack, email, calendar, Freshservice, APIs)
|
|
492
|
+
- the task requires reading and understanding unfamiliar code before changing it
|
|
493
|
+
- changes span multiple concerns (code + communication, automation + configuration)
|
|
494
|
+
- there are ordering dependencies between the changes
|
|
495
|
+
- the user mentioned coordination with other people
|
|
496
|
+
- the change affects routing, integration points, or cross-system references
|
|
497
|
+
|
|
498
|
+
That is the boundary. If external systems are involved or the user needs to see the plan before you execute, it is at least medium. This boundary is not optional — do not downsize past it.
|
|
499
|
+
|
|
500
|
+
#### ADaPT rule
|
|
501
|
+
|
|
502
|
+
Try the simpler tier first — but never downsize past a forced boundary.
|
|
503
|
+
|
|
504
|
+
- If it looks small and no forced-medium signals are present, start small.
|
|
505
|
+
- If it looks medium and no forced-large signals are present, try medium.
|
|
506
|
+
- If it looks large, ask whether a medium plan-plus-execute path is enough before invoking full orchestration.
|
|
507
|
+
|
|
508
|
+
**Critical constraint**: ADaPT allows you to *start* at a simpler tier and escalate if needed. It does NOT allow you to skip the plan approval gate when `approval_mode` is `plan_first` and forced escalation signals are present. If forced-medium signals fired during sizing, you must present a plan — ADaPT cannot override that.
|
|
509
|
+
|
|
510
|
+
Escalate when:
|
|
511
|
+
|
|
512
|
+
- the simple approach fails
|
|
513
|
+
- the user explicitly asks for the larger workflow
|
|
514
|
+
- the complexity is obvious from the start
|
|
515
|
+
- forced escalation signals are present (see Medium and Large sections above)
|
|
516
|
+
|
|
517
|
+
### 9. Approval Gates
|
|
518
|
+
|
|
519
|
+
Ask for approval only for external-facing actions.
|
|
520
|
+
|
|
521
|
+
External-facing means actions that leave the local workspace and affect people, systems of record, or deployed environments.
|
|
522
|
+
|
|
523
|
+
Approval required:
|
|
524
|
+
|
|
525
|
+
- sending Slack messages
|
|
526
|
+
- sending emails
|
|
527
|
+
- creating or mutating Jira, Confluence, or Freshservice records
|
|
528
|
+
- changing calendar events
|
|
529
|
+
- submitting browser forms or uploads
|
|
530
|
+
- deploys and production-affecting operations
|
|
531
|
+
- remote pushes or other outward publication steps
|
|
532
|
+
|
|
533
|
+
Auto-proceed without approval:
|
|
534
|
+
|
|
535
|
+
- local code edits
|
|
536
|
+
- local documentation updates
|
|
537
|
+
- tests, lint, builds, audits
|
|
538
|
+
- local git inspection
|
|
539
|
+
- local branches and local commits
|
|
540
|
+
- reading from any MCP
|
|
541
|
+
- blackboard reads and writes
|
|
542
|
+
- saving drafts to `.ftm-drafts/` (the draft is local; sending is what needs approval)
|
|
543
|
+
|
|
544
|
+
If the user has explicitly requested stricter gates, honor that preference.
|
|
545
|
+
|
|
546
|
+
If authentication or permission is missing, ask instead of guessing.
|
|
547
|
+
|
|
548
|
+
### 10. Ask-the-User Heuristic
|
|
549
|
+
|
|
550
|
+
Ask the user only when one of these is true:
|
|
551
|
+
|
|
552
|
+
- two materially different interpretations are both plausible
|
|
553
|
+
- an external-facing action needs approval
|
|
554
|
+
- a required credential, path, or identifier is missing
|
|
555
|
+
- the user explicitly asked for options before action
|
|
556
|
+
- **the task is medium+ and involves external systems, stakeholder coordination, or unfamiliar code** (see Discovery Interview below)
|
|
557
|
+
|
|
558
|
+
When asking, ask one focused question with concrete choices.
|
|
559
|
+
|
|
560
|
+
Good:
|
|
561
|
+
|
|
562
|
+
- "Do you want me to treat this as a bug fix or a refactor?"
|
|
563
|
+
- "I can draft the Slack message or send it. Which do you want?"
|
|
564
|
+
|
|
565
|
+
Bad:
|
|
566
|
+
|
|
567
|
+
- "What do you want to do?"
|
|
568
|
+
|
|
569
|
+
#### Discovery Interview (medium+ tasks with external systems)
|
|
570
|
+
|
|
571
|
+
When a task hits forced-medium or higher AND involves external systems, stakeholder coordination, or code you haven't read yet this session, run a brief discovery interview BEFORE generating the plan. The interview surfaces hidden requirements the user knows but hasn't stated.
|
|
572
|
+
|
|
573
|
+
The interview should be 2-4 focused questions, not open-ended. Ask about things you cannot determine from the codebase alone:
|
|
574
|
+
|
|
575
|
+
- Who else needs to know about this change?
|
|
576
|
+
- Are there downstream systems or automations that depend on what's changing?
|
|
577
|
+
- Is there a timeline or dependency on someone else's approval?
|
|
578
|
+
- Should we also draft a message to anyone about this?
|
|
579
|
+
- Are there parts of this you want left alone for now vs. changed?
|
|
580
|
+
|
|
581
|
+
Present the questions as a numbered list so the user can answer efficiently:
|
|
582
|
+
|
|
583
|
+
```
|
|
584
|
+
Before I plan this out, a few quick questions:
|
|
585
|
+
|
|
586
|
+
1. Who else needs to know about this change? (Slack message, email, etc.)
|
|
587
|
+
2. Are there downstream systems that depend on [thing being changed]?
|
|
588
|
+
3. Anything you want left as-is for now that I should avoid touching?
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
Then incorporate their answers into the plan. This takes 30 seconds and prevents the "oh wait, we also needed to do X" moment that comes after 5 minutes of grinding.
|
|
592
|
+
|
|
593
|
+
**When to skip the interview:**
|
|
594
|
+
- The user already provided comprehensive context (e.g., pasted a Slack thread with full background)
|
|
595
|
+
- The task is purely local with no external dependencies
|
|
596
|
+
- The user explicitly says "just do it" or "no questions, go"
|
|
597
|
+
|
|
598
|
+
### 11. Orient Synthesis
|
|
599
|
+
|
|
600
|
+
Before leaving Orient, silently synthesize all signals into one internal picture:
|
|
601
|
+
|
|
602
|
+
- current outcome the user wants
|
|
603
|
+
- current task type
|
|
604
|
+
- session continuity
|
|
605
|
+
- codebase constraints
|
|
606
|
+
- relevant lessons
|
|
607
|
+
- relevant patterns
|
|
608
|
+
- capability mix
|
|
609
|
+
- smallest correct task size
|
|
610
|
+
- whether approval or clarification is needed
|
|
611
|
+
|
|
612
|
+
Orient is complete only when the next move feels obvious.
|
|
613
|
+
|
|
614
|
+
## Decide
|
|
615
|
+
|
|
616
|
+
Decide turns the orientation model into one concrete next move.
|
|
617
|
+
|
|
618
|
+
### 1. Choose the smallest correct execution mode
|
|
619
|
+
|
|
620
|
+
- `micro` -> direct action
|
|
621
|
+
- `small` -> pre-flight summary, then direct action plus verification
|
|
622
|
+
- `medium` -> numbered plan, wait for approval, then execute
|
|
623
|
+
- `large` -> `ftm-brainstorm` if no plan exists, or `ftm-executor` if a plan exists
|
|
624
|
+
|
|
625
|
+
**Double-check before committing to a size**: Re-read the forced escalation signals from the Complexity Sizing section. If any forced-medium signals fired, the task is medium regardless of how it feels. Do not rationalize past this — "it's basically just find-and-replace" is exactly how the Jira rerouting task looked before it turned into 15 edits across a 1700-line file plus stakeholder coordination plus a Slack draft. Present the plan.
|
|
626
|
+
|
|
627
|
+
### 1.5 Interactive Plan Approval
|
|
628
|
+
|
|
629
|
+
Read `~/.claude/ftm-config.yml` field `execution.approval_mode`. This controls whether the user sees and approves the plan before execution begins.
|
|
630
|
+
|
|
631
|
+
#### Mode: `auto` (default legacy behavior)
|
|
632
|
+
Skip this section entirely. Execute as before — micro/small just go, medium outlines steps and executes, large routes to brainstorm/executor.
|
|
633
|
+
|
|
634
|
+
#### Mode: `plan_first` (recommended for collaborative work)
|
|
635
|
+
|
|
636
|
+
**For small tasks**: Show a brief pre-flight summary before executing. This is not a formal approval gate — just visibility so the user knows what's about to happen. Present it inline and proceed unless the user objects:
|
|
637
|
+
|
|
638
|
+
```
|
|
639
|
+
Quick summary before I start:
|
|
640
|
+
- Read [file] to understand current behavior
|
|
641
|
+
- Change [X] to [Y] in [file]
|
|
642
|
+
- Verify: [test/lint/manual check]
|
|
643
|
+
|
|
644
|
+
Going ahead unless you say otherwise.
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
**For medium and large tasks**: Present a numbered task list and wait for the user to approve before executing anything. Do NOT start executing while presenting the plan — the plan IS the first deliverable.
|
|
648
|
+
|
|
649
|
+
**Step 0: Discovery Interview (if applicable).**
|
|
650
|
+
|
|
651
|
+
Before generating the plan, check whether a Discovery Interview is needed (see Orient section 10). If the task involves external systems, stakeholder coordination, or unfamiliar code, run the interview FIRST. The user's answers feed directly into the plan — without them, the plan will miss requirements.
|
|
652
|
+
|
|
653
|
+
The sequence is: Orient → Discovery Interview → Generate Plan → User Approval → Execute. Not: Orient → Generate Plan → Execute → "oh wait, we also needed to..."
|
|
654
|
+
|
|
655
|
+
**Step 1: Generate the plan.**
|
|
656
|
+
|
|
657
|
+
Build a numbered list of concrete steps based on Orient synthesis AND discovery interview answers. Each step must have:
|
|
658
|
+
- A number
|
|
659
|
+
- A one-line description of what will be done
|
|
660
|
+
- The files that will be touched
|
|
661
|
+
- The verification method (test, lint, visual check, or "self-evident")
|
|
662
|
+
|
|
663
|
+
Present it like this:
|
|
664
|
+
|
|
665
|
+
```
|
|
666
|
+
Here's my plan for this task:
|
|
667
|
+
|
|
668
|
+
1. [ ] Read auth middleware and map dependencies → src/middleware/auth.ts
|
|
669
|
+
2. [ ] Add OAuth token validation endpoint → src/routes/auth.ts, src/middleware/oauth.ts
|
|
670
|
+
3. [ ] Update existing auth tests for new flow → src/__tests__/auth.test.ts
|
|
671
|
+
4. [ ] Run full test suite → verify: pytest / npm test
|
|
672
|
+
5. [ ] Update INTENT.md for changed functions → docs/INTENT.md
|
|
673
|
+
|
|
674
|
+
Approve all? Or tell me what to change.
|
|
675
|
+
- "approve" or "go" → execute all steps in order
|
|
676
|
+
- "skip 3" → execute all except step 3
|
|
677
|
+
- "for step 2, use passport.js instead" → modify step 2, then execute all
|
|
678
|
+
- "only 1,2" → execute only steps 1 and 2
|
|
679
|
+
- "add: step between 2 and 3 to update the config" → insert a step
|
|
680
|
+
- "deny" or "stop" → cancel entirely
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
**Step 2: Parse the user's response.**
|
|
684
|
+
|
|
685
|
+
| User says | Action |
|
|
686
|
+
|-----------|--------|
|
|
687
|
+
| `approve`, `go`, `yes`, `lgtm`, `ship it` | Execute all steps in order |
|
|
688
|
+
| `skip N` or `skip N,M` | Remove those steps, execute the rest |
|
|
689
|
+
| `only N,M,P` | Execute only the listed steps in order |
|
|
690
|
+
| `for step N, [instruction]` | Replace step N's approach with the user's instruction, then execute all |
|
|
691
|
+
| `add: [description] after N` or `add: [description] before N` | Insert a new step at that position, renumber, then execute all |
|
|
692
|
+
| `deny`, `stop`, `cancel`, `no` | Cancel. Do not execute anything. Ask what the user wants instead. |
|
|
693
|
+
| A longer message with mixed feedback | Parse each instruction. Apply all modifications to the plan. Present the revised plan and ask for final approval. |
|
|
694
|
+
|
|
695
|
+
**Step 3: Execute the approved plan.**
|
|
696
|
+
|
|
697
|
+
Work through the approved steps sequentially. After each step:
|
|
698
|
+
- Show a brief completion message: `Step 2/5 done: OAuth endpoint added.`
|
|
699
|
+
- If a step fails, stop and report. Ask: "Step 3 failed: [error]. Fix and continue, skip this step, or stop?"
|
|
700
|
+
- After all steps complete, show a summary of what was done.
|
|
701
|
+
|
|
702
|
+
**Step 4: Post-execution update.**
|
|
703
|
+
|
|
704
|
+
Update the blackboard with decisions made and experience recorded, same as normal Act phase.
|
|
705
|
+
|
|
706
|
+
#### Mode: `always_ask`
|
|
707
|
+
Same as `plan_first` but applies to **small** tasks too. Only micro tasks (single obvious edit) skip the approval gate.
|
|
708
|
+
|
|
709
|
+
#### Combining with explicit skill routing
|
|
710
|
+
|
|
711
|
+
When the mind decides to route to a skill (e.g., ftm-debug, ftm-executor), the plan approval still applies if the mode is `plan_first` or `always_ask`. Present:
|
|
712
|
+
|
|
713
|
+
```
|
|
714
|
+
For this task, I'd route to ftm-debug with this approach:
|
|
715
|
+
|
|
716
|
+
1. [ ] Launch ftm-debug war room on the flaky auth test
|
|
717
|
+
2. [ ] Apply the fix from debug findings
|
|
718
|
+
3. [ ] Run test suite to verify
|
|
719
|
+
4. [ ] Record experience to blackboard
|
|
720
|
+
|
|
721
|
+
Approve? Or adjust the approach.
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
This gives the user control over the *strategy* even when delegating to skills.
|
|
725
|
+
|
|
726
|
+
### Research tasks → ftm-researcher
|
|
727
|
+
|
|
728
|
+
Route to ftm-researcher when the request is primarily about gathering information,
|
|
729
|
+
comparing approaches, or understanding the state of the art on a topic.
|
|
730
|
+
|
|
731
|
+
Signals:
|
|
732
|
+
- "research X", "find out about Y", "what's the state of the art on Z"
|
|
733
|
+
- "compare approaches to W", "how do others handle X"
|
|
734
|
+
- "deep dive into X", "investigate Y", "look into Z"
|
|
735
|
+
- "find me examples of X", "what's out there for Y"
|
|
736
|
+
- The user wants facts and evidence, not ideation or planning
|
|
737
|
+
|
|
738
|
+
Distinguish from ftm-brainstorm:
|
|
739
|
+
- Brainstorm: user has an idea and wants to develop it → exploratory, iterative, extractive
|
|
740
|
+
- Researcher: user wants information about a topic → factual, evidence-based, comprehensive
|
|
741
|
+
- Ambiguous: if the user seems to want both exploration AND research, route to brainstorm (which calls researcher internally)
|
|
742
|
+
|
|
743
|
+
Mode selection:
|
|
744
|
+
- "quick look" / "briefly" → quick mode
|
|
745
|
+
- Default → standard mode
|
|
746
|
+
- "deep dive" / "thorough" / "comprehensive" → deep mode
|
|
747
|
+
|
|
748
|
+
### Structural code queries → ftm-map
|
|
749
|
+
|
|
750
|
+
Route to ftm-map when the request involves understanding code structure and dependencies:
|
|
751
|
+
|
|
752
|
+
**Strong signals (route immediately):**
|
|
753
|
+
- "what breaks if I change X" / "blast radius"
|
|
754
|
+
- "what depends on X" / "dependency chain"
|
|
755
|
+
- "what calls X" / "who calls X"
|
|
756
|
+
- "where do we handle X" (code search, not docs)
|
|
757
|
+
- "map this codebase" / "index this project"
|
|
758
|
+
|
|
759
|
+
**Disambiguation:**
|
|
760
|
+
- "document this function" → ftm-intent (documentation), NOT ftm-map
|
|
761
|
+
- "show the architecture diagram" → ftm-diagram, NOT ftm-map
|
|
762
|
+
- "search for X in the codebase" → could be ftm-map (if structural) or Grep (if text-literal)
|
|
763
|
+
- If `.ftm-map/map.db` doesn't exist and the query is structural, suggest bootstrapping first
|
|
764
|
+
|
|
765
|
+
### 2. Choose direct vs routed execution
|
|
766
|
+
|
|
767
|
+
Use direct execution when:
|
|
768
|
+
|
|
769
|
+
- the work is micro or small
|
|
770
|
+
- routing overhead adds no value
|
|
771
|
+
- the answer can be delivered faster than a delegated workflow
|
|
772
|
+
|
|
773
|
+
Use a ftm skill when:
|
|
774
|
+
|
|
775
|
+
- its specialized workflow will materially improve the result
|
|
776
|
+
- the user explicitly invoked it
|
|
777
|
+
- the task is medium/large and the skill is the right vehicle
|
|
778
|
+
|
|
779
|
+
### 3. Choose any supporting MCP reads
|
|
780
|
+
|
|
781
|
+
If the request depends on external context, fetch the minimum required state first.
|
|
782
|
+
|
|
783
|
+
Examples:
|
|
784
|
+
|
|
785
|
+
- Jira URL -> read the ticket first
|
|
786
|
+
- meeting request -> read calendar first
|
|
787
|
+
- internal policy question -> search Glean first
|
|
788
|
+
- UI bug -> snapshot or inspect browser first
|
|
789
|
+
|
|
790
|
+
### 4. Decide whether to loop
|
|
791
|
+
|
|
792
|
+
If the next move will reveal new information, plan to re-enter Observe after the action. This is normal for debugging, investigation, and mixed-tool workflows.
|
|
793
|
+
|
|
794
|
+
## Act
|
|
795
|
+
|
|
796
|
+
Act is clean, decisive execution.
|
|
797
|
+
|
|
798
|
+
### 1. Direct action
|
|
799
|
+
|
|
800
|
+
For micro tasks:
|
|
801
|
+
|
|
802
|
+
- do the work
|
|
803
|
+
- summarize what changed
|
|
804
|
+
|
|
805
|
+
For small tasks (when `approval_mode` is `plan_first` or `always_ask`):
|
|
806
|
+
|
|
807
|
+
- show the pre-flight summary first (see Decide section 1.5)
|
|
808
|
+
- then do the work
|
|
809
|
+
- verify
|
|
810
|
+
- summarize what changed
|
|
811
|
+
|
|
812
|
+
The pre-flight summary is not a gate — you proceed immediately after showing it unless the user objects. But showing it is mandatory because it gives the user a chance to catch mis-sizing or redirect before work begins. If the user says "wait" or "actually..." after seeing the pre-flight, stop and listen.
|
|
813
|
+
|
|
814
|
+
Do not over-narrate during execution.
|
|
815
|
+
|
|
816
|
+
### 2. Skill routing
|
|
817
|
+
|
|
818
|
+
Before invoking a skill, show one short routing line.
|
|
819
|
+
|
|
820
|
+
Examples:
|
|
821
|
+
|
|
822
|
+
- `Routing to ftm-debug: this is a flaky failure with real diagnostic uncertainty.`
|
|
823
|
+
- `Routing to ftm-brainstorm: this is still design-stage and benefits from research-backed planning.`
|
|
824
|
+
|
|
825
|
+
Then invoke the target skill with the full user input.
|
|
826
|
+
|
|
827
|
+
### 3. MCP execution
|
|
828
|
+
|
|
829
|
+
Use:
|
|
830
|
+
|
|
831
|
+
- parallel reads when safe
|
|
832
|
+
- sequential writes
|
|
833
|
+
- approval gates only for external-facing actions
|
|
834
|
+
|
|
835
|
+
### 3.5. Draft-before-send protocol
|
|
836
|
+
|
|
837
|
+
When composing Slack messages, emails, or any outbound communication, always save the draft locally before sending.
|
|
838
|
+
|
|
839
|
+
**Drafts folder**: `.ftm-drafts/` in the project root (or `~/.claude/ftm-drafts/` if no project context).
|
|
840
|
+
|
|
841
|
+
**Ensure the folder exists and is gitignored:**
|
|
842
|
+
|
|
843
|
+
1. Create `.ftm-drafts/` if it doesn't exist
|
|
844
|
+
2. Check `.gitignore` — if `.ftm-drafts/` is not listed, add it
|
|
845
|
+
|
|
846
|
+
**Save every draft** before presenting it to the user or sending it:
|
|
847
|
+
|
|
848
|
+
- Filename: `YYYY-MM-DD_HH-MM_<type>_<recipient-or-channel>.md` (e.g., `2026-03-19_14-30_slack_mo-ali.md`)
|
|
849
|
+
- Content format:
|
|
850
|
+
```markdown
|
|
851
|
+
---
|
|
852
|
+
type: slack | email
|
|
853
|
+
to: #channel-name | @person | email@address
|
|
854
|
+
subject: (email only)
|
|
855
|
+
drafted: 2026-03-19T14:30:00
|
|
856
|
+
status: draft | sent | cancelled
|
|
857
|
+
---
|
|
858
|
+
|
|
859
|
+
[message body]
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
**Workflow:**
|
|
863
|
+
1. Compose the message
|
|
864
|
+
2. Save to `.ftm-drafts/`
|
|
865
|
+
3. Present to user for approval (this is already required by the approval gates)
|
|
866
|
+
4. If approved and sent, update `status: sent` in the file
|
|
867
|
+
5. If cancelled or modified, update accordingly
|
|
868
|
+
|
|
869
|
+
This gives the user a local audit trail of everything ftm drafted on their behalf, without polluting git history.
|
|
870
|
+
|
|
871
|
+
### 4. Blackboard updates (mandatory)
|
|
872
|
+
|
|
873
|
+
After every completed task — not just "meaningful" ones — update the blackboard. This is how ftm learns. If you skip this step, the next session starts from zero on tasks like this one.
|
|
874
|
+
|
|
875
|
+
**Always do all of these:**
|
|
876
|
+
|
|
877
|
+
1. Update `context.json` — set `current_task` to reflect what was done, append to `recent_decisions`
|
|
878
|
+
2. Update `session_metadata.skills_invoked` if a skill was used
|
|
879
|
+
|
|
880
|
+
**After task completion, always record an experience file:**
|
|
881
|
+
|
|
882
|
+
3. Write an experience file to `/Users/kioja.kudumu/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json`
|
|
883
|
+
4. Update `/Users/kioja.kudumu/.claude/ftm-state/blackboard/experiences/index.json` with the new entry
|
|
884
|
+
|
|
885
|
+
The experience file should capture:
|
|
886
|
+
- `task_type`: what kind of work this was (e.g., `integration-reroute`, `automation-update`, `bug-fix`)
|
|
887
|
+
- `tags`: domain nouns for future retrieval (e.g., `jira`, `freshservice`, `llm-integration`, `aria`, `itwork2`)
|
|
888
|
+
- `outcome`: `success` or `partial` or `failed`
|
|
889
|
+
- `lessons`: what worked, what was missed, what to do differently next time
|
|
890
|
+
- `files_touched`: list of files modified
|
|
891
|
+
- `stakeholders`: people involved or notified
|
|
892
|
+
- `decisions_made`: key choices and their rationale
|
|
893
|
+
|
|
894
|
+
The reason this is mandatory: the Jira rerouting task involved discovering that ARIA uses Stories not CRs, has no active sprints, needs different custom fields, and requires stakeholder coordination with Mo. None of that is in the code — it's tribal knowledge that only exists if we record it.
|
|
895
|
+
|
|
896
|
+
Follow the schema and full-file write rules from `blackboard-schema.md`.
|
|
897
|
+
|
|
898
|
+
### 5. Loop
|
|
899
|
+
|
|
900
|
+
After acting:
|
|
901
|
+
|
|
902
|
+
- if complete, answer and stop
|
|
903
|
+
- if new information appeared, return to Observe
|
|
904
|
+
- if blocked by approval or missing info, ask the user
|
|
905
|
+
- if the simple approach failed, re-orient and escalate one level
|
|
906
|
+
|
|
907
|
+
## Routing Scenarios
|
|
908
|
+
|
|
909
|
+
Use these as behavioral tests.
|
|
910
|
+
|
|
911
|
+
| Input | What Orient notices | Decision |
|
|
912
|
+
|---|---|---|
|
|
913
|
+
| `debug this flaky test` | bug, uncertainty, likely multiple hypotheses | route to `ftm-debug` |
|
|
914
|
+
| `help me think through auth design` | ideation, architecture, not implementation yet | route to `ftm-brainstorm` |
|
|
915
|
+
| `execute ~/.claude/plans/foo.md` | explicit plan path and execution ask | route to `ftm-executor` |
|
|
916
|
+
| `rename this variable` | one obvious local edit, tiny blast radius | handle directly as `micro` |
|
|
917
|
+
| `what would other AIs think about this approach` | explicit multi-model request | route to `ftm-council` |
|
|
918
|
+
| `audit the wiring` | structural verification request | route to `ftm-audit` |
|
|
919
|
+
| Jira ticket URL only | ticket-driven work, intent not yet clear | fetch via `mcp-atlassian-personal`, then re-orient |
|
|
920
|
+
| `check my calendar and draft a slack message` | mixed-domain workflow, read + external draft/send boundary | read calendar, draft Slack, ask before send |
|
|
921
|
+
| `make this better` | ambiguous, insufficient anchor | ask one focused clarifying question |
|
|
922
|
+
| `/ftm help` | explicit help/menu request | show help menu |
|
|
923
|
+
| `I just committed the fix, now check it` | continuation, recent commit validation | inspect diff, run tests or audit, then report |
|
|
924
|
+
| `/ftm-debug auth race condition` | explicit skill choice | respect explicit route to `ftm-debug` |
|
|
925
|
+
| `/ftm-brainstorm replacement for Okta hooks` | explicit design-phase route | respect explicit route to `ftm-brainstorm` |
|
|
926
|
+
| `open the page and tell me what looks broken` | visual/browser task | route to `ftm-browse` or use browser support if already in-flow |
|
|
927
|
+
| `add error handling to the API routes` | medium task, multi-file, `plan_first` mode | present numbered plan for approval, wait for user response, then execute approved steps |
|
|
928
|
+
| `refactor auth to support OAuth` (with `plan_first`) | medium-large, multi-file with dependencies | present plan with 5-7 steps, user says "skip 4, for step 3 use passport.js" → adjust and execute |
|
|
929
|
+
| `reroute the Jira automation from ITWORK2 to ARIA` | forced-medium: external systems (Jira), cross-system references, unfamiliar codebase, stakeholder coordination | present numbered plan listing all reference changes, stakeholder communication, and verification steps — do NOT start editing code |
|
|
930
|
+
| `update the integration to point to the new API endpoint` | forced-medium: cross-system references, automation code, multiple files likely | present plan first — even if it looks like "just change a URL", the blast radius of integration changes is always higher than expected |
|
|
931
|
+
|
|
932
|
+
## Help Menu
|
|
933
|
+
|
|
934
|
+
When the user asks for help, shows empty input, or says `?` or `menu`, show:
|
|
935
|
+
|
|
936
|
+
```text
|
|
937
|
+
FTM Skills:
|
|
938
|
+
/ftm brainstorm [idea] — Research-backed idea development
|
|
939
|
+
/ftm execute [plan-path] — Autonomous plan execution with agent teams
|
|
940
|
+
/ftm debug [description] — Multi-vector deep debugging war room
|
|
941
|
+
/ftm audit — Wiring verification
|
|
942
|
+
/ftm council [question] — Multi-model deliberation
|
|
943
|
+
/ftm research [topic] — Deep parallel research engine
|
|
944
|
+
/ftm intent — Manage INTENT.md documentation
|
|
945
|
+
/ftm diagram — Manage architecture diagrams
|
|
946
|
+
/ftm codex-gate — Run adversarial Codex validation
|
|
947
|
+
/ftm browse [url] — Visual verification with browser tools
|
|
948
|
+
/ftm pause — Save session state for later
|
|
949
|
+
/ftm resume — Resume a paused session
|
|
950
|
+
/ftm upgrade — Check for skill updates
|
|
951
|
+
/ftm retro — Post-execution retrospective
|
|
952
|
+
/ftm config — Configure ftm settings
|
|
953
|
+
/ftm git — Secret scanning & credential safety gate
|
|
954
|
+
/ftm mind [anything] — Full cognitive loop
|
|
955
|
+
|
|
956
|
+
Or just describe what you need and ftm-mind will figure out the smallest correct next move.
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
## Anti-Patterns
|
|
960
|
+
|
|
961
|
+
Avoid these failures:
|
|
962
|
+
|
|
963
|
+
- keyword routing without real orientation
|
|
964
|
+
- routing a micro task just because a matching skill exists
|
|
965
|
+
- asking broad open-ended clarifying questions when a focused one would do
|
|
966
|
+
- apologizing for empty memory on cold start
|
|
967
|
+
- using past experience to override present repo reality
|
|
968
|
+
- escalating to planning when a direct pass would work
|
|
969
|
+
- performing external-facing actions without approval
|
|
970
|
+
- ignoring explicit skill invocation when it is coherent and safe
|
|
971
|
+
- **downsizing past forced escalation boundaries** — if forced-medium signals fired, the task is medium. Period. "It's basically just find-and-replace" is the exact rationalization that leads to grinding through 15 edits without a plan.
|
|
972
|
+
- **starting to edit code before presenting a plan** when `approval_mode` is `plan_first` and the task is medium+. The plan IS the first deliverable. Reading code to inform the plan is fine. Editing code before plan approval is not.
|
|
973
|
+
- **treating unfamiliar codebases as simple** — if you haven't read the code yet this session, you don't know how complex the change is. Default to medium until you've oriented.
|
|
974
|
+
- **skipping the discovery interview** for medium+ tasks that involve external systems or stakeholders. "I have enough context from the request" is almost never true — the user always knows things they haven't said yet.
|
|
975
|
+
- **skipping blackboard writes** after task completion. If you don't record the experience, the next session starts from zero. Tribal knowledge about project-specific details (custom field IDs, board configurations, stakeholder preferences) is exactly what experiences are for.
|
|
976
|
+
|
|
977
|
+
## Operating Principles
|
|
978
|
+
|
|
979
|
+
1. Orient is the differentiator. Without it, this is just a router.
|
|
980
|
+
2. Try simple first. Escalate only when reality demands it.
|
|
981
|
+
3. Respect explicit user intent.
|
|
982
|
+
4. Cold start is full capability, not degraded mode.
|
|
983
|
+
5. Experience retrieval must be concrete and selective.
|
|
984
|
+
6. Read before write.
|
|
985
|
+
7. Session trajectory matters.
|
|
986
|
+
8. The best route is often no route at all.
|