@ambystech/ambykit 1.3.1 → 1.6.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 (415) hide show
  1. package/CHANGELOG.md +131 -1
  2. package/README.md +9 -0
  3. package/dist/cli/activity.d.ts +5 -1
  4. package/dist/cli/activity.js +22 -8
  5. package/dist/cli/activity.js.map +1 -1
  6. package/dist/cli/add.js +12 -5
  7. package/dist/cli/add.js.map +1 -1
  8. package/dist/cli/analyze.js +68 -4
  9. package/dist/cli/analyze.js.map +1 -1
  10. package/dist/cli/base-command.js +6 -0
  11. package/dist/cli/base-command.js.map +1 -1
  12. package/dist/cli/check.js +18 -3
  13. package/dist/cli/check.js.map +1 -1
  14. package/dist/cli/dashboard.d.ts +4 -1
  15. package/dist/cli/dashboard.js +47 -15
  16. package/dist/cli/dashboard.js.map +1 -1
  17. package/dist/cli/directive.d.ts +7 -0
  18. package/dist/cli/directive.js +43 -0
  19. package/dist/cli/directive.js.map +1 -0
  20. package/dist/cli/fleet.d.ts +16 -0
  21. package/dist/cli/fleet.js +472 -0
  22. package/dist/cli/fleet.js.map +1 -0
  23. package/dist/cli/graph.d.ts +13 -0
  24. package/dist/cli/graph.js +40 -0
  25. package/dist/cli/graph.js.map +1 -0
  26. package/dist/cli/index.js +12 -0
  27. package/dist/cli/index.js.map +1 -1
  28. package/dist/cli/io/fsops.d.ts +4 -0
  29. package/dist/cli/io/fsops.js +62 -0
  30. package/dist/cli/io/fsops.js.map +1 -1
  31. package/dist/cli/lane.d.ts +0 -2
  32. package/dist/cli/lane.js +9 -104
  33. package/dist/cli/lane.js.map +1 -1
  34. package/dist/cli/mcp.d.ts +21 -0
  35. package/dist/cli/mcp.js +27 -0
  36. package/dist/cli/mcp.js.map +1 -0
  37. package/dist/cli/run-budget.d.ts +18 -0
  38. package/dist/cli/run-budget.js +75 -0
  39. package/dist/cli/run-budget.js.map +1 -0
  40. package/dist/cli/run-control.d.ts +28 -0
  41. package/dist/cli/run-control.js +139 -0
  42. package/dist/cli/run-control.js.map +1 -0
  43. package/dist/cli/run-files.d.ts +96 -0
  44. package/dist/cli/run-files.js +120 -0
  45. package/dist/cli/run-files.js.map +1 -0
  46. package/dist/cli/run-gates.d.ts +25 -0
  47. package/dist/cli/run-gates.js +45 -0
  48. package/dist/cli/run-gates.js.map +1 -0
  49. package/dist/cli/run-launch.d.ts +17 -0
  50. package/dist/cli/run-launch.js +89 -0
  51. package/dist/cli/run-launch.js.map +1 -0
  52. package/dist/cli/run-loop.d.ts +37 -0
  53. package/dist/cli/run-loop.js +150 -0
  54. package/dist/cli/run-loop.js.map +1 -0
  55. package/dist/cli/run-merger.d.ts +12 -0
  56. package/dist/cli/run-merger.js +88 -0
  57. package/dist/cli/run-merger.js.map +1 -0
  58. package/dist/cli/run-plan.d.ts +28 -0
  59. package/dist/cli/run-plan.js +49 -0
  60. package/dist/cli/run-plan.js.map +1 -0
  61. package/dist/cli/run-process.d.ts +39 -0
  62. package/dist/cli/run-process.js +99 -0
  63. package/dist/cli/run-process.js.map +1 -0
  64. package/dist/cli/run-protocol-prompts.d.ts +7 -0
  65. package/dist/cli/run-protocol-prompts.js +36 -0
  66. package/dist/cli/run-protocol-prompts.js.map +1 -0
  67. package/dist/cli/run-protocol.d.ts +10 -0
  68. package/dist/cli/run-protocol.js +99 -0
  69. package/dist/cli/run-protocol.js.map +1 -0
  70. package/dist/cli/run-script.d.ts +11 -0
  71. package/dist/cli/run-script.js +66 -0
  72. package/dist/cli/run-script.js.map +1 -0
  73. package/dist/cli/run-session.d.ts +60 -0
  74. package/dist/cli/run-session.js +21 -0
  75. package/dist/cli/run-session.js.map +1 -0
  76. package/dist/cli/run-supervisor.d.ts +20 -0
  77. package/dist/cli/run-supervisor.js +144 -0
  78. package/dist/cli/run-supervisor.js.map +1 -0
  79. package/dist/cli/run.d.ts +73 -0
  80. package/dist/cli/run.js +363 -0
  81. package/dist/cli/run.js.map +1 -0
  82. package/dist/cli/sync.d.ts +2 -0
  83. package/dist/cli/sync.js +31 -5
  84. package/dist/cli/sync.js.map +1 -1
  85. package/dist/cli/trace.d.ts +14 -0
  86. package/dist/cli/trace.js +89 -0
  87. package/dist/cli/trace.js.map +1 -0
  88. package/dist/cli/ui/dashboard/feature-chart.js +15 -2
  89. package/dist/cli/ui/dashboard/feature-chart.js.map +1 -1
  90. package/dist/cli/ui/dashboard/feature-view.js +11 -1
  91. package/dist/cli/ui/dashboard/feature-view.js.map +1 -1
  92. package/dist/cli/ui/dashboard/fleet-tokens.d.ts +404 -0
  93. package/dist/cli/ui/dashboard/fleet-tokens.js +405 -0
  94. package/dist/cli/ui/dashboard/fleet-tokens.js.map +1 -0
  95. package/dist/cli/ui/dashboard/fleet-view.d.ts +50 -0
  96. package/dist/cli/ui/dashboard/fleet-view.js +211 -0
  97. package/dist/cli/ui/dashboard/fleet-view.js.map +1 -0
  98. package/dist/cli/ui/dashboard/graph-view.d.ts +44 -0
  99. package/dist/cli/ui/dashboard/graph-view.js +78 -0
  100. package/dist/cli/ui/dashboard/graph-view.js.map +1 -0
  101. package/dist/cli/ui/dashboard/help-overlay.d.ts +1 -1
  102. package/dist/cli/ui/dashboard/help-overlay.js +20 -0
  103. package/dist/cli/ui/dashboard/help-overlay.js.map +1 -1
  104. package/dist/cli/ui/dashboard/quality-view.d.ts +8 -0
  105. package/dist/cli/ui/dashboard/quality-view.js +31 -0
  106. package/dist/cli/ui/dashboard/quality-view.js.map +1 -0
  107. package/dist/cli/ui/dashboard/story-detail.d.ts +1 -1
  108. package/dist/cli/ui/dashboard/story-detail.js +10 -3
  109. package/dist/cli/ui/dashboard/story-detail.js.map +1 -1
  110. package/dist/cli/ui/dashboard/tokens.d.ts +26 -0
  111. package/dist/cli/ui/dashboard/tokens.js +26 -0
  112. package/dist/cli/ui/dashboard/tokens.js.map +1 -1
  113. package/dist/cli/ui/icons.d.ts +22 -0
  114. package/dist/cli/ui/icons.js +17 -0
  115. package/dist/cli/ui/icons.js.map +1 -0
  116. package/dist/cli/ui/interactive/fleet-actions.d.ts +24 -0
  117. package/dist/cli/ui/interactive/fleet-actions.js +30 -0
  118. package/dist/cli/ui/interactive/fleet-actions.js.map +1 -0
  119. package/dist/cli/ui/interactive/fleet.d.ts +54 -0
  120. package/dist/cli/ui/interactive/fleet.js +98 -0
  121. package/dist/cli/ui/interactive/fleet.js.map +1 -0
  122. package/dist/cli/ui/interactive/fullscreen.js +26 -8
  123. package/dist/cli/ui/interactive/fullscreen.js.map +1 -1
  124. package/dist/cli/ui/interactive/live.d.ts +8 -0
  125. package/dist/cli/ui/interactive/live.js +13 -0
  126. package/dist/cli/ui/interactive/live.js.map +1 -1
  127. package/dist/cli/ui/interactive/overview.d.ts +27 -1
  128. package/dist/cli/ui/interactive/overview.js +111 -0
  129. package/dist/cli/ui/interactive/overview.js.map +1 -1
  130. package/dist/cli/ui/tool-options.d.ts +3 -2
  131. package/dist/cli/ui/tool-options.js +3 -3
  132. package/dist/cli/ui/tool-options.js.map +1 -1
  133. package/dist/cli/update.d.ts +1 -1
  134. package/dist/cli/update.js +8 -3
  135. package/dist/cli/update.js.map +1 -1
  136. package/dist/core/activity.d.ts +15 -2
  137. package/dist/core/activity.js +19 -4
  138. package/dist/core/activity.js.map +1 -1
  139. package/dist/core/analyze.d.ts +80 -2
  140. package/dist/core/analyze.js +200 -61
  141. package/dist/core/analyze.js.map +1 -1
  142. package/dist/core/checkouts.js +2 -0
  143. package/dist/core/checkouts.js.map +1 -1
  144. package/dist/core/config.d.ts +31 -1
  145. package/dist/core/config.js +50 -0
  146. package/dist/core/config.js.map +1 -1
  147. package/dist/core/dashboard.d.ts +4 -0
  148. package/dist/core/dashboard.js +5 -3
  149. package/dist/core/dashboard.js.map +1 -1
  150. package/dist/core/decisions.d.ts +60 -0
  151. package/dist/core/decisions.js +231 -0
  152. package/dist/core/decisions.js.map +1 -0
  153. package/dist/core/emit.d.ts +16 -1
  154. package/dist/core/emit.js +49 -5
  155. package/dist/core/emit.js.map +1 -1
  156. package/dist/core/features.js +6 -1
  157. package/dist/core/features.js.map +1 -1
  158. package/dist/core/fleet/claims.d.ts +45 -0
  159. package/dist/core/fleet/claims.js +85 -0
  160. package/dist/core/fleet/claims.js.map +1 -0
  161. package/dist/core/fleet/directives.d.ts +56 -0
  162. package/dist/core/fleet/directives.js +99 -0
  163. package/dist/core/fleet/directives.js.map +1 -0
  164. package/dist/core/fleet/flow-input.d.ts +6 -0
  165. package/dist/core/fleet/flow-input.js +35 -0
  166. package/dist/core/fleet/flow-input.js.map +1 -0
  167. package/dist/core/fleet/index.d.ts +9 -0
  168. package/dist/core/fleet/index.js +10 -0
  169. package/dist/core/fleet/index.js.map +1 -0
  170. package/dist/core/fleet/lane-status.d.ts +39 -0
  171. package/dist/core/fleet/lane-status.js +63 -0
  172. package/dist/core/fleet/lane-status.js.map +1 -0
  173. package/dist/core/fleet/lock.d.ts +23 -0
  174. package/dist/core/fleet/lock.js +103 -0
  175. package/dist/core/fleet/lock.js.map +1 -0
  176. package/dist/core/fleet/notes.d.ts +31 -0
  177. package/dist/core/fleet/notes.js +56 -0
  178. package/dist/core/fleet/notes.js.map +1 -0
  179. package/dist/core/fleet/run-flow.d.ts +157 -0
  180. package/dist/core/fleet/run-flow.js +205 -0
  181. package/dist/core/fleet/run-flow.js.map +1 -0
  182. package/dist/core/fleet/runs.d.ts +46 -0
  183. package/dist/core/fleet/runs.js +182 -0
  184. package/dist/core/fleet/runs.js.map +1 -0
  185. package/dist/core/fleet/types.d.ts +63 -0
  186. package/dist/core/fleet/types.js +11 -0
  187. package/dist/core/fleet/types.js.map +1 -0
  188. package/dist/core/fleet-view/derive.d.ts +14 -0
  189. package/dist/core/fleet-view/derive.js +54 -0
  190. package/dist/core/fleet-view/derive.js.map +1 -0
  191. package/dist/core/fleet-view/json.d.ts +37 -0
  192. package/dist/core/fleet-view/json.js +25 -0
  193. package/dist/core/fleet-view/json.js.map +1 -0
  194. package/dist/core/fleet-view/read.d.ts +8 -0
  195. package/dist/core/fleet-view/read.js +44 -0
  196. package/dist/core/fleet-view/read.js.map +1 -0
  197. package/dist/core/fleet-view/types.d.ts +52 -0
  198. package/dist/core/fleet-view/types.js +2 -0
  199. package/dist/core/fleet-view/types.js.map +1 -0
  200. package/dist/core/graph-format.d.ts +51 -0
  201. package/dist/core/graph-format.js +99 -0
  202. package/dist/core/graph-format.js.map +1 -0
  203. package/dist/core/graph-paths.d.ts +27 -0
  204. package/dist/core/graph-paths.js +94 -0
  205. package/dist/core/graph-paths.js.map +1 -0
  206. package/dist/core/graph-scope.d.ts +7 -0
  207. package/dist/core/graph-scope.js +31 -0
  208. package/dist/core/graph-scope.js.map +1 -0
  209. package/dist/core/graph-types.d.ts +55 -0
  210. package/dist/core/graph-types.js +6 -0
  211. package/dist/core/graph-types.js.map +1 -0
  212. package/dist/core/graph.d.ts +14 -0
  213. package/dist/core/graph.js +144 -0
  214. package/dist/core/graph.js.map +1 -0
  215. package/dist/core/index.d.ts +13 -0
  216. package/dist/core/index.js +13 -0
  217. package/dist/core/index.js.map +1 -1
  218. package/dist/core/lane-merge.d.ts +29 -0
  219. package/dist/core/lane-merge.js +105 -0
  220. package/dist/core/lane-merge.js.map +1 -0
  221. package/dist/core/markers.d.ts +44 -0
  222. package/dist/core/markers.js +139 -0
  223. package/dist/core/markers.js.map +1 -0
  224. package/dist/core/merge-json.d.ts +15 -0
  225. package/dist/core/merge-json.js +46 -0
  226. package/dist/core/merge-json.js.map +1 -0
  227. package/dist/core/moved-targets.d.ts +23 -0
  228. package/dist/core/moved-targets.js +23 -0
  229. package/dist/core/moved-targets.js.map +1 -0
  230. package/dist/core/overview-types.d.ts +27 -1
  231. package/dist/core/overview-types.js.map +1 -1
  232. package/dist/core/overview.d.ts +1 -1
  233. package/dist/core/overview.js +91 -74
  234. package/dist/core/overview.js.map +1 -1
  235. package/dist/core/path-guard.d.ts +5 -0
  236. package/dist/core/path-guard.js +9 -0
  237. package/dist/core/path-guard.js.map +1 -0
  238. package/dist/core/paths.d.ts +2 -0
  239. package/dist/core/paths.js +4 -0
  240. package/dist/core/paths.js.map +1 -1
  241. package/dist/core/query.d.ts +91 -0
  242. package/dist/core/query.js +197 -0
  243. package/dist/core/query.js.map +1 -0
  244. package/dist/core/report.d.ts +36 -0
  245. package/dist/core/report.js +62 -0
  246. package/dist/core/report.js.map +1 -0
  247. package/dist/core/rules.js +3 -0
  248. package/dist/core/rules.js.map +1 -1
  249. package/dist/core/run-gate-actions.d.ts +51 -0
  250. package/dist/core/run-gate-actions.js +105 -0
  251. package/dist/core/run-gate-actions.js.map +1 -0
  252. package/dist/core/run-launch-plan.d.ts +51 -0
  253. package/dist/core/run-launch-plan.js +27 -0
  254. package/dist/core/run-launch-plan.js.map +1 -0
  255. package/dist/core/run-prompt.d.ts +47 -0
  256. package/dist/core/run-prompt.js +37 -0
  257. package/dist/core/run-prompt.js.map +1 -0
  258. package/dist/core/run-review.d.ts +50 -0
  259. package/dist/core/run-review.js +20 -0
  260. package/dist/core/run-review.js.map +1 -0
  261. package/dist/core/run-schedule.d.ts +23 -0
  262. package/dist/core/run-schedule.js +40 -0
  263. package/dist/core/run-schedule.js.map +1 -0
  264. package/dist/core/run-supervise.d.ts +71 -0
  265. package/dist/core/run-supervise.js +61 -0
  266. package/dist/core/run-supervise.js.map +1 -0
  267. package/dist/core/runners.d.ts +59 -0
  268. package/dist/core/runners.js +60 -0
  269. package/dist/core/runners.js.map +1 -0
  270. package/dist/core/scaffold.d.ts +2 -2
  271. package/dist/core/scaffold.js +3 -1
  272. package/dist/core/scaffold.js.map +1 -1
  273. package/dist/core/subagents.d.ts +29 -0
  274. package/dist/core/subagents.js +52 -0
  275. package/dist/core/subagents.js.map +1 -0
  276. package/dist/core/tasks-edit.d.ts +34 -0
  277. package/dist/core/tasks-edit.js +115 -0
  278. package/dist/core/tasks-edit.js.map +1 -0
  279. package/dist/core/test-design.d.ts +94 -0
  280. package/dist/core/test-design.js +325 -0
  281. package/dist/core/test-design.js.map +1 -0
  282. package/dist/core/trace-cite.d.ts +16 -0
  283. package/dist/core/trace-cite.js +24 -0
  284. package/dist/core/trace-cite.js.map +1 -0
  285. package/dist/core/trace-coverage.d.ts +8 -0
  286. package/dist/core/trace-coverage.js +40 -0
  287. package/dist/core/trace-coverage.js.map +1 -0
  288. package/dist/core/trace-design.d.ts +6 -0
  289. package/dist/core/trace-design.js +16 -0
  290. package/dist/core/trace-design.js.map +1 -0
  291. package/dist/core/trace-io.d.ts +14 -0
  292. package/dist/core/trace-io.js +97 -0
  293. package/dist/core/trace-io.js.map +1 -0
  294. package/dist/core/trace-requirements.d.ts +9 -0
  295. package/dist/core/trace-requirements.js +27 -0
  296. package/dist/core/trace-requirements.js.map +1 -0
  297. package/dist/core/trace-tests.d.ts +7 -0
  298. package/dist/core/trace-tests.js +27 -0
  299. package/dist/core/trace-tests.js.map +1 -0
  300. package/dist/core/trace-types.d.ts +81 -0
  301. package/dist/core/trace-types.js +3 -0
  302. package/dist/core/trace-types.js.map +1 -0
  303. package/dist/core/trace.d.ts +18 -0
  304. package/dist/core/trace.js +109 -0
  305. package/dist/core/trace.js.map +1 -0
  306. package/dist/core/types.d.ts +50 -1
  307. package/dist/emitters/antigravity-cli.d.ts +4 -0
  308. package/dist/emitters/antigravity-cli.js +8 -0
  309. package/dist/emitters/antigravity-cli.js.map +1 -1
  310. package/dist/emitters/antigravity.d.ts +6 -0
  311. package/dist/emitters/antigravity.js +8 -0
  312. package/dist/emitters/antigravity.js.map +1 -1
  313. package/dist/emitters/base-emitter.d.ts +28 -0
  314. package/dist/emitters/base-emitter.js +41 -1
  315. package/dist/emitters/base-emitter.js.map +1 -1
  316. package/dist/emitters/claude.d.ts +12 -2
  317. package/dist/emitters/claude.js +34 -5
  318. package/dist/emitters/claude.js.map +1 -1
  319. package/dist/emitters/copilot-cli.d.ts +7 -1
  320. package/dist/emitters/copilot-cli.js +9 -0
  321. package/dist/emitters/copilot-cli.js.map +1 -1
  322. package/dist/emitters/copilot.d.ts +5 -0
  323. package/dist/emitters/copilot.js +23 -1
  324. package/dist/emitters/copilot.js.map +1 -1
  325. package/dist/emitters/cursor.d.ts +3 -0
  326. package/dist/emitters/cursor.js +8 -1
  327. package/dist/emitters/cursor.js.map +1 -1
  328. package/dist/emitters/index.d.ts +10 -3
  329. package/dist/emitters/index.js +6 -6
  330. package/dist/emitters/index.js.map +1 -1
  331. package/dist/emitters/opencode.d.ts +8 -0
  332. package/dist/emitters/opencode.js +23 -0
  333. package/dist/emitters/opencode.js.map +1 -1
  334. package/dist/index.d.ts +5 -0
  335. package/dist/index.js +4 -0
  336. package/dist/index.js.map +1 -1
  337. package/dist/mcp/protocol.d.ts +44 -0
  338. package/dist/mcp/protocol.js +114 -0
  339. package/dist/mcp/protocol.js.map +1 -0
  340. package/dist/mcp/registry.d.ts +40 -0
  341. package/dist/mcp/registry.js +44 -0
  342. package/dist/mcp/registry.js.map +1 -0
  343. package/dist/mcp/server.d.ts +7 -0
  344. package/dist/mcp/server.js +14 -0
  345. package/dist/mcp/server.js.map +1 -0
  346. package/dist/mcp/tools/common.d.ts +12 -0
  347. package/dist/mcp/tools/common.js +12 -0
  348. package/dist/mcp/tools/common.js.map +1 -0
  349. package/dist/mcp/tools/fleet.d.ts +10 -0
  350. package/dist/mcp/tools/fleet.js +102 -0
  351. package/dist/mcp/tools/fleet.js.map +1 -0
  352. package/dist/mcp/tools/index.d.ts +3 -0
  353. package/dist/mcp/tools/index.js +13 -0
  354. package/dist/mcp/tools/index.js.map +1 -0
  355. package/dist/mcp/tools/read.d.ts +6 -0
  356. package/dist/mcp/tools/read.js +62 -0
  357. package/dist/mcp/tools/read.js.map +1 -0
  358. package/dist/mcp/tools/write.d.ts +6 -0
  359. package/dist/mcp/tools/write.js +34 -0
  360. package/dist/mcp/tools/write.js.map +1 -0
  361. package/dist/plugins/api.d.ts +39 -0
  362. package/dist/plugins/api.js +28 -0
  363. package/dist/plugins/api.js.map +1 -0
  364. package/dist/plugins/index.d.ts +11 -0
  365. package/dist/plugins/index.js +9 -0
  366. package/dist/plugins/index.js.map +1 -0
  367. package/dist/plugins/loader.d.ts +35 -0
  368. package/dist/plugins/loader.js +117 -0
  369. package/dist/plugins/loader.js.map +1 -0
  370. package/dist/plugins/manifest.d.ts +21 -0
  371. package/dist/plugins/manifest.js +53 -0
  372. package/dist/plugins/manifest.js.map +1 -0
  373. package/dist/plugins/registry.d.ts +36 -0
  374. package/dist/plugins/registry.js +30 -0
  375. package/dist/plugins/registry.js.map +1 -0
  376. package/dist/plugins/report.d.ts +9 -0
  377. package/dist/plugins/report.js +19 -0
  378. package/dist/plugins/report.js.map +1 -0
  379. package/dist/plugins/semver.d.ts +23 -0
  380. package/dist/plugins/semver.js +106 -0
  381. package/dist/plugins/semver.js.map +1 -0
  382. package/dist/plugins/session.d.ts +18 -0
  383. package/dist/plugins/session.js +22 -0
  384. package/dist/plugins/session.js.map +1 -0
  385. package/dist/testkit/contract.d.ts +33 -0
  386. package/dist/testkit/contract.js +118 -0
  387. package/dist/testkit/contract.js.map +1 -0
  388. package/dist/testkit/index.d.ts +15 -0
  389. package/dist/testkit/index.js +15 -0
  390. package/dist/testkit/index.js.map +1 -0
  391. package/docs/architecture.md +33 -5
  392. package/docs/artifacts/decision-record.md +54 -0
  393. package/docs/artifacts/tasks.md +37 -0
  394. package/docs/artifacts/tests.md +43 -0
  395. package/docs/cli-reference.md +255 -6
  396. package/docs/concepts/mcp-server.md +93 -0
  397. package/docs/contributing.md +9 -0
  398. package/docs/index.md +1 -1
  399. package/docs/plugin-api.md +124 -0
  400. package/docs/plugin-split.md +55 -0
  401. package/docs/plugin-trust.md +51 -0
  402. package/docs/tool-compatibility.md +71 -6
  403. package/docs/workflow.md +37 -5
  404. package/package.json +5 -2
  405. package/src/agents/worker.md +37 -0
  406. package/src/prompts/converge.md +8 -3
  407. package/src/prompts/decide.md +31 -0
  408. package/src/prompts/implement.md +15 -7
  409. package/src/prompts/revise.md +4 -2
  410. package/src/prompts/run.md +100 -0
  411. package/src/prompts/tasks.md +13 -3
  412. package/src/roles/security.md +17 -0
  413. package/src/templates/adr.md +29 -0
  414. package/src/templates/tasks.md +6 -0
  415. package/src/templates/tests.md +29 -0
@@ -94,6 +94,26 @@ your edits are kept), warns when a role in `.amby/roles/` exceeds 150 words, and
94
94
  when two roles share an id. Projects with roles get one native sub-agent per role for Claude Code,
95
95
  OpenCode, and Copilot.
96
96
 
97
+ **Plugins (experimental).** `plugins` in `.amby/config.json` maps an `ambykit-emitter-*` package to the exact
98
+ version installed in the project's own `node_modules`; `sync` (and `check` and `add`) load only those, then
99
+ emit their targets like built-in ones:
100
+
101
+ ```json
102
+ { "tools": ["claude", "mytool"], "plugins": { "ambykit-emitter-mytool": "1.0.0" } }
103
+ ```
104
+
105
+ `sync` prints each loaded plugin as `name@version` and an experimental note. A plugin that is missing,
106
+ mis-pinned, outside the plugin-API range, malformed, or that clashes with another target is reported by name
107
+ and skipped; the other targets still sync and `sync` exits **1**. A plugin file outside the project is refused;
108
+ a file in the home directory needs `--include-user` and is never part of `--check`. Without a `plugins` key
109
+ nothing is loaded and output is unchanged. A configured target that moved to a plugin gets a notice naming the
110
+ package (none have moved yet). See [`plugin-api.md`](./plugin-api.md), [`plugin-trust.md`](./plugin-trust.md)
111
+ and [`plugin-split.md`](./plugin-split.md).
112
+
113
+ Plugin authors test with `@ambystech/ambykit/testkit` (`checkEmitterContract`, `assertEmitterContract`, and the
114
+ `createPluginApi` helper), which checks an emitter's paths and frontmatter keys against a matrix row; a missing
115
+ row fails. The plugin API itself is `@ambystech/ambykit/plugin`.
116
+
97
117
  ## `ambykit restore [file]`
98
118
 
99
119
  Recover an agent-doc file (`AGENTS.md`, `CLAUDE.md`, a tool's rules file) from the timestamped backup
@@ -173,25 +193,31 @@ Detection reads the process list only, never sends anything, and stops when you
173
193
  it reads without color);
174
194
  - **Attention** — dependency cycles and unknown references first, then blocked stories (status
175
195
  `blocked`, or a `blocked-by` story that is not done), then stories waiting on an unfinished
176
- `depends-on`;
196
+ `depends-on`; then open tasks that carry a `BLOCKED` marker (kind `task-blocked`) and phases
197
+ whose last recorded Verify result failed (kind `verify-failed`, keyed `<feature>:phase-N`);
177
198
  - **Up next** — the next undone tasks whose story is not in Attention (`--next=N`, default 5);
199
+ tasks carrying a `BLOCKED` marker are left out;
178
200
  - **burndown** — remaining vs. done tasks per day/week/month from the git history of `tasks.md`
179
201
  (the last column is your working tree); shows "No history available" outside a git repo;
180
202
  - **feature completion** — one row per feature with its bar, workflow phase (specified → designed →
181
203
  planned → tasked → implementing → done) and open `[NEEDS CLARIFICATION]` count. A feature with no
182
- `tasks.md` reads "not planned".
204
+ `tasks.md` reads "not planned". A feature with open `BLOCKED` tasks shows `N blocked` on its row
205
+ as plain text, only when N is above zero.
183
206
 
184
207
  Unreadable files are skipped and named in a notice line. Off a TTY (pipes, CI) the same content is
185
208
  printed as plain text.
186
209
  - **`--feature=X`** — the feature view for one feature (`X` is its number, e.g. `014`, or its
187
210
  directory name): artifacts present, open clarifications, status, the story table with a
188
- `Waiting on` column, and Attention / Up next / burndown scoped to the feature.
211
+ `Waiting on` column, and Attention / Up next / burndown scoped to the feature. The `tasks.md`
212
+ artifact line ends with `verify <passed>/<total>` when phases carry a `**Verify:**` line, plus
213
+ `, FAILED phase N` for each phase whose last result failed.
189
214
  - **`--status=X`** — narrow every widget to stories with that status.
190
215
  - **`--stories`** — the previous story table (`Feat | Story | description | progress | status |
191
216
  priority | blocked-by`) with an overall roll-up.
192
217
  - **`story-id`** — detail for one story. Story ids **restart per feature**, so a bare `US-3` may
193
218
  match several; qualify it with the feature ref as `NNN:US-3` (also accepts `NNN/US-3`). A bare id
194
- that matches more than one feature prints the matches so you can pick.
219
+ that matches more than one feature prints the matches so you can pick. A task row ends with
220
+ `BLOCKED: <reason>` and `DEVIATION: <note>` when the task line carries those markers.
195
221
  - **`--interactive`** — the overview full screen (TTY only): `tab` moves focus between Attention, Up
196
222
  next, Worktrees & agents and Feature completion, `↑`/`↓` move, `enter` opens the feature view and,
197
223
  from there, the story detail (tasks, relations, checkout and agent). `esc` goes back (on the
@@ -201,14 +227,40 @@ Detection reads the process list only, never sends anything, and stops when you
201
227
  header shows `● live · 3s ago`; where file watching is unavailable it polls every 2 s
202
228
  (`◌ polling`), and if monitoring fails it shows `⚠ live paused` and `r` retries. On a
203
229
  non-interactive terminal it prints the plain overview, and nothing is watched.
230
+ - **Fleet view** (`l` in `--interactive`) — the lanes of the current fleet run (`ambykit fleet`,
231
+ `ambykit run`), live. Each lane is a row with its assistant, state (`working`, `waiting`, `blocked`,
232
+ `paused`, `done`, `unreported`, `unknown`, always as a word as well as a glyph), quiet time and
233
+ directive status (`continue pending`, `pause requested`, `paused`, `obeyed`). A working lane with no
234
+ report and no `tasks.md` change for `fleet.stallMinutes` (default 15) carries the text
235
+ `STALLED <n>m`. The header shows the run, phase and review stage once (`QA round 1/3`,
236
+ `architect round 2/3`, `NEEDS A DECISION`) and `+N more runs` when other runs are unfinished; story
237
+ checkpoint gates waiting for you are listed below the lanes. Keys: `↑`/`↓` select a lane, `p` pause,
238
+ `u` continue, `x` stop (asks `y`/`n`), `P`/`U`/`X` do the same for every lane of the run (always with
239
+ a `y`/`n` confirmation), `a` approves a waiting gate (`←`/`→` choose between several), `esc` goes
240
+ back, `?` lists the keys. Pause, continue and stop are written as directives for the lane's worker,
241
+ which obeys at its next report; approving a gate is the same action as `ambykit run approve` and
242
+ writes no directive. Without a run the view says so. It reads local files only (no network, no model
243
+ tokens) and is loaded only under `--interactive`.
204
244
  - **`--icons=nerd|unicode|ascii`** — icon set. `nerd` (also `AMBYKIT_ICONS=nerd`) shows the
205
245
  worktree tag as the Nerd Font git-branch icon; agent icons stay Unicode. `ascii` uses tags like
206
- `[CC] Claude` and `wt`. The default is unicode when the terminal supports it.
246
+ `[CC] Claude` and `wt`. The default is unicode when the terminal supports it. The setting can also
247
+ live in `.amby/config.json` as `"dashboard": { "icons": "nerd" | "unicode" | "ascii" | "auto" }`
248
+ (hand-edited, never written by the dashboard). Precedence: `--icons`, then `AMBYKIT_ICONS`, then
249
+ `dashboard.icons`, then auto. A terminal without unicode is always ASCII. In the Fleet view `nerd`
250
+ draws the same glyphs as `unicode`; every state also has a word.
207
251
  - **`--json`** — the story list as JSON, unchanged from earlier releases.
208
252
  - **`--json --overview`** — one object: `stories` (exactly the `--json` list) plus `summary`,
209
253
  `statusCounts`, `features`, `attention`, `upNext`, `burndown`, `issues` and the applied `filters`.
210
254
  Each feature has a `checkout`: `{ "kind": "main" }`, or
211
- `{ "kind": "worktree", "branch", "dirty", "stale" }`.
255
+ `{ "kind": "worktree", "branch", "dirty", "stale" }`. A feature also has `blocked` (number of
256
+ open tasks with a `BLOCKED` marker) and `verify` (`{ "verified", "failed", "missing" }` counts of
257
+ phases); each key is omitted when it does not apply (`blocked` when zero, `verify` when the
258
+ feature has no Verify lines). `attention` may contain items of kind `task-blocked` (key
259
+ `<feature>:<task id>`) and `verify-failed` (key `<feature>:phase-N`, reason `verify failed: <why>`).
260
+ When a fleet run is unfinished, the object also has `fleet` (run, feature, status, phase, stage,
261
+ round, limit, needsDecision, `gates[]`, `lanes[]` with state, stalled, lastActivity and directive
262
+ status, and `others[]`); without a run the key is absent, so the output is byte-identical to before
263
+ (`specs/029-fleet-control-room/contracts/dashboard-json-fleet.md`). Bare `--json` is unchanged.
212
264
 
213
265
  ```bash
214
266
  ambykit dashboard
@@ -236,6 +288,109 @@ missing flag is a warning, and the exit code is always 0.
236
288
  ambykit activity 017 --agent=claude --phase=implement --task=T014
237
289
  ```
238
290
 
291
+ For a fleet lane (feature 025) add `--lane=<lane>` (`lane-1-2`, `1-2` or the full name), `--state=working|waiting|blocked|paused|done`
292
+ and `--run=<id>`. A lane puts its short name in the marker's file name, `<feature>.<agent>~lane-1-2.json`, so two lanes of one
293
+ assistant never overwrite each other; the marker body gains `lane`, `state` and `run`. Without these flags the marker is
294
+ byte-for-byte what it was. It is the same core writer the `report_activity` MCP tool calls.
295
+
296
+ ## `ambykit mcp`
297
+
298
+ Serves AmbyKit's state tools to an assistant over MCP on stdio (see [the MCP server](./concepts/mcp-server.md)). The assistant
299
+ starts it from the project root or a lane worktree; you do not run it by hand. stdout carries protocol messages only. Set
300
+ `"mcp": { "enabled": true }` in `.amby/config.json` and run `ambykit sync` to write each verified assistant's MCP config.
301
+
302
+ ## `ambykit directive <feature> <lane> pause|resume|stop`
303
+
304
+ Tells a fleet lane to pause, resume (writes `continue`) or stop. The worker finishes its current task and obeys at its next
305
+ report. `--run=<id>` picks the run when several are unfinished. An unknown lane is refused by name. This is the one writer that
306
+ the prompts, the terminal and the dashboard all call.
307
+
308
+ ```bash
309
+ ambykit directive 025 lane-1-1 pause
310
+ ```
311
+
312
+ ## `ambykit fleet <start|status|update|claim|release|note|directive> <feature>`
313
+
314
+ The helper `/amby.run` and its workers call, so every change to a run goes through one validated path. It
315
+ keeps no state of its own: runs, claims, notes and directives are the fleet state under `.amby/fleet/<run>/`,
316
+ and stall detection is the same one the dashboard uses.
317
+
318
+ ```bash
319
+ ambykit fleet start 019 [--new] # create run 019-...N; refuses when one is unfinished unless --new
320
+ ambykit fleet status 019 [--run=<id>] [--json] [--rebuild]
321
+ ambykit fleet update 019 --worker-start=lane-1-1 --assistant=claude --tasks=T001,T002
322
+ ambykit fleet update 019 --stage=qa | --phase=2 | --round=2 | --decision="<text>" | --done
323
+ ambykit fleet update 019 --pause[=<lane>] | --resume[=<lane>] | --stop[=<lane>]
324
+ ambykit fleet update 019 --overlap=squad --lanes=a,b --shared=<path> --writer=<path>:<lane> --order=a,b
325
+ ambykit fleet claim 019 T012 src/a.ts [--worker=<id>] # refused, naming the owner, when held
326
+ ambykit fleet release 019 T012
327
+ ambykit fleet note 019 T012 --files=src/a.ts "one-line note"
328
+ ambykit fleet directive 019 lane-1-1 # prints continue, pause or stop
329
+ ```
330
+
331
+ `start` creates nothing for a feature that is already done or whose spec, plan or tasks are missing or draft.
332
+ `status` prints the run, the next phase, each lane (state, idle time, directive, restarts left), free slots
333
+ under `fleet.concurrency`, and warnings: damaged state, a checked task that still holds claims, a lane edit
334
+ with no claim. `--rebuild` rewrites a missing or corrupt `run.json` from `tasks.md` and never touches checked
335
+ tasks. `--worker-start` is refused when no slot is free; `--restart` is refused after `fleet.restartLimit`
336
+ restarts, pausing the lane and asking a person. `--round` prints `retry` or `escalate` and, on `escalate`,
337
+ waits for a decision. Pause, resume and stop go through the same writer as `ambykit directive`.
338
+
339
+ ## `ambykit run <feature>` (experimental)
340
+
341
+ Run a feature's **prepared lanes** headless: one assistant per lane, in that lane's worktree, supervised,
342
+ merged and reviewed, without a person at the keyboard. **Experimental in 1.6** (the flags and the runner
343
+ commands may change before it is stable in 2.0). Launching processes that edit code is the riskiest thing
344
+ AmbyKit does, so nothing starts without `--yes`, and an assistant without a **verified** runner is refused.
345
+
346
+ ```bash
347
+ ambykit run 028 # print the exact command for each lane, caps, budgets; launch nothing
348
+ ambykit run 028 --yes # print, then launch the lanes and supervise them to the end
349
+ ambykit run 028 --emit-script # write launch.sh and launch.ps1 under .amby/fleet/028-....scripts/; launch nothing
350
+ ambykit run 028 --yes --assistant=claude,codex --unattended --max-minutes=90 --max-tasks=20
351
+ ambykit run --continue-run=028-ambykit-run.1 --yes # continue a stopped or interrupted run
352
+ ambykit run --runners [--json] # the headless runners, what each can do, and why one is not runnable
353
+ ambykit run approve|reject <run> [--gate=<id>] [--reason=<text>]
354
+ ambykit run approve <run> --reassign=lane-1-1:codex # a person's approval to move a lane to another assistant
355
+ ```
356
+
357
+ - **Prepare first.** `ambykit lane <feature>` creates the lanes; `run` never creates or removes them. It runs
358
+ the prepared sets in ascending phase order and starts a run only on this explicit request, named
359
+ `<feature>.<n>`. A second `run` on a feature with an unfinished run refuses and points at `--continue-run`.
360
+ - **What a lane gets.** Its task IDs, the artifacts by `@path` reference, the files it owns and the report
361
+ protocol: nothing else is copied in. A restart lists only the tasks still unchecked.
362
+ - **Caps.** `fleet.concurrency` (default 3 in total, 2 of one assistant). Lanes beyond the cap start as slots free.
363
+ - **Stalls.** A lane with no report and no `tasks.md` change for `fleet.stallMinutes` (15) is stopped and restarted
364
+ with its work preserved, up to `fleet.restartLimit` (2) times; then it pauses and a person decides. Waiting,
365
+ blocked and paused lanes are never stalled. A lane moves to another assistant only with
366
+ `approve --reassign`.
367
+ - **Review before merge.** A finished lane is reviewed by QA, then the architect, each launched as a process of the
368
+ lane's assistant, using spec 019's verdict files (`verdicts/<lane>.<role>.<round>.json`). A failure goes back to
369
+ the same lane's worker as finding IDs only; after `fleet.roundLimit` (3) failed rounds a person is asked. A
370
+ lane whose phase **Verify** line failed is never merged.
371
+ - **Merges.** One lane at a time in name order, with the check-off-aware merge of `ambykit lane merge`. A real
372
+ conflict pauses that merge and the run waits; resolve it by hand and the run carries on. A lane that ends with
373
+ tasks open is `unfinished` and never merged.
374
+ - **Checkpoints.** When a prepared set completes a user story the run stops for `approve` (or `reject`) before
375
+ the next set starts, unless `--unattended` was given (shown at start). The gate lives in `run.json` `gates[]`;
376
+ the dashboard calls the same function. Non-parallel tasks of a phase are not run headless: the run reports
377
+ them and pauses.
378
+ - **Budgets.** Wall-clock (default 120 minutes) and task events (twice the open tasks) are always enforced; a
379
+ token ceiling (`--max-tokens`) only where the runner reports usage, and the run says so when it cannot. Going
380
+ over stops launching, writes a `stop` directive for each running lane, records why, and terminates a lane that
381
+ still has not reported after `fleet.stopGraceMinutes` (10).
382
+ - **Directives.** `ambykit directive` (or the dashboard, or `/amby.run`) pauses, resumes or stops a lane from any
383
+ host; the worker finishes its task and obeys at its next report, and the run records it. Ctrl-C saves and
384
+ exits; `--continue-run` carries on and repeats no completed task.
385
+ - **State** is `.amby/fleet/<run>/`, the same layout `/amby.run` uses, so either host can inspect, pause or
386
+ continue the other's run. Nothing is written outside the project.
387
+
388
+ `run` uses the single `fleet` object in `.amby/config.json` (`stallMinutes`, `restartLimit`, `concurrency`,
389
+ `roundLimit`, `tickSeconds`, `budgets`, `workerModel`) and adds two keys: `stopGraceMinutes` and `runners` (the
390
+ assistants lanes are spread over, in order; default the configured `tools`). Both headless runners start
391
+ **unverified** (see the matrix in `docs/tool-compatibility.md`), so `--yes` refuses them until each has been
392
+ confirmed on a live install.
393
+
239
394
  ## `ambykit analyze`
240
395
 
241
396
  Validate the story dependency graph, computed locally from `specs/` (no model tokens): detects
@@ -248,11 +403,105 @@ where at least one is `[P]`, are reported as **Lane conflicts** (by task id and
248
403
  non-zero. Open tasks with no usable path, or a glob, are listed as warnings and do not affect the
249
404
  exit code.
250
405
 
406
+ Also reports, as warnings only (the exit code never changes), what the task file says about itself:
407
+
408
+ - **Blocked tasks** — open tasks with a `BLOCKED: <reason>` marker, and **Deviations** — tasks with
409
+ a `DEVIATION: <note>` marker. A `BLOCKED` marker with no reason, or on a checked task, is a
410
+ **marker issue**.
411
+ - **Verify** — phases whose last recorded Verify result failed, and phases with no `**Verify:**`
412
+ line (only for features that still have open tasks, grouped per feature in text). Phases are named
413
+ `<feature>:phase-N`.
414
+
415
+ - **Test design** — for every feature that has a [`tests.md`](./artifacts/tests.md): unknown ids, requirements with no
416
+ case and no reason, criteria with neither case nor flag, duplicate case ids, bad or missing manual reasons, more
417
+ than 15 cases for a story and `[stale]` cases. Features without a `tests.md` print nothing.
418
+
419
+ In `--json` these are the keys `blockedTasks` (`feature`, `task`, `story`, `reason`), `deviations`
420
+ (`feature`, `task`, `note`), `markerIssues` (`feature`, `task`, `kind` `missing-reason` or
421
+ `checked-but-blocked` or `path-after-marker` (a `(file/path)` group after the marker), `message`) and `verifyIssues` (`feature`, `phase`, `title`, `kind` `missing`
422
+ or `failed`, `why` for failed). Each key is absent when it has no entries, so output for a project
423
+ without markers is unchanged.
424
+
425
+ Test design adds one more key, `testDesign`: `findings` (`feature`, `kind`, `message`, optional `ref` and `line`) and
426
+ `missing` (the features that have no `tests.md`). It is present only when at least one feature has a `tests.md`,
427
+ so a project without test design reports exactly what it did before.
428
+
251
429
  ```bash
252
430
  ambykit analyze
253
431
  ambykit analyze --json # includes lanes.conflicts and lanes.declarations
432
+ # plus blockedTasks, deviations, markerIssues, verifyIssues, testDesign when present
254
433
  ```
255
434
 
435
+ ## `ambykit graph [feature]`
436
+
437
+ Print the story and feature dependency graph, built once from `specs/` by the same code that `analyze`
438
+ and the dashboard use (no model tokens). A story's `depends-on`, `blocked-by` and `NNN:US-#`
439
+ references become **story edges** (kept as separate kinds); a story in feature A that depends on a story
440
+ in feature B gives a **feature edge** from A to B that records the story edges causing it. Dependencies
441
+ that name something that does not exist are **broken edges**; a dependency loop is a **cycle**. Both are
442
+ listed first and make the command exit **1**; otherwise it exits 0. With a feature (its number or
443
+ directory name) it shows only that feature and its direct neighbours, in both directions.
444
+
445
+ ```bash
446
+ ambykit graph # readable text
447
+ ambykit graph 023 # one feature and its direct neighbours
448
+ ambykit graph --json # versioned machine shape (below)
449
+ ambykit graph --mermaid # Mermaid flowchart: one subgraph per feature
450
+ ```
451
+
452
+ `--mermaid`: `A --> B` means A depends on B, a dashed `A -.-> B` means A is blocked by B, and a thick
453
+ arrow joins two feature subgraphs for each feature edge. The syntax is checked structurally; paste it
454
+ into a Mermaid renderer to view it.
455
+
456
+ `--json` has `version` (`1`) and the keys below. Fields are only ever added, never removed or renamed
457
+ (see `specs/023-dependency-graph/contracts/graph-json.md`).
458
+
459
+ | Key | Contents |
460
+ | --- | --- |
461
+ | `nodes[]` | `id` (`NNN:US-#`), `feature` (directory), `story`, `title`, `status`, `priority` |
462
+ | `edges[]` | `from`, `to` (node ids), `kind` (`depends-on` or `blocked-by`) |
463
+ | `featureEdges[]` | `from`, `to` (feature directories), `via[]` (the causing story edges) |
464
+ | `broken[]` | `from`, `to` (as written), `kind`, `reason` (`unknown-story` or `unknown-feature`) |
465
+ | `cycles[]` | each cycle as an ordered list of node ids; a self-dependency is a cycle of one |
466
+
467
+ Output is the same for the same files whatever the directory order.
468
+
469
+ ## `ambykit trace [feature] [--json] [--gate]`
470
+
471
+ Shows which requirements have tests, computed locally from `specs/` and your test files (no model
472
+ tokens, read-only). For each feature it lists every `FR-###` as covered (with the tests that cite it),
473
+ uncovered (with its text), or deliberately uncovered. It also lists **orphans** (tests citing an id that
474
+ exists in no spec), **ambiguous** bare ids, **skipped** tests that cite a requirement, and **uncited**
475
+ tests (no id in the name; the first 20 are shown, all are in `--json`). A feature argument is a number
476
+ or directory name and limits the report to that feature.
477
+
478
+ - `--json` prints the versioned shape in `specs/024-trace/contracts/trace-json.md`; fields are only
479
+ ever added.
480
+ - `--gate` exits 1 when any requirement is uncovered, else 0. Without it `trace` always exits 0.
481
+ - A requirement left without a test on purpose is not counted uncovered by the gate. Record it as one
482
+ line, `uncovered: FR-### — reason`, in the feature's `tests.md` (or, without a test design, in
483
+ `spec.md`).
484
+ - If a feature has a `tests.md` (spec 021), each designed `auto` case is reported `matched` or
485
+ `missing` and each `manual` case is listed as `manual`.
486
+ - Tests are found as `*.test.*` / `*.spec.*` files under the project, skipping `node_modules`, `dist`,
487
+ `coverage`, `.git`, `.worktrees`, `.amby` and `specs`. Override with
488
+ `"trace": { "roots": ["src"], "ignore": ["fixtures"] }` in `.amby/config.json`.
489
+
490
+ ### Citing requirements
491
+
492
+ A test covers a requirement when its name **begins** with the qualified id and a colon:
493
+
494
+ ```ts
495
+ it("019:FR-004: rejects an empty name", () => { … });
496
+ it("019:FR-004, 020:FR-001: shared behavior", () => { … }); // several ids
497
+ ```
498
+
499
+ - Use `NNN:FR-###` (feature number, then requirement). A bare `FR-004` never matches: it is reported
500
+ ambiguous when several features define it, otherwise unqualified.
501
+ - An id anywhere but the start (`… (FR-004)`) does not cite. `skip`/`todo` tests never cover.
502
+ - Only `it`/`test` titles are read: an id in a `describe(...)` name does not cite the tests beneath it,
503
+ and `.each` titles are not expanded.
504
+
256
505
  ## `ambykit check`
257
506
 
258
507
  Doctor: verify integrations are present and well-formed and that expected assistant CLIs are
@@ -0,0 +1,93 @@
1
+ # AmbyKit as an MCP server
2
+
3
+ `ambykit mcp` serves a few small tools over the Model Context Protocol (stdio), so an assistant can ask
4
+ for **state** (the next task, a story's blockers) instead of reading `tasks.md` and the spec, and can
5
+ change state through **one validated path** instead of editing files by hand. It runs locally, uses zero
6
+ model tokens, and is **opt-in**: nothing changes until you turn it on, and every phase prompt still works
7
+ from files when the server is absent.
8
+
9
+ ## Turning it on
10
+
11
+ Set it in `.amby/config.json` and run `ambykit sync`:
12
+
13
+ ```json
14
+ { "tools": ["claude"], "mcp": { "enabled": true } }
15
+ ```
16
+
17
+ `sync` then adds one entry, `ambykit`, to each enabled assistant's MCP config, keeping every other key and
18
+ server in that file as you wrote it (the file is backed up under `.amby/backups/` before it changes). The
19
+ server is started as `ambykit mcp`, so `ambykit` must be on your `PATH`; AmbyKit never writes an `npx` fetch.
20
+
21
+ Only formats confirmed in the vendor's documentation are written (sources in
22
+ `specs/025-mcp-server/research.md`, rows in [`tool-compatibility.md`](../tool-compatibility.md)):
23
+
24
+ | Assistant | File | Written |
25
+ |---|---|---|
26
+ | Claude Code | `.mcp.json` (`mcpServers`) | with `mcp.enabled` |
27
+ | Copilot (VS Code) | `.vscode/mcp.json` (`servers`) | with `mcp.enabled` |
28
+ | Cursor and Cursor CLI | `.cursor/mcp.json` (`mcpServers`) | with `mcp.enabled` |
29
+ | Antigravity CLI | `.agents/mcp_config.json` (`mcpServers`) | with `mcp.enabled` |
30
+ | Copilot CLI | `~/.copilot/mcp-config.json` (user level) | only with `ambykit sync --include-user`; never part of `sync --check` |
31
+ | OpenCode, Antigravity IDE, Codex and the rest | — | **not written**; `sync` names each one and why |
32
+
33
+ A config file that is not plain JSON (comments, trailing commas) is left untouched and reported.
34
+
35
+ ## The tools
36
+
37
+ All inputs are validated and published through `tools/list`. `feature` is the number (`025`) or the
38
+ directory name. Failures are `{ "error": … }` naming what was not found.
39
+
40
+ | Tool | What it returns or does |
41
+ |---|---|
42
+ | `next_task` | The next unchecked task whose story is not blocked and that is not marked BLOCKED: `{ id, text, paths[], story }`, or `{ none }` |
43
+ | `story_status` | `{ story, status, priority, blockers[] }` from the dependency graph |
44
+ | `lane_tasks` | A lane's tasks and checked state, capped at 40 |
45
+ | `lane_status` | A lane's state, whether it is **stalled**, and its directive |
46
+ | `analyze_report` | The findings of `ambykit analyze`, sliced to a feature and capped |
47
+ | `tick_task` | Checks off one task (one changed line); releases that task's file claims |
48
+ | `set_story_status` | Sets one story's status; refuses values outside `draft ready in-progress blocked done` |
49
+ | `report_activity` | Records what the assistant is doing; returns a directive. Never fails the agent |
50
+ | `claim_file` | Claims files for a task; refused, naming the owner, when another worker holds an overlapping path |
51
+ | `post_note` | Posts one `T### \| files \| text` line to the run's notes board |
52
+
53
+ An answer to `next_task` or `story_status` is under 1 KB.
54
+
55
+ ## Reporting and directives
56
+
57
+ A worker reports at the start of a task, at the end of a task, and whenever it is blocked or waiting. It
58
+ never reports on a timer and never reports progress. The reply carries a **directive** for its lane:
59
+ `continue`, `pause` or `stop`. On `pause` or `stop` the worker finishes the task it is on, then obeys at its
60
+ next report.
61
+
62
+ Any host can steer a lane through the same single writer:
63
+
64
+ ```bash
65
+ ambykit directive 025 lane-1-1 pause # or resume (writes continue) / stop
66
+ ```
67
+
68
+ A directive status is derived, never stored: **pause requested**, **paused**, **pending** or **obeyed**.
69
+
70
+ ## Runs and fleet state
71
+
72
+ Directives, claims, notes and the run record live in the **primary checkout** under
73
+ `.amby/fleet/<run>/` (git-ignored), so every lane worktree sees the same files. A run `<feature>.<n>` is
74
+ created only on explicit request; there is no implicit run. A report with no run still records the
75
+ activity marker and comes back with a warning, never a failure; with several unfinished runs the warning
76
+ names them and you pass `run`.
77
+
78
+ `fleet` in `.amby/config.json` holds the shared settings (defaults shown):
79
+
80
+ ```json
81
+ { "fleet": { "stallMinutes": 15, "restartLimit": 2, "concurrency": { "total": 3, "perType": 2 }, "roundLimit": 3 } }
82
+ ```
83
+
84
+ A lane is **stalled** when its state is `working` and it has made neither a report nor a change to its
85
+ `tasks.md` for `stallMinutes`. That limit is the fleet's own and is independent of the dashboard's idle limit.
86
+
87
+ ## Safety
88
+
89
+ - Edits are patches: `tick_task` and `set_story_status` change one line under a lockfile, re-parse the
90
+ result with the same parsers every other command uses, and refuse anything that would not read back.
91
+ - The server speaks the protocol on stdout only; diagnostics go to stderr.
92
+ - It supports the `initialize` handshake of the 2024-11-05 to 2025-11-25 revisions and the handshake-free
93
+ 2026-07-28 revision (`server/discover`).
@@ -48,3 +48,12 @@ run `ambykit sync` and include the regenerated files in your commit.
48
48
 
49
49
  - Keep changes small and focused; update docs and the compatibility matrix alongside code.
50
50
  - Ensure `npm run typecheck` and `npm test` pass before opening a PR.
51
+
52
+ ## Release checklist
53
+
54
+ - Move the `[Unreleased]` entries in `CHANGELOG.md` under the new version and bump `package.json`.
55
+ - **Plugins:** state in the changelog whether plugins are affected. A change to anything in
56
+ [`plugin-api.md`](./plugin-api.md) (extension points, the `PluginApi`, the matrix-row shape, the
57
+ `ambykit.pluginApi` range, `PLUGIN_API_VERSION`) gets a line starting `[plugin-api]`; otherwise write
58
+ "Plugins: not affected." If the API changed incompatibly, bump `PLUGIN_API_VERSION`.
59
+ - Run `npm run typecheck`, `npm test` and `ambykit sync --check`.
package/docs/index.md CHANGED
@@ -25,7 +25,7 @@ native format — Claude Code, OpenCode, GitHub Copilot (VS Code + CLI), Cursor
25
25
  ## Read next
26
26
 
27
27
  - [Getting started](./getting-started.md) — install and run your first feature.
28
- - [The workflow](./workflow.md) — the eleven phases in order.
28
+ - [The workflow](./workflow.md) — the twelve phases in order.
29
29
  - Concepts: [Spec-Driven Development](./concepts/spec-driven-development.md) ·
30
30
  [The constitution](./concepts/constitution.md)
31
31
  - Artifacts: [spec](./artifacts/spec.md) · [UI design](./artifacts/ui-design.md) ·
@@ -0,0 +1,124 @@
1
+ # Plugin API (experimental)
2
+
3
+ > **Experimental in 1.6.** The API may change in minor releases until it is frozen at 2.0. Plugins say
4
+ > which API range they support, and AmbyKit refuses a plugin outside it. Read
5
+ > [`plugin-trust.md`](./plugin-trust.md) before you install one: a plugin is code that runs on your
6
+ > machine.
7
+
8
+ A plugin adds **emitter targets**: a new assistant that `ambykit sync` writes native command files for.
9
+ Roles, phases and templates are not extensible yet (they ship in a later 1.x release).
10
+
11
+ ## What a plugin is
12
+
13
+ An npm package named `ambykit-emitter-<name>` (a scope is fine: `@acme/ambykit-emitter-foo`) whose
14
+ default export is a **factory**:
15
+
16
+ ```js
17
+ export default function (api) {
18
+ class MyEmitter extends api.BaseEmitter {
19
+ toolId = "mytool";
20
+ displayName = "My tool";
21
+ commandSurface = "commands";
22
+ commandDir = ".mytool/commands";
23
+ commandFrontmatter(spec) {
24
+ return [["description", this.yamlQuote(spec.description)]];
25
+ }
26
+ }
27
+ return { targets: [{ id: "mytool", displayName: "My tool", emitter: new MyEmitter() }] };
28
+ }
29
+ ```
30
+
31
+ The factory receives the **extension points** (below), so your classes always extend the running copy of
32
+ AmbyKit, never a second install next to your package. A plain object `{ targets: [...] }` is also
33
+ accepted; it cannot subclass anything, so it is only useful for an emitter written from scratch. A
34
+ working example with all three extension points is in
35
+ [`examples/ambykit-emitter-example/`](../examples/ambykit-emitter-example/).
36
+
37
+ `package.json` must carry the range of plugin API versions the plugin supports:
38
+
39
+ ```json
40
+ { "name": "ambykit-emitter-mytool", "version": "1.0.0", "type": "module",
41
+ "ambykit": { "pluginApi": "^1" },
42
+ "peerDependencies": { "@ambystech/ambykit": ">=1.6.0" } }
43
+ ```
44
+
45
+ The current API version is `1.0.0` (`PLUGIN_API_VERSION`). A plugin whose range does not contain it is
46
+ refused, and the message names the range it asked for and the version found. Ranges may use an exact
47
+ version, `^`, `~`, `>=`, `>`, `<=`, `<`, spaces (AND) and `||` (OR); anything else is refused.
48
+
49
+ ## Extension points
50
+
51
+ Import from `@ambystech/ambykit/plugin`, or take them from the factory's `api` argument.
52
+
53
+ - `BaseEmitter` — the shared emit logic. Set `toolId`, `displayName`, `commandSurface`, `commandDir`
54
+ and override only what differs: `commandFrontmatter`, `commandFileName`, `commandFilePath`,
55
+ `renderCommand`, `transformBody`, `generatedNotice`, `rulesFiles`, `roleFiles`.
56
+ - `SkillsEmitter` — for hosts whose commands are skills: one `<commandDir>/<name>/SKILL.md` per phase
57
+ with `name` and `description`.
58
+ - `TomlCommandEmitter` — for hosts whose commands are TOML: `description` and a multi-line `prompt`.
59
+ - `skillName`, `skillPath`, `skillFrontmatter` — the skills helpers, for an emitter that cannot extend
60
+ `SkillsEmitter`.
61
+ - `tomlBasic`, `tomlPrompt` — TOML string helpers.
62
+ - `PLUGIN_API_VERSION`, `PLUGIN_API_EXPERIMENTAL` — the API version and the experimental flag.
63
+
64
+ Types: `TargetDef`, `CommandSpec`, `CommandSurface`, `EmittedFile`, `RulesContext`, `Role`,
65
+ `PluginModule`, `PluginFactory`, `PluginApi`.
66
+
67
+ ## Options and guarantees
68
+
69
+ - **A target** is `{ id, displayName, emitter }`. `id` is what a person writes in `tools`. It must not
70
+ equal a built-in target's id or another plugin's; if it does, the plugin target is reported and **not
71
+ registered** (nothing is overridden).
72
+ - **Shape, not class.** AmbyKit checks an emitter has `toolId`, `displayName`, `commandSurface`
73
+ (`commands`, `skills`, `workflows` or `none`), `commandDir` and an `emit` function. It never uses
74
+ `instanceof`.
75
+ - **Files stay in the project.** Every `scope: "project"` file path must be relative and stay inside the
76
+ project root (no absolute path, no drive letter, no `..`); otherwise the whole sync fails and names the
77
+ plugin. A `scope: "user"` file (under the home directory) is written only with
78
+ `ambykit sync --include-user` and is never part of `sync --check`.
79
+ - **Deterministic output.** A second `sync` over the same plugins writes nothing. Do not put timestamps
80
+ or random values in emitted files.
81
+ - **Output collisions.** Two targets writing one path must write identical bytes, or the sync fails
82
+ naming both owners (and their plugins).
83
+ - **Failures are isolated.** A plugin that is missing, mis-pinned, out of range, malformed or throws on
84
+ load is reported with a reason; the other targets still sync, and `sync` exits 1.
85
+ - **What AmbyKit prints.** On every `sync`, each loaded plugin as `name@version` and a note that the
86
+ API is experimental.
87
+
88
+ ## Using a plugin
89
+
90
+ 1. `npm install --save-exact ambykit-emitter-mytool` in the project (it must be in the project's own
91
+ `node_modules`: nothing is searched in parent folders or globally).
92
+ 2. List it with the **exact** installed version in `.amby/config.json`, and add its target:
93
+
94
+ ```json
95
+ { "tools": ["claude", "mytool"], "plugins": { "ambykit-emitter-mytool": "1.0.0" } }
96
+ ```
97
+
98
+ 3. `ambykit sync`.
99
+
100
+ An unlisted package is never loaded, and a version that differs from the pin is refused.
101
+
102
+ ## Testing a plugin
103
+
104
+ `@ambystech/ambykit/testkit` checks an emitter against a **matrix row** (the host's documented paths and
105
+ frontmatter keys). See [`tool-compatibility.md`](./tool-compatibility.md#matrix-rows-for-plugins).
106
+
107
+ ```js
108
+ import { readFileSync } from "node:fs";
109
+ import { assertEmitterContract, createPluginApi } from "@ambystech/ambykit/testkit";
110
+ import factory from "./index.js";
111
+
112
+ const rows = JSON.parse(readFileSync(new URL("./matrix-rows.json", import.meta.url), "utf8"));
113
+ const { targets } = factory(createPluginApi());
114
+ for (const target of targets) assertEmitterContract(target, rows.find((r) => r.target === target.id));
115
+ ```
116
+
117
+ `assertEmitterContract(target, row)` (a row is a plain object, see below) throws one error listing every difference, so it works under any
118
+ test runner; `checkEmitterContract` returns them as a list. With no row, the check fails: a plugin
119
+ without a documented row for its host cannot pass.
120
+
121
+ ## Stability
122
+
123
+ - 1.6: experimental; `[plugin-api]` entries in `CHANGELOG.md` say whether a release affects plugins.
124
+ - 2.0: frozen under semver. A breaking change then needs a new major plugin API version.
@@ -0,0 +1,55 @@
1
+ # Core versus plugin: the target split
2
+
3
+ Which assistants stay in AmbyKit's core and which could become official plugins
4
+ (feature 027, FR-013). **No target is removed from the core in 1.6.** The plugin API ships first
5
+ ([`plugin-api.md`](./plugin-api.md)); this page records the evidence the 2.0 gate review uses to decide
6
+ what to extract (SC-007). If a target does move, the mechanism for telling a project is already in
7
+ `ambykit sync` (`src/core/moved-targets.ts`); nothing it wrote is deleted.
8
+
9
+ **Rule used for the starting classification** (plan open decision 3): the families the roadmap names
10
+ (Claude, Copilot, Cursor, OpenCode, Codex, Antigravity) are *built in*, and so are their sibling targets
11
+ (VS Code and CLI variants, and Pi, which reuses Codex's output). The later additions are *plugin
12
+ candidates*: Gemini CLI, LLxprt Code, Qwen Code, Kilo Code, Augment Code, Windsurf and Kiro.
13
+
14
+ ## The 18 targets
15
+
16
+ Churn is measured from git history of the target's emitter source file as of 2026-11-16: commits that
17
+ touched the file, the date it was added and the date of the last change. It counts **our own** edits too
18
+ (worker agents, MCP files, the skills surface), so it is an upper bound on upstream format churn, not a
19
+ count of it. Aliases share their parent's file.
20
+
21
+ | Target | Emitter | Status | Churn: commits · added · last change | Demand evidence |
22
+ |---|---|---|---|---|
23
+ | `claude` | `claude.ts` | built in | 8 · 2026-07-07 · 2026-11-16 | not collected |
24
+ | `claude-vscode` | alias of `claude` | built in (sibling) | same file as `claude` | not collected |
25
+ | `copilot` | `copilot.ts` | built in | 7 · 2026-07-07 · 2026-11-16 | not collected |
26
+ | `copilot-cli` | `copilot-cli.ts` | built in (sibling) | 4 · 2026-07-07 · 2026-11-16 | not collected |
27
+ | `opencode` | `opencode.ts` | built in | 5 · 2026-07-07 · 2026-11-16 | not collected |
28
+ | `cursor` | `cursor.ts` | built in | 4 · 2026-07-07 · 2026-11-16 | not collected |
29
+ | `cursor-cli` | `cursor-cli.ts` | built in (sibling) | 1 · 2026-07-07 · 2026-07-07 | not collected |
30
+ | `antigravity` | `antigravity.ts` | built in | 4 · 2026-07-07 · 2026-11-16 | not collected |
31
+ | `antigravity-cli` | `antigravity-cli.ts` | built in (sibling) | 3 · 2026-07-07 · 2026-11-16 | not collected |
32
+ | `codex` | `codex.ts` | built in | 2 · 2026-07-13 · 2026-11-03 | not collected |
33
+ | `gemini` | `gemini.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
34
+ | `llxprt` | `llxprt.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
35
+ | `qwen` | `qwen.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
36
+ | `kilo` | `kilo.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
37
+ | `augment` | `augment.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
38
+ | `windsurf` | `windsurf.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
39
+ | `kiro` | `kiro.ts` | plugin candidate | 1 · 2026-11-03 · 2026-11-03 | not collected |
40
+ | `pi` | alias of `codex` | built in (sibling) | same file as `codex` | not collected |
41
+
42
+ ## Demand evidence is a gap
43
+
44
+ AmbyKit has no usage telemetry (Principle 7), so **no demand evidence exists yet**. Before the 2.0 gate,
45
+ collect what can be collected without tracking people: issues and discussions naming each assistant,
46
+ requests for a new target, and (for any official plugin) the plugin's own package downloads. Record the
47
+ figures in the column above with the date and source; a row with no evidence stays *built in*.
48
+
49
+ ## Reviewing at the 2.0 gate
50
+
51
+ 1. Update the churn column from git history, and separate upstream format changes from our own edits.
52
+ 2. Fill the demand column and the date it was read.
53
+ 3. A candidate moves only if its churn is mostly upstream and its demand is low. Moving means: publish
54
+ the plugin, add its entry to `MOVED_TARGETS`, drop it from `TARGETS`, and record it in the changelog
55
+ with a `[plugin-api]` line.