@ambystech/ambykit 1.3.0 → 1.5.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 (367) hide show
  1. package/CHANGELOG.md +125 -1
  2. package/README.md +16 -4
  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.d.ts +1 -1
  9. package/dist/cli/analyze.js +83 -6
  10. package/dist/cli/analyze.js.map +1 -1
  11. package/dist/cli/base-command.js +12 -0
  12. package/dist/cli/base-command.js.map +1 -1
  13. package/dist/cli/check.js +36 -3
  14. package/dist/cli/check.js.map +1 -1
  15. package/dist/cli/dashboard.js +3 -1
  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 +9 -0
  29. package/dist/cli/io/fsops.js +70 -1
  30. package/dist/cli/io/fsops.js.map +1 -1
  31. package/dist/cli/lane.d.ts +20 -0
  32. package/dist/cli/lane.js +396 -0
  33. package/dist/cli/lane.js.map +1 -0
  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/sync.d.ts +9 -1
  38. package/dist/cli/sync.js +61 -7
  39. package/dist/cli/sync.js.map +1 -1
  40. package/dist/cli/trace.d.ts +14 -0
  41. package/dist/cli/trace.js +89 -0
  42. package/dist/cli/trace.js.map +1 -0
  43. package/dist/cli/ui/dashboard/feature-chart.js +15 -2
  44. package/dist/cli/ui/dashboard/feature-chart.js.map +1 -1
  45. package/dist/cli/ui/dashboard/feature-view.js +11 -1
  46. package/dist/cli/ui/dashboard/feature-view.js.map +1 -1
  47. package/dist/cli/ui/dashboard/graph-view.d.ts +44 -0
  48. package/dist/cli/ui/dashboard/graph-view.js +78 -0
  49. package/dist/cli/ui/dashboard/graph-view.js.map +1 -0
  50. package/dist/cli/ui/dashboard/help-overlay.d.ts +1 -1
  51. package/dist/cli/ui/dashboard/help-overlay.js +9 -0
  52. package/dist/cli/ui/dashboard/help-overlay.js.map +1 -1
  53. package/dist/cli/ui/dashboard/live-tokens.d.ts +221 -0
  54. package/dist/cli/ui/dashboard/live-tokens.js +221 -0
  55. package/dist/cli/ui/dashboard/live-tokens.js.map +1 -1
  56. package/dist/cli/ui/dashboard/quality-view.d.ts +8 -0
  57. package/dist/cli/ui/dashboard/quality-view.js +31 -0
  58. package/dist/cli/ui/dashboard/quality-view.js.map +1 -0
  59. package/dist/cli/ui/dashboard/story-detail.d.ts +1 -1
  60. package/dist/cli/ui/dashboard/story-detail.js +10 -3
  61. package/dist/cli/ui/dashboard/story-detail.js.map +1 -1
  62. package/dist/cli/ui/dashboard/tokens.d.ts +26 -0
  63. package/dist/cli/ui/dashboard/tokens.js +26 -0
  64. package/dist/cli/ui/dashboard/tokens.js.map +1 -1
  65. package/dist/cli/ui/dashboard/worktrees-panel.js +21 -3
  66. package/dist/cli/ui/dashboard/worktrees-panel.js.map +1 -1
  67. package/dist/cli/ui/interactive/live.js +3 -0
  68. package/dist/cli/ui/interactive/live.js.map +1 -1
  69. package/dist/cli/ui/interactive/overview.d.ts +13 -1
  70. package/dist/cli/ui/interactive/overview.js +62 -0
  71. package/dist/cli/ui/interactive/overview.js.map +1 -1
  72. package/dist/cli/ui/interactive/prompt.d.ts +17 -2
  73. package/dist/cli/ui/interactive/prompt.js +39 -9
  74. package/dist/cli/ui/interactive/prompt.js.map +1 -1
  75. package/dist/cli/ui/tool-options.d.ts +3 -2
  76. package/dist/cli/ui/tool-options.js +3 -3
  77. package/dist/cli/ui/tool-options.js.map +1 -1
  78. package/dist/cli/update.d.ts +1 -1
  79. package/dist/cli/update.js +8 -3
  80. package/dist/cli/update.js.map +1 -1
  81. package/dist/core/activity.d.ts +19 -2
  82. package/dist/core/activity.js +23 -7
  83. package/dist/core/activity.js.map +1 -1
  84. package/dist/core/agents.d.ts +1 -1
  85. package/dist/core/agents.js +9 -0
  86. package/dist/core/agents.js.map +1 -1
  87. package/dist/core/analyze.d.ts +86 -2
  88. package/dist/core/analyze.js +211 -63
  89. package/dist/core/analyze.js.map +1 -1
  90. package/dist/core/checkouts.d.ts +11 -0
  91. package/dist/core/checkouts.js +84 -10
  92. package/dist/core/checkouts.js.map +1 -1
  93. package/dist/core/config.d.ts +28 -1
  94. package/dist/core/config.js +44 -0
  95. package/dist/core/config.js.map +1 -1
  96. package/dist/core/dashboard.d.ts +17 -0
  97. package/dist/core/dashboard.js +29 -1
  98. package/dist/core/dashboard.js.map +1 -1
  99. package/dist/core/decisions.d.ts +60 -0
  100. package/dist/core/decisions.js +231 -0
  101. package/dist/core/decisions.js.map +1 -0
  102. package/dist/core/emit.d.ts +21 -1
  103. package/dist/core/emit.js +93 -4
  104. package/dist/core/emit.js.map +1 -1
  105. package/dist/core/features.js +6 -1
  106. package/dist/core/features.js.map +1 -1
  107. package/dist/core/fleet/claims.d.ts +45 -0
  108. package/dist/core/fleet/claims.js +85 -0
  109. package/dist/core/fleet/claims.js.map +1 -0
  110. package/dist/core/fleet/directives.d.ts +56 -0
  111. package/dist/core/fleet/directives.js +99 -0
  112. package/dist/core/fleet/directives.js.map +1 -0
  113. package/dist/core/fleet/flow-input.d.ts +6 -0
  114. package/dist/core/fleet/flow-input.js +35 -0
  115. package/dist/core/fleet/flow-input.js.map +1 -0
  116. package/dist/core/fleet/index.d.ts +9 -0
  117. package/dist/core/fleet/index.js +10 -0
  118. package/dist/core/fleet/index.js.map +1 -0
  119. package/dist/core/fleet/lane-status.d.ts +39 -0
  120. package/dist/core/fleet/lane-status.js +63 -0
  121. package/dist/core/fleet/lane-status.js.map +1 -0
  122. package/dist/core/fleet/lock.d.ts +23 -0
  123. package/dist/core/fleet/lock.js +103 -0
  124. package/dist/core/fleet/lock.js.map +1 -0
  125. package/dist/core/fleet/notes.d.ts +31 -0
  126. package/dist/core/fleet/notes.js +56 -0
  127. package/dist/core/fleet/notes.js.map +1 -0
  128. package/dist/core/fleet/run-flow.d.ts +157 -0
  129. package/dist/core/fleet/run-flow.js +205 -0
  130. package/dist/core/fleet/run-flow.js.map +1 -0
  131. package/dist/core/fleet/runs.d.ts +46 -0
  132. package/dist/core/fleet/runs.js +182 -0
  133. package/dist/core/fleet/runs.js.map +1 -0
  134. package/dist/core/fleet/types.d.ts +63 -0
  135. package/dist/core/fleet/types.js +11 -0
  136. package/dist/core/fleet/types.js.map +1 -0
  137. package/dist/core/graph-format.d.ts +51 -0
  138. package/dist/core/graph-format.js +99 -0
  139. package/dist/core/graph-format.js.map +1 -0
  140. package/dist/core/graph-paths.d.ts +27 -0
  141. package/dist/core/graph-paths.js +94 -0
  142. package/dist/core/graph-paths.js.map +1 -0
  143. package/dist/core/graph-scope.d.ts +7 -0
  144. package/dist/core/graph-scope.js +31 -0
  145. package/dist/core/graph-scope.js.map +1 -0
  146. package/dist/core/graph-types.d.ts +55 -0
  147. package/dist/core/graph-types.js +6 -0
  148. package/dist/core/graph-types.js.map +1 -0
  149. package/dist/core/graph.d.ts +14 -0
  150. package/dist/core/graph.js +144 -0
  151. package/dist/core/graph.js.map +1 -0
  152. package/dist/core/index.d.ts +13 -0
  153. package/dist/core/index.js +13 -0
  154. package/dist/core/index.js.map +1 -1
  155. package/dist/core/lanes.d.ts +116 -0
  156. package/dist/core/lanes.js +225 -0
  157. package/dist/core/lanes.js.map +1 -0
  158. package/dist/core/legacy.d.ts +10 -0
  159. package/dist/core/legacy.js +35 -0
  160. package/dist/core/legacy.js.map +1 -0
  161. package/dist/core/markers.d.ts +44 -0
  162. package/dist/core/markers.js +139 -0
  163. package/dist/core/markers.js.map +1 -0
  164. package/dist/core/merge-json.d.ts +15 -0
  165. package/dist/core/merge-json.js +46 -0
  166. package/dist/core/merge-json.js.map +1 -0
  167. package/dist/core/moved-targets.d.ts +23 -0
  168. package/dist/core/moved-targets.js +23 -0
  169. package/dist/core/moved-targets.js.map +1 -0
  170. package/dist/core/overview-types.d.ts +42 -2
  171. package/dist/core/overview-types.js.map +1 -1
  172. package/dist/core/overview.d.ts +1 -1
  173. package/dist/core/overview.js +93 -74
  174. package/dist/core/overview.js.map +1 -1
  175. package/dist/core/path-guard.d.ts +5 -0
  176. package/dist/core/path-guard.js +9 -0
  177. package/dist/core/path-guard.js.map +1 -0
  178. package/dist/core/paths.d.ts +2 -0
  179. package/dist/core/paths.js +4 -0
  180. package/dist/core/paths.js.map +1 -1
  181. package/dist/core/query.d.ts +91 -0
  182. package/dist/core/query.js +197 -0
  183. package/dist/core/query.js.map +1 -0
  184. package/dist/core/report.d.ts +36 -0
  185. package/dist/core/report.js +62 -0
  186. package/dist/core/report.js.map +1 -0
  187. package/dist/core/rules.js +5 -2
  188. package/dist/core/rules.js.map +1 -1
  189. package/dist/core/scaffold.d.ts +2 -2
  190. package/dist/core/scaffold.js +3 -1
  191. package/dist/core/scaffold.js.map +1 -1
  192. package/dist/core/subagents.d.ts +29 -0
  193. package/dist/core/subagents.js +52 -0
  194. package/dist/core/subagents.js.map +1 -0
  195. package/dist/core/tasks-edit.d.ts +34 -0
  196. package/dist/core/tasks-edit.js +115 -0
  197. package/dist/core/tasks-edit.js.map +1 -0
  198. package/dist/core/test-design.d.ts +94 -0
  199. package/dist/core/test-design.js +325 -0
  200. package/dist/core/test-design.js.map +1 -0
  201. package/dist/core/trace-cite.d.ts +16 -0
  202. package/dist/core/trace-cite.js +24 -0
  203. package/dist/core/trace-cite.js.map +1 -0
  204. package/dist/core/trace-coverage.d.ts +8 -0
  205. package/dist/core/trace-coverage.js +40 -0
  206. package/dist/core/trace-coverage.js.map +1 -0
  207. package/dist/core/trace-design.d.ts +6 -0
  208. package/dist/core/trace-design.js +16 -0
  209. package/dist/core/trace-design.js.map +1 -0
  210. package/dist/core/trace-io.d.ts +14 -0
  211. package/dist/core/trace-io.js +97 -0
  212. package/dist/core/trace-io.js.map +1 -0
  213. package/dist/core/trace-requirements.d.ts +9 -0
  214. package/dist/core/trace-requirements.js +27 -0
  215. package/dist/core/trace-requirements.js.map +1 -0
  216. package/dist/core/trace-tests.d.ts +7 -0
  217. package/dist/core/trace-tests.js +27 -0
  218. package/dist/core/trace-tests.js.map +1 -0
  219. package/dist/core/trace-types.d.ts +81 -0
  220. package/dist/core/trace-types.js +3 -0
  221. package/dist/core/trace-types.js.map +1 -0
  222. package/dist/core/trace.d.ts +18 -0
  223. package/dist/core/trace.js +109 -0
  224. package/dist/core/trace.js.map +1 -0
  225. package/dist/core/types.d.ts +48 -1
  226. package/dist/core/worktree.d.ts +8 -0
  227. package/dist/core/worktree.js +19 -1
  228. package/dist/core/worktree.js.map +1 -1
  229. package/dist/emitters/antigravity-cli.d.ts +7 -2
  230. package/dist/emitters/antigravity-cli.js +11 -2
  231. package/dist/emitters/antigravity-cli.js.map +1 -1
  232. package/dist/emitters/antigravity.d.ts +14 -9
  233. package/dist/emitters/antigravity.js +16 -10
  234. package/dist/emitters/antigravity.js.map +1 -1
  235. package/dist/emitters/augment.d.ts +14 -0
  236. package/dist/emitters/augment.js +20 -0
  237. package/dist/emitters/augment.js.map +1 -0
  238. package/dist/emitters/base-emitter.d.ts +34 -0
  239. package/dist/emitters/base-emitter.js +50 -3
  240. package/dist/emitters/base-emitter.js.map +1 -1
  241. package/dist/emitters/claude.d.ts +12 -2
  242. package/dist/emitters/claude.js +34 -5
  243. package/dist/emitters/claude.js.map +1 -1
  244. package/dist/emitters/codex.d.ts +2 -9
  245. package/dist/emitters/codex.js +2 -19
  246. package/dist/emitters/codex.js.map +1 -1
  247. package/dist/emitters/copilot-cli.d.ts +7 -3
  248. package/dist/emitters/copilot-cli.js +12 -8
  249. package/dist/emitters/copilot-cli.js.map +1 -1
  250. package/dist/emitters/copilot.d.ts +5 -0
  251. package/dist/emitters/copilot.js +23 -1
  252. package/dist/emitters/copilot.js.map +1 -1
  253. package/dist/emitters/cursor.d.ts +3 -0
  254. package/dist/emitters/cursor.js +8 -1
  255. package/dist/emitters/cursor.js.map +1 -1
  256. package/dist/emitters/gemini.d.ts +14 -0
  257. package/dist/emitters/gemini.js +19 -0
  258. package/dist/emitters/gemini.js.map +1 -0
  259. package/dist/emitters/index.d.ts +28 -2
  260. package/dist/emitters/index.js +55 -4
  261. package/dist/emitters/index.js.map +1 -1
  262. package/dist/emitters/kilo.d.ts +14 -0
  263. package/dist/emitters/kilo.js +17 -0
  264. package/dist/emitters/kilo.js.map +1 -0
  265. package/dist/emitters/kiro.d.ts +12 -0
  266. package/dist/emitters/kiro.js +14 -0
  267. package/dist/emitters/kiro.js.map +1 -0
  268. package/dist/emitters/llxprt.d.ts +13 -0
  269. package/dist/emitters/llxprt.js +18 -0
  270. package/dist/emitters/llxprt.js.map +1 -0
  271. package/dist/emitters/opencode.d.ts +8 -0
  272. package/dist/emitters/opencode.js +23 -0
  273. package/dist/emitters/opencode.js.map +1 -1
  274. package/dist/emitters/qwen.d.ts +15 -0
  275. package/dist/emitters/qwen.js +23 -0
  276. package/dist/emitters/qwen.js.map +1 -0
  277. package/dist/emitters/skills-emitter.d.ts +21 -0
  278. package/dist/emitters/skills-emitter.js +39 -0
  279. package/dist/emitters/skills-emitter.js.map +1 -0
  280. package/dist/emitters/toml-command-emitter.d.ts +29 -0
  281. package/dist/emitters/toml-command-emitter.js +69 -0
  282. package/dist/emitters/toml-command-emitter.js.map +1 -0
  283. package/dist/emitters/windsurf.d.ts +16 -0
  284. package/dist/emitters/windsurf.js +21 -0
  285. package/dist/emitters/windsurf.js.map +1 -0
  286. package/dist/index.d.ts +5 -0
  287. package/dist/index.js +4 -0
  288. package/dist/index.js.map +1 -1
  289. package/dist/mcp/protocol.d.ts +44 -0
  290. package/dist/mcp/protocol.js +114 -0
  291. package/dist/mcp/protocol.js.map +1 -0
  292. package/dist/mcp/registry.d.ts +40 -0
  293. package/dist/mcp/registry.js +44 -0
  294. package/dist/mcp/registry.js.map +1 -0
  295. package/dist/mcp/server.d.ts +7 -0
  296. package/dist/mcp/server.js +14 -0
  297. package/dist/mcp/server.js.map +1 -0
  298. package/dist/mcp/tools/common.d.ts +12 -0
  299. package/dist/mcp/tools/common.js +12 -0
  300. package/dist/mcp/tools/common.js.map +1 -0
  301. package/dist/mcp/tools/fleet.d.ts +10 -0
  302. package/dist/mcp/tools/fleet.js +102 -0
  303. package/dist/mcp/tools/fleet.js.map +1 -0
  304. package/dist/mcp/tools/index.d.ts +3 -0
  305. package/dist/mcp/tools/index.js +13 -0
  306. package/dist/mcp/tools/index.js.map +1 -0
  307. package/dist/mcp/tools/read.d.ts +6 -0
  308. package/dist/mcp/tools/read.js +62 -0
  309. package/dist/mcp/tools/read.js.map +1 -0
  310. package/dist/mcp/tools/write.d.ts +6 -0
  311. package/dist/mcp/tools/write.js +34 -0
  312. package/dist/mcp/tools/write.js.map +1 -0
  313. package/dist/plugins/api.d.ts +39 -0
  314. package/dist/plugins/api.js +28 -0
  315. package/dist/plugins/api.js.map +1 -0
  316. package/dist/plugins/index.d.ts +11 -0
  317. package/dist/plugins/index.js +9 -0
  318. package/dist/plugins/index.js.map +1 -0
  319. package/dist/plugins/loader.d.ts +35 -0
  320. package/dist/plugins/loader.js +117 -0
  321. package/dist/plugins/loader.js.map +1 -0
  322. package/dist/plugins/manifest.d.ts +21 -0
  323. package/dist/plugins/manifest.js +53 -0
  324. package/dist/plugins/manifest.js.map +1 -0
  325. package/dist/plugins/registry.d.ts +36 -0
  326. package/dist/plugins/registry.js +30 -0
  327. package/dist/plugins/registry.js.map +1 -0
  328. package/dist/plugins/report.d.ts +9 -0
  329. package/dist/plugins/report.js +19 -0
  330. package/dist/plugins/report.js.map +1 -0
  331. package/dist/plugins/semver.d.ts +23 -0
  332. package/dist/plugins/semver.js +106 -0
  333. package/dist/plugins/semver.js.map +1 -0
  334. package/dist/plugins/session.d.ts +18 -0
  335. package/dist/plugins/session.js +22 -0
  336. package/dist/plugins/session.js.map +1 -0
  337. package/dist/testkit/contract.d.ts +33 -0
  338. package/dist/testkit/contract.js +118 -0
  339. package/dist/testkit/contract.js.map +1 -0
  340. package/dist/testkit/index.d.ts +15 -0
  341. package/dist/testkit/index.js +15 -0
  342. package/dist/testkit/index.js.map +1 -0
  343. package/docs/architecture.md +34 -6
  344. package/docs/artifacts/decision-record.md +54 -0
  345. package/docs/artifacts/tasks.md +37 -0
  346. package/docs/artifacts/tests.md +43 -0
  347. package/docs/cli-reference.md +224 -7
  348. package/docs/concepts/mcp-server.md +93 -0
  349. package/docs/contributing.md +9 -0
  350. package/docs/index.md +2 -2
  351. package/docs/plugin-api.md +124 -0
  352. package/docs/plugin-split.md +55 -0
  353. package/docs/plugin-trust.md +51 -0
  354. package/docs/tool-compatibility.md +155 -18
  355. package/docs/workflow.md +66 -5
  356. package/package.json +5 -2
  357. package/src/agents/worker.md +37 -0
  358. package/src/prompts/converge.md +8 -3
  359. package/src/prompts/decide.md +31 -0
  360. package/src/prompts/implement.md +17 -8
  361. package/src/prompts/revise.md +4 -2
  362. package/src/prompts/run.md +100 -0
  363. package/src/prompts/tasks.md +16 -4
  364. package/src/roles/security.md +17 -0
  365. package/src/templates/adr.md +29 -0
  366. package/src/templates/tasks.md +8 -1
  367. package/src/templates/tests.md +29 -0
@@ -52,7 +52,13 @@ npx @ambystech/ambykit init --dry-run # preview merges, write nothing
52
52
  Add or refresh integration for one or more targets (see [tool compatibility](./tool-compatibility.md)
53
53
  for target names). On an interactive terminal, running it with **no target** opens a multi-select
54
54
  prompt (`space` toggle, `enter` confirm, `esc` cancel); non-interactively it errors with the list of
55
- available targets instead of blocking. `init` behaves the same when `--tools` is omitted.
55
+ available targets instead of blocking. `init` behaves the same when `--tools` is omitted. The
56
+ selector scrolls when the list is taller than the terminal (`↑ n more` / `↓ n more`).
57
+
58
+ Target ids: `claude`, `claude-vscode`, `copilot`, `copilot-cli`, `opencode`, `cursor`, `cursor-cli`,
59
+ `antigravity`, `antigravity-cli`, `codex`, `gemini`, `llxprt`, `qwen`, `kilo`, `augment`, `windsurf`,
60
+ `kiro`, `pi`. Targets that share an emitter (for example `codex` and `pi`) write their files once;
61
+ `ambykit check` names the owners of each shared output.
56
62
 
57
63
  ```bash
58
64
  ambykit add cursor claude
@@ -71,13 +77,43 @@ running it keeps your agent docs current without a full re-init.
71
77
  ```bash
72
78
  ambykit sync
73
79
  ambykit sync --dry-run
80
+ ambykit sync --prune-legacy
74
81
  ```
75
82
 
83
+ **Antigravity migration.** Antigravity retired workflows on 2026-10-19; the `antigravity` and
84
+ `antigravity-cli` targets now write skills (`.agents/skills/amby-*/SKILL.md`, the same files Codex and Pi
85
+ write). Workflow files that an earlier release generated at `.agents/workflows/amby.<phase>.md` are left
86
+ in place and reported; `--prune-legacy` backs each up under `.amby/backups/` and removes only the ones
87
+ that carry AmbyKit's generated notice (your own workflows are never touched; `ambykit restore <file>`
88
+ brings one back). `sync` never overwrites an existing skill file that AmbyKit did not generate. When
89
+ several targets write one skill file it is written once and reports one assistant id (`codex`, then
90
+ `antigravity`, then `antigravity-cli`).
91
+
76
92
  Also installs any newly shipped templates, reference docs, and **roles** into `.amby/` (write-if-absent —
77
93
  your edits are kept), warns when a role in `.amby/roles/` exceeds 150 words, and refuses to emit
78
94
  when two roles share an id. Projects with roles get one native sub-agent per role for Claude Code,
79
95
  OpenCode, and Copilot.
80
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
+
81
117
  ## `ambykit restore [file]`
82
118
 
83
119
  Recover an agent-doc file (`AGENTS.md`, `CLAUDE.md`, a tool's rules file) from the timestamped backup
@@ -109,6 +145,29 @@ branch is already merged. Opt in to automatic creation from `/amby.specify` by a
109
145
  `ambykit init`, or set `"worktrees": true` in `.amby/config.json`. Inside a worktree, phases resolve
110
146
  "the current feature" from the directory name.
111
147
 
148
+ ## `ambykit lane <feature> | list | remove <feature> [<lane>] | merge <feature> [<lane>]`
149
+
150
+ **Parallel lanes**: split one phase's `[P]` tasks into isolated worktrees that cannot touch the same
151
+ files, then merge them back. Lane `k` of phase `p` is the worktree and branch
152
+ `.worktrees/<feature>.lane-<p>-<k>`, created from the feature branch. Each lane holds a manifest
153
+ (`.amby/lane/lane.json`, self-ignoring) listing only its tasks. Zero model tokens. Requires
154
+ `"worktrees": true` in `.amby/config.json`.
155
+
156
+ ```bash
157
+ ambykit lane 015-slug # 2 lanes from the first phase with open [P] tasks
158
+ ambykit lane 015-slug --phase=3 --lanes=3 # choose the phase and lane count
159
+ ambykit lane list [015-slug] # tasks, done/total, clean/dirty/merged, drift
160
+ ambykit lane merge 015-slug [3-1] # merge finished lanes into the feature branch
161
+ ambykit lane remove 015-slug [3-1] [--force] # remove working copies (branches are kept)
162
+ ```
163
+
164
+ Tasks are dealt round-robin in task order. Creating is refused when the phase has path conflicts
165
+ (see `ambykit analyze`) and is a no-op when the lanes already exist. `merge` runs in the feature's
166
+ checkout, which must be clean. Check-offs that land on adjacent `tasks.md` lines are resolved
167
+ automatically (a box is ticked if either side ticked it); any other conflict aborts that lane's merge
168
+ and leaves the checkout clean. `list` reports **drift** when a lane task is missing from, or has
169
+ different paths in, the feature's current `tasks.md`.
170
+
112
171
  ## `ambykit dashboard [story-id]`
113
172
 
114
173
  Progress view over the story/task graph, computed locally from `specs/*/` files and, for the
@@ -134,25 +193,31 @@ Detection reads the process list only, never sends anything, and stops when you
134
193
  it reads without color);
135
194
  - **Attention** — dependency cycles and unknown references first, then blocked stories (status
136
195
  `blocked`, or a `blocked-by` story that is not done), then stories waiting on an unfinished
137
- `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`);
138
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;
139
200
  - **burndown** — remaining vs. done tasks per day/week/month from the git history of `tasks.md`
140
201
  (the last column is your working tree); shows "No history available" outside a git repo;
141
202
  - **feature completion** — one row per feature with its bar, workflow phase (specified → designed →
142
203
  planned → tasked → implementing → done) and open `[NEEDS CLARIFICATION]` count. A feature with no
143
- `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.
144
206
 
145
207
  Unreadable files are skipped and named in a notice line. Off a TTY (pipes, CI) the same content is
146
208
  printed as plain text.
147
209
  - **`--feature=X`** — the feature view for one feature (`X` is its number, e.g. `014`, or its
148
210
  directory name): artifacts present, open clarifications, status, the story table with a
149
- `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.
150
214
  - **`--status=X`** — narrow every widget to stories with that status.
151
215
  - **`--stories`** — the previous story table (`Feat | Story | description | progress | status |
152
216
  priority | blocked-by`) with an overall roll-up.
153
217
  - **`story-id`** — detail for one story. Story ids **restart per feature**, so a bare `US-3` may
154
218
  match several; qualify it with the feature ref as `NNN:US-3` (also accepts `NNN/US-3`). A bare id
155
- 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.
156
221
  - **`--interactive`** — the overview full screen (TTY only): `tab` moves focus between Attention, Up
157
222
  next, Worktrees & agents and Feature completion, `↑`/`↓` move, `enter` opens the feature view and,
158
223
  from there, the story detail (tasks, relations, checkout and agent). `esc` goes back (on the
@@ -169,7 +234,12 @@ Detection reads the process list only, never sends anything, and stops when you
169
234
  - **`--json --overview`** — one object: `stories` (exactly the `--json` list) plus `summary`,
170
235
  `statusCounts`, `features`, `attention`, `upNext`, `burndown`, `issues` and the applied `filters`.
171
236
  Each feature has a `checkout`: `{ "kind": "main" }`, or
172
- `{ "kind": "worktree", "branch", "dirty", "stale" }`.
237
+ `{ "kind": "worktree", "branch", "dirty", "stale" }`. A feature also has `blocked` (number of
238
+ open tasks with a `BLOCKED` marker) and `verify` (`{ "verified", "failed", "missing" }` counts of
239
+ phases); each key is omitted when it does not apply (`blocked` when zero, `verify` when the
240
+ feature has no Verify lines). `attention` may contain items of kind `task-blocked` (key
241
+ `<feature>:<task id>`) and `verify-failed` (key `<feature>:phase-N`, reason `verify failed: <why>`).
242
+ Bare `--json` is unchanged.
173
243
 
174
244
  ```bash
175
245
  ambykit dashboard
@@ -197,6 +267,54 @@ missing flag is a warning, and the exit code is always 0.
197
267
  ambykit activity 017 --agent=claude --phase=implement --task=T014
198
268
  ```
199
269
 
270
+ For a fleet lane (feature 025) add `--lane=<lane>` (`lane-1-2`, `1-2` or the full name), `--state=working|waiting|blocked|paused|done`
271
+ 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
272
+ assistant never overwrite each other; the marker body gains `lane`, `state` and `run`. Without these flags the marker is
273
+ byte-for-byte what it was. It is the same core writer the `report_activity` MCP tool calls.
274
+
275
+ ## `ambykit mcp`
276
+
277
+ Serves AmbyKit's state tools to an assistant over MCP on stdio (see [the MCP server](./concepts/mcp-server.md)). The assistant
278
+ starts it from the project root or a lane worktree; you do not run it by hand. stdout carries protocol messages only. Set
279
+ `"mcp": { "enabled": true }` in `.amby/config.json` and run `ambykit sync` to write each verified assistant's MCP config.
280
+
281
+ ## `ambykit directive <feature> <lane> pause|resume|stop`
282
+
283
+ Tells a fleet lane to pause, resume (writes `continue`) or stop. The worker finishes its current task and obeys at its next
284
+ report. `--run=<id>` picks the run when several are unfinished. An unknown lane is refused by name. This is the one writer that
285
+ the prompts, the terminal and the dashboard all call.
286
+
287
+ ```bash
288
+ ambykit directive 025 lane-1-1 pause
289
+ ```
290
+
291
+ ## `ambykit fleet <start|status|update|claim|release|note|directive> <feature>`
292
+
293
+ The helper `/amby.run` and its workers call, so every change to a run goes through one validated path. It
294
+ keeps no state of its own: runs, claims, notes and directives are the fleet state under `.amby/fleet/<run>/`,
295
+ and stall detection is the same one the dashboard uses.
296
+
297
+ ```bash
298
+ ambykit fleet start 019 [--new] # create run 019-...N; refuses when one is unfinished unless --new
299
+ ambykit fleet status 019 [--run=<id>] [--json] [--rebuild]
300
+ ambykit fleet update 019 --worker-start=lane-1-1 --assistant=claude --tasks=T001,T002
301
+ ambykit fleet update 019 --stage=qa | --phase=2 | --round=2 | --decision="<text>" | --done
302
+ ambykit fleet update 019 --pause[=<lane>] | --resume[=<lane>] | --stop[=<lane>]
303
+ ambykit fleet update 019 --overlap=squad --lanes=a,b --shared=<path> --writer=<path>:<lane> --order=a,b
304
+ ambykit fleet claim 019 T012 src/a.ts [--worker=<id>] # refused, naming the owner, when held
305
+ ambykit fleet release 019 T012
306
+ ambykit fleet note 019 T012 --files=src/a.ts "one-line note"
307
+ ambykit fleet directive 019 lane-1-1 # prints continue, pause or stop
308
+ ```
309
+
310
+ `start` creates nothing for a feature that is already done or whose spec, plan or tasks are missing or draft.
311
+ `status` prints the run, the next phase, each lane (state, idle time, directive, restarts left), free slots
312
+ under `fleet.concurrency`, and warnings: damaged state, a checked task that still holds claims, a lane edit
313
+ with no claim. `--rebuild` rewrites a missing or corrupt `run.json` from `tasks.md` and never touches checked
314
+ tasks. `--worker-start` is refused when no slot is free; `--restart` is refused after `fleet.restartLimit`
315
+ restarts, pausing the lane and asking a person. `--round` prints `retry` or `escalate` and, on `escalate`,
316
+ waits for a decision. Pause, resume and stop go through the same writer as `ambykit directive`.
317
+
200
318
  ## `ambykit analyze`
201
319
 
202
320
  Validate the story dependency graph, computed locally from `specs/` (no model tokens): detects
@@ -204,11 +322,110 @@ Validate the story dependency graph, computed locally from `specs/` (no model to
204
322
  stories and **orphans** (stories with no tasks). Exits non-zero on structural errors, so it can gate
205
323
  CI. Complements the generative `/amby.analyze` phase.
206
324
 
325
+ Also checks **lane ownership**: open tasks in the same phase that declare overlapping file paths,
326
+ where at least one is `[P]`, are reported as **Lane conflicts** (by task id and path) and exit
327
+ non-zero. Open tasks with no usable path, or a glob, are listed as warnings and do not affect the
328
+ exit code.
329
+
330
+ Also reports, as warnings only (the exit code never changes), what the task file says about itself:
331
+
332
+ - **Blocked tasks** — open tasks with a `BLOCKED: <reason>` marker, and **Deviations** — tasks with
333
+ a `DEVIATION: <note>` marker. A `BLOCKED` marker with no reason, or on a checked task, is a
334
+ **marker issue**.
335
+ - **Verify** — phases whose last recorded Verify result failed, and phases with no `**Verify:**`
336
+ line (only for features that still have open tasks, grouped per feature in text). Phases are named
337
+ `<feature>:phase-N`.
338
+
339
+ - **Test design** — for every feature that has a [`tests.md`](./artifacts/tests.md): unknown ids, requirements with no
340
+ case and no reason, criteria with neither case nor flag, duplicate case ids, bad or missing manual reasons, more
341
+ than 15 cases for a story and `[stale]` cases. Features without a `tests.md` print nothing.
342
+
343
+ In `--json` these are the keys `blockedTasks` (`feature`, `task`, `story`, `reason`), `deviations`
344
+ (`feature`, `task`, `note`), `markerIssues` (`feature`, `task`, `kind` `missing-reason` or
345
+ `checked-but-blocked` or `path-after-marker` (a `(file/path)` group after the marker), `message`) and `verifyIssues` (`feature`, `phase`, `title`, `kind` `missing`
346
+ or `failed`, `why` for failed). Each key is absent when it has no entries, so output for a project
347
+ without markers is unchanged.
348
+
349
+ Test design adds one more key, `testDesign`: `findings` (`feature`, `kind`, `message`, optional `ref` and `line`) and
350
+ `missing` (the features that have no `tests.md`). It is present only when at least one feature has a `tests.md`,
351
+ so a project without test design reports exactly what it did before.
352
+
207
353
  ```bash
208
354
  ambykit analyze
209
- ambykit analyze --json
355
+ ambykit analyze --json # includes lanes.conflicts and lanes.declarations
356
+ # plus blockedTasks, deviations, markerIssues, verifyIssues, testDesign when present
357
+ ```
358
+
359
+ ## `ambykit graph [feature]`
360
+
361
+ Print the story and feature dependency graph, built once from `specs/` by the same code that `analyze`
362
+ and the dashboard use (no model tokens). A story's `depends-on`, `blocked-by` and `NNN:US-#`
363
+ references become **story edges** (kept as separate kinds); a story in feature A that depends on a story
364
+ in feature B gives a **feature edge** from A to B that records the story edges causing it. Dependencies
365
+ that name something that does not exist are **broken edges**; a dependency loop is a **cycle**. Both are
366
+ listed first and make the command exit **1**; otherwise it exits 0. With a feature (its number or
367
+ directory name) it shows only that feature and its direct neighbours, in both directions.
368
+
369
+ ```bash
370
+ ambykit graph # readable text
371
+ ambykit graph 023 # one feature and its direct neighbours
372
+ ambykit graph --json # versioned machine shape (below)
373
+ ambykit graph --mermaid # Mermaid flowchart: one subgraph per feature
210
374
  ```
211
375
 
376
+ `--mermaid`: `A --> B` means A depends on B, a dashed `A -.-> B` means A is blocked by B, and a thick
377
+ arrow joins two feature subgraphs for each feature edge. The syntax is checked structurally; paste it
378
+ into a Mermaid renderer to view it.
379
+
380
+ `--json` has `version` (`1`) and the keys below. Fields are only ever added, never removed or renamed
381
+ (see `specs/023-dependency-graph/contracts/graph-json.md`).
382
+
383
+ | Key | Contents |
384
+ | --- | --- |
385
+ | `nodes[]` | `id` (`NNN:US-#`), `feature` (directory), `story`, `title`, `status`, `priority` |
386
+ | `edges[]` | `from`, `to` (node ids), `kind` (`depends-on` or `blocked-by`) |
387
+ | `featureEdges[]` | `from`, `to` (feature directories), `via[]` (the causing story edges) |
388
+ | `broken[]` | `from`, `to` (as written), `kind`, `reason` (`unknown-story` or `unknown-feature`) |
389
+ | `cycles[]` | each cycle as an ordered list of node ids; a self-dependency is a cycle of one |
390
+
391
+ Output is the same for the same files whatever the directory order.
392
+
393
+ ## `ambykit trace [feature] [--json] [--gate]`
394
+
395
+ Shows which requirements have tests, computed locally from `specs/` and your test files (no model
396
+ tokens, read-only). For each feature it lists every `FR-###` as covered (with the tests that cite it),
397
+ uncovered (with its text), or deliberately uncovered. It also lists **orphans** (tests citing an id that
398
+ exists in no spec), **ambiguous** bare ids, **skipped** tests that cite a requirement, and **uncited**
399
+ tests (no id in the name; the first 20 are shown, all are in `--json`). A feature argument is a number
400
+ or directory name and limits the report to that feature.
401
+
402
+ - `--json` prints the versioned shape in `specs/024-trace/contracts/trace-json.md`; fields are only
403
+ ever added.
404
+ - `--gate` exits 1 when any requirement is uncovered, else 0. Without it `trace` always exits 0.
405
+ - A requirement left without a test on purpose is not counted uncovered by the gate. Record it as one
406
+ line, `uncovered: FR-### — reason`, in the feature's `tests.md` (or, without a test design, in
407
+ `spec.md`).
408
+ - If a feature has a `tests.md` (spec 021), each designed `auto` case is reported `matched` or
409
+ `missing` and each `manual` case is listed as `manual`.
410
+ - Tests are found as `*.test.*` / `*.spec.*` files under the project, skipping `node_modules`, `dist`,
411
+ `coverage`, `.git`, `.worktrees`, `.amby` and `specs`. Override with
412
+ `"trace": { "roots": ["src"], "ignore": ["fixtures"] }` in `.amby/config.json`.
413
+
414
+ ### Citing requirements
415
+
416
+ A test covers a requirement when its name **begins** with the qualified id and a colon:
417
+
418
+ ```ts
419
+ it("019:FR-004: rejects an empty name", () => { … });
420
+ it("019:FR-004, 020:FR-001: shared behavior", () => { … }); // several ids
421
+ ```
422
+
423
+ - Use `NNN:FR-###` (feature number, then requirement). A bare `FR-004` never matches: it is reported
424
+ ambiguous when several features define it, otherwise unqualified.
425
+ - An id anywhere but the start (`… (FR-004)`) does not cite. `skip`/`todo` tests never cover.
426
+ - Only `it`/`test` titles are read: an id in a `describe(...)` name does not cite the tests beneath it,
427
+ and `.each` titles are not expanded.
428
+
212
429
  ## `ambykit check`
213
430
 
214
431
  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
@@ -20,12 +20,12 @@ tools omit.
20
20
 
21
21
  You write the workflow and artifacts once. AmbyKit's **emitters** compile them into each assistant's
22
22
  native format — Claude Code, OpenCode, GitHub Copilot (VS Code + CLI), Cursor (+ CLI), Antigravity
23
- (IDE + CLI). One source of truth, no per-tool drift. See [architecture](./architecture.md).
23
+ (IDE + CLI), Codex CLI, Gemini CLI, Windsurf, Qwen Code, Kiro, Kilo Code, Augment Code, LLxprt Code and Pi. One source of truth, no per-tool drift. See [architecture](./architecture.md).
24
24
 
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.