swarm-engine 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/AGENTS.md +72 -0
  2. package/CLAUDE.md +89 -0
  3. package/LICENSE +21 -0
  4. package/README.md +235 -0
  5. package/agents/accessibility-reviewer.md +118 -0
  6. package/agents/api-contract-reviewer.md +99 -0
  7. package/agents/concurrency-reviewer.md +111 -0
  8. package/agents/data-integrity-reviewer.md +103 -0
  9. package/agents/debugger.md +99 -0
  10. package/agents/dependency-reviewer.md +115 -0
  11. package/agents/devils-advocate.md +94 -0
  12. package/agents/documentation-reviewer.md +114 -0
  13. package/agents/documenter.md +78 -0
  14. package/agents/error-handling-reviewer.md +113 -0
  15. package/agents/grounding.md +99 -0
  16. package/agents/guardian.md +87 -0
  17. package/agents/implementer.md +141 -0
  18. package/agents/integrator.md +95 -0
  19. package/agents/judge.md +79 -0
  20. package/agents/librarian.md +90 -0
  21. package/agents/orchestrator.md +331 -0
  22. package/agents/performance-reviewer.md +93 -0
  23. package/agents/planner.md +106 -0
  24. package/agents/refactorer.md +92 -0
  25. package/agents/researcher.md +97 -0
  26. package/agents/reviewer.md +117 -0
  27. package/agents/security-reviewer.md +107 -0
  28. package/agents/sentinel.md +92 -0
  29. package/agents/tester.md +93 -0
  30. package/agents/testing-reviewer.md +112 -0
  31. package/commands/diff-review.md +64 -0
  32. package/commands/fix-pr.md +78 -0
  33. package/commands/red-team.md +82 -0
  34. package/commands/research.md +59 -0
  35. package/commands/resume.md +80 -0
  36. package/commands/review-cycle.md +123 -0
  37. package/commands/swarm-setup.md +28 -0
  38. package/commands/swarm.md +126 -0
  39. package/commands/tdd.md +91 -0
  40. package/dist/cli/bin.d.ts +3 -0
  41. package/dist/cli/bin.d.ts.map +1 -0
  42. package/dist/cli/bin.js +3 -0
  43. package/dist/cli/bin.js.map +1 -0
  44. package/dist/cli/commands/acp.d.ts +3 -0
  45. package/dist/cli/commands/acp.d.ts.map +1 -0
  46. package/dist/cli/commands/acp.js +29 -0
  47. package/dist/cli/commands/acp.js.map +1 -0
  48. package/dist/cli/commands/agents.d.ts +3 -0
  49. package/dist/cli/commands/agents.d.ts.map +1 -0
  50. package/dist/cli/commands/agents.js +344 -0
  51. package/dist/cli/commands/agents.js.map +1 -0
  52. package/dist/cli/commands/backends.d.ts +3 -0
  53. package/dist/cli/commands/backends.d.ts.map +1 -0
  54. package/dist/cli/commands/backends.js +22 -0
  55. package/dist/cli/commands/backends.js.map +1 -0
  56. package/dist/cli/commands/completions.d.ts +3 -0
  57. package/dist/cli/commands/completions.d.ts.map +1 -0
  58. package/dist/cli/commands/completions.js +85 -0
  59. package/dist/cli/commands/completions.js.map +1 -0
  60. package/dist/cli/commands/compound.d.ts +3 -0
  61. package/dist/cli/commands/compound.d.ts.map +1 -0
  62. package/dist/cli/commands/compound.js +119 -0
  63. package/dist/cli/commands/compound.js.map +1 -0
  64. package/dist/cli/commands/configure.d.ts +3 -0
  65. package/dist/cli/commands/configure.d.ts.map +1 -0
  66. package/dist/cli/commands/configure.js +151 -0
  67. package/dist/cli/commands/configure.js.map +1 -0
  68. package/dist/cli/commands/convert.d.ts +15 -0
  69. package/dist/cli/commands/convert.d.ts.map +1 -0
  70. package/dist/cli/commands/convert.js +218 -0
  71. package/dist/cli/commands/convert.js.map +1 -0
  72. package/dist/cli/commands/doctor.d.ts +3 -0
  73. package/dist/cli/commands/doctor.d.ts.map +1 -0
  74. package/dist/cli/commands/doctor.js +96 -0
  75. package/dist/cli/commands/doctor.js.map +1 -0
  76. package/dist/cli/commands/init.d.ts +3 -0
  77. package/dist/cli/commands/init.d.ts.map +1 -0
  78. package/dist/cli/commands/init.js +154 -0
  79. package/dist/cli/commands/init.js.map +1 -0
  80. package/dist/cli/commands/learn.d.ts +3 -0
  81. package/dist/cli/commands/learn.d.ts.map +1 -0
  82. package/dist/cli/commands/learn.js +163 -0
  83. package/dist/cli/commands/learn.js.map +1 -0
  84. package/dist/cli/commands/mcp.d.ts +3 -0
  85. package/dist/cli/commands/mcp.d.ts.map +1 -0
  86. package/dist/cli/commands/mcp.js +89 -0
  87. package/dist/cli/commands/mcp.js.map +1 -0
  88. package/dist/cli/commands/memory.d.ts +3 -0
  89. package/dist/cli/commands/memory.d.ts.map +1 -0
  90. package/dist/cli/commands/memory.js +134 -0
  91. package/dist/cli/commands/memory.js.map +1 -0
  92. package/dist/cli/commands/orchestrate.d.ts +3 -0
  93. package/dist/cli/commands/orchestrate.d.ts.map +1 -0
  94. package/dist/cli/commands/orchestrate.js +237 -0
  95. package/dist/cli/commands/orchestrate.js.map +1 -0
  96. package/dist/cli/commands/patterns.d.ts +3 -0
  97. package/dist/cli/commands/patterns.d.ts.map +1 -0
  98. package/dist/cli/commands/patterns.js +25 -0
  99. package/dist/cli/commands/patterns.js.map +1 -0
  100. package/dist/cli/commands/plan.d.ts +3 -0
  101. package/dist/cli/commands/plan.d.ts.map +1 -0
  102. package/dist/cli/commands/plan.js +77 -0
  103. package/dist/cli/commands/plan.js.map +1 -0
  104. package/dist/cli/commands/plugin.d.ts +3 -0
  105. package/dist/cli/commands/plugin.d.ts.map +1 -0
  106. package/dist/cli/commands/plugin.js +124 -0
  107. package/dist/cli/commands/plugin.js.map +1 -0
  108. package/dist/cli/commands/resume.d.ts +3 -0
  109. package/dist/cli/commands/resume.d.ts.map +1 -0
  110. package/dist/cli/commands/resume.js +55 -0
  111. package/dist/cli/commands/resume.js.map +1 -0
  112. package/dist/cli/commands/run.d.ts +3 -0
  113. package/dist/cli/commands/run.d.ts.map +1 -0
  114. package/dist/cli/commands/run.js +78 -0
  115. package/dist/cli/commands/run.js.map +1 -0
  116. package/dist/cli/commands/share.d.ts +3 -0
  117. package/dist/cli/commands/share.d.ts.map +1 -0
  118. package/dist/cli/commands/share.js +34 -0
  119. package/dist/cli/commands/share.js.map +1 -0
  120. package/dist/cli/commands/status.d.ts +3 -0
  121. package/dist/cli/commands/status.d.ts.map +1 -0
  122. package/dist/cli/commands/status.js +148 -0
  123. package/dist/cli/commands/status.js.map +1 -0
  124. package/dist/cli/commands/template.d.ts +3 -0
  125. package/dist/cli/commands/template.d.ts.map +1 -0
  126. package/dist/cli/commands/template.js +213 -0
  127. package/dist/cli/commands/template.js.map +1 -0
  128. package/dist/cli/commands/vault.d.ts +3 -0
  129. package/dist/cli/commands/vault.d.ts.map +1 -0
  130. package/dist/cli/commands/vault.js +402 -0
  131. package/dist/cli/commands/vault.js.map +1 -0
  132. package/dist/cli/commands/verify.d.ts +3 -0
  133. package/dist/cli/commands/verify.d.ts.map +1 -0
  134. package/dist/cli/commands/verify.js +38 -0
  135. package/dist/cli/commands/verify.js.map +1 -0
  136. package/dist/cli/commands/version.d.ts +3 -0
  137. package/dist/cli/commands/version.d.ts.map +1 -0
  138. package/dist/cli/commands/version.js +19 -0
  139. package/dist/cli/commands/version.js.map +1 -0
  140. package/dist/cli/commands/watch.d.ts +3 -0
  141. package/dist/cli/commands/watch.d.ts.map +1 -0
  142. package/dist/cli/commands/watch.js +179 -0
  143. package/dist/cli/commands/watch.js.map +1 -0
  144. package/dist/cli/index.d.ts +3 -0
  145. package/dist/cli/index.d.ts.map +1 -0
  146. package/dist/cli/index.js +118 -0
  147. package/dist/cli/index.js.map +1 -0
  148. package/dist/core/checkpoint.d.ts +35 -0
  149. package/dist/core/checkpoint.d.ts.map +1 -0
  150. package/dist/core/checkpoint.js +80 -0
  151. package/dist/core/checkpoint.js.map +1 -0
  152. package/dist/core/event-bus.d.ts +41 -0
  153. package/dist/core/event-bus.d.ts.map +1 -0
  154. package/dist/core/event-bus.js +115 -0
  155. package/dist/core/event-bus.js.map +1 -0
  156. package/dist/core/lifecycle.d.ts +30 -0
  157. package/dist/core/lifecycle.d.ts.map +1 -0
  158. package/dist/core/lifecycle.js +72 -0
  159. package/dist/core/lifecycle.js.map +1 -0
  160. package/dist/core/patterns.d.ts +43 -0
  161. package/dist/core/patterns.d.ts.map +1 -0
  162. package/dist/core/patterns.js +372 -0
  163. package/dist/core/patterns.js.map +1 -0
  164. package/dist/core/permissions.d.ts +40 -0
  165. package/dist/core/permissions.d.ts.map +1 -0
  166. package/dist/core/permissions.js +113 -0
  167. package/dist/core/permissions.js.map +1 -0
  168. package/dist/core/registry.d.ts +80 -0
  169. package/dist/core/registry.d.ts.map +1 -0
  170. package/dist/core/registry.js +308 -0
  171. package/dist/core/registry.js.map +1 -0
  172. package/dist/core/snapshots.d.ts +20 -0
  173. package/dist/core/snapshots.d.ts.map +1 -0
  174. package/dist/core/snapshots.js +73 -0
  175. package/dist/core/snapshots.js.map +1 -0
  176. package/dist/core/types.d.ts +168 -0
  177. package/dist/core/types.d.ts.map +1 -0
  178. package/dist/core/types.js +33 -0
  179. package/dist/core/types.js.map +1 -0
  180. package/dist/hooks/cli.d.ts +11 -0
  181. package/dist/hooks/cli.d.ts.map +1 -0
  182. package/dist/hooks/cli.js +32 -0
  183. package/dist/hooks/cli.js.map +1 -0
  184. package/dist/hooks/index.d.ts +23 -0
  185. package/dist/hooks/index.d.ts.map +1 -0
  186. package/dist/hooks/index.js +58 -0
  187. package/dist/hooks/index.js.map +1 -0
  188. package/dist/index.d.ts +82 -0
  189. package/dist/index.d.ts.map +1 -0
  190. package/dist/index.js +49 -0
  191. package/dist/index.js.map +1 -0
  192. package/dist/memory/index.d.ts +105 -0
  193. package/dist/memory/index.d.ts.map +1 -0
  194. package/dist/memory/index.js +298 -0
  195. package/dist/memory/index.js.map +1 -0
  196. package/dist/memory/schema.d.ts +6 -0
  197. package/dist/memory/schema.d.ts.map +1 -0
  198. package/dist/memory/schema.js +71 -0
  199. package/dist/memory/schema.js.map +1 -0
  200. package/dist/plugin/index.d.ts +6 -0
  201. package/dist/plugin/index.d.ts.map +1 -0
  202. package/dist/plugin/index.js +182 -0
  203. package/dist/plugin/index.js.map +1 -0
  204. package/dist/runtime/acp.d.ts +41 -0
  205. package/dist/runtime/acp.d.ts.map +1 -0
  206. package/dist/runtime/acp.js +137 -0
  207. package/dist/runtime/acp.js.map +1 -0
  208. package/dist/runtime/adaptive.d.ts +34 -0
  209. package/dist/runtime/adaptive.d.ts.map +1 -0
  210. package/dist/runtime/adaptive.js +229 -0
  211. package/dist/runtime/adaptive.js.map +1 -0
  212. package/dist/runtime/autonomy.d.ts +21 -0
  213. package/dist/runtime/autonomy.d.ts.map +1 -0
  214. package/dist/runtime/autonomy.js +74 -0
  215. package/dist/runtime/autonomy.js.map +1 -0
  216. package/dist/runtime/backends/claude.d.ts +9 -0
  217. package/dist/runtime/backends/claude.d.ts.map +1 -0
  218. package/dist/runtime/backends/claude.js +134 -0
  219. package/dist/runtime/backends/claude.js.map +1 -0
  220. package/dist/runtime/backends/codex.d.ts +9 -0
  221. package/dist/runtime/backends/codex.d.ts.map +1 -0
  222. package/dist/runtime/backends/codex.js +132 -0
  223. package/dist/runtime/backends/codex.js.map +1 -0
  224. package/dist/runtime/backends/gemini.d.ts +9 -0
  225. package/dist/runtime/backends/gemini.d.ts.map +1 -0
  226. package/dist/runtime/backends/gemini.js +103 -0
  227. package/dist/runtime/backends/gemini.js.map +1 -0
  228. package/dist/runtime/backends/index.d.ts +17 -0
  229. package/dist/runtime/backends/index.d.ts.map +1 -0
  230. package/dist/runtime/backends/index.js +39 -0
  231. package/dist/runtime/backends/index.js.map +1 -0
  232. package/dist/runtime/backends/mock.d.ts +21 -0
  233. package/dist/runtime/backends/mock.d.ts.map +1 -0
  234. package/dist/runtime/backends/mock.js +46 -0
  235. package/dist/runtime/backends/mock.js.map +1 -0
  236. package/dist/runtime/backends/types.d.ts +34 -0
  237. package/dist/runtime/backends/types.d.ts.map +1 -0
  238. package/dist/runtime/backends/types.js +2 -0
  239. package/dist/runtime/backends/types.js.map +1 -0
  240. package/dist/runtime/backends/vercel-ai.d.ts +14 -0
  241. package/dist/runtime/backends/vercel-ai.d.ts.map +1 -0
  242. package/dist/runtime/backends/vercel-ai.js +137 -0
  243. package/dist/runtime/backends/vercel-ai.js.map +1 -0
  244. package/dist/runtime/cache-optimizer.d.ts +37 -0
  245. package/dist/runtime/cache-optimizer.d.ts.map +1 -0
  246. package/dist/runtime/cache-optimizer.js +54 -0
  247. package/dist/runtime/cache-optimizer.js.map +1 -0
  248. package/dist/runtime/cascade.d.ts +26 -0
  249. package/dist/runtime/cascade.d.ts.map +1 -0
  250. package/dist/runtime/cascade.js +54 -0
  251. package/dist/runtime/cascade.js.map +1 -0
  252. package/dist/runtime/chunker.d.ts +36 -0
  253. package/dist/runtime/chunker.d.ts.map +1 -0
  254. package/dist/runtime/chunker.js +210 -0
  255. package/dist/runtime/chunker.js.map +1 -0
  256. package/dist/runtime/compaction.d.ts +22 -0
  257. package/dist/runtime/compaction.d.ts.map +1 -0
  258. package/dist/runtime/compaction.js +36 -0
  259. package/dist/runtime/compaction.js.map +1 -0
  260. package/dist/runtime/compounder.d.ts +66 -0
  261. package/dist/runtime/compounder.d.ts.map +1 -0
  262. package/dist/runtime/compounder.js +276 -0
  263. package/dist/runtime/compounder.js.map +1 -0
  264. package/dist/runtime/cost-model.d.ts +24 -0
  265. package/dist/runtime/cost-model.d.ts.map +1 -0
  266. package/dist/runtime/cost-model.js +120 -0
  267. package/dist/runtime/cost-model.js.map +1 -0
  268. package/dist/runtime/distiller.d.ts +21 -0
  269. package/dist/runtime/distiller.d.ts.map +1 -0
  270. package/dist/runtime/distiller.js +70 -0
  271. package/dist/runtime/distiller.js.map +1 -0
  272. package/dist/runtime/engine.d.ts +123 -0
  273. package/dist/runtime/engine.d.ts.map +1 -0
  274. package/dist/runtime/engine.js +969 -0
  275. package/dist/runtime/engine.js.map +1 -0
  276. package/dist/runtime/executor.d.ts +71 -0
  277. package/dist/runtime/executor.d.ts.map +1 -0
  278. package/dist/runtime/executor.js +283 -0
  279. package/dist/runtime/executor.js.map +1 -0
  280. package/dist/runtime/heuristics.d.ts +33 -0
  281. package/dist/runtime/heuristics.d.ts.map +1 -0
  282. package/dist/runtime/heuristics.js +188 -0
  283. package/dist/runtime/heuristics.js.map +1 -0
  284. package/dist/runtime/living-spec.d.ts +34 -0
  285. package/dist/runtime/living-spec.d.ts.map +1 -0
  286. package/dist/runtime/living-spec.js +91 -0
  287. package/dist/runtime/living-spec.js.map +1 -0
  288. package/dist/runtime/lsp.d.ts +50 -0
  289. package/dist/runtime/lsp.d.ts.map +1 -0
  290. package/dist/runtime/lsp.js +110 -0
  291. package/dist/runtime/lsp.js.map +1 -0
  292. package/dist/runtime/mcp.d.ts +27 -0
  293. package/dist/runtime/mcp.d.ts.map +1 -0
  294. package/dist/runtime/mcp.js +154 -0
  295. package/dist/runtime/mcp.js.map +1 -0
  296. package/dist/runtime/model-router.d.ts +22 -0
  297. package/dist/runtime/model-router.d.ts.map +1 -0
  298. package/dist/runtime/model-router.js +94 -0
  299. package/dist/runtime/model-router.js.map +1 -0
  300. package/dist/runtime/panes.d.ts +76 -0
  301. package/dist/runtime/panes.d.ts.map +1 -0
  302. package/dist/runtime/panes.js +279 -0
  303. package/dist/runtime/panes.js.map +1 -0
  304. package/dist/runtime/plan-search.d.ts +41 -0
  305. package/dist/runtime/plan-search.d.ts.map +1 -0
  306. package/dist/runtime/plan-search.js +140 -0
  307. package/dist/runtime/plan-search.js.map +1 -0
  308. package/dist/runtime/plugins.d.ts +59 -0
  309. package/dist/runtime/plugins.d.ts.map +1 -0
  310. package/dist/runtime/plugins.js +121 -0
  311. package/dist/runtime/plugins.js.map +1 -0
  312. package/dist/runtime/reflexion.d.ts +22 -0
  313. package/dist/runtime/reflexion.d.ts.map +1 -0
  314. package/dist/runtime/reflexion.js +85 -0
  315. package/dist/runtime/reflexion.js.map +1 -0
  316. package/dist/runtime/review-schema.d.ts +75 -0
  317. package/dist/runtime/review-schema.d.ts.map +1 -0
  318. package/dist/runtime/review-schema.js +223 -0
  319. package/dist/runtime/review-schema.js.map +1 -0
  320. package/dist/runtime/rewriter.d.ts +8 -0
  321. package/dist/runtime/rewriter.d.ts.map +1 -0
  322. package/dist/runtime/rewriter.js +81 -0
  323. package/dist/runtime/rewriter.js.map +1 -0
  324. package/dist/runtime/sharing.d.ts +15 -0
  325. package/dist/runtime/sharing.d.ts.map +1 -0
  326. package/dist/runtime/sharing.js +48 -0
  327. package/dist/runtime/sharing.js.map +1 -0
  328. package/dist/runtime/stats.d.ts +53 -0
  329. package/dist/runtime/stats.d.ts.map +1 -0
  330. package/dist/runtime/stats.js +160 -0
  331. package/dist/runtime/stats.js.map +1 -0
  332. package/dist/runtime/templates.d.ts +77 -0
  333. package/dist/runtime/templates.d.ts.map +1 -0
  334. package/dist/runtime/templates.js +221 -0
  335. package/dist/runtime/templates.js.map +1 -0
  336. package/dist/runtime/traces.d.ts +60 -0
  337. package/dist/runtime/traces.d.ts.map +1 -0
  338. package/dist/runtime/traces.js +166 -0
  339. package/dist/runtime/traces.js.map +1 -0
  340. package/dist/runtime/verifier.d.ts +54 -0
  341. package/dist/runtime/verifier.d.ts.map +1 -0
  342. package/dist/runtime/verifier.js +172 -0
  343. package/dist/runtime/verifier.js.map +1 -0
  344. package/dist/runtime/worktree.d.ts +24 -0
  345. package/dist/runtime/worktree.d.ts.map +1 -0
  346. package/dist/runtime/worktree.js +82 -0
  347. package/dist/runtime/worktree.js.map +1 -0
  348. package/dist/tui/dashboard.d.ts +65 -0
  349. package/dist/tui/dashboard.d.ts.map +1 -0
  350. package/dist/tui/dashboard.js +496 -0
  351. package/dist/tui/dashboard.js.map +1 -0
  352. package/dist/tui/progress.d.ts +32 -0
  353. package/dist/tui/progress.d.ts.map +1 -0
  354. package/dist/tui/progress.js +257 -0
  355. package/dist/tui/progress.js.map +1 -0
  356. package/dist/tui/renderer.d.ts +72 -0
  357. package/dist/tui/renderer.d.ts.map +1 -0
  358. package/dist/tui/renderer.js +205 -0
  359. package/dist/tui/renderer.js.map +1 -0
  360. package/dist/utils/compact-format.d.ts +35 -0
  361. package/dist/utils/compact-format.d.ts.map +1 -0
  362. package/dist/utils/compact-format.js +106 -0
  363. package/dist/utils/compact-format.js.map +1 -0
  364. package/dist/utils/config.d.ts +73 -0
  365. package/dist/utils/config.d.ts.map +1 -0
  366. package/dist/utils/config.js +70 -0
  367. package/dist/utils/config.js.map +1 -0
  368. package/dist/utils/env.d.ts +6 -0
  369. package/dist/utils/env.d.ts.map +1 -0
  370. package/dist/utils/env.js +28 -0
  371. package/dist/utils/env.js.map +1 -0
  372. package/dist/utils/errors.d.ts +14 -0
  373. package/dist/utils/errors.d.ts.map +1 -0
  374. package/dist/utils/errors.js +120 -0
  375. package/dist/utils/errors.js.map +1 -0
  376. package/dist/utils/logger.d.ts +14 -0
  377. package/dist/utils/logger.d.ts.map +1 -0
  378. package/dist/utils/logger.js +56 -0
  379. package/dist/utils/logger.js.map +1 -0
  380. package/dist/utils/output.d.ts +10 -0
  381. package/dist/utils/output.d.ts.map +1 -0
  382. package/dist/utils/output.js +26 -0
  383. package/dist/utils/output.js.map +1 -0
  384. package/dist/utils/paths.d.ts +7 -0
  385. package/dist/utils/paths.d.ts.map +1 -0
  386. package/dist/utils/paths.js +16 -0
  387. package/dist/utils/paths.js.map +1 -0
  388. package/dist/utils/project-config.d.ts +18 -0
  389. package/dist/utils/project-config.d.ts.map +1 -0
  390. package/dist/utils/project-config.js +46 -0
  391. package/dist/utils/project-config.js.map +1 -0
  392. package/dist/utils/redact.d.ts +5 -0
  393. package/dist/utils/redact.d.ts.map +1 -0
  394. package/dist/utils/redact.js +25 -0
  395. package/dist/utils/redact.js.map +1 -0
  396. package/dist/utils/schemas.d.ts +109 -0
  397. package/dist/utils/schemas.d.ts.map +1 -0
  398. package/dist/utils/schemas.js +63 -0
  399. package/dist/utils/schemas.js.map +1 -0
  400. package/dist/utils/terminal.d.ts +33 -0
  401. package/dist/utils/terminal.d.ts.map +1 -0
  402. package/dist/utils/terminal.js +82 -0
  403. package/dist/utils/terminal.js.map +1 -0
  404. package/dist/utils/tokens.d.ts +9 -0
  405. package/dist/utils/tokens.d.ts.map +1 -0
  406. package/dist/utils/tokens.js +11 -0
  407. package/dist/utils/tokens.js.map +1 -0
  408. package/package.json +71 -0
  409. package/skills/design-system/SKILL.md +195 -0
  410. package/skills/orchestration-patterns/SKILL.md +81 -0
  411. package/skills/orchestration-patterns/examples/example-workflows.md +290 -0
  412. package/skills/orchestration-patterns/references/adversarial.md +51 -0
  413. package/skills/orchestration-patterns/references/batch.md +63 -0
  414. package/skills/orchestration-patterns/references/chaos.md +43 -0
  415. package/skills/orchestration-patterns/references/competitive.md +84 -0
  416. package/skills/orchestration-patterns/references/debate.md +44 -0
  417. package/skills/orchestration-patterns/references/emergence.md +50 -0
  418. package/skills/orchestration-patterns/references/fan-out-fan-in.md +74 -0
  419. package/skills/orchestration-patterns/references/iterative.md +99 -0
  420. package/skills/orchestration-patterns/references/pipeline.md +72 -0
  421. package/skills/swarm-output-style/SKILL.md +85 -0
  422. package/templates/add-endpoint.yml +44 -0
  423. package/templates/add-feature.yml +30 -0
  424. package/templates/agent-template.md +73 -0
  425. package/templates/bug-fix.yml +31 -0
  426. package/templates/explore.yml +21 -0
  427. package/templates/fix-pr.yml +30 -0
  428. package/templates/migration.yml +36 -0
  429. package/templates/refactor.yml +35 -0
  430. package/templates/security-audit.yml +27 -0
  431. package/templates/workflow-template.md +63 -0
package/AGENTS.md ADDED
@@ -0,0 +1,72 @@
1
+ # AGENTS.md
2
+ # Cross-tool agent instructions — read by Claude Code, Codex, and Gemini CLI
3
+
4
+ ## Swarm Engine
5
+
6
+ This project uses the Swarm Engine for multi-agent orchestration. The `swarm` CLI coordinates multiple specialized AI agents working together.
7
+
8
+ ## Commands
9
+
10
+ ```bash
11
+ # Main orchestration
12
+ swarm orchestrate "<task>" # Full multi-phase: research → implement → review
13
+
14
+ # Single agent
15
+ swarm run <agent> "<task>" # Run one agent (researcher, implementer, reviewer, etc.)
16
+
17
+ # Configuration
18
+ swarm setup # Interactive wizard — configure backends and models
19
+ swarm status # Show registered agents, backends, and patterns
20
+
21
+ # Memory
22
+ swarm memory search "<query>" # Search past decisions and knowledge
23
+ swarm memory store <type> "<title>" # Save knowledge (pipe content via stdin)
24
+ ```
25
+
26
+ ## Available Agents
27
+
28
+ | Agent | Role | Use when |
29
+ |-------|------|----------|
30
+ | researcher | Explores code, finds patterns | You need to understand a codebase area |
31
+ | implementer | Writes code following conventions | You have a clear spec to build |
32
+ | reviewer | Finds bugs, security issues | Code needs quality review |
33
+ | tester | Writes and runs tests | Features need test coverage |
34
+ | debugger | Diagnoses and fixes bugs | Something is broken |
35
+ | planner | Designs architecture | Complex feature needs upfront design |
36
+ | refactorer | Safe incremental refactoring | Code needs restructuring with test gates |
37
+ | integrator | Verifies cross-module contracts | After parallel work on different modules |
38
+ | devils-advocate | Challenges assumptions | High-risk code needs adversarial review |
39
+ | grounding | Verifies implementation matches spec | Risk of scope drift |
40
+ | security-reviewer | Finds security vulnerabilities (OWASP) | Code handles auth, user input, or secrets |
41
+ | performance-reviewer | Finds performance issues | Code has hot paths, large data, or I/O |
42
+ | data-integrity-reviewer | Reviews migrations and data handling | Database changes or multi-table writes |
43
+ | api-contract-reviewer | Checks backward compatibility | Public API or type export changes |
44
+ | testing-reviewer | Reviews test quality and coverage | Tests need gap analysis or flakiness check |
45
+ | accessibility-reviewer | Checks WCAG/ARIA compliance | UI code needs accessibility audit |
46
+ | dependency-reviewer | Reviews dep security and licenses | New packages added or upgraded |
47
+ | error-handling-reviewer | Reviews error handling patterns | Code has I/O, external APIs, or error paths |
48
+ | concurrency-reviewer | Finds race conditions and deadlocks | Shared state or parallel async operations |
49
+ | documentation-reviewer | Checks docs accuracy vs code | Docs may be stale after code changes |
50
+ | judge | Evaluates competing outputs | Spike/discover patterns need a winner |
51
+ | orchestrator | Coordinates multi-agent workflows | Complex multi-phase tasks |
52
+ | sentinel | Monitors git activity | Background knowledge updates |
53
+ | guardian | Runs affected tests | Background regression detection |
54
+ | librarian | Maintains knowledge quality | Vault cleanup and organization |
55
+ | documenter | Writes technical documentation | Code needs docs |
56
+
57
+ ## Orchestration Patterns
58
+
59
+ | Pattern | Use when |
60
+ |---------|----------|
61
+ | `hybrid` | Most tasks — research → implement → review |
62
+ | `tdd` | New features that need test coverage |
63
+ | `red-team` | Security-sensitive code — build then break |
64
+ | `spike` | Uncertain approach — try two, pick the best |
65
+ | `discover` | Novel problem — hypothesize → experiment → implement |
66
+
67
+ ## Conventions
68
+
69
+ - Agents follow existing codebase patterns and conventions
70
+ - Every implementation gets reviewed by parallel reviewers (correctness + security + conventions)
71
+ - Knowledge from past sessions is stored in memory — agents check it before starting
72
+ - Tech debt is tagged explicitly: DEBT:NEW, DEBT:EXISTING, DEBT:WORSENED
package/CLAUDE.md ADDED
@@ -0,0 +1,89 @@
1
+ # Swarm Engine — Developer Guide
2
+
3
+ ## Architecture
4
+
5
+ ```
6
+ src/
7
+ ├── core/
8
+ │ ├── types.ts # 18+ types: Agent, Phase, Orchestration, Event, Pattern
9
+ │ ├── event-bus.ts # Typed events + JSONL logging + 10MB rotation
10
+ │ ├── lifecycle.ts # Agent FSM (registered → spawning → running → idle → shutdown)
11
+ │ ├── registry.ts # Agent registration from code or .md files (js-yaml)
12
+ │ ├── patterns.ts # 7 composable patterns with compose() + extend()
13
+ │ ├── checkpoint.ts # Save/resume orchestration state (UUID-validated)
14
+ │ ├── permissions.ts # Fine-grained permission model + doom loop detector
15
+ │ └── snapshots.ts # Filesystem snapshot/rollback for agent changes
16
+ ├── runtime/
17
+ │ ├── engine.ts # DAG executor: work-queue, retries, timeouts, approvals
18
+ │ ├── executor.ts # Routes to pluggable backends with permission/snapshot hooks
19
+ │ ├── compaction.ts # Context window management and summarization
20
+ │ ├── distiller.ts # Context distillation between phases
21
+ │ ├── verifier.ts # Project verification + ContinuousVerifier
22
+ │ ├── cost-model.ts # Cost estimation and budget tracking
23
+ │ ├── stats.ts # Execution statistics collector
24
+ │ ├── model-router.ts # UCB1-based model selection across task types
25
+ │ ├── autonomy.ts # Autonomy level tracking per task type
26
+ │ ├── adaptive.ts # Adaptive replanning based on phase results
27
+ │ ├── reflexion.ts # Post-phase reflection engine
28
+ │ ├── rewriter.ts # Plan rewriting rules
29
+ │ ├── traces.ts # Execution trace storage and similarity search
30
+ │ ├── templates.ts # Reusable orchestration templates
31
+ │ ├── sharing.ts # Generate HTML/Markdown/JSON reports
32
+ │ ├── plugins.ts # TypeScript plugin loader with lifecycle hooks
33
+ │ ├── worktree.ts # Git worktree isolation for parallel agents
34
+ │ ├── panes.ts # Tmux split pane manager for visible agent execution
35
+ │ ├── mcp.ts # MCP client (stdio + HTTP transports)
36
+ │ ├── lsp.ts # LSP client for type info and diagnostics
37
+ │ ├── acp.ts # ACP server for IDE integration
38
+ │ ├── heuristics.ts # Task-level learning from execution traces
39
+ │ ├── compounder.ts # Knowledge compounding across orchestrations
40
+ │ ├── plan-search.ts # Plan search and optimization
41
+ │ ├── cache-optimizer.ts # Prompt cache optimization
42
+ │ ├── cascade.ts # Task complexity classification + model cascading
43
+ │ ├── living-spec.ts # Living specification that evolves during execution
44
+ │ ├── chunker.ts # Content chunking for large inputs
45
+ │ ├── review-schema.ts # Review output schema validation
46
+ │ └── backends/
47
+ │ ├── types.ts # ExecutionBackend interface
48
+ │ ├── claude.ts # Claude Code via Agent SDK
49
+ │ ├── codex.ts # OpenAI Codex CLI
50
+ │ ├── gemini.ts # Google Gemini CLI
51
+ │ ├── vercel-ai.ts # Vercel AI SDK (20+ providers)
52
+ │ ├── mock.ts # Testing backend
53
+ │ └── index.ts # BackendRegistry
54
+ ├── memory/ # SQLite + FTS5 + Obsidian vault sync
55
+ ├── hooks/ # TypeScript hook handlers (universal ANSI)
56
+ ├── plugin/ # Claude Code plugin generator
57
+ ├── cli/ # 21 CLI commands (15 visible + 6 hidden)
58
+ └── utils/ # Logger, config, terminal, paths, redact, tokens, errors, env
59
+ ```
60
+
61
+ ## Development
62
+
63
+ ```bash
64
+ npm install # Install dependencies
65
+ npm run dev # Run CLI in dev mode (tsx)
66
+ npm test # Run tests in watch mode
67
+ npm run test:run # Run tests once (871 passing)
68
+ npm run build # Compile TypeScript to dist/
69
+ npm run lint # Type-check without emit
70
+ ```
71
+
72
+ ## Key Design Decisions
73
+
74
+ - **Backend selection**: mock flag → config.backend → defaultBackend → 'claude'
75
+ - **Permission mode**: defaults to 'default' (not bypassPermissions)
76
+ - **Phase DAG**: work-queue approach, not linear loop
77
+ - **IDs**: crypto.randomUUID() everywhere
78
+ - **Checkpoint security**: UUID format validation prevents path traversal
79
+ - **Terminal**: standard ANSI only, no iTerm2-specific codes
80
+ - **Memory**: write-through to ~/swarm-vault/ for Obsidian Sync
81
+ - **Event bus**: try/catch on listeners, 10MB JSONL rotation
82
+
83
+ ## Agents
84
+
85
+ 26 agents in agents/*.md with YAML frontmatter, "Before You Act" + "Self-Check" blocks, debt tagging (DEBT:NEW/EXISTING/WORSENED). Includes 10 specialized reviewers: security, performance, data-integrity, api-contract, testing, accessibility, dependency, error-handling, concurrency, documentation.
86
+
87
+ ## Testing
88
+
89
+ 871 tests across 54 files covering core (types, events, lifecycle, registry, patterns, checkpoints, permissions, snapshots), runtime (engine, executor, backends, compaction, distiller, sharing, plugins, MCP, ACP, panes, heuristics, cascade, cost-model, plan-search, adaptive, reflexion, review-schema, compounder, traces, stats, verifier, templates), memory, hooks, TUI (renderer, dashboard), utils (terminal, config, logger, project-config, errors, env, redact, compact-format), CLI commands (doctor, agents, init, learn), and integration tests.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Simon Coombes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,235 @@
1
+ # Swarm Engine
2
+
3
+ **Your agents. Orchestrated.**
4
+
5
+ Coordinate multiple AI agents working on your code - researching, implementing, reviewing, testing - with an intelligent planner that learns from every run.
6
+
7
+ Works with Claude Code, OpenAI Codex, and Google Gemini CLI. Mix models across agents in the same orchestration.
8
+
9
+ ## What It Looks Like
10
+
11
+ ```
12
+ Swarm Engine - hybrid pattern
13
+
14
+ Phase 1: research ━━━━━━━━━━━━━━━━━━━━ 100% 42s
15
+ ✓ researcher-code sonnet 3.2K tokens
16
+ ✓ researcher-context sonnet 1.8K tokens
17
+
18
+ Phase 2: implement ━━━━━━━━━━━━━━━━━━━ 55% 1m 12s
19
+ ● implementer opus src/auth/rate-limit.ts...
20
+
21
+ Phase 3: review pending
22
+ ○ reviewer-correctness ○ reviewer-security ○ reviewer-convention
23
+
24
+ $0.24 spent | 12.8K tokens | ~2m remaining
25
+ ```
26
+
27
+ ```
28
+ ┌─────────────────────────────────────────────────┐
29
+ │ ✓ Orchestration complete │
30
+ │ Pattern: hybrid (3 phases, 6 agents) │
31
+ │ Duration: 3m 42s | Tokens: 47K | Cost: $0.38 │
32
+ │ │
33
+ │ Save as template? deploy-lambda │
34
+ └─────────────────────────────────────────────────┘
35
+ ```
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ git clone https://github.com/simoncoombes/swarm-engine.git ~/dev/swarm-engine
41
+ cd ~/dev/swarm-engine && npm install && bash install.sh
42
+ swarm doctor # verify everything works
43
+ ```
44
+
45
+ Requires Node.js 20+, jq, and at least one of Claude Code, Codex, or Gemini CLI.
46
+
47
+ ## Quick Start
48
+
49
+ ```bash
50
+ # From Claude Code (agents run in split panes)
51
+ /swarm "add rate limiting to the API"
52
+
53
+ # From any terminal
54
+ swarm orchestrate "add rate limiting to the API"
55
+
56
+ # Preview what will happen before running
57
+ swarm plan "add rate limiting" --dry-run
58
+ ```
59
+
60
+ ## VS Code and Cursor
61
+
62
+ Swarm Engine ships with a VS Code extension that works in both VS Code and Cursor.
63
+
64
+ **Install the extension:**
65
+ ```bash
66
+ cd ~/dev/swarm-engine/vscode-extension
67
+ npm install && npm run build
68
+ npx @vscode/vsce package --allow-missing-repository
69
+ ```
70
+ Then: `Cmd+Shift+P` > "Extensions: Install from VSIX" > select the `.vsix` file.
71
+
72
+ **What you get:**
73
+ - `@swarm` in Copilot Chat - type `@swarm add auth middleware` and it orchestrates the task
74
+ - Sidebar panel with quick actions, pattern browser, and agent list
75
+ - Command palette (`Cmd+Shift+P` > "Swarm") for all commands
76
+ - Status bar shortcut
77
+
78
+ **Copilot Chat examples:**
79
+ ```
80
+ @swarm add rate limiting to the API
81
+ @swarm plan add auth middleware
82
+ @swarm template bug-fix
83
+ @swarm status
84
+ ```
85
+
86
+ ## Why Swarm Engine
87
+
88
+ AI coding agents work alone. You get one agent, one model, one approach. For complex tasks, that's not enough.
89
+
90
+ Swarm Engine orchestrates multiple agents in parallel. Each has a specialized role, the right model for the job, and shared knowledge from past runs.
91
+
92
+ - **7 composable patterns** - hybrid, TDD, red-team, spike, discover, review-cycle, research. Compose them: `--pattern "research | tdd | red-team"`
93
+ - **Intelligent planner** - cost-based optimization, adaptive execution, learns from every run
94
+ - **Mix any backend** - Claude for implementation, Codex for review, Gemini for research. Different model per agent.
95
+ - **Reusable templates** - save successful workflows, run them again with different parameters
96
+ - **26 specialized agents** - 16 core roles plus 10 focused reviewers (security, performance, data integrity, API contracts, testing, accessibility, dependencies, error handling, concurrency, documentation)
97
+ - **871 tests** - 4 rounds of security review, clean on all adversarial attack vectors
98
+
99
+ ## Templates
100
+
101
+ Save successful orchestrations as reusable templates:
102
+
103
+ ```bash
104
+ swarm template list
105
+
106
+ add-endpoint - REST API endpoint with tests
107
+ bug-fix - Reproduce, diagnose, fix, verify
108
+ security-audit - OWASP security review
109
+ refactor - Safe refactoring with verification gates
110
+ migration - Schema migration with rollback
111
+
112
+ swarm template run add-endpoint -i
113
+ ```
114
+
115
+ ## Explain Plan
116
+
117
+ See exactly what will happen before it runs:
118
+
119
+ ```bash
120
+ swarm plan "add auth middleware" --pattern hybrid
121
+
122
+ Phase 1: research [parallel]
123
+ researcher-code sonnet ~5K tokens
124
+ researcher-context sonnet ~3K tokens
125
+ Phase 2: implement [sequential]
126
+ implementer opus ~15K tokens
127
+ Phase 3: review [parallel]
128
+ reviewer-correct opus ~8K tokens
129
+ reviewer-security opus ~8K tokens
130
+
131
+ Est. cost: $0.51 | Est. duration: 95s
132
+ Optimizations: model downgrade for research phase (sonnet vs opus)
133
+ ```
134
+
135
+ ## Commands
136
+
137
+ **Daily use**
138
+
139
+ | Command | What it does |
140
+ |---------|-------------|
141
+ | `/swarm <task>` | Full orchestration - research, implement, review |
142
+ | `/review-cycle <task>` | Implement with iterative quality gate |
143
+ | `/diff-review [base]` | Review branch diff before PR |
144
+ | `/research <question>` | Parallel research across multiple angles |
145
+ | `/tdd <feature>` | Test-driven: write tests first, then implement |
146
+
147
+ **Advanced**
148
+
149
+ | Command | What it does |
150
+ |---------|-------------|
151
+ | `/spike <problem>` | Two approaches compete, judge picks winner |
152
+ | `/red-team <task>` | Adversarial build and break |
153
+ | `/discover <problem>` | Hypothesize, experiment, implement winner |
154
+ | `/fix-pr <PR#>` | Fix PR review comments |
155
+ | `/resume` | Resume from checkpoint |
156
+
157
+ ## Patterns
158
+
159
+ 7 composable patterns. Use them individually or combine them.
160
+
161
+ | Pattern | Flow | Phases |
162
+ |---------|------|--------|
163
+ | hybrid | Research, Implement, Review | 3 |
164
+ | research | Parallel fan-out research | 1 |
165
+ | review-cycle | Implement, Challenge, Review (iterative) | 4 |
166
+ | tdd | Test-first, Implement, Verify, Review | 5 |
167
+ | spike | Two approaches compete, judge decides | 4 |
168
+ | red-team | Build, Break, Harden | 4 |
169
+ | discover | Hypothesize, Experiment, Implement winner | 5 |
170
+
171
+ Compose patterns: `swarm orchestrate "task" --pattern "tdd | red-team"`
172
+
173
+ ## Agents
174
+
175
+ 16 core agents plus 10 specialized reviewers.
176
+
177
+ | Agent | Role |
178
+ |-------|------|
179
+ | researcher | Explores code, finds patterns, traces dependencies |
180
+ | implementer | Writes clean, tested code following conventions |
181
+ | reviewer | Finds bugs, security issues, convention violations |
182
+ | tester | Writes and runs tests, reports coverage |
183
+ | debugger | Reproduces and fixes bugs systematically |
184
+ | planner | Designs architecture before code is written |
185
+ | refactorer | Safe incremental refactoring with test gates |
186
+ | integrator | Verifies cross-module contracts after parallel work |
187
+ | devils-advocate | Challenges every assumption before review |
188
+ | grounding | Verifies the implementation solves the actual problem |
189
+ | orchestrator | Coordinates everything |
190
+ | judge | Evaluates competing implementations and picks the winner |
191
+ | sentinel | Background: watches git activity |
192
+ | guardian | Background: runs affected tests |
193
+ | librarian | Background: maintains knowledge quality |
194
+ | documenter | Writes technical documentation |
195
+
196
+ **Specialized reviewers:** security, performance, data integrity, API contracts, testing, accessibility, dependencies, error handling, concurrency, documentation.
197
+
198
+ ## Cross-Tool Support
199
+
200
+ Convert your agents to work natively in other tools:
201
+
202
+ ```bash
203
+ swarm convert --to copilot # GitHub Copilot .agent.md format
204
+ swarm convert --to cursor # Cursor .mdc rules
205
+ swarm convert --to codex # OpenAI Codex prompts
206
+ swarm convert --to gemini # Gemini CLI skills
207
+ swarm convert --to opencode # OpenCode agents
208
+ swarm convert --to windsurf # Windsurf skills
209
+ ```
210
+
211
+ ## Memory
212
+
213
+ SQLite-backed knowledge base with full-text search. Syncs to Obsidian vault for cross-machine access. The engine learns from every run and compounds knowledge over time.
214
+
215
+ ```bash
216
+ swarm memory search "authentication"
217
+ swarm compound stats
218
+ ```
219
+
220
+ ## Requirements
221
+
222
+ - Node.js 20+
223
+ - jq (`brew install jq`)
224
+ - At least one AI backend:
225
+ - [Claude Code](https://claude.ai/code) (recommended)
226
+ - [Codex CLI](https://github.com/openai/codex) (`npm i -g @openai/codex`)
227
+ - [Gemini CLI](https://github.com/google-gemini/gemini-cli) (`npm i -g @google/gemini-cli`)
228
+
229
+ ## Contributing
230
+
231
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Share agents, templates, patterns, and plugins.
232
+
233
+ ## License
234
+
235
+ MIT
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: accessibility-reviewer
3
+ description: |
4
+ Reviews UI code for accessibility compliance — WCAG, ARIA, keyboard navigation, screen reader support.
5
+
6
+ <example>
7
+ <context>New form component has been built</context>
8
+ <user-request>Review this form for accessibility — labels, keyboard nav, screen readers</user-request>
9
+ <assistant-response>Launches accessibility-reviewer to check WCAG compliance and ARIA usage</assistant-response>
10
+ <commentary>Accessibility audit on a new UI component</commentary>
11
+ </example>
12
+
13
+ <example>
14
+ <context>Dashboard with interactive elements</context>
15
+ <user-request>Check the dashboard for keyboard navigation and focus management</user-request>
16
+ <assistant-response>Launches accessibility-reviewer to verify keyboard and screen reader support</assistant-response>
17
+ <commentary>Interactive UI accessibility review</commentary>
18
+ </example>
19
+ model: sonnet
20
+ tools: Read, Glob, Grep
21
+ disallowedTools: Write, Edit, Bash
22
+ permissionProfile: safe
23
+ maxTurns: 30
24
+ tags: [review, accessibility, frontend]
25
+ ---
26
+
27
+ You are an Accessibility Review Agent. You analyze UI code for WCAG compliance, ARIA correctness, keyboard accessibility, and screen reader compatibility.
28
+
29
+ ## Process
30
+
31
+ 1. **Identify interactive elements** — Buttons, links, forms, modals, dropdowns, tabs, custom widgets
32
+ 2. **Check semantic HTML**:
33
+ - Using `<div>` or `<span>` where `<button>`, `<a>`, `<nav>`, `<main>`, `<section>` is appropriate
34
+ - Missing heading hierarchy (`<h1>` → `<h2>` → `<h3>`, not skipping levels)
35
+ - Lists not using `<ul>`/`<ol>`/`<li>`
36
+ - Tables not using `<th>`, `<caption>`, `scope` attributes
37
+ 3. **Check ARIA usage**:
38
+ - Missing `aria-label` or `aria-labelledby` on icon-only buttons and non-text elements
39
+ - Incorrect ARIA roles (e.g., `role="button"` on a `<div>` instead of using `<button>`)
40
+ - Missing `aria-expanded`, `aria-haspopup` on disclosure widgets
41
+ - Missing `aria-live` regions for dynamic content updates
42
+ 4. **Check keyboard navigation**:
43
+ - All interactive elements reachable via Tab
44
+ - Focus visible on all interactive elements (`:focus-visible` styles)
45
+ - Focus trapped properly in modals (no Tab escape)
46
+ - Escape key closes modals/popups
47
+ - Arrow keys work for grouped controls (tabs, radio buttons, menus)
48
+ 5. **Check visual accessibility**:
49
+ - Color contrast ratios (4.5:1 for normal text, 3:1 for large text — WCAG AA)
50
+ - Information not conveyed by color alone
51
+ - Text resizable to 200% without loss
52
+ - Touch targets at least 44x44px
53
+ 6. **Check form accessibility**:
54
+ - All inputs have associated `<label>` elements (via `for`/`id` or wrapping)
55
+ - Error messages associated with inputs via `aria-describedby`
56
+ - Required fields indicated with `aria-required` and visual indicator
57
+ - Form validation errors announced to screen readers
58
+ 7. **Check image/media accessibility**:
59
+ - All `<img>` have meaningful `alt` text (or `alt=""` for decorative)
60
+ - Video has captions, audio has transcripts
61
+
62
+ ## Before You Act
63
+
64
+ Before executing your process, reason through these questions internally (do not output this thinking):
65
+
66
+ 1. **What's the REAL problem?** Restate the accessibility review scope. What UI am I auditing?
67
+ 2. **What could go wrong?** Missing a barrier that makes the UI unusable for someone. Over-flagging patterns that are actually accessible.
68
+ 3. **What's the blast radius?** Accessibility failures exclude users entirely — not a degraded experience, but no experience.
69
+ 4. **Am I the right agent for this?** If the code has no UI, defer. If the issue is purely visual design, note it but focus on functional accessibility.
70
+
71
+ ## Output Format
72
+
73
+ ```
74
+ ## Accessibility Review Summary
75
+ [ACCESSIBLE / CONCERNS FOUND / BARRIERS FOUND — 1-2 sentence assessment]
76
+ [WCAG Level targeted: A / AA / AAA]
77
+
78
+ ## Findings
79
+
80
+ | # | WCAG | Category | Severity | File:Line | Finding | Confidence |
81
+ |---|------|----------|----------|-----------|---------|------------|
82
+ | 1 | 1.1.1 | Images | High | `file:line` | Missing alt text on logo | 95% |
83
+ | 2 | 2.1.1 | Keyboard | Critical | `file:line` | Custom dropdown not keyboard accessible | 90% |
84
+
85
+ ## Keyboard Navigation Audit
86
+ - [List of interactive elements and their keyboard accessibility status]
87
+
88
+ ## Screen Reader Audit
89
+ - [How the page would be experienced with a screen reader]
90
+
91
+ ## Recommendations
92
+ - [Prioritized fixes — critical barriers first]
93
+ ```
94
+
95
+ ## Rules
96
+
97
+ 1. **Confidence threshold** — Only report findings with confidence >= 80%
98
+ 2. **WCAG references required** — Every finding must cite the relevant WCAG success criterion
99
+ 3. **Barriers over preferences** — Focus on things that prevent access, not style preferences
100
+ 4. **Check the rendered output** — ARIA in the code must produce correct screen reader experience
101
+ 5. **Stay read-only** — Report issues, don't fix them
102
+ 6. **Be specific** — Include file paths, line numbers, and the exact element with the issue
103
+ 7. **Abstention** — If there's no UI code in scope, say so clearly
104
+ 8. **Scratchpad** — If a scratchpad path is provided, read it first and append findings under `## Agent: accessibility-reviewer`
105
+
106
+ ## Self-Check (internal — do not output)
107
+ Before finalizing your output:
108
+ - Did I check keyboard AND screen reader AND visual accessibility?
109
+ - Did I verify ARIA usage is correct (not just present)?
110
+ - Did I consider users with motor, visual, cognitive, and hearing impairments?
111
+ - Would this UI be usable with a screen reader? With keyboard only? With high contrast mode?
112
+
113
+ Always include at the end of your response:
114
+
115
+ ## Meta
116
+ - **Confidence**: [high|medium|low] — how confident you are in your output
117
+ - **Blockers**: [list of things that prevented full completion, or "none"]
118
+ - **Files touched**: none — read-only agent
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: api-contract-reviewer
3
+ description: |
4
+ Reviews API changes for backward compatibility, breaking changes, and contract violations.
5
+
6
+ <example>
7
+ <context>API endpoint response format has been modified</context>
8
+ <user-request>Check if these API changes break existing clients</user-request>
9
+ <assistant-response>Launches api-contract-reviewer to diff contracts and identify breaking changes</assistant-response>
10
+ <commentary>Backward compatibility analysis on API surface changes</commentary>
11
+ </example>
12
+
13
+ <example>
14
+ <context>New API version is being introduced</context>
15
+ <user-request>Review the v2 API for contract consistency and migration path</user-request>
16
+ <assistant-response>Launches api-contract-reviewer to verify versioning and deprecation strategy</assistant-response>
17
+ <commentary>API versioning and migration review</commentary>
18
+ </example>
19
+ model: sonnet
20
+ tools: Read, Glob, Grep
21
+ disallowedTools: Write, Edit, Bash
22
+ permissionProfile: safe
23
+ maxTurns: 30
24
+ tags: [review, api]
25
+ ---
26
+
27
+ You are an API Contract Review Agent. You analyze API changes for backward compatibility, breaking changes, and contract consistency.
28
+
29
+ ## Process
30
+
31
+ 1. **Map the API surface** — Identify all public endpoints, exported functions, type definitions, CLI commands, and configuration formats
32
+ 2. **Detect breaking changes**:
33
+ - Removed endpoints, functions, or type exports
34
+ - Renamed fields in request/response objects
35
+ - Changed parameter types (string → number, optional → required)
36
+ - Changed response shapes (removed fields, changed nesting)
37
+ - Changed error codes or error response format
38
+ - Changed authentication requirements
39
+ - Changed rate limits or pagination behavior
40
+ 3. **Check versioning** — Are breaking changes behind a version bump? Is there a migration path?
41
+ 4. **Check contract consistency** — Do request/response types match the implementation? Are TypeScript types accurate?
42
+ 5. **Check error contracts** — Are error responses documented? Are new error codes introduced without docs?
43
+ 6. **Check defaults** — Have default values changed? Callers relying on defaults will break silently
44
+
45
+ ## Before You Act
46
+
47
+ Before executing your process, reason through these questions internally (do not output this thinking):
48
+
49
+ 1. **What's the REAL problem?** Restate the API review scope. What interfaces am I auditing?
50
+ 2. **What could go wrong?** Missing a breaking change that crashes existing clients. Failing to catch a silent behavior change.
51
+ 3. **What's the blast radius?** Breaking API changes affect every consumer. Internal APIs affect teammates. Public APIs affect users you can't notify.
52
+ 4. **Am I the right agent for this?** If the changes are purely internal implementation, defer to the generic reviewer.
53
+
54
+ ## Output Format
55
+
56
+ ```
57
+ ## API Contract Review Summary
58
+ [COMPATIBLE / MINOR CONCERNS / BREAKING CHANGES FOUND — 1-2 sentence assessment]
59
+
60
+ ## Breaking Changes
61
+
62
+ | # | Type | Severity | File:Line | Before → After | Affected Consumers | Confidence |
63
+ |---|------|----------|-----------|----------------|-------------------|------------|
64
+ | 1 | Field removed | Critical | `file:line` | `user.name` → removed | All GET /users clients | 95% |
65
+
66
+ ## Non-Breaking Changes
67
+ - [List of additive or backward-compatible changes — these are fine]
68
+
69
+ ## Contract Consistency
70
+ - [Type mismatches between definition and implementation]
71
+
72
+ ## Migration Path
73
+ - [Required steps for consumers to adapt, if breaking changes exist]
74
+ ```
75
+
76
+ ## Rules
77
+
78
+ 1. **Confidence threshold** — Only report findings with confidence >= 80%
79
+ 2. **Additive changes are safe** — New optional fields, new endpoints, new error codes (if existing ones unchanged) are not breaking
80
+ 3. **Defaults matter** — A changed default is a breaking change for callers who relied on it
81
+ 4. **Check consumers** — Grep for who calls the changed API. Breaking changes with zero consumers are informational, not critical
82
+ 5. **Stay read-only** — Report issues, don't fix them
83
+ 6. **Be specific** — Show the before/after for every breaking change
84
+ 7. **Abstention** — If the code has no public API surface, say so clearly
85
+ 8. **Scratchpad** — If a scratchpad path is provided, read it first and append findings under `## Agent: api-contract-reviewer`
86
+
87
+ ## Self-Check (internal — do not output)
88
+ Before finalizing your output:
89
+ - Did I check ALL public interfaces, not just HTTP endpoints?
90
+ - Did I consider TypeScript type exports as API surface?
91
+ - Did I verify each "breaking change" is actually consumed by someone?
92
+ - Would a consumer integrating with this API break after this change?
93
+
94
+ Always include at the end of your response:
95
+
96
+ ## Meta
97
+ - **Confidence**: [high|medium|low] — how confident you are in your output
98
+ - **Blockers**: [list of things that prevented full completion, or "none"]
99
+ - **Files touched**: none — read-only agent