feed-the-machine 1.6.1 → 1.7.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 (269) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +170 -170
  3. package/bin/brain.py +1340 -0
  4. package/bin/convert_claude_skills_to_codex.py +490 -0
  5. package/bin/generate-manifest.mjs +463 -463
  6. package/bin/harden_codex_skills.py +141 -0
  7. package/bin/install.mjs +491 -491
  8. package/bin/migrate-eng-buddy-data.py +875 -0
  9. package/bin/playbook_engine/__init__.py +1 -0
  10. package/bin/playbook_engine/conftest.py +8 -0
  11. package/bin/playbook_engine/extractor.py +33 -0
  12. package/bin/playbook_engine/manager.py +102 -0
  13. package/bin/playbook_engine/models.py +84 -0
  14. package/bin/playbook_engine/registry.py +35 -0
  15. package/bin/playbook_engine/test_extractor.py +72 -0
  16. package/bin/playbook_engine/test_integration.py +129 -0
  17. package/bin/playbook_engine/test_manager.py +85 -0
  18. package/bin/playbook_engine/test_models.py +166 -0
  19. package/bin/playbook_engine/test_registry.py +67 -0
  20. package/bin/playbook_engine/test_tracer.py +86 -0
  21. package/bin/playbook_engine/tracer.py +93 -0
  22. package/bin/tasks_db.py +456 -0
  23. package/docs/HOOKS.md +243 -243
  24. package/docs/INBOX.md +233 -233
  25. package/ftm/SKILL.md +125 -122
  26. package/ftm-audit/SKILL.md +623 -623
  27. package/ftm-audit/references/protocols/PROJECT-PATTERNS.md +91 -91
  28. package/ftm-audit/references/protocols/RUNTIME-WIRING.md +66 -66
  29. package/ftm-audit/references/protocols/WIRING-CONTRACTS.md +135 -135
  30. package/ftm-audit/references/strategies/AUTO-FIX-STRATEGIES.md +69 -69
  31. package/ftm-audit/references/templates/REPORT-FORMAT.md +96 -96
  32. package/ftm-audit/scripts/run-knip.sh +23 -23
  33. package/ftm-audit.yml +2 -2
  34. package/ftm-brainstorm/SKILL.md +1003 -498
  35. package/ftm-brainstorm/evals/evals.json +180 -100
  36. package/ftm-brainstorm/evals/promptfoo.yaml +109 -109
  37. package/ftm-brainstorm/references/agent-prompts.md +552 -224
  38. package/ftm-brainstorm/references/plan-template.md +209 -121
  39. package/ftm-brainstorm.yml +2 -2
  40. package/ftm-browse/SKILL.md +454 -454
  41. package/ftm-browse/daemon/browser-manager.ts +206 -206
  42. package/ftm-browse/daemon/bun.lock +30 -30
  43. package/ftm-browse/daemon/cli.ts +347 -347
  44. package/ftm-browse/daemon/commands.ts +410 -410
  45. package/ftm-browse/daemon/main.ts +357 -357
  46. package/ftm-browse/daemon/package.json +17 -17
  47. package/ftm-browse/daemon/server.ts +189 -189
  48. package/ftm-browse/daemon/snapshot.ts +519 -519
  49. package/ftm-browse/daemon/tsconfig.json +22 -22
  50. package/ftm-browse.yml +4 -4
  51. package/ftm-capture/SKILL.md +370 -370
  52. package/ftm-capture.yml +4 -4
  53. package/ftm-codex-gate/SKILL.md +361 -361
  54. package/ftm-codex-gate.yml +2 -2
  55. package/ftm-config/SKILL.md +422 -345
  56. package/ftm-config.default.yml +125 -82
  57. package/ftm-config.yml +44 -2
  58. package/ftm-council/SKILL.md +416 -416
  59. package/ftm-council/references/prompts/CLAUDE-INVESTIGATION.md +60 -60
  60. package/ftm-council/references/prompts/CODEX-INVESTIGATION.md +58 -58
  61. package/ftm-council/references/prompts/GEMINI-INVESTIGATION.md +58 -58
  62. package/ftm-council/references/prompts/REBUTTAL-TEMPLATE.md +57 -57
  63. package/ftm-council/references/protocols/PREREQUISITES.md +47 -47
  64. package/ftm-council/references/protocols/STEP-0-FRAMING.md +46 -46
  65. package/ftm-council.yml +2 -2
  66. package/ftm-dashboard/SKILL.md +163 -163
  67. package/ftm-dashboard.yml +4 -4
  68. package/ftm-debug/SKILL.md +1037 -1037
  69. package/ftm-debug/references/phases/PHASE-0-INTAKE.md +58 -58
  70. package/ftm-debug/references/phases/PHASE-1-TRIAGE.md +46 -46
  71. package/ftm-debug/references/phases/PHASE-2-WAR-ROOM-AGENTS.md +279 -279
  72. package/ftm-debug/references/phases/PHASE-3-TO-6-EXECUTION.md +436 -436
  73. package/ftm-debug/references/protocols/BLACKBOARD.md +86 -86
  74. package/ftm-debug/references/protocols/EDGE-CASES.md +103 -103
  75. package/ftm-debug.yml +2 -2
  76. package/ftm-diagram/SKILL.md +277 -277
  77. package/ftm-diagram.yml +2 -2
  78. package/ftm-executor/SKILL.md +777 -777
  79. package/ftm-executor/references/STYLE-TEMPLATE.md +73 -73
  80. package/ftm-executor/references/phases/PHASE-0-VERIFICATION.md +62 -62
  81. package/ftm-executor/references/phases/PHASE-2-AGENT-ASSEMBLY.md +34 -34
  82. package/ftm-executor/references/phases/PHASE-3-WORKTREES.md +38 -38
  83. package/ftm-executor/references/phases/PHASE-4-5-AUDIT.md +72 -72
  84. package/ftm-executor/references/phases/PHASE-4-DISPATCH.md +66 -66
  85. package/ftm-executor/references/phases/PHASE-5-5-CODEX-GATE.md +73 -73
  86. package/ftm-executor/references/protocols/DOCUMENTATION-BOOTSTRAP.md +36 -36
  87. package/ftm-executor/references/protocols/MODEL-PROFILE.md +59 -59
  88. package/ftm-executor/references/protocols/PROGRESS-TRACKING.md +66 -66
  89. package/ftm-executor/runtime/ftm-runtime.mjs +252 -252
  90. package/ftm-executor/runtime/package.json +8 -8
  91. package/ftm-executor.yml +2 -2
  92. package/ftm-git/SKILL.md +441 -441
  93. package/ftm-git/evals/evals.json +26 -26
  94. package/ftm-git/evals/promptfoo.yaml +75 -75
  95. package/ftm-git/hooks/post-commit-experience.sh +92 -92
  96. package/ftm-git/references/patterns/SECRET-PATTERNS.md +104 -104
  97. package/ftm-git/references/protocols/REMEDIATION.md +139 -139
  98. package/ftm-git/scripts/pre-commit-secrets.sh +110 -110
  99. package/ftm-git.yml +2 -2
  100. package/ftm-inbox/backend/__pycache__/main.cpython-314.pyc +0 -0
  101. package/ftm-inbox/backend/adapters/_retry.py +64 -64
  102. package/ftm-inbox/backend/adapters/base.py +230 -230
  103. package/ftm-inbox/backend/adapters/freshservice.py +104 -104
  104. package/ftm-inbox/backend/adapters/gmail.py +125 -125
  105. package/ftm-inbox/backend/adapters/jira.py +136 -136
  106. package/ftm-inbox/backend/adapters/registry.py +192 -192
  107. package/ftm-inbox/backend/adapters/slack.py +110 -110
  108. package/ftm-inbox/backend/db/connection.py +54 -54
  109. package/ftm-inbox/backend/db/schema.py +78 -78
  110. package/ftm-inbox/backend/executor/__init__.py +7 -7
  111. package/ftm-inbox/backend/executor/engine.py +149 -149
  112. package/ftm-inbox/backend/executor/step_runner.py +98 -98
  113. package/ftm-inbox/backend/main.py +103 -103
  114. package/ftm-inbox/backend/models/__init__.py +1 -1
  115. package/ftm-inbox/backend/models/unified_task.py +36 -36
  116. package/ftm-inbox/backend/planner/__init__.py +6 -6
  117. package/ftm-inbox/backend/planner/__pycache__/__init__.cpython-314.pyc +0 -0
  118. package/ftm-inbox/backend/planner/__pycache__/generator.cpython-314.pyc +0 -0
  119. package/ftm-inbox/backend/planner/__pycache__/schema.cpython-314.pyc +0 -0
  120. package/ftm-inbox/backend/planner/generator.py +127 -127
  121. package/ftm-inbox/backend/planner/schema.py +34 -34
  122. package/ftm-inbox/backend/requirements.txt +5 -5
  123. package/ftm-inbox/backend/routes/__pycache__/plan.cpython-314.pyc +0 -0
  124. package/ftm-inbox/backend/routes/execute.py +186 -186
  125. package/ftm-inbox/backend/routes/health.py +52 -52
  126. package/ftm-inbox/backend/routes/inbox.py +68 -68
  127. package/ftm-inbox/backend/routes/plan.py +271 -271
  128. package/ftm-inbox/bin/launchagent.mjs +91 -91
  129. package/ftm-inbox/bin/setup.mjs +188 -188
  130. package/ftm-inbox/bin/start.sh +10 -10
  131. package/ftm-inbox/bin/status.sh +17 -17
  132. package/ftm-inbox/bin/stop.sh +8 -8
  133. package/ftm-inbox/config.example.yml +55 -55
  134. package/ftm-inbox/package-lock.json +2898 -2898
  135. package/ftm-inbox/package.json +26 -26
  136. package/ftm-inbox/postcss.config.js +6 -6
  137. package/ftm-inbox/src/app.css +199 -199
  138. package/ftm-inbox/src/app.html +18 -18
  139. package/ftm-inbox/src/lib/api.ts +166 -166
  140. package/ftm-inbox/src/lib/components/ExecutionLog.svelte +81 -81
  141. package/ftm-inbox/src/lib/components/InboxFeed.svelte +143 -143
  142. package/ftm-inbox/src/lib/components/PlanStep.svelte +271 -271
  143. package/ftm-inbox/src/lib/components/PlanView.svelte +206 -206
  144. package/ftm-inbox/src/lib/components/StreamPanel.svelte +99 -99
  145. package/ftm-inbox/src/lib/components/TaskCard.svelte +190 -190
  146. package/ftm-inbox/src/lib/components/ui/EmptyState.svelte +63 -63
  147. package/ftm-inbox/src/lib/components/ui/KawaiiCard.svelte +86 -86
  148. package/ftm-inbox/src/lib/components/ui/PillButton.svelte +106 -106
  149. package/ftm-inbox/src/lib/components/ui/StatusBadge.svelte +67 -67
  150. package/ftm-inbox/src/lib/components/ui/StreamDrawer.svelte +149 -149
  151. package/ftm-inbox/src/lib/components/ui/ThemeToggle.svelte +80 -80
  152. package/ftm-inbox/src/lib/theme.ts +47 -47
  153. package/ftm-inbox/src/routes/+layout.svelte +76 -76
  154. package/ftm-inbox/src/routes/+page.svelte +401 -401
  155. package/ftm-inbox/svelte.config.js +12 -12
  156. package/ftm-inbox/tailwind.config.ts +63 -63
  157. package/ftm-inbox/tsconfig.json +13 -13
  158. package/ftm-inbox/vite.config.ts +6 -6
  159. package/ftm-intent/SKILL.md +241 -241
  160. package/ftm-intent.yml +2 -2
  161. package/ftm-manifest.json +3794 -3794
  162. package/ftm-map/SKILL.md +291 -291
  163. package/ftm-map/scripts/db.py +712 -712
  164. package/ftm-map/scripts/index.py +415 -415
  165. package/ftm-map/scripts/parser.py +224 -224
  166. package/ftm-map/scripts/queries/go-tags.scm +20 -20
  167. package/ftm-map/scripts/queries/javascript-tags.scm +35 -35
  168. package/ftm-map/scripts/queries/python-tags.scm +31 -31
  169. package/ftm-map/scripts/queries/ruby-tags.scm +19 -19
  170. package/ftm-map/scripts/queries/rust-tags.scm +37 -37
  171. package/ftm-map/scripts/queries/typescript-tags.scm +41 -41
  172. package/ftm-map/scripts/query.py +301 -301
  173. package/ftm-map/scripts/ranker.py +377 -377
  174. package/ftm-map/scripts/requirements.txt +5 -5
  175. package/ftm-map/scripts/setup-hooks.sh +27 -27
  176. package/ftm-map/scripts/setup.sh +56 -56
  177. package/ftm-map/scripts/test_db.py +364 -364
  178. package/ftm-map/scripts/test_parser.py +174 -174
  179. package/ftm-map/scripts/test_query.py +183 -183
  180. package/ftm-map/scripts/test_ranker.py +199 -199
  181. package/ftm-map/scripts/views.py +591 -591
  182. package/ftm-map.yml +2 -2
  183. package/ftm-mind/SKILL.md +201 -1943
  184. package/ftm-mind/evals/promptfoo.yaml +142 -142
  185. package/ftm-mind/references/blackboard-protocol.md +110 -0
  186. package/ftm-mind/references/blackboard-schema.md +328 -328
  187. package/ftm-mind/references/complexity-guide.md +110 -110
  188. package/ftm-mind/references/complexity-sizing.md +138 -0
  189. package/ftm-mind/references/decide-act-protocol.md +172 -0
  190. package/ftm-mind/references/direct-execution.md +51 -0
  191. package/ftm-mind/references/environment-discovery.md +77 -0
  192. package/ftm-mind/references/event-registry.md +319 -319
  193. package/ftm-mind/references/mcp-inventory.md +300 -296
  194. package/ftm-mind/references/ops-routing.md +47 -0
  195. package/ftm-mind/references/orient-protocol.md +234 -0
  196. package/ftm-mind/references/personality.md +40 -0
  197. package/ftm-mind/references/protocols/COMPLEXITY-SIZING.md +72 -72
  198. package/ftm-mind/references/protocols/MCP-HEURISTICS.md +32 -32
  199. package/ftm-mind/references/protocols/PLAN-APPROVAL.md +80 -80
  200. package/ftm-mind/references/reflexion-protocol.md +249 -249
  201. package/ftm-mind/references/routing/SCENARIOS.md +22 -22
  202. package/ftm-mind/references/routing-scenarios.md +35 -35
  203. package/ftm-mind.yml +2 -2
  204. package/ftm-ops.yml +4 -0
  205. package/ftm-pause/SKILL.md +395 -395
  206. package/ftm-pause/references/protocols/SKILL-RESTORE-PROTOCOLS.md +186 -186
  207. package/ftm-pause/references/protocols/VALIDATION.md +80 -80
  208. package/ftm-pause.yml +2 -2
  209. package/ftm-researcher/SKILL.md +275 -275
  210. package/ftm-researcher/evals/agent-diversity.yaml +17 -17
  211. package/ftm-researcher/evals/synthesis-quality.yaml +12 -12
  212. package/ftm-researcher/evals/trigger-accuracy.yaml +39 -39
  213. package/ftm-researcher/references/adaptive-search.md +116 -116
  214. package/ftm-researcher/references/agent-prompts.md +193 -193
  215. package/ftm-researcher/references/council-integration.md +193 -193
  216. package/ftm-researcher/references/output-format.md +203 -203
  217. package/ftm-researcher/references/synthesis-pipeline.md +165 -165
  218. package/ftm-researcher/scripts/score_credibility.py +234 -234
  219. package/ftm-researcher/scripts/validate_research.py +92 -92
  220. package/ftm-researcher.yml +2 -2
  221. package/ftm-resume/SKILL.md +518 -518
  222. package/ftm-resume/references/protocols/VALIDATION.md +172 -172
  223. package/ftm-resume.yml +2 -2
  224. package/ftm-retro/SKILL.md +380 -380
  225. package/ftm-retro/references/protocols/SCORING-RUBRICS.md +89 -89
  226. package/ftm-retro/references/templates/REPORT-FORMAT.md +109 -109
  227. package/ftm-retro.yml +2 -2
  228. package/ftm-routine/SKILL.md +170 -170
  229. package/ftm-routine.yml +4 -4
  230. package/ftm-state/blackboard/capabilities.json +5 -5
  231. package/ftm-state/blackboard/capabilities.schema.json +27 -27
  232. package/ftm-state/blackboard/context.json +37 -23
  233. package/ftm-state/blackboard/experiences/doom-statusline-fix.json +26 -0
  234. package/ftm-state/blackboard/experiences/hackathon-pages-site.json +26 -0
  235. package/ftm-state/blackboard/experiences/hindsight-sso-kickoff.json +42 -0
  236. package/ftm-state/blackboard/experiences/index.json +58 -9
  237. package/ftm-state/blackboard/experiences/learning-ragnarok-api-access.json +23 -0
  238. package/ftm-state/blackboard/experiences/nordlayer-members-auto-assign.json +26 -0
  239. package/ftm-state/blackboard/experiences/saml2aws-stale-session-fix.json +41 -0
  240. package/ftm-state/blackboard/patterns.json +6 -6
  241. package/ftm-state/schemas/context.schema.json +130 -130
  242. package/ftm-state/schemas/experience-index.schema.json +77 -77
  243. package/ftm-state/schemas/experience.schema.json +78 -78
  244. package/ftm-state/schemas/patterns.schema.json +44 -44
  245. package/ftm-upgrade/SKILL.md +194 -194
  246. package/ftm-upgrade/scripts/check-version.sh +76 -76
  247. package/ftm-upgrade/scripts/upgrade.sh +143 -143
  248. package/ftm-upgrade.yml +2 -2
  249. package/ftm-verify.yml +2 -2
  250. package/ftm.yml +2 -2
  251. package/hooks/ftm-auto-log.sh +137 -0
  252. package/hooks/ftm-blackboard-enforcer.sh +93 -93
  253. package/hooks/ftm-discovery-reminder.sh +90 -90
  254. package/hooks/ftm-drafts-gate.sh +61 -61
  255. package/hooks/ftm-event-logger.mjs +107 -107
  256. package/hooks/ftm-install-hooks.sh +240 -0
  257. package/hooks/ftm-learning-capture.sh +117 -0
  258. package/hooks/ftm-map-autodetect.sh +79 -79
  259. package/hooks/ftm-pending-sync-check.sh +22 -22
  260. package/hooks/ftm-plan-gate.sh +92 -92
  261. package/hooks/ftm-post-commit-trigger.sh +57 -57
  262. package/hooks/ftm-post-compaction.sh +138 -0
  263. package/hooks/ftm-pre-compaction.sh +147 -0
  264. package/hooks/ftm-session-end.sh +52 -0
  265. package/hooks/ftm-session-snapshot.sh +213 -0
  266. package/hooks/settings-template.json +81 -81
  267. package/install.sh +363 -363
  268. package/package.json +84 -84
  269. package/uninstall.sh +25 -25
@@ -1,777 +1,777 @@
1
- ---
2
- name: ftm-executor
3
- description: Autonomous plan execution engine. Takes any plan document and executes it end-to-end with a dynamically assembled agent team — analyzing tasks, creating purpose-built agents, dispatching them in parallel worktrees, and running each through a commit-review-fix loop until complete. Use this skill whenever the user wants to execute a plan, run a plan doc, launch an agent team on tasks, or says things like "execute this plan", "run this", "launch agents on this doc", "take this plan and go", or points to a plan file and wants it implemented autonomously. Even if they just paste a plan path and say "go" — this is the skill.
4
- ---
5
-
6
- ## Events
7
-
8
- ### Emits
9
- - `task_received` — when a new task is acknowledged and added to the execution queue
10
- - `plan_generated` — when a plan document is created or validated and ready for review
11
- - `plan_approved` — when the user confirms a plan and execution is authorized to begin
12
- - `code_changed` — when files are modified in a worktree (pre-commit state)
13
- - `code_committed` — when a git commit is successfully made in any worktree
14
- - `test_passed` — when the test suite passes (post-task verification or full-suite run)
15
- - `test_failed` — when the test suite fails during post-task verification or regression check
16
- - `task_completed` — when a task passes all verification gates (tests, audit, Codex gate)
17
- - `error_encountered` — when an unexpected error occurs that halts or disrupts a task or wave
18
-
19
- ### Listens To
20
- - `plan_approved` — begin Phase 3 worktree setup and dispatch agents for the first wave
21
-
22
- ## Blackboard Read
23
-
24
- Before starting, load context from the blackboard:
25
-
26
- 1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
27
- 2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter entries by task_type matching plan tasks and tags overlapping with the plan domain
28
- 3. Load top 3-5 matching experience files for relevant lessons on agent performance and timing
29
- 4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check execution_patterns for agent performance and timing accuracy patterns
30
-
31
- If index.json is empty or no matches found, proceed normally without experience-informed shortcuts.
32
-
33
- # Plan Executor
34
-
35
- Autonomous agent-team orchestrator for plan documents. You read the plan, assemble the right team, give each agent its own worktree, and let them rip through tasks in a commit-review-fix loop until everything is done.
36
-
37
- ## Why This Exists
38
-
39
- Executing a multi-task plan manually means: read plan, pick a task, do it, commit, review, fix, repeat — while also tracking dependencies and parallelism yourself. That's slow and error-prone. This skill automates the entire thing by treating the plan as a job spec and dynamically building the team to fulfill it.
40
-
41
- ## The Process
42
-
43
- ### Phase 0: Plan Requirement Gate
44
-
45
- **Before anything else, verify that a plan document exists and has been approved by the user.**
46
-
47
- This gate exists because the executor's entire value comes from structured, parallel execution of a well-defined plan. Without a plan, you're just grinding through code changes sequentially — which is what ftm-mind's direct action path does, and it's worse at it than a focused engineer because it lacks the user's judgment about ordering and priorities.
48
-
49
- **Check for a plan:**
50
-
51
- 1. Was a plan path provided? (e.g., the user said "execute ~/.claude/plans/foo.md" or ftm-mind routed with a plan reference)
52
- 2. If yes, read the plan and proceed to Phase 0.5.
53
- 3. If no plan path was provided, **do not start coding**. Instead:
54
-
55
- a. Read the user's request and the codebase context passed from ftm-mind.
56
- b. Generate a structured plan document with numbered tasks, file lists, dependencies, acceptance criteria, and verification steps.
57
- c. Present the plan to the user for approval:
58
-
59
- ```
60
- I need a plan before I can execute. Here's what I'd propose:
61
-
62
- 1. [ ] [task description] → [files] | verify: [method]
63
- 2. [ ] [task description] → [files] | verify: [method]
64
- 3. [ ] [task description] → [files] | verify: [method]
65
- ...
66
-
67
- Approve? Or tell me what to change.
68
- ```
69
-
70
- d. Wait for user approval. Parse their response the same way ftm-mind's Interactive Plan Approval handles it (approve, skip N, modify step N, deny).
71
- e. Only after approval, save the plan to `~/.claude/plans/` and proceed to Phase 0.5.
72
-
73
- **Why this gate matters**: The Jira rerouting incident showed what happens without it — the executor (or mind acting as executor) jumped straight into reading files and making 15+ edits across a 1700-line file without ever presenting a plan. The user never got to say "wait, also draft a Slack message to Mo" or "check with the ARIA team about epic assignment first" or "actually, don't change the sprint logic yet." By the time the user saw the changes, 2 minutes of grinding had already happened in the wrong direction. A 30-second plan would have caught all of this.
74
-
75
- ---
76
-
77
- ### Phase 0.5: Plan Verification Gate
78
-
79
- **Before executing anything, validate the plan.** A bad plan wastes every agent's time. This gate catches structural problems, missing dependencies, and unrealistic scope before any code is written.
80
-
81
- Spawn a **Plan Checker** agent to verify the plan:
82
-
83
- ```
84
- You are a plan quality checker. Analyze this implementation plan and report issues.
85
- Do NOT implement anything — just verify the plan is sound.
86
-
87
- Plan path: [path]
88
-
89
- Check these dimensions:
90
-
91
- 1. STRUCTURAL INTEGRITY
92
- - Every task has: description, files list, dependencies, acceptance criteria
93
- - Task numbering is consistent (no gaps, no duplicates)
94
- - Dependencies reference valid task numbers
95
- - No circular dependencies (Task A depends on B, B depends on A)
96
-
97
- 2. DEPENDENCY GRAPH VALIDITY
98
- - Build the full dependency graph
99
- - Verify all referenced tasks exist
100
- - Check for implicit dependencies (two tasks modifying the same file
101
- but not declared as dependent)
102
- - Flag tasks with too many dependencies (>3 usually means bad decomposition)
103
-
104
- 3. FILE CONFLICT DETECTION
105
- - Map every task to its file list
106
- - Flag any files touched by multiple tasks in the same wave
107
- - These MUST be sequential, not parallel — if the plan puts them
108
- in the same wave, that's a bug
109
-
110
- 4. SCOPE REASONABLENESS
111
- - Flag tasks that touch >10 files (probably too big for one agent)
112
- - Flag tasks with vague acceptance criteria ("make it work", "looks good")
113
- - Flag tasks with no verification steps
114
-
115
- 5. PROJECT COMPATIBILITY
116
- - Check that file paths reference real directories in the project
117
- - Verify the tech stack matches what the plan assumes
118
- - Check that dependencies/libraries the plan references are installed
119
- or listed in package.json/requirements.txt
120
-
121
- Return a structured report:
122
-
123
- PASS — plan is sound, proceed to execution
124
- WARN — issues found but execution can proceed (list warnings)
125
- FAIL — critical issues that must be fixed before execution (list blockers)
126
-
127
- For FAIL findings, suggest specific fixes.
128
- ```
129
-
130
- **Interpret the result:**
131
- - **PASS**: Proceed to Phase 0.7 → Phase 1 → Phase 1.5 (documentation bootstrap) → Phase 2
132
- - **WARN**: Show warnings to user, proceed unless they object
133
- - **FAIL**: Present blockers and suggested fixes. Ask user: fix the plan and re-run, or override and execute anyway?
134
-
135
- If the plan checker finds file conflicts between tasks in the same wave, automatically restructure the wave ordering to make conflicting tasks sequential. Report the change.
136
-
137
- ---
138
-
139
- ### Phase 0.7: Load Model Profile and Agent Mode
140
-
141
- Read `~/.claude/ftm-config.yml` to determine which models and permission mode to use for agent dispatch. If the file doesn't exist, use balanced defaults:
142
- - Planning agents: opus
143
- - Execution agents: sonnet
144
- - Review/audit agents: sonnet
145
-
146
- When spawning agents in subsequent phases, pass the `model` parameter based on the agent's role:
147
- - Phase 2 (team assembly / plan checking): use `planning` model
148
- - Phase 4 (task execution): use `execution` model
149
- - Phase 4.5 (audit): use `review` model
150
-
151
- If the profile specifies `inherit`, omit the `model` parameter (uses session default).
152
-
153
- **Agent permission mode**: Read `execution.agent_mode` from ftm-config.yml. Pass this as the `mode` parameter on every Agent tool call. Default: `bypassPermissions`. This ensures spawned agents inherit the user's preferred permission level and do not downgrade to `acceptEdits` or `default`.
154
-
155
- ---
156
-
157
- ### Phase 1: Analyze the Plan
158
-
159
- Read the plan document and extract:
160
-
161
- 1. **All tasks** — number, description, files touched, dependencies
162
- 2. **Dependency graph** — which tasks block which (the plan usually states this)
163
- 3. **Domain clusters** — group tasks by what kind of work they are (frontend, backend, infra, testing, styling, etc.)
164
- 4. **Parallelism opportunities** — independent tasks or independent clusters that can run simultaneously
165
-
166
- Output a brief execution summary before proceeding:
167
- ```
168
- Plan: [title]
169
- Tasks: [N] total
170
- Agents needed: [list with reasoning]
171
- Parallel waves:
172
- Wave 1 (independent): Tasks 1, 2, 3, 4
173
- Wave 2 (depends on wave 1): Tasks 5, 6, 7
174
- Wave 3: Tasks 8-14
175
- ...
176
- Final: Task [N] (integration/cleanup)
177
- ```
178
-
179
- **After outputting the summary, proceed IMMEDIATELY to Phase 1.5.** Do NOT skip to Phase 2. The documentation bootstrap must run before any agents are dispatched.
180
-
181
- ---
182
-
183
- ### Phase 1.5: Documentation Layer Bootstrap (MANDATORY)
184
-
185
- **This phase is non-skippable.** The documentation layer is required for ftm-verify to assess plan completion, for ftm-codex-gate to detect intent conflicts, and for agents to update docs as they work. Without it, every downstream verification step is degraded.
186
-
187
- Before dispatching any agents, check if the project has the required documentation layer. If any of these files are missing, create them. If they already exist, verify they're non-empty and well-formed.
188
-
189
- **Required documentation files — create if missing:**
190
- 1. **INTENT.md** (project root) — Bootstrap from the plan's Vision and Architecture Decisions sections. Use the ftm-intent skill's root template format. Must include: Vision, Architecture Decisions table, Module Map.
191
- 2. **ARCHITECTURE.mmd** (project root) — Bootstrap by scanning the codebase for modules and their import relationships. Use the ftm-diagram skill's root template format. Must have at least one node and one edge.
192
- 3. **STYLE.md** (project root) — Copy from `~/.claude/skills/ftm-executor/references/STYLE-TEMPLATE.md` into the project root.
193
- 4. **DEBUG.md** (project root) — Create with a header:
194
- ```markdown
195
- # Debug Log
196
-
197
- Failed approaches and their outcomes. Codex and Claude append here — never retry what's already logged.
198
- ```
199
-
200
- **Phase 1.5 Gate:** After creating any missing files, verify all 4 exist:
201
- ```bash
202
- for f in INTENT.md ARCHITECTURE.mmd STYLE.md DEBUG.md; do
203
- [ -f "$f" ] || echo "MISSING: $f"
204
- done
205
- ```
206
- If any file is still missing after the bootstrap attempt, STOP and report:
207
- ```
208
- Documentation bootstrap failed — missing: [list]
209
- Cannot proceed without documentation layer. Fix manually or re-run.
210
- ```
211
- Do NOT proceed to Phase 2 with missing documentation files.
212
-
213
- **Phase 1.5 complete.** All documentation files verified. Proceed to Phase 2.
214
-
215
- **CRITICAL FLOW REMINDER: The execution sequence is Phase 0 → 0.5 → 0.7 → 1 → 1.5 → 2 → 3 → 3.5 → 4. Phase 1.5 MUST execute between Phase 1 and Phase 2. If you are reading this and have not yet created/verified the documentation layer, STOP and do it now before dispatching any agents.**
216
-
217
- ---
218
-
219
- ### Phase 2: Assemble the Agent Team
220
-
221
- For each domain cluster, you need an agent. Here's how to pick or create them:
222
-
223
- #### Check existing agents first
224
-
225
- Look at the available agent types (the ones in the Agent tool). Map each task cluster to the best fit:
226
-
227
- | Domain | Likely Agent |
228
- |--------|-------------|
229
- | React/UI/CSS/components | frontend-developer |
230
- | API/server/database | backend-architect |
231
- | CI/CD/deploy/infra | devops-automator |
232
- | Tests/coverage | test-writer-fixer |
233
- | Mobile/native | mobile-app-builder |
234
- | AI/ML features | ai-engineer |
235
- | General coding | general-purpose |
236
-
237
- #### When no existing agent fits
238
-
239
- If a task cluster requires specialized knowledge that none of the standard agents cover well — for example, "theme system with CSS custom properties and dark mode" or "WebSocket terminal integration" — create a purpose-built agent prompt.
240
-
241
- Write a focused agent definition that includes:
242
- - **Domain expertise**: What this agent knows deeply
243
- - **Task context**: The specific tasks from the plan it will handle
244
- - **Standards**: Coding conventions from the project (infer from existing code)
245
- - **Constraints**: Don't touch files outside your scope
246
-
247
- Store these as reference prompts in the skill workspace so they can be reused. The prompt becomes the `prompt` parameter when spawning the agent.
248
-
249
- The goal is that over time, your agent library grows with battle-tested specialists. A "theme-engineer" agent created for one project's CSS system can be reused next time themes come up.
250
-
251
- ### Phase 3: Set Up Worktrees
252
-
253
- Each agent gets its own isolated worktree so they don't step on each other's changes.
254
-
255
- For each agent in the current wave:
256
-
257
- 1. Create a worktree branch: `plan-exec/<agent-name>` (e.g., `plan-exec/frontend-tasks-1-4`)
258
- 2. Use git worktree to create isolation:
259
- ```bash
260
- git worktree add .worktrees/plan-exec-<agent-name> -b plan-exec/<agent-name>
261
- ```
262
- 3. Run any project setup (npm install, etc.) in the worktree
263
- 4. Verify the worktree starts clean (tests pass or at least build succeeds)
264
-
265
- Make sure `.worktrees/` is in `.gitignore` first. If it's not, add it.
266
-
267
- ### Phase 3.5: Initialize Progress Tracking
268
-
269
- If `progress_tracking` is enabled in `~/.claude/ftm-config.yml` (default: true), create a `PROGRESS.md` file in the project root that gets updated after every significant event. This gives visibility into long-running executions without interrupting them.
270
-
271
- **Create the initial file:**
272
-
273
- ```markdown
274
- # FTM Executor — Progress
275
-
276
- **Plan:** [plan title]
277
- **Started:** [timestamp]
278
- **Status:** IN PROGRESS
279
-
280
- ## Execution Summary
281
- | Wave | Tasks | Status | Started | Completed |
282
- |------|-------|--------|---------|-----------|
283
- | 1 | [task list] | PENDING | — | — |
284
- | 2 | [task list] | PENDING | — | — |
285
- | ... | | | | |
286
-
287
- ## Task Status
288
- | # | Title | Agent | Status | Audit | Notes |
289
- |---|-------|-------|--------|-------|-------|
290
- | 1 | [title] | [agent] | PENDING | — | |
291
- | 2 | [title] | [agent] | PENDING | — | |
292
- | ... | | | | | |
293
-
294
- ## Activity Log
295
- [reverse chronological — newest first]
296
- ```
297
-
298
- **Update PROGRESS.md at these events:**
299
- - Wave starts → update wave status to `IN PROGRESS`, add timestamp
300
- - Task agent returns → update task status to `COMPLETE` or `FAILED`, add audit result
301
- - Wave completes → update wave status to `COMPLETE`, add timestamp
302
- - Merge completes → add to activity log
303
- - Errors/blockers → add to activity log with details
304
-
305
- **Activity log entries** use this format:
306
- ```
307
- ### [HH:MM] [event type]
308
- [brief description]
309
- ```
310
-
311
- Example:
312
- ```
313
- ### 14:32 Wave 1 complete
314
- Tasks 1-4 merged to main. All audits passed. 2 auto-fixes applied.
315
-
316
- ### 14:15 Task 3 audit — auto-fix
317
- Added missing import for UserPreferences in SettingsView.tsx
318
-
319
- ### 13:45 Wave 1 started
320
- Dispatching 4 agents in parallel: frontend (tasks 1,2), backend (task 3), testing (task 4)
321
- ```
322
-
323
- This file is for human consumption — the user can check it anytime without interrupting execution. Keep entries concise and informative.
324
-
325
- ---
326
-
327
- ### Phase 4: Dispatch Agents
328
-
329
- Launch agents for all tasks in the current wave **in parallel**. Each agent gets a prompt structured like this:
330
-
331
- ```
332
- You are working in an isolated git worktree at: [worktree path]
333
- Your working directory is: [worktree path]
334
-
335
- ## Your Assignment
336
-
337
- Execute the following tasks from the plan:
338
-
339
- [paste the relevant task sections verbatim from the plan doc]
340
-
341
- ## Plan Context
342
-
343
- Full plan: [plan path]
344
- Your tasks: [task numbers]
345
- Dependencies satisfied: [list what was already completed in prior waves]
346
-
347
- ## Execution Loop
348
-
349
- For EACH task, follow this cycle:
350
-
351
- 1. **Implement** — Follow the plan's steps exactly. Read files before modifying them. Use the project's existing patterns.
352
-
353
- 2. **Commit** — Before committing, run **ftm-git** to scan staged files for hardcoded secrets. If ftm-git emits `secrets_found`, stop and remediate before proceeding. Only after ftm-git emits `secrets_clear` or `secrets_remediated`, stage and commit your changes with a clear message describing what was done. Never reference AI/Claude in commit messages.
354
-
355
- 2.5. **Document** — Every commit must include documentation updates:
356
- - Update the module's INTENT.md: add entries for new functions, update entries for changed functions (Does/Why/Relationships/Decisions format)
357
- - Update the module's DIAGRAM.mmd: add nodes for new functions, update edges for changed dependencies
358
- - If you created a new module directory, also create its INTENT.md and DIAGRAM.mmd, and add rows to root INTENT.md module map and root ARCHITECTURE.mmd
359
- - Reference STYLE.md for code standards — your code must comply with all Hard Limits and Structure Rules
360
-
361
- 3. **Review** — After committing, review your own changes:
362
- - Run `git diff HEAD~1` to see what changed
363
- - Check for: bugs, missing error handling, type errors, style inconsistencies
364
- - Run any verification commands the plan specifies
365
- - Run the project's linter/typecheck if available
366
-
367
- 4. **Fix** — If the review surfaces issues:
368
- - Fix them immediately
369
- - Commit the fixes
370
- - Review again
371
- - Repeat until clean
372
-
373
- 5. **Continue** — Move to the next task. Do not stop to ask questions. If something is ambiguous, make the best technical decision and document it in your commit message.
374
-
375
- ## Rules
376
-
377
- - NEVER stop to ask for input. Make decisions and keep going.
378
- - ALWAYS commit after each task (not one big commit at the end).
379
- - ALWAYS review after each commit. The review-fix loop is not optional.
380
- - Follow the plan's steps exactly — don't improvise unless the plan is clearly wrong.
381
- - Stay in your worktree. Don't touch files outside your assigned scope.
382
- - If a verification step fails and you can't fix it in 3 attempts, note it in a commit message and move on.
383
- - Run tests/build after each task if the project supports it.
384
- - Read STYLE.md at the project root before writing code. Follow all Hard Limits and Structure Rules.
385
- - Every commit must include: code changes + tests + INTENT.md update + DIAGRAM.mmd update. A commit without documentation updates is incomplete.
386
- ```
387
-
388
- ### Phase 4.5: Post-Task Audit (automatic)
389
-
390
- After each task agent returns and before marking the task complete, run the ftm-audit verification automatically.
391
-
392
- **Per-Task Verification Gate (runs before audit):**
393
-
394
- Before running ftm-audit, verify these four checks pass for every task:
395
-
396
- 1. **Claude's tests pass** — any tests written or affected by the task must be green
397
- 2. **INTENT.md updated** — check that new/changed functions have entries in their module's INTENT.md
398
- 3. **Diagram updated** — check that new/changed functions have nodes in their module's DIAGRAM.mmd
399
- 4. **Full suite still green** — run the project's test suite (if one exists) and verify no regressions
400
-
401
- 5. **Visual smoke test (optional)** — If the project has a running dev server (detected via `lsof -i :3000` or `lsof -i :5173` or configured in plan metadata as `dev_server_url`), run:
402
- - `$PB goto <dev_server_url>`
403
- - `$PB screenshot`
404
- - Verify the screenshot shows a rendered page (not a blank screen or error page)
405
- - If the task modified UI components, `$PB snapshot -i` to verify new elements appear in the ARIA tree
406
-
407
- Where `$PB` is `$HOME/.claude/skills/ftm-browse/bin/ftm-browse`.
408
-
409
- **Graceful degradation**: If ftm-browse binary is not installed at `$HOME/.claude/skills/ftm-browse/bin/ftm-browse`, skip visual checks with a note: "Visual smoke test skipped — ftm-browse not installed." Do not fail the task.
410
-
411
- A task is NOT marked complete until all four checks pass (check 5 is optional). If a check fails:
412
- - For test failures: the agent must fix them before the task can complete
413
- - For missing INTENT.md entries: add them (use ftm-intent format)
414
- - For missing diagram nodes: add them (use ftm-diagram format)
415
- - For regression failures: investigate and fix before continuing
416
-
417
- **When to run:**
418
- - After EVERY task agent returns with completed work
419
- - SKIP for documentation-only tasks (tasks that only create/modify .md files with no code)
420
- - SKIP if the plan explicitly marks a task with `audit: skip`
421
-
422
- **How to run:**
423
-
424
- 1. **Invoke ftm-audit** against the agent's changes:
425
- - Scope the audit to the files the task modified (check the agent's commits)
426
- - If the task has a `Wiring:` contract in the plan, pass it to ftm-audit for contract checking
427
- - Run all three layers: knip static analysis → adversarial audit → auto-fix
428
-
429
- 2. **Interpret results:**
430
- - **PASS (no findings):** Mark task complete, proceed to next task
431
- - **PASS after auto-fix:** FTM-audit found issues and fixed them automatically. Commit the fixes in the agent's worktree with message "Auto-fix: wire [description]". Mark task complete.
432
- - **FAIL (manual intervention needed):** Task stays in-progress. Report the findings to the user:
433
- ```
434
- ⚠ Task [N] audit failed — manual intervention needed:
435
- - [finding 1 with file:line]
436
- - [finding 2 with file:line]
437
- Suggested fixes: [ftm-audit's suggestions]
438
- ```
439
- Wait for user input before continuing to next task.
440
-
441
- 3. **Include audit results in task completion report:**
442
- ```
443
- Task [N]: [title] — COMPLETE
444
- Audit: PASS (0 findings) | PASS after auto-fix (2 fixed) | FAIL (1 manual)
445
- [if auto-fixed: list what was fixed]
446
- [if failed: list outstanding issues]
447
- ```
448
-
449
- **Skipping the audit:**
450
-
451
- To skip the audit for a specific task, the plan can include:
452
- ```yaml
453
- audit: skip
454
- reason: "Documentation-only task" | "Config change" | "Test-only change"
455
- ```
456
-
457
- The audit is also automatically skipped when:
458
- - The task only modified `.md`, `.txt`, `.json` (config), or `.yml` files
459
- - The task is explicitly marked as a "setup" or "scaffold" task
460
- - The project has no `package.json` AND no identifiable entry point (nothing to trace wiring against)
461
-
462
- ### Phase 5: Collect and Integrate
463
-
464
- As each agent completes:
465
-
466
- 1. **Read the agent's summary** — what was done, any issues encountered
467
- 2. **Review the worktree's commits** — `git log` in each worktree to see what changed
468
- 3. **Merge into the main branch** — one worktree at a time, resolving conflicts if any:
469
- ```bash
470
- git checkout main # or whatever the working branch is
471
- git merge plan-exec/<agent-name> --no-ff -m "Merge <agent-name> tasks [N-M]"
472
- ```
473
- 4. **Run full verification** — tests, build, lint after each merge
474
- 5. **Fix merge issues** — if merging breaks something, fix it before proceeding
475
-
476
- If there are multiple waves, after merging wave N:
477
- - Verify everything still works
478
- - Update each wave N+1 worktree with the merged changes (or create fresh worktrees from the updated branch)
479
- - Dispatch wave N+1
480
-
481
- ### Phase 5.5: Codex Gate (Wave Boundary Validation)
482
-
483
- After merging all agents' work for a wave (Phase 5) and before proceeding to the next wave, invoke the ftm-codex-gate skill for adversarial validation.
484
-
485
- **When to invoke:**
486
- - After EVERY wave completes and is merged — this is the heavy validation gate
487
- - For single-task executor runs (plans with only 1 task), invoke on task completion instead of wave completion
488
-
489
- **How to invoke:**
490
-
491
- 1. **Gather inputs for ftm-codex-gate:**
492
- - `file_list`: All files changed across the wave (collect from all agents' commits via `git diff --name-only` against the pre-wave state)
493
- - `acceptance_criteria`: Combined acceptance criteria from all tasks in the wave
494
- - `wave_context`: Summary of what the wave accomplished (task titles + brief descriptions)
495
- - `project_root`: The project working directory
496
- - `mode`: `"wave"` for multi-task waves, `"single-task"` for single-task runs
497
-
498
- 2. **Invoke the Codex gate** by using the ftm-codex-gate skill with these inputs. The gate will:
499
- - Construct a Codex CLI command with the adversarial review prompt
500
- - Run `codex exec --yolo --ephemeral -m "gpt-5.4"` against the changed files
501
- - Return structured results
502
-
503
- 3. **Interpret the results:**
504
-
505
- **PASS (no issues found):**
506
- - Log in PROGRESS.md: "Codex gate PASSED — 0 issues"
507
- - Proceed to next wave (or Phase 6 if this was the last wave)
508
-
509
- **PASS_WITH_FIXES (issues found and auto-fixed by Codex):**
510
- - Codex committed fixes directly — review the fix commits
511
- - Read each fix commit and diff it against INTENT.md entries for the affected functions
512
- - **No INTENT.md conflict?** Accept the fixes. Log in PROGRESS.md and DEBUG.md. Proceed.
513
- - **INTENT.md conflict detected?** See "INTENT.md Conflict Resolution" below.
514
-
515
- **FAIL (issues Codex could not fix):**
516
- - Read the remaining issues from the gate results
517
- - Attempt to fix them yourself (you have full context from the wave)
518
- - If you can fix them, commit and re-run the Codex gate
519
- - If you cannot fix them after 2 attempts, report to the user:
520
- ```
521
- ⚠ Codex gate FAILED for Wave [N] — manual intervention needed:
522
- - [remaining issue 1]
523
- - [remaining issue 2]
524
- Codex attempted [N] fixes but these remain unresolved.
525
- ```
526
- Wait for user input before continuing.
527
-
528
- **INTENT.md Conflict Resolution:**
529
-
530
- When Codex fixes code in a way that contradicts what INTENT.md says a function should do:
531
-
532
- 1. **Detect the conflict**: Compare Codex's fix diff against the INTENT.md entry for the affected function. A conflict exists when:
533
- - Codex changed a function's behavior but INTENT.md's "Does" field describes different behavior
534
- - Codex reverted a deliberate choice documented in INTENT.md's "Decisions" field
535
- - Codex changed the function signature documented in the INTENT.md header
536
-
537
- 2. **Auto-invoke ftm-council** with a structured conflict payload:
538
- ```
539
- CONFLICT TYPE: Codex fix contradicts INTENT.md
540
-
541
- ORIGINAL INTENT (from INTENT.md):
542
- [paste the full INTENT.md entry for the affected function]
543
-
544
- CODEX'S CHANGE:
545
- [paste the diff of what Codex changed]
546
-
547
- CODEX'S REASONING:
548
- [paste Codex's explanation from the gate results]
549
-
550
- THE CODE IN QUESTION:
551
- [file path and relevant code section]
552
-
553
- DEBUG.md HISTORY:
554
- [paste relevant entries from DEBUG.md so the council doesn't suggest already-failed approaches]
555
-
556
- QUESTION FOR THE COUNCIL:
557
- Should we (A) update INTENT.md to match Codex's fix, or (B) revert Codex's fix and keep the original intent?
558
- ```
559
-
560
- 3. **Execute the council's verdict:**
561
- - If verdict is "update intent": Update the INTENT.md entry to reflect the new behavior. Commit with message "Update intent: [function] — council verdict [round N]"
562
- - If verdict is "revert fix": Revert Codex's fix commit. Commit with message "Revert codex fix: [function] — council verdict preserves original intent"
563
- - Log the full decision + reasoning in DEBUG.md
564
-
565
- 4. **Continue to next wave** after all conflicts are resolved.
566
-
567
- ---
568
-
569
- ### Phase 6: Final Verification and Completion
570
-
571
- After all waves are merged:
572
-
573
- 1. Run the full test suite
574
- 2. Run the build
575
- 3. Run linting/typechecking
576
- 4. Fix any remaining issues (zero broken windows — fix everything, not just "your" stuff)
577
- 4.5. **Final Codex gate** — Run one last Codex gate across ALL files changed in the entire plan execution. This catches cross-wave integration issues that per-wave gates might miss. Use `mode: "wave"` with the complete file list.
578
- 5. **Branch finishing** — After all verification passes (including the final Codex gate), present exactly 4 options to the user:
579
-
580
- ```
581
- All tasks complete. All tests pass. Codex gate passed. Choose how to finish:
582
-
583
- 1. **Merge locally** — Merge the work branch into main/develop right now
584
- - Verifies all tests pass one final time before merging
585
- - Uses --no-ff to preserve branch history
586
- - Deletes the work branch after successful merge
587
-
588
- 2. **Push + Create PR** — Push the branch and create a pull request
589
- - Pushes the branch to origin
590
- - Creates a PR with auto-generated summary from:
591
- - Root INTENT.md vision section
592
- - Task list with acceptance criteria status
593
- - Codex gate results summary
594
- - Files changed count
595
- - Returns the PR URL
596
-
597
- 3. **Keep branch as-is** — Leave everything on the current branch
598
- - Prints the branch name so the user can return to it
599
- - Preserves all worktrees (does NOT run cleanup)
600
- - Good for: "I want to review this myself first"
601
-
602
- 4. **Discard** — Delete the branch and all changes
603
- - Requires typed confirmation: user must type "discard" to proceed
604
- - Runs full cleanup (worktrees + branches)
605
- - Cannot be undone
606
- ```
607
-
608
- Wait for the user to choose. Execute their choice. Do not proceed without explicit selection.
609
-
610
- ### Phase 6.5: Retrospective
611
-
612
- After all verification passes and before presenting branch finishing options, automatically invoke the ftm-retro skill with execution context.
613
-
614
- **Invoke ftm-retro** with this context:
615
- - Plan title and path
616
- - Task count, wave count
617
- - Total agents spawned (count of Agent tool invocations)
618
- - Per-task audit results: for each task, whether it passed audit on first attempt, needed auto-fix, or required manual intervention
619
- - Codex gate results: for each wave, whether it passed on first attempt or needed fixes
620
- - Any errors, blockers, or manual interventions that occurred during execution
621
-
622
- The retro runs automatically — do not ask the user whether to run it. The report is saved to `~/.claude/ftm-retros/` and a one-line summary of the overall score (X/50) is shown to the user before presenting the branch finishing options.
623
-
624
- **Graceful degradation**: If the ftm-retro skill is not available (not installed), skip with a note and proceed to branch finishing.
625
-
626
- ### Cleanup
627
-
628
- Cleanup runs automatically after options 1 (merge), 2 (PR), and 4 (discard). It does NOT run for option 3 (keep branch).
629
-
630
- ```bash
631
- git worktree list # verify what exists
632
- git worktree remove .worktrees/plan-exec-<name> # for each worktree
633
- git branch -d plan-exec/<name> # delete branches (use -D for discard option)
634
- ```
635
-
636
- For option 3, print a reminder:
637
- ```
638
- Branch preserved: plan-exec/<name>
639
- Worktrees at: .worktrees/plan-exec-*
640
- Run cleanup manually when ready: git worktree remove .worktrees/plan-exec-<name>
641
- ```
642
-
643
- ## Handling Edge Cases
644
-
645
- **Plan has no dependency map**: Analyze task descriptions and file lists yourself. Tasks touching the same files must be sequential. Tasks touching different files/domains can be parallel.
646
-
647
- **Agent fails or gets stuck**: If an agent returns with unfinished tasks or errors it couldn't resolve, don't panic. Read its output, understand what went wrong, and either:
648
- - Fix it yourself in the worktree
649
- - Respawn the agent with more context about what failed
650
-
651
- **Merge conflicts**: These happen when parallel agents touched overlapping files (shouldn't happen with good task partitioning, but sometimes it does). Resolve them manually — you have context from both agents' work.
652
-
653
- **Very large plans (20+ tasks)**: Don't try to explain every task upfront. Show the wave structure and agent assignments, then execute. Report progress between waves.
654
-
655
- **No tests in the project**: The review step becomes more important. Pay extra attention to the diff review and manual verification steps in the plan.
656
-
657
- **Single-task plans**: For plans with only 1 task, skip the wave-boundary Codex gate and instead run the gate immediately after the task completes (using `mode: "single-task"`). The flow is: task agent completes → per-task verification gate → ftm-audit → Codex gate → Phase 6 completion.
658
-
659
- ## What Makes This Different from executing-plans
660
-
661
- The `executing-plans` skill is a human-in-the-loop batch executor — it does 3 tasks, stops, waits for feedback, continues. That's valuable when the human wants to steer.
662
-
663
- This skill is fully autonomous. It analyzes the plan, builds a team, and executes everything without stopping. The human trusts the plan and wants it done. The review loop is agent-self-review, not human review.
664
-
665
- Use `executing-plans` when: human wants checkpoints and control.
666
- Use `ftm-executor` when: human says "just go" and trusts the plan.
667
-
668
- **Critical distinction**: "just go" means "execute this plan autonomously" — it does NOT mean "skip the plan and start coding." If no plan exists, Phase 0 generates one and gets approval first. The autonomy is in execution, not in deciding what to execute.
669
-
670
- ## Blackboard Write
671
-
672
- After completing, update the blackboard:
673
-
674
- 1. Update `~/.claude/ftm-state/blackboard/context.json`:
675
- - Set current_task status to "complete"
676
- - Append decision summary to recent_decisions (cap at 10)
677
- - Update session_metadata.skills_invoked and last_updated
678
- 2. Write an experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json` capturing task_type, agent team used, wave count, audit outcomes, and lessons learned
679
- 3. Update `~/.claude/ftm-state/blackboard/experiences/index.json` with the new entry
680
- 4. Emit `task_completed` event
681
-
682
- ## Requirements
683
-
684
- - tool: `git` | required | worktree creation, branch management, commit operations
685
- - config: `~/.claude/ftm-config.yml` | optional | model profiles, max_parallel_agents, auto_audit, progress_tracking
686
- - reference: `~/.claude/plans/` | optional | plan documents for execution
687
- - tool: `node` | optional | project setup commands in worktrees
688
- - reference: `~/.claude/skills/ftm-executor/references/STYLE-TEMPLATE.md` | optional | STYLE.md bootstrap template
689
-
690
- ## Risk
691
-
692
- - level: high_write
693
- - scope: creates git worktrees and branches, modifies source files across multiple tasks, runs tests and builds, optionally pushes branches or creates PRs
694
- - rollback: git worktree remove + git branch -D for each worktree; all changes isolated to plan-exec/* branches until explicitly merged
695
-
696
- ## Approval Gates
697
-
698
- - trigger: no plan document provided | action: generate plan and wait for explicit user approval before any code is written
699
- - trigger: plan_checker returns FAIL | action: present blockers and ask user to fix or override before proceeding
700
- - trigger: plan_checker returns WARN | action: show warnings to user, proceed unless they object
701
- - trigger: wave complete and all agents done | action: auto-invoke ftm-codex-gate (no user gate needed for this step)
702
- - trigger: final phase 6 verification passes | action: present 4 branch finishing options and wait for explicit user choice
703
- - trigger: codex gate FAIL after 2 fix attempts | action: report to user and wait for input before continuing
704
- - complexity_routing: micro → auto | small → auto | medium → plan_first | large → plan_first | xl → always_ask
705
-
706
- ## Fallbacks
707
-
708
- - condition: ftm-browse not installed at $HOME/.claude/skills/ftm-browse/bin/ftm-browse | action: skip visual smoke test checks, log "Visual smoke test skipped — ftm-browse not installed"
709
- - condition: ftm-retro skill not available | action: skip retrospective phase, note in output and proceed to branch finishing
710
- - condition: codex CLI not found | action: skip codex gate, log "Codex gate skipped — codex not installed", proceed to next wave
711
- - condition: no package.json in project | action: skip npm install in worktree setup; skip knip-based audit layers
712
- - condition: project has no test suite | action: skip test verification gates, rely on diff review and build checks
713
- - condition: agent fails or gets stuck | action: read agent output, fix directly or respawn with more context
714
-
715
- ## Capabilities
716
-
717
- - cli: `git` | required | worktree management and version control
718
- - cli: `node` | optional | project dependency installation
719
- - mcp: `sequential-thinking` | optional | complex dependency analysis and plan validation
720
- - env: none required directly (agents inherit from session)
721
-
722
- ## Event Payloads
723
-
724
- ### task_received
725
- - skill: string — "ftm-executor"
726
- - task_description: string — description of the task being queued
727
- - plan_path: string — absolute path to plan document
728
-
729
- ### plan_generated
730
- - skill: string — "ftm-executor"
731
- - plan_path: string — absolute path to saved plan file
732
- - task_count: number — total tasks in the plan
733
- - wave_count: number — number of parallel execution waves
734
-
735
- ### plan_approved
736
- - skill: string — "ftm-executor"
737
- - plan_path: string — absolute path to approved plan
738
- - approved_steps: number[] — step numbers approved for execution
739
-
740
- ### code_changed
741
- - skill: string — "ftm-executor"
742
- - worktree: string — path to the worktree where files changed
743
- - files: string[] — list of modified file paths
744
- - agent: string — agent type that made the changes
745
-
746
- ### code_committed
747
- - skill: string — "ftm-executor"
748
- - worktree: string — path to worktree
749
- - commit_hash: string — short commit hash
750
- - message: string — commit message
751
- - task_number: number — plan task number this commit belongs to
752
-
753
- ### test_passed
754
- - skill: string — "ftm-executor"
755
- - scope: string — "task" | "full_suite"
756
- - task_number: number | null — task number if scoped to task
757
- - worktree: string — worktree path
758
-
759
- ### test_failed
760
- - skill: string — "ftm-executor"
761
- - scope: string — "task" | "full_suite"
762
- - task_number: number | null — task number if scoped
763
- - worktree: string — worktree path
764
- - error_summary: string — brief description of failure
765
-
766
- ### task_completed
767
- - skill: string — "ftm-executor"
768
- - task_number: number — completed task number
769
- - audit_result: string — "pass" | "pass_with_fixes" | "fail" | "skipped"
770
- - auto_fixed_count: number — issues auto-remediated by ftm-audit
771
- - duration_ms: number — task execution time
772
-
773
- ### error_encountered
774
- - skill: string — "ftm-executor"
775
- - phase: string — execution phase where error occurred
776
- - task_number: number | null — associated task if applicable
777
- - error: string — error description
1
+ ---
2
+ name: ftm-executor
3
+ description: Autonomous plan execution engine. Takes any plan document and executes it end-to-end with a dynamically assembled agent team — analyzing tasks, creating purpose-built agents, dispatching them in parallel worktrees, and running each through a commit-review-fix loop until complete. Use this skill whenever the user wants to execute a plan, run a plan doc, launch an agent team on tasks, or says things like "execute this plan", "run this", "launch agents on this doc", "take this plan and go", or points to a plan file and wants it implemented autonomously. Even if they just paste a plan path and say "go" — this is the skill.
4
+ ---
5
+
6
+ ## Events
7
+
8
+ ### Emits
9
+ - `task_received` — when a new task is acknowledged and added to the execution queue
10
+ - `plan_generated` — when a plan document is created or validated and ready for review
11
+ - `plan_approved` — when the user confirms a plan and execution is authorized to begin
12
+ - `code_changed` — when files are modified in a worktree (pre-commit state)
13
+ - `code_committed` — when a git commit is successfully made in any worktree
14
+ - `test_passed` — when the test suite passes (post-task verification or full-suite run)
15
+ - `test_failed` — when the test suite fails during post-task verification or regression check
16
+ - `task_completed` — when a task passes all verification gates (tests, audit, Codex gate)
17
+ - `error_encountered` — when an unexpected error occurs that halts or disrupts a task or wave
18
+
19
+ ### Listens To
20
+ - `plan_approved` — begin Phase 3 worktree setup and dispatch agents for the first wave
21
+
22
+ ## Blackboard Read
23
+
24
+ Before starting, load context from the blackboard:
25
+
26
+ 1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
27
+ 2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter entries by task_type matching plan tasks and tags overlapping with the plan domain
28
+ 3. Load top 3-5 matching experience files for relevant lessons on agent performance and timing
29
+ 4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check execution_patterns for agent performance and timing accuracy patterns
30
+
31
+ If index.json is empty or no matches found, proceed normally without experience-informed shortcuts.
32
+
33
+ # Plan Executor
34
+
35
+ Autonomous agent-team orchestrator for plan documents. You read the plan, assemble the right team, give each agent its own worktree, and let them rip through tasks in a commit-review-fix loop until everything is done.
36
+
37
+ ## Why This Exists
38
+
39
+ Executing a multi-task plan manually means: read plan, pick a task, do it, commit, review, fix, repeat — while also tracking dependencies and parallelism yourself. That's slow and error-prone. This skill automates the entire thing by treating the plan as a job spec and dynamically building the team to fulfill it.
40
+
41
+ ## The Process
42
+
43
+ ### Phase 0: Plan Requirement Gate
44
+
45
+ **Before anything else, verify that a plan document exists and has been approved by the user.**
46
+
47
+ This gate exists because the executor's entire value comes from structured, parallel execution of a well-defined plan. Without a plan, you're just grinding through code changes sequentially — which is what ftm-mind's direct action path does, and it's worse at it than a focused engineer because it lacks the user's judgment about ordering and priorities.
48
+
49
+ **Check for a plan:**
50
+
51
+ 1. Was a plan path provided? (e.g., the user said "execute ~/.claude/plans/foo.md" or ftm-mind routed with a plan reference)
52
+ 2. If yes, read the plan and proceed to Phase 0.5.
53
+ 3. If no plan path was provided, **do not start coding**. Instead:
54
+
55
+ a. Read the user's request and the codebase context passed from ftm-mind.
56
+ b. Generate a structured plan document with numbered tasks, file lists, dependencies, acceptance criteria, and verification steps.
57
+ c. Present the plan to the user for approval:
58
+
59
+ ```
60
+ I need a plan before I can execute. Here's what I'd propose:
61
+
62
+ 1. [ ] [task description] → [files] | verify: [method]
63
+ 2. [ ] [task description] → [files] | verify: [method]
64
+ 3. [ ] [task description] → [files] | verify: [method]
65
+ ...
66
+
67
+ Approve? Or tell me what to change.
68
+ ```
69
+
70
+ d. Wait for user approval. Parse their response the same way ftm-mind's Interactive Plan Approval handles it (approve, skip N, modify step N, deny).
71
+ e. Only after approval, save the plan to `~/.claude/plans/` and proceed to Phase 0.5.
72
+
73
+ **Why this gate matters**: The Jira rerouting incident showed what happens without it — the executor (or mind acting as executor) jumped straight into reading files and making 15+ edits across a 1700-line file without ever presenting a plan. The user never got to say "wait, also draft a Slack message to Mo" or "check with the ARIA team about epic assignment first" or "actually, don't change the sprint logic yet." By the time the user saw the changes, 2 minutes of grinding had already happened in the wrong direction. A 30-second plan would have caught all of this.
74
+
75
+ ---
76
+
77
+ ### Phase 0.5: Plan Verification Gate
78
+
79
+ **Before executing anything, validate the plan.** A bad plan wastes every agent's time. This gate catches structural problems, missing dependencies, and unrealistic scope before any code is written.
80
+
81
+ Spawn a **Plan Checker** agent to verify the plan:
82
+
83
+ ```
84
+ You are a plan quality checker. Analyze this implementation plan and report issues.
85
+ Do NOT implement anything — just verify the plan is sound.
86
+
87
+ Plan path: [path]
88
+
89
+ Check these dimensions:
90
+
91
+ 1. STRUCTURAL INTEGRITY
92
+ - Every task has: description, files list, dependencies, acceptance criteria
93
+ - Task numbering is consistent (no gaps, no duplicates)
94
+ - Dependencies reference valid task numbers
95
+ - No circular dependencies (Task A depends on B, B depends on A)
96
+
97
+ 2. DEPENDENCY GRAPH VALIDITY
98
+ - Build the full dependency graph
99
+ - Verify all referenced tasks exist
100
+ - Check for implicit dependencies (two tasks modifying the same file
101
+ but not declared as dependent)
102
+ - Flag tasks with too many dependencies (>3 usually means bad decomposition)
103
+
104
+ 3. FILE CONFLICT DETECTION
105
+ - Map every task to its file list
106
+ - Flag any files touched by multiple tasks in the same wave
107
+ - These MUST be sequential, not parallel — if the plan puts them
108
+ in the same wave, that's a bug
109
+
110
+ 4. SCOPE REASONABLENESS
111
+ - Flag tasks that touch >10 files (probably too big for one agent)
112
+ - Flag tasks with vague acceptance criteria ("make it work", "looks good")
113
+ - Flag tasks with no verification steps
114
+
115
+ 5. PROJECT COMPATIBILITY
116
+ - Check that file paths reference real directories in the project
117
+ - Verify the tech stack matches what the plan assumes
118
+ - Check that dependencies/libraries the plan references are installed
119
+ or listed in package.json/requirements.txt
120
+
121
+ Return a structured report:
122
+
123
+ PASS — plan is sound, proceed to execution
124
+ WARN — issues found but execution can proceed (list warnings)
125
+ FAIL — critical issues that must be fixed before execution (list blockers)
126
+
127
+ For FAIL findings, suggest specific fixes.
128
+ ```
129
+
130
+ **Interpret the result:**
131
+ - **PASS**: Proceed to Phase 0.7 → Phase 1 → Phase 1.5 (documentation bootstrap) → Phase 2
132
+ - **WARN**: Show warnings to user, proceed unless they object
133
+ - **FAIL**: Present blockers and suggested fixes. Ask user: fix the plan and re-run, or override and execute anyway?
134
+
135
+ If the plan checker finds file conflicts between tasks in the same wave, automatically restructure the wave ordering to make conflicting tasks sequential. Report the change.
136
+
137
+ ---
138
+
139
+ ### Phase 0.7: Load Model Profile and Agent Mode
140
+
141
+ Read `~/.claude/ftm-config.yml` to determine which models and permission mode to use for agent dispatch. If the file doesn't exist, use balanced defaults:
142
+ - Planning agents: opus
143
+ - Execution agents: sonnet
144
+ - Review/audit agents: sonnet
145
+
146
+ When spawning agents in subsequent phases, pass the `model` parameter based on the agent's role:
147
+ - Phase 2 (team assembly / plan checking): use `planning` model
148
+ - Phase 4 (task execution): use `execution` model
149
+ - Phase 4.5 (audit): use `review` model
150
+
151
+ If the profile specifies `inherit`, omit the `model` parameter (uses session default).
152
+
153
+ **Agent permission mode**: Read `execution.agent_mode` from ftm-config.yml. Pass this as the `mode` parameter on every Agent tool call. Default: `bypassPermissions`. This ensures spawned agents inherit the user's preferred permission level and do not downgrade to `acceptEdits` or `default`.
154
+
155
+ ---
156
+
157
+ ### Phase 1: Analyze the Plan
158
+
159
+ Read the plan document and extract:
160
+
161
+ 1. **All tasks** — number, description, files touched, dependencies
162
+ 2. **Dependency graph** — which tasks block which (the plan usually states this)
163
+ 3. **Domain clusters** — group tasks by what kind of work they are (frontend, backend, infra, testing, styling, etc.)
164
+ 4. **Parallelism opportunities** — independent tasks or independent clusters that can run simultaneously
165
+
166
+ Output a brief execution summary before proceeding:
167
+ ```
168
+ Plan: [title]
169
+ Tasks: [N] total
170
+ Agents needed: [list with reasoning]
171
+ Parallel waves:
172
+ Wave 1 (independent): Tasks 1, 2, 3, 4
173
+ Wave 2 (depends on wave 1): Tasks 5, 6, 7
174
+ Wave 3: Tasks 8-14
175
+ ...
176
+ Final: Task [N] (integration/cleanup)
177
+ ```
178
+
179
+ **After outputting the summary, proceed IMMEDIATELY to Phase 1.5.** Do NOT skip to Phase 2. The documentation bootstrap must run before any agents are dispatched.
180
+
181
+ ---
182
+
183
+ ### Phase 1.5: Documentation Layer Bootstrap (MANDATORY)
184
+
185
+ **This phase is non-skippable.** The documentation layer is required for ftm-verify to assess plan completion, for ftm-codex-gate to detect intent conflicts, and for agents to update docs as they work. Without it, every downstream verification step is degraded.
186
+
187
+ Before dispatching any agents, check if the project has the required documentation layer. If any of these files are missing, create them. If they already exist, verify they're non-empty and well-formed.
188
+
189
+ **Required documentation files — create if missing:**
190
+ 1. **INTENT.md** (project root) — Bootstrap from the plan's Vision and Architecture Decisions sections. Use the ftm-intent skill's root template format. Must include: Vision, Architecture Decisions table, Module Map.
191
+ 2. **ARCHITECTURE.mmd** (project root) — Bootstrap by scanning the codebase for modules and their import relationships. Use the ftm-diagram skill's root template format. Must have at least one node and one edge.
192
+ 3. **STYLE.md** (project root) — Copy from `~/.claude/skills/ftm-executor/references/STYLE-TEMPLATE.md` into the project root.
193
+ 4. **DEBUG.md** (project root) — Create with a header:
194
+ ```markdown
195
+ # Debug Log
196
+
197
+ Failed approaches and their outcomes. Codex and Claude append here — never retry what's already logged.
198
+ ```
199
+
200
+ **Phase 1.5 Gate:** After creating any missing files, verify all 4 exist:
201
+ ```bash
202
+ for f in INTENT.md ARCHITECTURE.mmd STYLE.md DEBUG.md; do
203
+ [ -f "$f" ] || echo "MISSING: $f"
204
+ done
205
+ ```
206
+ If any file is still missing after the bootstrap attempt, STOP and report:
207
+ ```
208
+ Documentation bootstrap failed — missing: [list]
209
+ Cannot proceed without documentation layer. Fix manually or re-run.
210
+ ```
211
+ Do NOT proceed to Phase 2 with missing documentation files.
212
+
213
+ **Phase 1.5 complete.** All documentation files verified. Proceed to Phase 2.
214
+
215
+ **CRITICAL FLOW REMINDER: The execution sequence is Phase 0 → 0.5 → 0.7 → 1 → 1.5 → 2 → 3 → 3.5 → 4. Phase 1.5 MUST execute between Phase 1 and Phase 2. If you are reading this and have not yet created/verified the documentation layer, STOP and do it now before dispatching any agents.**
216
+
217
+ ---
218
+
219
+ ### Phase 2: Assemble the Agent Team
220
+
221
+ For each domain cluster, you need an agent. Here's how to pick or create them:
222
+
223
+ #### Check existing agents first
224
+
225
+ Look at the available agent types (the ones in the Agent tool). Map each task cluster to the best fit:
226
+
227
+ | Domain | Likely Agent |
228
+ |--------|-------------|
229
+ | React/UI/CSS/components | frontend-developer |
230
+ | API/server/database | backend-architect |
231
+ | CI/CD/deploy/infra | devops-automator |
232
+ | Tests/coverage | test-writer-fixer |
233
+ | Mobile/native | mobile-app-builder |
234
+ | AI/ML features | ai-engineer |
235
+ | General coding | general-purpose |
236
+
237
+ #### When no existing agent fits
238
+
239
+ If a task cluster requires specialized knowledge that none of the standard agents cover well — for example, "theme system with CSS custom properties and dark mode" or "WebSocket terminal integration" — create a purpose-built agent prompt.
240
+
241
+ Write a focused agent definition that includes:
242
+ - **Domain expertise**: What this agent knows deeply
243
+ - **Task context**: The specific tasks from the plan it will handle
244
+ - **Standards**: Coding conventions from the project (infer from existing code)
245
+ - **Constraints**: Don't touch files outside your scope
246
+
247
+ Store these as reference prompts in the skill workspace so they can be reused. The prompt becomes the `prompt` parameter when spawning the agent.
248
+
249
+ The goal is that over time, your agent library grows with battle-tested specialists. A "theme-engineer" agent created for one project's CSS system can be reused next time themes come up.
250
+
251
+ ### Phase 3: Set Up Worktrees
252
+
253
+ Each agent gets its own isolated worktree so they don't step on each other's changes.
254
+
255
+ For each agent in the current wave:
256
+
257
+ 1. Create a worktree branch: `plan-exec/<agent-name>` (e.g., `plan-exec/frontend-tasks-1-4`)
258
+ 2. Use git worktree to create isolation:
259
+ ```bash
260
+ git worktree add .worktrees/plan-exec-<agent-name> -b plan-exec/<agent-name>
261
+ ```
262
+ 3. Run any project setup (npm install, etc.) in the worktree
263
+ 4. Verify the worktree starts clean (tests pass or at least build succeeds)
264
+
265
+ Make sure `.worktrees/` is in `.gitignore` first. If it's not, add it.
266
+
267
+ ### Phase 3.5: Initialize Progress Tracking
268
+
269
+ If `progress_tracking` is enabled in `~/.claude/ftm-config.yml` (default: true), create a `PROGRESS.md` file in the project root that gets updated after every significant event. This gives visibility into long-running executions without interrupting them.
270
+
271
+ **Create the initial file:**
272
+
273
+ ```markdown
274
+ # FTM Executor — Progress
275
+
276
+ **Plan:** [plan title]
277
+ **Started:** [timestamp]
278
+ **Status:** IN PROGRESS
279
+
280
+ ## Execution Summary
281
+ | Wave | Tasks | Status | Started | Completed |
282
+ |------|-------|--------|---------|-----------|
283
+ | 1 | [task list] | PENDING | — | — |
284
+ | 2 | [task list] | PENDING | — | — |
285
+ | ... | | | | |
286
+
287
+ ## Task Status
288
+ | # | Title | Agent | Status | Audit | Notes |
289
+ |---|-------|-------|--------|-------|-------|
290
+ | 1 | [title] | [agent] | PENDING | — | |
291
+ | 2 | [title] | [agent] | PENDING | — | |
292
+ | ... | | | | | |
293
+
294
+ ## Activity Log
295
+ [reverse chronological — newest first]
296
+ ```
297
+
298
+ **Update PROGRESS.md at these events:**
299
+ - Wave starts → update wave status to `IN PROGRESS`, add timestamp
300
+ - Task agent returns → update task status to `COMPLETE` or `FAILED`, add audit result
301
+ - Wave completes → update wave status to `COMPLETE`, add timestamp
302
+ - Merge completes → add to activity log
303
+ - Errors/blockers → add to activity log with details
304
+
305
+ **Activity log entries** use this format:
306
+ ```
307
+ ### [HH:MM] [event type]
308
+ [brief description]
309
+ ```
310
+
311
+ Example:
312
+ ```
313
+ ### 14:32 Wave 1 complete
314
+ Tasks 1-4 merged to main. All audits passed. 2 auto-fixes applied.
315
+
316
+ ### 14:15 Task 3 audit — auto-fix
317
+ Added missing import for UserPreferences in SettingsView.tsx
318
+
319
+ ### 13:45 Wave 1 started
320
+ Dispatching 4 agents in parallel: frontend (tasks 1,2), backend (task 3), testing (task 4)
321
+ ```
322
+
323
+ This file is for human consumption — the user can check it anytime without interrupting execution. Keep entries concise and informative.
324
+
325
+ ---
326
+
327
+ ### Phase 4: Dispatch Agents
328
+
329
+ Launch agents for all tasks in the current wave **in parallel**. Each agent gets a prompt structured like this:
330
+
331
+ ```
332
+ You are working in an isolated git worktree at: [worktree path]
333
+ Your working directory is: [worktree path]
334
+
335
+ ## Your Assignment
336
+
337
+ Execute the following tasks from the plan:
338
+
339
+ [paste the relevant task sections verbatim from the plan doc]
340
+
341
+ ## Plan Context
342
+
343
+ Full plan: [plan path]
344
+ Your tasks: [task numbers]
345
+ Dependencies satisfied: [list what was already completed in prior waves]
346
+
347
+ ## Execution Loop
348
+
349
+ For EACH task, follow this cycle:
350
+
351
+ 1. **Implement** — Follow the plan's steps exactly. Read files before modifying them. Use the project's existing patterns.
352
+
353
+ 2. **Commit** — Before committing, run **ftm-git** to scan staged files for hardcoded secrets. If ftm-git emits `secrets_found`, stop and remediate before proceeding. Only after ftm-git emits `secrets_clear` or `secrets_remediated`, stage and commit your changes with a clear message describing what was done. Never reference AI/Claude in commit messages.
354
+
355
+ 2.5. **Document** — Every commit must include documentation updates:
356
+ - Update the module's INTENT.md: add entries for new functions, update entries for changed functions (Does/Why/Relationships/Decisions format)
357
+ - Update the module's DIAGRAM.mmd: add nodes for new functions, update edges for changed dependencies
358
+ - If you created a new module directory, also create its INTENT.md and DIAGRAM.mmd, and add rows to root INTENT.md module map and root ARCHITECTURE.mmd
359
+ - Reference STYLE.md for code standards — your code must comply with all Hard Limits and Structure Rules
360
+
361
+ 3. **Review** — After committing, review your own changes:
362
+ - Run `git diff HEAD~1` to see what changed
363
+ - Check for: bugs, missing error handling, type errors, style inconsistencies
364
+ - Run any verification commands the plan specifies
365
+ - Run the project's linter/typecheck if available
366
+
367
+ 4. **Fix** — If the review surfaces issues:
368
+ - Fix them immediately
369
+ - Commit the fixes
370
+ - Review again
371
+ - Repeat until clean
372
+
373
+ 5. **Continue** — Move to the next task. Do not stop to ask questions. If something is ambiguous, make the best technical decision and document it in your commit message.
374
+
375
+ ## Rules
376
+
377
+ - NEVER stop to ask for input. Make decisions and keep going.
378
+ - ALWAYS commit after each task (not one big commit at the end).
379
+ - ALWAYS review after each commit. The review-fix loop is not optional.
380
+ - Follow the plan's steps exactly — don't improvise unless the plan is clearly wrong.
381
+ - Stay in your worktree. Don't touch files outside your assigned scope.
382
+ - If a verification step fails and you can't fix it in 3 attempts, note it in a commit message and move on.
383
+ - Run tests/build after each task if the project supports it.
384
+ - Read STYLE.md at the project root before writing code. Follow all Hard Limits and Structure Rules.
385
+ - Every commit must include: code changes + tests + INTENT.md update + DIAGRAM.mmd update. A commit without documentation updates is incomplete.
386
+ ```
387
+
388
+ ### Phase 4.5: Post-Task Audit (automatic)
389
+
390
+ After each task agent returns and before marking the task complete, run the ftm-audit verification automatically.
391
+
392
+ **Per-Task Verification Gate (runs before audit):**
393
+
394
+ Before running ftm-audit, verify these four checks pass for every task:
395
+
396
+ 1. **Claude's tests pass** — any tests written or affected by the task must be green
397
+ 2. **INTENT.md updated** — check that new/changed functions have entries in their module's INTENT.md
398
+ 3. **Diagram updated** — check that new/changed functions have nodes in their module's DIAGRAM.mmd
399
+ 4. **Full suite still green** — run the project's test suite (if one exists) and verify no regressions
400
+
401
+ 5. **Visual smoke test (optional)** — If the project has a running dev server (detected via `lsof -i :3000` or `lsof -i :5173` or configured in plan metadata as `dev_server_url`), run:
402
+ - `$PB goto <dev_server_url>`
403
+ - `$PB screenshot`
404
+ - Verify the screenshot shows a rendered page (not a blank screen or error page)
405
+ - If the task modified UI components, `$PB snapshot -i` to verify new elements appear in the ARIA tree
406
+
407
+ Where `$PB` is `$HOME/.claude/skills/ftm-browse/bin/ftm-browse`.
408
+
409
+ **Graceful degradation**: If ftm-browse binary is not installed at `$HOME/.claude/skills/ftm-browse/bin/ftm-browse`, skip visual checks with a note: "Visual smoke test skipped — ftm-browse not installed." Do not fail the task.
410
+
411
+ A task is NOT marked complete until all four checks pass (check 5 is optional). If a check fails:
412
+ - For test failures: the agent must fix them before the task can complete
413
+ - For missing INTENT.md entries: add them (use ftm-intent format)
414
+ - For missing diagram nodes: add them (use ftm-diagram format)
415
+ - For regression failures: investigate and fix before continuing
416
+
417
+ **When to run:**
418
+ - After EVERY task agent returns with completed work
419
+ - SKIP for documentation-only tasks (tasks that only create/modify .md files with no code)
420
+ - SKIP if the plan explicitly marks a task with `audit: skip`
421
+
422
+ **How to run:**
423
+
424
+ 1. **Invoke ftm-audit** against the agent's changes:
425
+ - Scope the audit to the files the task modified (check the agent's commits)
426
+ - If the task has a `Wiring:` contract in the plan, pass it to ftm-audit for contract checking
427
+ - Run all three layers: knip static analysis → adversarial audit → auto-fix
428
+
429
+ 2. **Interpret results:**
430
+ - **PASS (no findings):** Mark task complete, proceed to next task
431
+ - **PASS after auto-fix:** FTM-audit found issues and fixed them automatically. Commit the fixes in the agent's worktree with message "Auto-fix: wire [description]". Mark task complete.
432
+ - **FAIL (manual intervention needed):** Task stays in-progress. Report the findings to the user:
433
+ ```
434
+ ⚠ Task [N] audit failed — manual intervention needed:
435
+ - [finding 1 with file:line]
436
+ - [finding 2 with file:line]
437
+ Suggested fixes: [ftm-audit's suggestions]
438
+ ```
439
+ Wait for user input before continuing to next task.
440
+
441
+ 3. **Include audit results in task completion report:**
442
+ ```
443
+ Task [N]: [title] — COMPLETE
444
+ Audit: PASS (0 findings) | PASS after auto-fix (2 fixed) | FAIL (1 manual)
445
+ [if auto-fixed: list what was fixed]
446
+ [if failed: list outstanding issues]
447
+ ```
448
+
449
+ **Skipping the audit:**
450
+
451
+ To skip the audit for a specific task, the plan can include:
452
+ ```yaml
453
+ audit: skip
454
+ reason: "Documentation-only task" | "Config change" | "Test-only change"
455
+ ```
456
+
457
+ The audit is also automatically skipped when:
458
+ - The task only modified `.md`, `.txt`, `.json` (config), or `.yml` files
459
+ - The task is explicitly marked as a "setup" or "scaffold" task
460
+ - The project has no `package.json` AND no identifiable entry point (nothing to trace wiring against)
461
+
462
+ ### Phase 5: Collect and Integrate
463
+
464
+ As each agent completes:
465
+
466
+ 1. **Read the agent's summary** — what was done, any issues encountered
467
+ 2. **Review the worktree's commits** — `git log` in each worktree to see what changed
468
+ 3. **Merge into the main branch** — one worktree at a time, resolving conflicts if any:
469
+ ```bash
470
+ git checkout main # or whatever the working branch is
471
+ git merge plan-exec/<agent-name> --no-ff -m "Merge <agent-name> tasks [N-M]"
472
+ ```
473
+ 4. **Run full verification** — tests, build, lint after each merge
474
+ 5. **Fix merge issues** — if merging breaks something, fix it before proceeding
475
+
476
+ If there are multiple waves, after merging wave N:
477
+ - Verify everything still works
478
+ - Update each wave N+1 worktree with the merged changes (or create fresh worktrees from the updated branch)
479
+ - Dispatch wave N+1
480
+
481
+ ### Phase 5.5: Codex Gate (Wave Boundary Validation)
482
+
483
+ After merging all agents' work for a wave (Phase 5) and before proceeding to the next wave, invoke the ftm-codex-gate skill for adversarial validation.
484
+
485
+ **When to invoke:**
486
+ - After EVERY wave completes and is merged — this is the heavy validation gate
487
+ - For single-task executor runs (plans with only 1 task), invoke on task completion instead of wave completion
488
+
489
+ **How to invoke:**
490
+
491
+ 1. **Gather inputs for ftm-codex-gate:**
492
+ - `file_list`: All files changed across the wave (collect from all agents' commits via `git diff --name-only` against the pre-wave state)
493
+ - `acceptance_criteria`: Combined acceptance criteria from all tasks in the wave
494
+ - `wave_context`: Summary of what the wave accomplished (task titles + brief descriptions)
495
+ - `project_root`: The project working directory
496
+ - `mode`: `"wave"` for multi-task waves, `"single-task"` for single-task runs
497
+
498
+ 2. **Invoke the Codex gate** by using the ftm-codex-gate skill with these inputs. The gate will:
499
+ - Construct a Codex CLI command with the adversarial review prompt
500
+ - Run `codex exec --yolo --ephemeral -m "gpt-5.4"` against the changed files
501
+ - Return structured results
502
+
503
+ 3. **Interpret the results:**
504
+
505
+ **PASS (no issues found):**
506
+ - Log in PROGRESS.md: "Codex gate PASSED — 0 issues"
507
+ - Proceed to next wave (or Phase 6 if this was the last wave)
508
+
509
+ **PASS_WITH_FIXES (issues found and auto-fixed by Codex):**
510
+ - Codex committed fixes directly — review the fix commits
511
+ - Read each fix commit and diff it against INTENT.md entries for the affected functions
512
+ - **No INTENT.md conflict?** Accept the fixes. Log in PROGRESS.md and DEBUG.md. Proceed.
513
+ - **INTENT.md conflict detected?** See "INTENT.md Conflict Resolution" below.
514
+
515
+ **FAIL (issues Codex could not fix):**
516
+ - Read the remaining issues from the gate results
517
+ - Attempt to fix them yourself (you have full context from the wave)
518
+ - If you can fix them, commit and re-run the Codex gate
519
+ - If you cannot fix them after 2 attempts, report to the user:
520
+ ```
521
+ ⚠ Codex gate FAILED for Wave [N] — manual intervention needed:
522
+ - [remaining issue 1]
523
+ - [remaining issue 2]
524
+ Codex attempted [N] fixes but these remain unresolved.
525
+ ```
526
+ Wait for user input before continuing.
527
+
528
+ **INTENT.md Conflict Resolution:**
529
+
530
+ When Codex fixes code in a way that contradicts what INTENT.md says a function should do:
531
+
532
+ 1. **Detect the conflict**: Compare Codex's fix diff against the INTENT.md entry for the affected function. A conflict exists when:
533
+ - Codex changed a function's behavior but INTENT.md's "Does" field describes different behavior
534
+ - Codex reverted a deliberate choice documented in INTENT.md's "Decisions" field
535
+ - Codex changed the function signature documented in the INTENT.md header
536
+
537
+ 2. **Auto-invoke ftm-council** with a structured conflict payload:
538
+ ```
539
+ CONFLICT TYPE: Codex fix contradicts INTENT.md
540
+
541
+ ORIGINAL INTENT (from INTENT.md):
542
+ [paste the full INTENT.md entry for the affected function]
543
+
544
+ CODEX'S CHANGE:
545
+ [paste the diff of what Codex changed]
546
+
547
+ CODEX'S REASONING:
548
+ [paste Codex's explanation from the gate results]
549
+
550
+ THE CODE IN QUESTION:
551
+ [file path and relevant code section]
552
+
553
+ DEBUG.md HISTORY:
554
+ [paste relevant entries from DEBUG.md so the council doesn't suggest already-failed approaches]
555
+
556
+ QUESTION FOR THE COUNCIL:
557
+ Should we (A) update INTENT.md to match Codex's fix, or (B) revert Codex's fix and keep the original intent?
558
+ ```
559
+
560
+ 3. **Execute the council's verdict:**
561
+ - If verdict is "update intent": Update the INTENT.md entry to reflect the new behavior. Commit with message "Update intent: [function] — council verdict [round N]"
562
+ - If verdict is "revert fix": Revert Codex's fix commit. Commit with message "Revert codex fix: [function] — council verdict preserves original intent"
563
+ - Log the full decision + reasoning in DEBUG.md
564
+
565
+ 4. **Continue to next wave** after all conflicts are resolved.
566
+
567
+ ---
568
+
569
+ ### Phase 6: Final Verification and Completion
570
+
571
+ After all waves are merged:
572
+
573
+ 1. Run the full test suite
574
+ 2. Run the build
575
+ 3. Run linting/typechecking
576
+ 4. Fix any remaining issues (zero broken windows — fix everything, not just "your" stuff)
577
+ 4.5. **Final Codex gate** — Run one last Codex gate across ALL files changed in the entire plan execution. This catches cross-wave integration issues that per-wave gates might miss. Use `mode: "wave"` with the complete file list.
578
+ 5. **Branch finishing** — After all verification passes (including the final Codex gate), present exactly 4 options to the user:
579
+
580
+ ```
581
+ All tasks complete. All tests pass. Codex gate passed. Choose how to finish:
582
+
583
+ 1. **Merge locally** — Merge the work branch into main/develop right now
584
+ - Verifies all tests pass one final time before merging
585
+ - Uses --no-ff to preserve branch history
586
+ - Deletes the work branch after successful merge
587
+
588
+ 2. **Push + Create PR** — Push the branch and create a pull request
589
+ - Pushes the branch to origin
590
+ - Creates a PR with auto-generated summary from:
591
+ - Root INTENT.md vision section
592
+ - Task list with acceptance criteria status
593
+ - Codex gate results summary
594
+ - Files changed count
595
+ - Returns the PR URL
596
+
597
+ 3. **Keep branch as-is** — Leave everything on the current branch
598
+ - Prints the branch name so the user can return to it
599
+ - Preserves all worktrees (does NOT run cleanup)
600
+ - Good for: "I want to review this myself first"
601
+
602
+ 4. **Discard** — Delete the branch and all changes
603
+ - Requires typed confirmation: user must type "discard" to proceed
604
+ - Runs full cleanup (worktrees + branches)
605
+ - Cannot be undone
606
+ ```
607
+
608
+ Wait for the user to choose. Execute their choice. Do not proceed without explicit selection.
609
+
610
+ ### Phase 6.5: Retrospective
611
+
612
+ After all verification passes and before presenting branch finishing options, automatically invoke the ftm-retro skill with execution context.
613
+
614
+ **Invoke ftm-retro** with this context:
615
+ - Plan title and path
616
+ - Task count, wave count
617
+ - Total agents spawned (count of Agent tool invocations)
618
+ - Per-task audit results: for each task, whether it passed audit on first attempt, needed auto-fix, or required manual intervention
619
+ - Codex gate results: for each wave, whether it passed on first attempt or needed fixes
620
+ - Any errors, blockers, or manual interventions that occurred during execution
621
+
622
+ The retro runs automatically — do not ask the user whether to run it. The report is saved to `~/.claude/ftm-retros/` and a one-line summary of the overall score (X/50) is shown to the user before presenting the branch finishing options.
623
+
624
+ **Graceful degradation**: If the ftm-retro skill is not available (not installed), skip with a note and proceed to branch finishing.
625
+
626
+ ### Cleanup
627
+
628
+ Cleanup runs automatically after options 1 (merge), 2 (PR), and 4 (discard). It does NOT run for option 3 (keep branch).
629
+
630
+ ```bash
631
+ git worktree list # verify what exists
632
+ git worktree remove .worktrees/plan-exec-<name> # for each worktree
633
+ git branch -d plan-exec/<name> # delete branches (use -D for discard option)
634
+ ```
635
+
636
+ For option 3, print a reminder:
637
+ ```
638
+ Branch preserved: plan-exec/<name>
639
+ Worktrees at: .worktrees/plan-exec-*
640
+ Run cleanup manually when ready: git worktree remove .worktrees/plan-exec-<name>
641
+ ```
642
+
643
+ ## Handling Edge Cases
644
+
645
+ **Plan has no dependency map**: Analyze task descriptions and file lists yourself. Tasks touching the same files must be sequential. Tasks touching different files/domains can be parallel.
646
+
647
+ **Agent fails or gets stuck**: If an agent returns with unfinished tasks or errors it couldn't resolve, don't panic. Read its output, understand what went wrong, and either:
648
+ - Fix it yourself in the worktree
649
+ - Respawn the agent with more context about what failed
650
+
651
+ **Merge conflicts**: These happen when parallel agents touched overlapping files (shouldn't happen with good task partitioning, but sometimes it does). Resolve them manually — you have context from both agents' work.
652
+
653
+ **Very large plans (20+ tasks)**: Don't try to explain every task upfront. Show the wave structure and agent assignments, then execute. Report progress between waves.
654
+
655
+ **No tests in the project**: The review step becomes more important. Pay extra attention to the diff review and manual verification steps in the plan.
656
+
657
+ **Single-task plans**: For plans with only 1 task, skip the wave-boundary Codex gate and instead run the gate immediately after the task completes (using `mode: "single-task"`). The flow is: task agent completes → per-task verification gate → ftm-audit → Codex gate → Phase 6 completion.
658
+
659
+ ## What Makes This Different from executing-plans
660
+
661
+ The `executing-plans` skill is a human-in-the-loop batch executor — it does 3 tasks, stops, waits for feedback, continues. That's valuable when the human wants to steer.
662
+
663
+ This skill is fully autonomous. It analyzes the plan, builds a team, and executes everything without stopping. The human trusts the plan and wants it done. The review loop is agent-self-review, not human review.
664
+
665
+ Use `executing-plans` when: human wants checkpoints and control.
666
+ Use `ftm-executor` when: human says "just go" and trusts the plan.
667
+
668
+ **Critical distinction**: "just go" means "execute this plan autonomously" — it does NOT mean "skip the plan and start coding." If no plan exists, Phase 0 generates one and gets approval first. The autonomy is in execution, not in deciding what to execute.
669
+
670
+ ## Blackboard Write
671
+
672
+ After completing, update the blackboard:
673
+
674
+ 1. Update `~/.claude/ftm-state/blackboard/context.json`:
675
+ - Set current_task status to "complete"
676
+ - Append decision summary to recent_decisions (cap at 10)
677
+ - Update session_metadata.skills_invoked and last_updated
678
+ 2. Write an experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json` capturing task_type, agent team used, wave count, audit outcomes, and lessons learned
679
+ 3. Update `~/.claude/ftm-state/blackboard/experiences/index.json` with the new entry
680
+ 4. Emit `task_completed` event
681
+
682
+ ## Requirements
683
+
684
+ - tool: `git` | required | worktree creation, branch management, commit operations
685
+ - config: `~/.claude/ftm-config.yml` | optional | model profiles, max_parallel_agents, auto_audit, progress_tracking
686
+ - reference: `~/.claude/plans/` | optional | plan documents for execution
687
+ - tool: `node` | optional | project setup commands in worktrees
688
+ - reference: `~/.claude/skills/ftm-executor/references/STYLE-TEMPLATE.md` | optional | STYLE.md bootstrap template
689
+
690
+ ## Risk
691
+
692
+ - level: high_write
693
+ - scope: creates git worktrees and branches, modifies source files across multiple tasks, runs tests and builds, optionally pushes branches or creates PRs
694
+ - rollback: git worktree remove + git branch -D for each worktree; all changes isolated to plan-exec/* branches until explicitly merged
695
+
696
+ ## Approval Gates
697
+
698
+ - trigger: no plan document provided | action: generate plan and wait for explicit user approval before any code is written
699
+ - trigger: plan_checker returns FAIL | action: present blockers and ask user to fix or override before proceeding
700
+ - trigger: plan_checker returns WARN | action: show warnings to user, proceed unless they object
701
+ - trigger: wave complete and all agents done | action: auto-invoke ftm-codex-gate (no user gate needed for this step)
702
+ - trigger: final phase 6 verification passes | action: present 4 branch finishing options and wait for explicit user choice
703
+ - trigger: codex gate FAIL after 2 fix attempts | action: report to user and wait for input before continuing
704
+ - complexity_routing: micro → auto | small → auto | medium → plan_first | large → plan_first | xl → always_ask
705
+
706
+ ## Fallbacks
707
+
708
+ - condition: ftm-browse not installed at $HOME/.claude/skills/ftm-browse/bin/ftm-browse | action: skip visual smoke test checks, log "Visual smoke test skipped — ftm-browse not installed"
709
+ - condition: ftm-retro skill not available | action: skip retrospective phase, note in output and proceed to branch finishing
710
+ - condition: codex CLI not found | action: skip codex gate, log "Codex gate skipped — codex not installed", proceed to next wave
711
+ - condition: no package.json in project | action: skip npm install in worktree setup; skip knip-based audit layers
712
+ - condition: project has no test suite | action: skip test verification gates, rely on diff review and build checks
713
+ - condition: agent fails or gets stuck | action: read agent output, fix directly or respawn with more context
714
+
715
+ ## Capabilities
716
+
717
+ - cli: `git` | required | worktree management and version control
718
+ - cli: `node` | optional | project dependency installation
719
+ - mcp: `sequential-thinking` | optional | complex dependency analysis and plan validation
720
+ - env: none required directly (agents inherit from session)
721
+
722
+ ## Event Payloads
723
+
724
+ ### task_received
725
+ - skill: string — "ftm-executor"
726
+ - task_description: string — description of the task being queued
727
+ - plan_path: string — absolute path to plan document
728
+
729
+ ### plan_generated
730
+ - skill: string — "ftm-executor"
731
+ - plan_path: string — absolute path to saved plan file
732
+ - task_count: number — total tasks in the plan
733
+ - wave_count: number — number of parallel execution waves
734
+
735
+ ### plan_approved
736
+ - skill: string — "ftm-executor"
737
+ - plan_path: string — absolute path to approved plan
738
+ - approved_steps: number[] — step numbers approved for execution
739
+
740
+ ### code_changed
741
+ - skill: string — "ftm-executor"
742
+ - worktree: string — path to the worktree where files changed
743
+ - files: string[] — list of modified file paths
744
+ - agent: string — agent type that made the changes
745
+
746
+ ### code_committed
747
+ - skill: string — "ftm-executor"
748
+ - worktree: string — path to worktree
749
+ - commit_hash: string — short commit hash
750
+ - message: string — commit message
751
+ - task_number: number — plan task number this commit belongs to
752
+
753
+ ### test_passed
754
+ - skill: string — "ftm-executor"
755
+ - scope: string — "task" | "full_suite"
756
+ - task_number: number | null — task number if scoped to task
757
+ - worktree: string — worktree path
758
+
759
+ ### test_failed
760
+ - skill: string — "ftm-executor"
761
+ - scope: string — "task" | "full_suite"
762
+ - task_number: number | null — task number if scoped
763
+ - worktree: string — worktree path
764
+ - error_summary: string — brief description of failure
765
+
766
+ ### task_completed
767
+ - skill: string — "ftm-executor"
768
+ - task_number: number — completed task number
769
+ - audit_result: string — "pass" | "pass_with_fixes" | "fail" | "skipped"
770
+ - auto_fixed_count: number — issues auto-remediated by ftm-audit
771
+ - duration_ms: number — task execution time
772
+
773
+ ### error_encountered
774
+ - skill: string — "ftm-executor"
775
+ - phase: string — execution phase where error occurred
776
+ - task_number: number | null — associated task if applicable
777
+ - error: string — error description