@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
@@ -0,0 +1,51 @@
1
+ # Plugin trust
2
+
3
+ > The plugin API is **experimental** in 1.6 (see [`plugin-api.md`](./plugin-api.md)). **There is no
4
+ > sandbox.** A plugin is JavaScript that runs inside `ambykit sync` with your permissions. Install one
5
+ > only if you would run its author's code.
6
+
7
+ ## What AmbyKit does to keep this safe
8
+
9
+ - **Nothing is discovered.** A package loads only when it is named in `.amby/config.json` under
10
+ `plugins`. Installing one does not enable it, and a package that happens to be in `node_modules` is
11
+ never imported.
12
+ - **Exact pins.** Each entry is `"package name": "x.y.z"`. A range, a tag, an empty value or anything
13
+ that is not an exact version is refused before any file of the package is read.
14
+ - **Installed version = pin.** If `node_modules/<package>/package.json` is not exactly the pinned
15
+ version, the plugin is refused. Upgrading is a deliberate edit to the pin, reviewed like any change.
16
+ - **One place to look.** Only `<project>/node_modules/<package>` is searched. A copy in a parent folder,
17
+ a global install or `NODE_PATH` is ignored, so the same config loads the same code on every machine
18
+ or fails loudly.
19
+ - **Named.** Every `sync` and `check` prints each loaded plugin as `name@version`.
20
+ - **Names are constrained.** Only packages named `ambykit-emitter-*` (optionally scoped) are accepted.
21
+ - **Failures are contained.** A plugin that is missing, out of range, malformed or throws on load is
22
+ reported by name; the other targets still sync, and the run exits 1 so CI notices.
23
+
24
+ ## What a plugin can and cannot do
25
+
26
+ A plugin **can** run any code Node can run (read and write files, use the network, spawn processes) at
27
+ the moment it is loaded and while it emits. Nothing prevents that.
28
+
29
+ AmbyKit **does** limit what it will *write on a plugin's behalf*:
30
+
31
+ - Files a plugin asks AmbyKit to write must be **inside the project**. A path that is absolute, has a
32
+ drive letter or contains `..` fails the whole sync and names the plugin.
33
+ - A file in the **home directory** (`scope: "user"`) is written only when you run
34
+ `ambykit sync --include-user`. That flag is the recorded consent, it is per run, and those files are
35
+ never part of `sync --check`.
36
+ - A plugin cannot replace a built-in target or another plugin's target: a clash is reported and the
37
+ later target is not registered.
38
+ - Two targets writing the same path must write identical bytes, or the sync fails naming both plugins.
39
+
40
+ ## Before you install a plugin
41
+
42
+ 1. Read its source or trust its maintainers; check the repository and the published tarball.
43
+ 2. Install with `npm install --save-exact` so the version in `package.json` is the one you pin.
44
+ 3. Copy that exact version into `plugins` in `.amby/config.json`.
45
+ 4. Re-read the diff when you change the pin.
46
+
47
+ ## Reporting a problem
48
+
49
+ A plugin that writes where it should not, or runs code you did not expect, is a bug in the plugin;
50
+ report it to its author. If AmbyKit loads something that is not listed and exactly pinned, that is a bug
51
+ in AmbyKit; please open an issue.
@@ -40,8 +40,10 @@ Several targets share one emitter's output (why `BaseEmitter` + thin subclasses
40
40
  | Args placeholder | `$ARGUMENTS`, `$N`, `$name` | `$ARGUMENTS`, `$1` | `${input:x}` | — | prompt text | — | none — reworded as prose (as Codex) | none — trailing free text only (AmbyKit reworks `$ARGUMENTS` into prose) |
41
41
  | Agents | `.claude/agents/*.md` | `.opencode/agents/*.md` | `.github/agents/*.agent.md` | `.github/agents/*.agent.md` | UI modes (no file) | — | none (SDK only) | none (skills only) |
42
42
  | Agent frontmatter | `name`*, `description`*, `tools`, `model` (body = system prompt) | `description`* (+`mode`, `permission`; filename = id) | `description`*, `name`, `tools` | same as Copilot VS Code | — | — | — | — |
43
- | MCP file | `.mcp.json` | `opencode.json` → `mcp` | `.vscode/mcp.json` | `~/.copilot/mcp-config.json` (user) | `.cursor/mcp.json` | reads `.cursor/mcp.json` | `mcp_config.json` (user) | `.codex/config.toml` (TOML) — **out of scope**, AmbyKit does not write it |
44
- | MCP top-level key | (per-server `type`) | `mcp` | `servers` | `mcpServers` | `mcpServers` | — | `mcpServers` | `mcp_servers.<id>` (not written) |
43
+ | Subagents for `/amby.run` (019) | **confirmed**: the emitted `amby-*` agents are spawnable in a live Claude Code session (checked 2026-11-16); `amby-worker` is emitted at `.claude/agents/amby-worker.md` with `tools` incl. Write/Edit/Bash and `model` from `fleet.workerModel` | unconfirmed: format documented, `amby-worker` emitted at `.opencode/agents/` (no `model`), not run live | unconfirmed: `amby-worker` emitted at `.github/agents/amby-worker.agent.md`, not run live | unconfirmed (shares the Copilot file) | none (UI modes only) | none | none (SDK only) | none (skills only) |
44
+ | MCP file | `.mcp.json` | `opencode.json` — **not written** (two incompatible schemas; see `specs/025-mcp-server/research.md`) | `.vscode/mcp.json` | `~/.copilot/mcp-config.json` (user) | `.cursor/mcp.json` | reads `.cursor/mcp.json` | **not written** for the IDE (the CLI uses `.agents/mcp_config.json`, project) | `.codex/config.toml` (TOML) — **out of scope**, AmbyKit does not write it |
45
+ | MCP top-level key | `mcpServers` | `mcp` or `mcp.servers` (by version) | `servers` | `mcpServers` | `mcpServers` | `mcpServers` (shared file) | `mcpServers` | `mcp_servers.<id>` (not written) |
46
+ | MCP entry shape | `{type:"stdio",command,args}` | — | `{type:"stdio",command,args}` | `{type:"local",command,args,tools:["*"]}` (`tools` required) | `{type:"stdio",command,args}` | same as Cursor | `{command,args}` | — |
45
47
  | AGENTS.md native | No (bridge) | Yes | Yes (opt-in) | Yes | Yes | Yes | Yes | Yes |
46
48
 
47
49
  ## Matrix — additional targets (feature 016)
@@ -58,6 +60,7 @@ documented surfaces are emitted (Principle 4).
58
60
  | Command name | path under the dir, `/` ⇒ `:`; dots kept | as Gemini | as Gemini; dots kept | filename | filename; subdir ⇒ `:` | filename | directory name | invoked `/skill:<name>` |
59
61
  | AGENTS.md native | No (opt-in via `context.fileName`) | No (`contextFileName`) | Yes per source; the docs page still says `QWEN.md` only | Yes | Yes | Yes | Yes | Yes (also `CLAUDE.md`) |
60
62
  | Agents/personas | not emitted | not emitted | not emitted | not emitted | not emitted | not emitted | not emitted | not emitted |
63
+ | Subagents for `/amby.run` (019) | none (no documented file format) | none (`/subagent save` only) | none | none | none | none | none | none (shares the Codex output) |
61
64
  | Sources | github.com/google-gemini/gemini-cli (docs/cli/custom-commands.md, gemini-md.md) | github.com/vybestack/llxprt-code (docs/cli/commands.md, configuration.md) | qwenlm.github.io/qwen-code-docs (features/commands); github.com/QwenLM/qwen-code | kilo.ai/docs (customize/workflows, agents-md) | docs.augmentcode.com/cli (custom-commands, rules) | docs.devin.ai/desktop/cascade (workflows, memories) | kiro.dev/docs (skills, steering) | github.com/earendil-works/pi (packages/coding-agent/docs/skills.md) |
62
65
 
63
66
  **Gemini and LLxprt (TOML).** The prompt is a TOML literal multi-line string (`'''…'''`), so
@@ -78,6 +81,15 @@ identical and written once. Its activity self-report says `codex`.
78
81
  skill). This is documented, not suppressed. Augment also reads `.claude/commands/`; the names are
79
82
  identical and `.augment/` takes precedence, so Claude plus Augment yields no duplicates.
80
83
 
84
+ **Subagents (feature 019).** `/amby.run` delegates to a write-capable `amby-worker` and to the read-only
85
+ `amby-qa` and `amby-architect` personas. The per-target table is `src/core/subagents.ts`; only a target
86
+ confirmed on a live install counts as supported (Principle 4), every other target gets the same prompt with
87
+ `$SUBAGENTS` = `no`, so the lead does the worker, QA and review steps itself in sequence from the same state
88
+ files. Claude Code is confirmed (the `amby-*` agents from feature 013 are spawnable in a live session, and the
89
+ worker uses the same documented frontmatter plus write tools); the first live run of `amby-worker` from
90
+ `/amby.run` is the 019 dogfood gate. Only Claude documents a `model` key for agent files, so
91
+ `fleet.workerModel` is applied there and ignored elsewhere.
92
+
81
93
  ### Status notes (checked 2026-11-04)
82
94
 
83
95
  - **Gemini CLI** is being transitioned to Antigravity CLI. Since 2026-06-18 it no longer serves free
@@ -119,10 +131,14 @@ identical and `.augment/` takes precedence, so Claude plus Augment yields no dup
119
131
  - **Rules files are merged, not overwritten.** Every rules file wraps AmbyKit's content in a
120
132
  `### AmbyKit usage` section so it can be spliced into a file the user already authored; only that
121
133
  section is AmbyKit's. (Command/prompt/skill/workflow files remain fully generated and overwritten.)
122
- - **MCP top-level key differs**: `servers` (Copilot VS Code) vs `mcpServers` (Cursor, Copilot CLI,
123
- Antigravity) vs `mcp` (OpenCode) vs per-server `type` blocks (Claude `.mcp.json`).
124
- - **MCP scope differs**: Copilot CLI and Antigravity use **user-level** files outside the repo — AmbyKit
125
- writes these only with explicit consent and excludes them from the "repo in sync" check.
134
+ - **MCP top-level key differs**: `servers` (Copilot VS Code) vs `mcpServers` (Claude `.mcp.json`, Cursor,
135
+ Copilot CLI, Antigravity) vs `mcp` / `mcp.servers` (OpenCode, version-dependent, not written). Copilot CLI's
136
+ entry needs `type: "local"` and `tools`; the others use `type: "stdio"` (Antigravity has none).
137
+ - **MCP scope differs**: Copilot CLI uses a **user-level** file outside the repo, and the Antigravity IDE's
138
+ documented global file is user-level too. AmbyKit writes the Copilot CLI file only with explicit consent
139
+ (`--include-user`), never writes the Antigravity IDE's, and excludes user files from the "repo in sync"
140
+ check. Antigravity CLI has a project file, `.agents/mcp_config.json`. Verified shapes and sources are in
141
+ `specs/025-mcp-server/research.md`.
126
142
  - **Scoped-instruction key differs**: Copilot `applyTo` vs Cursor `globs` (+ `alwaysApply`).
127
143
  - **Command surface differs**: Copilot CLI has no `.prompt.md`; phases map to `SKILL.md`. Antigravity
128
144
  now uses skills (`.agents/skills/<name>/SKILL.md`); workflows (`.agents/workflows/*.md`, with a
@@ -179,6 +195,23 @@ currently affect only the worktree tag, which uses Octicons `oct-git_branch` U+F
179
195
  Unicode in every mode: the brand glyphs (`cod-claude` U+EC82, `cod-openai` U+EC81) only arrived in
180
196
  recent Nerd Fonts (present in v3.5.1), and older installs render them as empty boxes.
181
197
 
198
+ ## Headless runners (`ambykit run`, feature 028, experimental)
199
+
200
+ `ambykit run` launches one assistant per lane without a person at the keyboard. Only a **verified** runner is
201
+ ever launched (Principle 4); the registry in `src/core/runners.ts` and this table carry the same rows, and a
202
+ test keeps them equal. A row becomes `verified` only after its command has run a real lane task on a live
203
+ install (the manual tasks T044 and T045 of spec 028), with the CLI version recorded.
204
+
205
+ | Runner | Command (prompt on stdin) | Exit behaviour | Reports usage | Status | Version |
206
+ | --- | --- | --- | --- | --- | --- |
207
+ | `claude` | `claude -p` | 0 = finished its turn; non-zero = failed | no | unverified | — |
208
+ | `codex` | `codex exec -` | 0 = finished; non-zero = failed | no | unverified | — |
209
+
210
+ To confirm on a live install, per runner: the non-interactive flag, how the prompt is delivered (stdin, an
211
+ argument or a file), the permission or sandbox flags a headless edit needs, the exit codes, and whether usage
212
+ is reported (a token ceiling is enforced only for runners that report it). Until then `ambykit run --runners`
213
+ lists the runner as not runnable and `ambykit run <feature> --yes` refuses it with this reason.
214
+
182
215
  ## To verify against a live install
183
216
 
184
217
  Docs conflicted on a couple of points; confirm before shipping those emitters:
@@ -198,3 +231,35 @@ and docs.github.com/copilot · Cursor: cursor.com/docs · Antigravity: antigravi
198
231
  Google Cloud blog. Codex CLI: developers.openai.com/codex (skills, custom prompts, config reference,
199
232
  AGENTS.md guide). Gemini CLI, LLxprt, Qwen Code, Kilo, Augment, Windsurf, Kiro and Pi: see the
200
233
  "Sources" row of the additional-targets matrix. AGENTS.md standard: agents.md.
234
+
235
+ ## Matrix rows for plugins
236
+
237
+ The matrix above is prose for people. A plugin (feature 027, experimental) records the same facts as
238
+ **data**, so the test kit in `@ambystech/ambykit/testkit` can check an emitter against them. One row
239
+ describes one target:
240
+
241
+ ```json
242
+ {
243
+ "target": "mytool",
244
+ "commandSurface": "commands",
245
+ "commandDir": ".mytool/commands",
246
+ "fileTemplate": "amby.<phase>.md",
247
+ "frontmatterKeys": ["description"],
248
+ "sourceUrl": "https://example.com/docs/custom-commands"
249
+ }
250
+ ```
251
+
252
+ | Field | Meaning |
253
+ |---|---|
254
+ | `target` | The target id the row describes. |
255
+ | `commandSurface` | `commands`, `skills`, `workflows` or `none` (rules-only: no command files). |
256
+ | `commandDir` | Directory holding the command files, relative to the project root. |
257
+ | `fileTemplate` | One command file's path under `commandDir`. `<phase>` is replaced by each phase id (`specify`, `plan`, …); a skills layout is `amby-<phase>/SKILL.md`. |
258
+ | `frontmatterKeys` | The exact, ordered keys the host documents: YAML `key:` lines, or TOML `key =` lines for `.toml` files. |
259
+ | `sourceUrl` | Where the row was verified. Principle 4: no row, no emit; a row without a source is a guess. |
260
+
261
+ `checkEmitterContract(target, row)` emits every phase and lists each difference: a wrong `commandSurface`
262
+ or `commandDir`, a missing or unexpected file, frontmatter keys that differ (grouped when many files
263
+ share the difference), a path outside the project, or `emit()` throwing. **A missing row fails.** An
264
+ official plugin ships its row as `matrix-rows.json` in its own repository; this document keeps only the
265
+ human-readable summary.
package/docs/workflow.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # The AmbyKit workflow
2
2
 
3
- Eleven phases, each a slash command in your assistant, each producing or updating one artifact. The
3
+ Thirteen phases, each a slash command in your assistant, each producing or updating one artifact. The
4
4
  happy path is **specify → design → plan → tasks → implement**, with `constitution` once up front and
5
- `clarify`/`revise`/`analyze`/`converge`/`review` when you need them.
5
+ `clarify`/`revise`/`analyze`/`converge`/`review`/`decide`/`run` when you need them.
6
6
 
7
7
  | Phase | Command | Reads | Writes |
8
8
  |---|---|---|---|
@@ -12,11 +12,13 @@ happy path is **specify → design → plan → tasks → implement**, with `con
12
12
  | Revise | `/amby.revise` | spec, ui | spec / ui (continues in place) |
13
13
  | Design (UI) | `/amby.design` | spec | `ui.md`, `design-tokens.json` |
14
14
  | Plan (HOW) | `/amby.plan` | spec, ui | `plan.md` (+ `data-model.md`, `contracts/`) |
15
- | Tasks | `/amby.tasks` | plan | `tasks.md` |
15
+ | Tasks | `/amby.tasks` | plan | `tasks.md` + `tests.md` (test design) |
16
16
  | Analyze | `/amby.analyze` | all | consistency report |
17
17
  | Implement | `/amby.implement` | tasks (one slice) | code + task/status updates |
18
18
  | Converge | `/amby.converge` | spec, plan, tasks + code | `tasks.md` (appends gap tasks), story status |
19
19
  | Review | `/amby.review` | any artifact + a role | findings (advisory); the artifact only with `--apply` |
20
+ | Decide | `/amby.decide` | decision index | `.amby/decisions/ADR-###.md` + the index |
21
+ | Run | `/amby.run` | spec, plan, tasks, `tests.md` | `tasks.md` check-offs + `.amby/fleet/<run>/` |
20
22
 
21
23
  ## 1. Constitution
22
24
 
@@ -59,7 +61,9 @@ needed. See [the plan artifact](./artifacts/plan.md).
59
61
 
60
62
  Turns the plan into an ordered, dependency-aware checklist: stable `T###` IDs, `[P]` parallel
61
63
  markers, `[US#]` story tags, and file paths, grouped so foundational work precedes feature work. See
62
- [the tasks artifact](./artifacts/tasks.md).
64
+ [the tasks artifact](./artifacts/tasks.md). The same phase also writes `tests.md`, the test design: one case per
65
+ acceptance criterion with an automate-or-manual decision, decided before any code. See
66
+ [the tests artifact](./artifacts/tests.md).
63
67
 
64
68
  ## 8. Analyze
65
69
 
@@ -71,12 +75,20 @@ Cross-checks spec ↔ plan ↔ tasks for coverage gaps and inconsistencies, and
71
75
  Executes tasks one slice at a time, checking off `tasks.md` checkboxes and updating each story's
72
76
  `status:` as it goes — which is what `ambykit dashboard` reports on.
73
77
 
78
+ A task that cannot proceed gets a trailing `⚠ BLOCKED: <reason>` marker (and `↪ DEVIATION: <note>` when it
79
+ was done differently than planned); the implementer moves on to another unblocked task. Each phase ends
80
+ with one `**Verify:**` line that is run before the checkpoint, and its result (`✓ passed`,
81
+ `✗ failed: <why>`, `? unverified`) is written back on that line; a failed Verify keeps the checkpoint
82
+ closed. `ambykit dashboard` and `ambykit analyze` surface both at zero model tokens. Syntax:
83
+ [tasks artifact](./artifacts/tasks.md).
84
+
74
85
  ## 10. Converge
75
86
 
76
87
  Closes the loop after implementation: checks the code against every `FR-###`/`SC-###`, plan
77
88
  decision, and checked task; appends one unchecked task per gap under `## Convergence` in `tasks.md`
78
89
  (`[VERIFY]` for inconclusive items); marks fully covered stories `done`. Append-only and idempotent —
79
- it never edits source. Loop `implement → converge` until it reports **converged**.
90
+ it never edits source. It starts from `ambykit trace <feature> --json` (which requirements have tests),
91
+ so it spends effort only on what the matrix cannot answer. Loop `implement → converge` until it reports **converged**.
80
92
 
81
93
  ## 11. Review
82
94
 
@@ -85,6 +97,26 @@ plan, the PM on a UI design, or any role via `--as <id>`. Findings are one per l
85
97
  stable ID with severity and a suggested fix; nothing is modified. `--apply` patches the artifact in
86
98
  place (IDs are never renumbered) and appends a `## Reviews` record. Advisory, like `analyze`.
87
99
 
100
+ ## 12. Decide
101
+
102
+ Records a durable decision as `.amby/decisions/ADR-###.md` (context, decision, alternatives, consequences)
103
+ and patches the index. Callable from any phase; it has no role. It points to an existing record instead of
104
+ duplicating one, keeps a decision that conflicts with a constitution principle `proposed` for a person to
105
+ settle, and `--supersede ADR-###` marks the old record superseded on both sides. Cite records elsewhere as
106
+ `ADR-###`; `ambykit analyze` flags a citation with no record. See `docs/artifacts/decision-record.md`.
107
+
108
+ ## 13. Run
109
+
110
+ `/amby.run <feature>` works a feature through its tasks as a team. The assistant you call it from is the
111
+ **lead**: it gives worker subagents only their task IDs, file ownership and artifact references, then runs a
112
+ QA step (the phase's `**Verify:**` line and acceptance criteria, with the `tests.md` cases when present) and an
113
+ architect review before a phase passes. A failing Verify never passes a checkpoint; a failed review returns only
114
+ finding IDs to the same worker, and at the round limit (default 3) the lead stops and asks you. State lives in
115
+ `.amby/fleet/<feature>.<n>/`, so a run resumes in a new session; pause, resume and stop are directives that
116
+ workers obey at their next report. Defaults (`stallMinutes`, `restartLimit`, `concurrency`, `roundLimit`,
117
+ `workerModel`) are the `fleet` object in `.amby/config.json`. Without verified subagent support the lead does
118
+ every step itself, in sequence. `ambykit fleet` is the helper the prompt calls; see `docs/cli-reference.md`.
119
+
88
120
  ## Roles
89
121
 
90
122
  Every phase acts as a role defined in `.amby/roles/<id>.md` (PM, UX Designer, Architect, Tech
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ambystech/ambykit",
3
- "version": "1.3.1",
3
+ "version": "1.6.0",
4
4
  "description": "Spec-Driven Development framework that helps AI coding assistants build better software — author your specs, user stories, UI design, plans and tasks once, and emit native config for Claude Code, OpenCode, GitHub Copilot, Cursor, Antigravity and more.",
5
5
  "keywords": [
6
6
  "spec-driven-development",
@@ -39,12 +39,15 @@
39
39
  "ambykit": "dist/cli/index.js"
40
40
  },
41
41
  "exports": {
42
- ".": "./dist/index.js"
42
+ ".": "./dist/index.js",
43
+ "./plugin": "./dist/plugins/index.js",
44
+ "./testkit": "./dist/testkit/index.js"
43
45
  },
44
46
  "files": [
45
47
  "dist",
46
48
  "src/templates",
47
49
  "src/prompts",
50
+ "src/agents",
48
51
  "src/reference",
49
52
  "src/roles",
50
53
  "README.md",
@@ -0,0 +1,37 @@
1
+ ---
2
+ id: worker
3
+ name: Worker
4
+ description: AmbyKit fleet worker — implements the task IDs the lead gives it, checks them off and reports one line; used by /amby.run.
5
+ ---
6
+
7
+ You are an AmbyKit **worker**. The lead gave you a feature, a lane, task IDs and the files you own. Do those
8
+ tasks and nothing else; you are the only agent allowed to write for them.
9
+
10
+ **Load only what the tasks need:** your task lines in `specs/<feature>/tasks.md` by ID, the plan sections and
11
+ `US-#`/`FR-###` they cite, and `tests.md` cases for them if it exists. Never restate artifacts.
12
+
13
+ **For each task, in order:**
14
+
15
+ 1. Report (below), then claim the files you will edit: `ambykit fleet claim <feature> T### <file>...`. A refused
16
+ claim names the owner: do not edit that file; post a note (step 5) and tell the lead you are blocked.
17
+ 2. Do the task. Edit only files listed for it (plus its tests). Build to the `tests.md` cases when they exist.
18
+ 3. Check it off: `[ ]` → `[x]` on its line (the `tick_task` tool, or an edit of that one box). Checking off
19
+ frees the task's claims; if you edited by hand, also run `ambykit fleet release <feature> T###`.
20
+ 4. Report, then send the lead **one line**: `T###: <what changed> (<files>)`. No logs, no diffs.
21
+ 5. Anything the next person needs to know goes on the shared board as one line:
22
+ `ambykit fleet note <feature> T### --files=<files> "<text>"`.
23
+
24
+ **Stuck?** Stop work on that task and mark it, last on the task line: `⚠ BLOCKED: <reason>` (add
25
+ `↪ DEVIATION: <note>` if you did it differently than planned). Report `blocked`, tell the lead in one line, and
26
+ continue with another of your tasks that is not blocked. Never ask another worker directly: blocked work goes
27
+ through the lead.
28
+
29
+ **Reporting:** `ambykit activity <feature> --agent=$AGENT --phase=implement --task=T### --lane=<lane> --state=<state>`
30
+ (add `--run=<run>`; ignore any error), or the `report_activity` tool when it is available.
31
+ Report at the start of a task, at the end of a task, and whenever you are blocked or waiting. Never report on a timer and never report progress.
32
+ The reply carries a directive: continue, pause or stop. On pause or stop, finish the task you are on, then obey it at your next report: do not start another task.
33
+ `report_activity` returns the directive; without that tool, run `ambykit fleet directive <feature> <lane>` after
34
+ reporting, which prints it.
35
+
36
+ **Review findings:** when the lead returns finding IDs, fix exactly those in the same lane, check nothing new off
37
+ unless a task requires it, and report one line per ID: `<id>: fixed (<files>)`.
@@ -5,7 +5,7 @@ description: Check the codebase against spec, plan, and tasks after implementing
5
5
  argument-hint: "[feature id, defaults to current]"
6
6
  phase: converge
7
7
  role: qa
8
- reads: [specs/NNN-slug/spec.md, specs/NNN-slug/plan.md, specs/NNN-slug/tasks.md]
8
+ reads: [specs/NNN-slug/spec.md, specs/NNN-slug/plan.md, specs/NNN-slug/tasks.md, specs/NNN-slug/tests.md]
9
9
  writes: [specs/NNN-slug/tasks.md, specs/NNN-slug/spec.md]
10
10
  allowedTools: [read, edit]
11
11
  ---
@@ -14,13 +14,18 @@ Converge feature `$ARGUMENTS` (default: the current feature): does the code sati
14
14
  Never edit source code — only that feature's `tasks.md` and `spec.md` are writable.
15
15
 
16
16
  Run `ambykit activity <feature> --agent=$AGENT --phase=converge` first, with that feature's number; ignore any error.
17
+ Then run `ambykit trace <feature> --json`; if it fails, go on as without it. Its uncovered requirements are
18
+ gaps already — do not re-derive coverage by reading every test; read tests only to judge whether the covered
19
+ ones truly satisfy their requirement.
17
20
 
18
21
  1. No `tasks.md` → stop, say to run `/amby.tasks`. No `plan.md` → converge on spec + tasks and say so.
19
22
  2. For every `FR-###`/`SC-###`, plan decision (incl. `data-model.md`/`contracts/`), and checked
20
23
  `T###`: look for evidence only in files the plan/tasks name. Classify **covered**, **gap**
21
- (absent), or **unverified** (inconclusive). Skip items the plan marks deferred/out of scope.
24
+ (absent), or **unverified** (inconclusive). Skip items the plan marks deferred/out of scope. If `tests.md`
25
+ exists, read it after the `trace` matrix (where there is one) and treat its cases as the expected tests; spend
26
+ effort only on what neither answers.
22
27
  3. **Append, don't rewrite.** Under `## Convergence` in `tasks.md` (create at the end if absent) add
23
- `- [ ] [T###] [US#] … (closes FR-…)` per gap and `- [ ] [T###] [US#] [VERIFY] …` per unverified
28
+ `- [ ] [T###] [US#] … (closes NNN:FR-###)` per gap and `- [ ] [T###] [US#] [VERIFY] …` per unverified
24
29
  item. Continue IDs from the highest `T###` anywhere in the file; skip items already listed
25
30
  unchecked there. Nothing to add → leave the file untouched.
26
31
  4. In `spec.md`, patch only `status:` lines: a story → `done` when every FR/SC it maps to is
@@ -0,0 +1,31 @@
1
+ ---
2
+ id: decide
3
+ name: amby.decide
4
+ description: Record a decision as a numbered record — cited by ID, supersedable, checked by analyze.
5
+ argument-hint: "<decision text> [--supersede ADR-###]"
6
+ phase: decide
7
+ reads: [.amby/decisions/README.md, .amby/templates/adr.md, .amby/constitution.md]
8
+ writes: [.amby/decisions/ADR-###.md, .amby/decisions/README.md]
9
+ allowedTools: [read, write, edit, bash]
10
+ ---
11
+
12
+ Record the decision in `$ARGUMENTS`. Callable from any phase; it has no role of its own.
13
+
14
+ If a current feature applies, run `ambykit activity <feature> --agent=$AGENT --phase=decide` first; ignore any error.
15
+
16
+ 1. No decision text → ask for it in one question. Read `.amby/decisions/README.md` (the index) only;
17
+ if a row's title already covers the decision, name that `ADR-###` and stop — do not duplicate.
18
+ 2. Number: highest of the `ADR-###.md` files **and** the index rows, plus 1, three digits. Never reuse a
19
+ number, even for a deleted file. Create `.amby/decisions/` and its index (`| ID | Title | Status |`)
20
+ on first use.
21
+ 3. Write `.amby/decisions/ADR-<n>.md` from `@.amby/templates/adr.md`: Context, Decision, Alternatives,
22
+ Consequences, each short. Fill `feature` from the current feature and `principle` when relevant.
23
+ The file name is the id, with no slug.
24
+ 4. Principle conflict: if the decision conflicts with a constitution principle, set `status: proposed`,
25
+ list the principle numbers in `conflicts`, and tell the person it needs their call. Never write
26
+ `accepted` with `conflicts` filled. Otherwise `status: accepted`.
27
+ 5. `--supersede ADR-###`: set `supersedes` on the new record, and on the old record set
28
+ `status: superseded` and `superseded-by: <new id>`. Both sides, always. Never edit the old record's body.
29
+ 6. A wording-only edit of an existing record keeps its `id` and `status`.
30
+ 7. Patch the index in place: add or update this record's row. Leave rows of deleted files (tombstones).
31
+ 8. Cite decisions elsewhere only by `ADR-###`; never restate them. End with the id and path.
@@ -5,7 +5,7 @@ description: Execute the task list, checking off tasks and updating story status
5
5
  argument-hint: "[task id or story id, defaults to next unblocked]"
6
6
  phase: implement
7
7
  role: developer
8
- reads: [specs/NNN-slug/tasks.md, specs/NNN-slug/plan.md]
8
+ reads: [specs/NNN-slug/tasks.md, specs/NNN-slug/plan.md, specs/NNN-slug/tests.md]
9
9
  writes: [specs/NNN-slug/tasks.md, specs/NNN-slug/spec.md]
10
10
  allowedTools: [read, write, edit, bash]
11
11
  ---
@@ -20,9 +20,17 @@ Run `ambykit activity <feature> --agent=$AGENT --phase=implement` first, with th
20
20
  2. Load **only** the slice you need: the task line, the relevant `plan.md` section, and the specific
21
21
  files named. Don't read the whole spec tree (token-frugal).
22
22
  3. Implement to satisfy the mapped `FR-###`/acceptance criteria and the constitution. Add/adjust
23
- tests for the acceptance criteria.
24
- 4. **Patch in place:** flip the completed task's checkbox to `- [x]` in `tasks.md`; when all of a
25
- story's tasks are done, set that story's `status: done` in `spec.md` (or `in-progress` while
26
- partway). Don't rewrite untouched sections. After each checked task, run
27
- `ambykit activity <feature> --agent=$AGENT --phase=implement --task=T###` (ignore errors).
28
- 5. Report what you did and the next unblocked task. Stop at a story checkpoint for review.
23
+ tests for the acceptance criteria: build to the story's cases in `tests.md` and name tests `NNN:FR-###: …`;
24
+ at the story checkpoint say if `tests.md` is missing, never pass silently. If you cannot finish a task, add `⚠ BLOCKED: <reason>` as the last
25
+ segment of its line (after the `(file/path)` group), stop that task and continue with another unblocked
26
+ one; note any departure from the plan as `↪ DEVIATION: <note>`. Remove `⚠ BLOCKED:` once resolved.
27
+ 4. **Patch in place:** flip the completed task's checkbox to `- [x]` in `tasks.md`; set the story's
28
+ `status: in-progress` in `spec.md` while it is partway. Don't rewrite untouched sections. After each
29
+ checked task, run `ambykit activity <feature> --agent=$AGENT --phase=implement --task=T###` (ignore errors).
30
+ 5. At a phase checkpoint, run that phase's `**Verify:**` check before passing it (no Verify line: say so
31
+ and continue). Write the result at the end of that line, replacing any earlier one: `✓ passed`,
32
+ `✗ failed: <why>` or `? unverified`. Never pass the checkpoint on a failure: fix it and run again. If
33
+ you cannot run the check, ask a person to run or confirm it and record `? unverified`. Only once the
34
+ Verify has passed (or there is none) and all of a story's tasks are done, set that story's
35
+ `status: done`. In a lane, record the result after the phase's lanes are merged.
36
+ 6. Report what you did and the next unblocked task. Stop at a story checkpoint for review.
@@ -5,8 +5,8 @@ description: Continue an existing feature's spec (or design) — add and refine
5
5
  argument-hint: "[feature id, defaults to current] + what to add or refine"
6
6
  phase: revise
7
7
  role: pm
8
- reads: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md]
9
- writes: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md]
8
+ reads: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md, specs/NNN-slug/tests.md]
9
+ writes: [specs/NNN-slug/spec.md, specs/NNN-slug/ui.md, specs/NNN-slug/tests.md]
10
10
  allowedTools: [read, edit]
11
11
  ---
12
12
 
@@ -27,6 +27,8 @@ of `@.amby/templates/spec.md`. This command **extends** an existing feature —
27
27
  - New requirements use EARS (SHALL / WHEN / WHILE / IF-THEN / WHERE); new acceptance criteria use
28
28
  Given/When/Then — consistent with `specify`.
29
29
  - Leave any story already marked `status: done` untouched; you may still add new stories.
30
+ - If `tests.md` exists, mark each case citing a changed criterion `[stale]` and each citing a removed one
31
+ `[obsolete]` (never delete); change nothing else there.
30
32
  4. Set the `spec.md` frontmatter `status:` to `in-progress`.
31
33
  5. **Design (optional).** If the author is continuing the UI/design and `ui.md` exists, extend it in
32
34
  place, preserving existing sections. If `ui.md` does **not** exist, do not create it here — direct
@@ -0,0 +1,100 @@
1
+ ---
2
+ id: run
3
+ name: amby.run
4
+ description: Run a feature's tasks as a team — workers build, QA and architect review, state kept in files, resumable.
5
+ argument-hint: "<feature> [--new]"
6
+ phase: run
7
+ reads: [specs/<feature>/spec.md, specs/<feature>/plan.md, specs/<feature>/tasks.md, specs/<feature>/tests.md, .amby/fleet/<run>/run.json]
8
+ writes: [specs/<feature>/tasks.md, .amby/fleet/<run>/]
9
+ allowedTools: [read, write, edit, bash]
10
+ ---
11
+
12
+ Run the feature in `$ARGUMENTS` (number or name; `--new` only when the person asked for a new run). You are the
13
+ **lead**: you start workers, hand out task IDs, run the reviews and keep the run state. You have no role of
14
+ your own. Run `ambykit activity <feature> --agent=$AGENT --phase=run` first; ignore any error.
15
+
16
+ Subagents on this host: `$SUBAGENTS`. If `yes`, workers are the `amby-worker` subagent and reviewers the
17
+ `amby-qa` and `amby-architect` subagents (roles `@.amby/roles/qa.md`, `@.amby/roles/architect.md`). If `no`,
18
+ say so once, then do each worker, QA and architect step yourself, in sequence, one task at a time, with the
19
+ same commands and state files below: claim, edit, check off, report; QA before architect, each acting as its
20
+ role file, and say which role you are acting as.
21
+
22
+ Every step works from files with these verbs alone, and nothing here needs a server: `ambykit fleet`,
23
+ `ambykit activity`, `ambykit directive`.
24
+
25
+ ## 1. Resume or start
26
+
27
+ Run `ambykit fleet status <feature>`; it prints the run, the next phase, lanes, free slots and warnings.
28
+
29
+ - **Done** → say so and change nothing. **Stopped** naming `spec.md`, `plan.md` or `tasks.md` (missing, or the
30
+ spec still `draft`) → stop, name that artifact and the command that makes it.
31
+ - **No unfinished run** → `ambykit fleet start <feature>` (this invocation is the request; `--new` starts another
32
+ run on request only). **One** → resume it. **Several** → list them and ask which; never pick.
33
+ - **Warning: state missing or corrupt** → `ambykit fleet status <feature> --run=<id> --rebuild`, then go on.
34
+ Checked tasks in `tasks.md` stay checked, so nothing completed is repeated.
35
+ - Load by reference only: the current phase of `@specs/<feature>/tasks.md`, the plan sections and `US-#`/`FR-###`
36
+ its tasks cite, and `@specs/<feature>/tests.md` when it exists. Never whole artifacts.
37
+
38
+ ## 2. Work the phase (stage `working`)
39
+
40
+ - Take the phase's open, unblocked tasks from `status`. Tasks are independent when their file ownership is
41
+ disjoint. If two tasks you want to run together own overlapping files, see **Overlap**.
42
+ - **Caps:** `status` shows free slots (default 3 workers, 2 per assistant type). Never start a worker without one.
43
+ - Per worker: `ambykit fleet update <feature> --worker-start=<lane> --assistant=<id> --tasks=T001,T002`
44
+ (`<lane>` is `lane-<phase>-<k>`, `<id>` the assistant the worker runs on, the same id as your `--agent`; it is refused
45
+ when no slot is free). Give the worker only: the feature, run,
46
+ lane, its task IDs, their file ownership and the artifacts by `@path`. It returns one line per task.
47
+ - Workers report on a fixed rule, which you must also keep. Report at the start of a task, at the end of a task, and whenever you are blocked or waiting. Never report on a timer and never report progress.
48
+ - When a worker finishes: `ambykit fleet update <feature> --worker-done=<lane>`.
49
+ - **Blocked:** the worker marks the task `⚠ BLOCKED: <reason>` and you continue with other unblocked tasks.
50
+ Blocked work is yours to resolve or give to the person; workers never ask each other.
51
+ - **Stalled:** `status` flags a lane with no report and no `tasks.md` change for the stall limit. Restart it with
52
+ `ambykit fleet update <feature> --restart=<lane>` and re-delegate its unchecked IDs. After the restart limit the
53
+ command pauses the lane and asks for a person: only they may approve moving it to another assistant or marking
54
+ its task BLOCKED.
55
+ - **Notes and claims:** workers claim files before editing (`ambykit fleet claim`), post one-line notes
56
+ (`ambykit fleet note`) and their claims are released when a task is checked off. A refused claim names the
57
+ owner; sort it out through the board and `status` warnings, not by editing the file.
58
+
59
+ ## 3. QA (stage `qa`)
60
+
61
+ When every task of the phase is checked: `ambykit fleet update <feature> --stage=qa`. Ask QA (`@.amby/roles/qa.md`, read-only) to:
62
+
63
+ 1. run the phase's `**Verify:**` line, and check the acceptance criteria of its stories; if `tests.md` exists, its
64
+ cases for these tasks are the expected tests. No Verify line → check the criteria only and say the phase has none.
65
+ 2. return a verdict. You write it to `.amby/fleet/<run>/verdicts/<lane>.qa.<round>.json`
66
+ (`<round>` = failed rounds so far + 1): `{"verdict":"pass"|"fail","findings":[{"id","severity","finding","fix"}]}`.
67
+ 3. record the result on the Verify line, per spec 020: `✓ passed`, `✗ failed: <why>`, or, when the check cannot be
68
+ run here, tell the person, ask them to confirm and record `? unverified`.
69
+
70
+ A failing Verify never passes the checkpoint. Do not tick the checkpoint or start the next phase until it passes.
71
+
72
+ ## 4. Architect review (stage `architect`)
73
+
74
+ After QA passes: `ambykit fleet update <feature> --stage=architect`. Ask the architect (`@.amby/roles/architect.md`, read-only) for correctness,
75
+ simplification and fit with `plan.md`; findings by stable ID, same verdict file with `.architect.`.
76
+
77
+ - **Fail** (QA or architect): `ambykit fleet update <feature> --round=<failed rounds so far>`. It prints `retry` or
78
+ `escalate`. **retry** → return only the finding IDs and their `fix` to the **same worker** (same lane) and go back
79
+ to `working`. **escalate** (the round limit) → stop: summarize the open findings and ask the person to decide.
80
+ Record their answer with `ambykit fleet update <feature> --decision="<text>"` and continue from it.
81
+ - **Pass:** `ambykit fleet update <feature> --phase=<next>`; after the last phase,
82
+ `ambykit fleet update <feature> --done`, then suggest `/amby.converge`.
83
+
84
+ ## Pause, resume, stop
85
+
86
+ When the person asks: `ambykit fleet update <feature> --pause` (or `--resume`, `--stop`; add `=<lane>` for one lane).
87
+ This writes a directive per lane; start no new worker while paused. The directive protocol is: The reply carries a directive: continue, pause or stop. On pause or stop, finish the task you are on, then obey it at your next report: do not start another task.
88
+ The run state records `paused`; the next `/amby.run` resumes from it.
89
+
90
+ ## Overlap
91
+
92
+ If workers' files overlap, choose before any work starts and record it:
93
+ - **Serialize:** one worker after the other. `ambykit fleet update <feature> --overlap=serialized --lanes=a,b --order=a,b`
94
+ - **Squad:** one writer per shared file, a fixed merge order; others send change requests through the writer or you.
95
+ `ambykit fleet update <feature> --overlap=squad --lanes=a,b --shared=<path>,... --writer=<path>:<lane>,... --order=a,b`
96
+
97
+ ## Rules
98
+
99
+ - All review roles, including `security`, stay read-only; never give them write access. Only workers write code.
100
+ - Keep every status line to one line; no logs, no restated artifacts.
@@ -2,11 +2,11 @@
2
2
  id: tasks
3
3
  name: amby.tasks
4
4
  description: Break the plan into an ordered, dependency-aware task checklist.
5
- argument-hint: "[feature id, defaults to current]"
5
+ argument-hint: "[feature id, defaults to current] [--skip-tests <reason>]"
6
6
  phase: tasks
7
7
  role: tech-lead
8
- reads: [specs/NNN-slug/plan.md, specs/NNN-slug/spec.md]
9
- writes: [specs/NNN-slug/tasks.md]
8
+ reads: [specs/NNN-slug/plan.md, specs/NNN-slug/spec.md, specs/NNN-slug/tests.md]
9
+ writes: [specs/NNN-slug/tasks.md, specs/NNN-slug/tests.md]
10
10
  allowedTools: [read, write, edit]
11
11
  ---
12
12
 
@@ -25,5 +25,15 @@ Run `ambykit activity <feature> --agent=$AGENT --phase=tasks` first, with that f
25
25
  4. Give every task a stable `T###` id and its file paths as the line's last parenthesized group:
26
26
  comma-separated, repo-relative, dirs end `/`, no globs. Mark `[P]` only when no other task in the
27
27
  same phase shares or nests a path.
28
+ 5. End every phase with exactly ONE `**Verify:**` line, plain text after its tasks: a runnable check
29
+ or observable condition that proves the phase works (e.g. a test command). Never more than one.
30
+ 6. Also write `tests.md` (the test design) in this phase per `@.amby/templates/tests.md`, touching only `tasks.md`
31
+ and `tests.md`. If `spec.md` is not `status: ready`, skip it and say the spec must be ready first. One case per
32
+ acceptance criterion (negative and edge ones too, max 15 per story); one too vague to test goes under `## Flags`.
33
+ With `--skip-tests <reason>`, write `tests.md` holding only the line `skipped: <reason>`.
34
+ 7. Cases are `auto` unless a fixed-list reason makes them manual (add `verify:` and `record:`). Each cites its `US-n#k`
35
+ and `FR-###`s; `TC-###` is highest + 1, never reused. An FR with no case goes under `## Uncovered` with a reason.
36
+ With an existing `tests.md`, patch only the cases citing changed criteria (keep their ids, clear `[stale]`), mark
37
+ cases whose criterion was removed `[obsolete]` and add new ones; leave the rest untouched.
28
38
 
29
39
  Do not start implementing. Keep descriptions to one line each.
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: security
3
+ name: Security Reviewer
4
+ phases: [review]
5
+ ---
6
+ Review for security risk. Read-only and advisory: never edit, never create a decision record.
7
+
8
+ **Focus:**
9
+ - Trust boundaries and untrusted input named for each flow
10
+ - Authentication, authorization and least privilege on every action
11
+ - Secrets, tokens and personal data: where stored, logged, transmitted
12
+ - Injection, path traversal and unsafe deserialization in file and command handling
13
+ - Dependencies and install steps: pinned, minimal, from known sources
14
+ - Failure modes that leak data or fail open
15
+
16
+ **Hand-off:** findings by stable ID with severity and a one-line fix. Where a choice is durable,
17
+ suggest recording it with `/amby.decide`; the person decides.
@@ -0,0 +1,29 @@
1
+ ---
2
+ id: ADR-{{NNN}}
3
+ title: {{TITLE}}
4
+ status: proposed # proposed | accepted | superseded | deprecated
5
+ date: {{DATE}}
6
+ feature: # optional: NNN-slug this decision came from
7
+ principle: # optional: constitution principle number
8
+ conflicts: [] # principle numbers this decision conflicts with; must be empty to accept
9
+ supersedes: # optional: ADR-### this record replaces
10
+ superseded-by: # set on the OLD record when replaced
11
+ ---
12
+
13
+ # {{TITLE}}
14
+
15
+ ## Context
16
+
17
+ {{WHY_A_DECISION_WAS_NEEDED}}
18
+
19
+ ## Decision
20
+
21
+ {{WHAT_WAS_DECIDED}}
22
+
23
+ ## Alternatives
24
+
25
+ - {{ALTERNATIVE}} — {{WHY_NOT}}
26
+
27
+ ## Consequences
28
+
29
+ - {{CONSEQUENCE}}