swarm-engine 1.1.0 → 1.3.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 (300) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +102 -25
  3. package/agents/accessibility-reviewer.md +2 -0
  4. package/agents/api-contract-reviewer.md +2 -0
  5. package/agents/concurrency-reviewer.md +2 -0
  6. package/agents/data-integrity-reviewer.md +1 -0
  7. package/agents/debugger.md +2 -0
  8. package/agents/dependency-reviewer.md +2 -0
  9. package/agents/devils-advocate.md +1 -0
  10. package/agents/documentation-reviewer.md +2 -0
  11. package/agents/documenter.md +13 -0
  12. package/agents/error-handling-reviewer.md +2 -0
  13. package/agents/grounding.md +3 -2
  14. package/agents/guardian.md +3 -0
  15. package/agents/implementer.md +2 -0
  16. package/agents/integrator.md +3 -0
  17. package/agents/judge.md +2 -0
  18. package/agents/librarian.md +4 -1
  19. package/agents/orchestrator.md +3 -0
  20. package/agents/performance-reviewer.md +2 -0
  21. package/agents/planner.md +2 -0
  22. package/agents/refactorer.md +3 -0
  23. package/agents/reviewer.md +1 -0
  24. package/agents/security-reviewer.md +1 -0
  25. package/agents/sentinel.md +3 -0
  26. package/agents/tester.md +2 -0
  27. package/agents/testing-reviewer.md +2 -0
  28. package/commands/diff-review.md +27 -15
  29. package/commands/discover.md +102 -0
  30. package/commands/dynamic.md +136 -0
  31. package/commands/fix-pr.md +30 -24
  32. package/commands/postmortem.md +106 -0
  33. package/commands/red-team.md +41 -26
  34. package/commands/research.md +22 -1
  35. package/commands/review-cycle.md +38 -20
  36. package/commands/spike.md +108 -0
  37. package/commands/swarm.md +68 -60
  38. package/commands/tdd.md +44 -24
  39. package/dist/cli/commands/acp.d.ts.map +1 -1
  40. package/dist/cli/commands/acp.js +12 -2
  41. package/dist/cli/commands/acp.js.map +1 -1
  42. package/dist/cli/commands/agents.d.ts.map +1 -1
  43. package/dist/cli/commands/agents.js +16 -13
  44. package/dist/cli/commands/agents.js.map +1 -1
  45. package/dist/cli/commands/completions.d.ts.map +1 -1
  46. package/dist/cli/commands/completions.js +21 -9
  47. package/dist/cli/commands/completions.js.map +1 -1
  48. package/dist/cli/commands/compound.d.ts.map +1 -1
  49. package/dist/cli/commands/compound.js +1 -2
  50. package/dist/cli/commands/compound.js.map +1 -1
  51. package/dist/cli/commands/configure.d.ts.map +1 -1
  52. package/dist/cli/commands/configure.js +24 -8
  53. package/dist/cli/commands/configure.js.map +1 -1
  54. package/dist/cli/commands/convert.d.ts +1 -1
  55. package/dist/cli/commands/convert.d.ts.map +1 -1
  56. package/dist/cli/commands/convert.js +22 -48
  57. package/dist/cli/commands/convert.js.map +1 -1
  58. package/dist/cli/commands/doctor.d.ts.map +1 -1
  59. package/dist/cli/commands/doctor.js +1 -3
  60. package/dist/cli/commands/doctor.js.map +1 -1
  61. package/dist/cli/commands/init.d.ts.map +1 -1
  62. package/dist/cli/commands/init.js +17 -7
  63. package/dist/cli/commands/init.js.map +1 -1
  64. package/dist/cli/commands/install.d.ts.map +1 -1
  65. package/dist/cli/commands/install.js +1 -1
  66. package/dist/cli/commands/install.js.map +1 -1
  67. package/dist/cli/commands/learn.js +6 -6
  68. package/dist/cli/commands/learn.js.map +1 -1
  69. package/dist/cli/commands/mcp.d.ts.map +1 -1
  70. package/dist/cli/commands/mcp.js +1 -2
  71. package/dist/cli/commands/mcp.js.map +1 -1
  72. package/dist/cli/commands/memory.d.ts.map +1 -1
  73. package/dist/cli/commands/memory.js +1 -2
  74. package/dist/cli/commands/memory.js.map +1 -1
  75. package/dist/cli/commands/orchestrate.d.ts.map +1 -1
  76. package/dist/cli/commands/orchestrate.js +20 -7
  77. package/dist/cli/commands/orchestrate.js.map +1 -1
  78. package/dist/cli/commands/plan.d.ts.map +1 -1
  79. package/dist/cli/commands/plan.js.map +1 -1
  80. package/dist/cli/commands/plugin.d.ts.map +1 -1
  81. package/dist/cli/commands/plugin.js +8 -5
  82. package/dist/cli/commands/plugin.js.map +1 -1
  83. package/dist/cli/commands/resume.js +1 -1
  84. package/dist/cli/commands/resume.js.map +1 -1
  85. package/dist/cli/commands/run.d.ts.map +1 -1
  86. package/dist/cli/commands/run.js +20 -6
  87. package/dist/cli/commands/run.js.map +1 -1
  88. package/dist/cli/commands/share.d.ts.map +1 -1
  89. package/dist/cli/commands/share.js +6 -1
  90. package/dist/cli/commands/share.js.map +1 -1
  91. package/dist/cli/commands/status.d.ts.map +1 -1
  92. package/dist/cli/commands/status.js +15 -7
  93. package/dist/cli/commands/status.js.map +1 -1
  94. package/dist/cli/commands/template.d.ts.map +1 -1
  95. package/dist/cli/commands/template.js +14 -6
  96. package/dist/cli/commands/template.js.map +1 -1
  97. package/dist/cli/commands/vault.d.ts.map +1 -1
  98. package/dist/cli/commands/vault.js +14 -9
  99. package/dist/cli/commands/vault.js.map +1 -1
  100. package/dist/cli/commands/verify.d.ts.map +1 -1
  101. package/dist/cli/commands/verify.js +2 -2
  102. package/dist/cli/commands/verify.js.map +1 -1
  103. package/dist/cli/commands/watch.js +1 -1
  104. package/dist/cli/commands/watch.js.map +1 -1
  105. package/dist/cli/index.js +14 -4
  106. package/dist/cli/index.js.map +1 -1
  107. package/dist/core/checkpoint.js +1 -1
  108. package/dist/core/checkpoint.js.map +1 -1
  109. package/dist/core/event-bus.d.ts.map +1 -1
  110. package/dist/core/event-bus.js +9 -3
  111. package/dist/core/event-bus.js.map +1 -1
  112. package/dist/core/lifecycle.js.map +1 -1
  113. package/dist/core/patterns.d.ts.map +1 -1
  114. package/dist/core/patterns.js +31 -8
  115. package/dist/core/patterns.js.map +1 -1
  116. package/dist/core/permissions.d.ts.map +1 -1
  117. package/dist/core/permissions.js +21 -10
  118. package/dist/core/permissions.js.map +1 -1
  119. package/dist/core/registry.d.ts.map +1 -1
  120. package/dist/core/registry.js +10 -6
  121. package/dist/core/registry.js.map +1 -1
  122. package/dist/core/snapshots.d.ts.map +1 -1
  123. package/dist/core/snapshots.js +17 -5
  124. package/dist/core/snapshots.js.map +1 -1
  125. package/dist/core/types.d.ts +3 -0
  126. package/dist/core/types.d.ts.map +1 -1
  127. package/dist/core/types.js.map +1 -1
  128. package/dist/hooks/index.js.map +1 -1
  129. package/dist/index.d.ts +68 -6
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +60 -4
  132. package/dist/index.js.map +1 -1
  133. package/dist/memory/index.d.ts +1 -0
  134. package/dist/memory/index.d.ts.map +1 -1
  135. package/dist/memory/index.js +39 -24
  136. package/dist/memory/index.js.map +1 -1
  137. package/dist/memory/schema.d.ts +1 -0
  138. package/dist/memory/schema.d.ts.map +1 -1
  139. package/dist/memory/schema.js +20 -19
  140. package/dist/memory/schema.js.map +1 -1
  141. package/dist/plugin/index.d.ts.map +1 -1
  142. package/dist/plugin/index.js.map +1 -1
  143. package/dist/runtime/acp.d.ts.map +1 -1
  144. package/dist/runtime/acp.js +71 -41
  145. package/dist/runtime/acp.js.map +1 -1
  146. package/dist/runtime/adaptive.d.ts.map +1 -1
  147. package/dist/runtime/adaptive.js +30 -31
  148. package/dist/runtime/adaptive.js.map +1 -1
  149. package/dist/runtime/agent-runner.d.ts +52 -0
  150. package/dist/runtime/agent-runner.d.ts.map +1 -0
  151. package/dist/runtime/agent-runner.js +156 -0
  152. package/dist/runtime/agent-runner.js.map +1 -0
  153. package/dist/runtime/autonomy.d.ts +1 -0
  154. package/dist/runtime/autonomy.d.ts.map +1 -1
  155. package/dist/runtime/autonomy.js +37 -19
  156. package/dist/runtime/autonomy.js.map +1 -1
  157. package/dist/runtime/backends/claude.d.ts.map +1 -1
  158. package/dist/runtime/backends/claude.js +2 -2
  159. package/dist/runtime/backends/claude.js.map +1 -1
  160. package/dist/runtime/backends/codex.d.ts.map +1 -1
  161. package/dist/runtime/backends/codex.js +8 -11
  162. package/dist/runtime/backends/codex.js.map +1 -1
  163. package/dist/runtime/backends/gemini.d.ts.map +1 -1
  164. package/dist/runtime/backends/gemini.js +11 -7
  165. package/dist/runtime/backends/gemini.js.map +1 -1
  166. package/dist/runtime/backends/index.js +1 -1
  167. package/dist/runtime/backends/index.js.map +1 -1
  168. package/dist/runtime/backends/mock.d.ts.map +1 -1
  169. package/dist/runtime/backends/mock.js +1 -1
  170. package/dist/runtime/backends/mock.js.map +1 -1
  171. package/dist/runtime/backends/vercel-ai.d.ts.map +1 -1
  172. package/dist/runtime/backends/vercel-ai.js +41 -9
  173. package/dist/runtime/backends/vercel-ai.js.map +1 -1
  174. package/dist/runtime/cache-optimizer.d.ts.map +1 -1
  175. package/dist/runtime/cache-optimizer.js +3 -9
  176. package/dist/runtime/cache-optimizer.js.map +1 -1
  177. package/dist/runtime/cascade.d.ts.map +1 -1
  178. package/dist/runtime/cascade.js +34 -7
  179. package/dist/runtime/cascade.js.map +1 -1
  180. package/dist/runtime/chunker.d.ts.map +1 -1
  181. package/dist/runtime/chunker.js +12 -6
  182. package/dist/runtime/chunker.js.map +1 -1
  183. package/dist/runtime/compounder.d.ts +1 -1
  184. package/dist/runtime/compounder.d.ts.map +1 -1
  185. package/dist/runtime/compounder.js +30 -11
  186. package/dist/runtime/compounder.js.map +1 -1
  187. package/dist/runtime/cost-model.d.ts.map +1 -1
  188. package/dist/runtime/cost-model.js +1 -1
  189. package/dist/runtime/cost-model.js.map +1 -1
  190. package/dist/runtime/database.d.ts +16 -0
  191. package/dist/runtime/database.d.ts.map +1 -0
  192. package/dist/runtime/database.js +39 -0
  193. package/dist/runtime/database.js.map +1 -0
  194. package/dist/runtime/distiller.d.ts.map +1 -1
  195. package/dist/runtime/distiller.js +6 -3
  196. package/dist/runtime/distiller.js.map +1 -1
  197. package/dist/runtime/engine.d.ts +7 -9
  198. package/dist/runtime/engine.d.ts.map +1 -1
  199. package/dist/runtime/engine.js +129 -394
  200. package/dist/runtime/engine.js.map +1 -1
  201. package/dist/runtime/executor.d.ts +1 -2
  202. package/dist/runtime/executor.d.ts.map +1 -1
  203. package/dist/runtime/executor.js +45 -14
  204. package/dist/runtime/executor.js.map +1 -1
  205. package/dist/runtime/heuristics.d.ts +1 -0
  206. package/dist/runtime/heuristics.d.ts.map +1 -1
  207. package/dist/runtime/heuristics.js +44 -22
  208. package/dist/runtime/heuristics.js.map +1 -1
  209. package/dist/runtime/learning-engine.d.ts +51 -0
  210. package/dist/runtime/learning-engine.d.ts.map +1 -0
  211. package/dist/runtime/learning-engine.js +209 -0
  212. package/dist/runtime/learning-engine.js.map +1 -0
  213. package/dist/runtime/living-spec.js +3 -3
  214. package/dist/runtime/living-spec.js.map +1 -1
  215. package/dist/runtime/lsp.d.ts.map +1 -1
  216. package/dist/runtime/lsp.js +41 -14
  217. package/dist/runtime/lsp.js.map +1 -1
  218. package/dist/runtime/mcp.d.ts.map +1 -1
  219. package/dist/runtime/mcp.js +56 -19
  220. package/dist/runtime/mcp.js.map +1 -1
  221. package/dist/runtime/model-router.d.ts +1 -0
  222. package/dist/runtime/model-router.d.ts.map +1 -1
  223. package/dist/runtime/model-router.js +37 -21
  224. package/dist/runtime/model-router.js.map +1 -1
  225. package/dist/runtime/panes.d.ts.map +1 -1
  226. package/dist/runtime/panes.js +50 -49
  227. package/dist/runtime/panes.js.map +1 -1
  228. package/dist/runtime/plan-search.js +2 -2
  229. package/dist/runtime/plan-search.js.map +1 -1
  230. package/dist/runtime/plugins.d.ts +1 -1
  231. package/dist/runtime/plugins.d.ts.map +1 -1
  232. package/dist/runtime/plugins.js +63 -47
  233. package/dist/runtime/plugins.js.map +1 -1
  234. package/dist/runtime/reflexion.d.ts.map +1 -1
  235. package/dist/runtime/reflexion.js +4 -8
  236. package/dist/runtime/reflexion.js.map +1 -1
  237. package/dist/runtime/review-schema.d.ts.map +1 -1
  238. package/dist/runtime/review-schema.js +12 -12
  239. package/dist/runtime/review-schema.js.map +1 -1
  240. package/dist/runtime/rewriter.d.ts.map +1 -1
  241. package/dist/runtime/rewriter.js +29 -9
  242. package/dist/runtime/rewriter.js.map +1 -1
  243. package/dist/runtime/sharing.d.ts +1 -1
  244. package/dist/runtime/sharing.d.ts.map +1 -1
  245. package/dist/runtime/sharing.js +55 -27
  246. package/dist/runtime/sharing.js.map +1 -1
  247. package/dist/runtime/stats.d.ts +1 -0
  248. package/dist/runtime/stats.d.ts.map +1 -1
  249. package/dist/runtime/stats.js +40 -24
  250. package/dist/runtime/stats.js.map +1 -1
  251. package/dist/runtime/templates.d.ts.map +1 -1
  252. package/dist/runtime/templates.js +2 -2
  253. package/dist/runtime/templates.js.map +1 -1
  254. package/dist/runtime/traces.d.ts +1 -0
  255. package/dist/runtime/traces.d.ts.map +1 -1
  256. package/dist/runtime/traces.js +50 -28
  257. package/dist/runtime/traces.js.map +1 -1
  258. package/dist/runtime/verifier.d.ts.map +1 -1
  259. package/dist/runtime/verifier.js +12 -6
  260. package/dist/runtime/verifier.js.map +1 -1
  261. package/dist/runtime/worktree.d.ts.map +1 -1
  262. package/dist/runtime/worktree.js +35 -18
  263. package/dist/runtime/worktree.js.map +1 -1
  264. package/dist/tui/dashboard.d.ts.map +1 -1
  265. package/dist/tui/dashboard.js +20 -16
  266. package/dist/tui/dashboard.js.map +1 -1
  267. package/dist/tui/progress.d.ts +2 -0
  268. package/dist/tui/progress.d.ts.map +1 -1
  269. package/dist/tui/progress.js +105 -33
  270. package/dist/tui/progress.js.map +1 -1
  271. package/dist/tui/renderer.d.ts.map +1 -1
  272. package/dist/tui/renderer.js.map +1 -1
  273. package/dist/utils/compact-format.js +1 -1
  274. package/dist/utils/compact-format.js.map +1 -1
  275. package/dist/utils/config.d.ts.map +1 -1
  276. package/dist/utils/config.js.map +1 -1
  277. package/dist/utils/env.d.ts.map +1 -1
  278. package/dist/utils/env.js +19 -5
  279. package/dist/utils/env.js.map +1 -1
  280. package/dist/utils/errors.d.ts.map +1 -1
  281. package/dist/utils/errors.js +3 -7
  282. package/dist/utils/errors.js.map +1 -1
  283. package/dist/utils/output.d.ts.map +1 -1
  284. package/dist/utils/output.js +6 -2
  285. package/dist/utils/output.js.map +1 -1
  286. package/dist/utils/project-config.d.ts +18 -0
  287. package/dist/utils/project-config.d.ts.map +1 -1
  288. package/dist/utils/project-config.js +14 -6
  289. package/dist/utils/project-config.js.map +1 -1
  290. package/dist/utils/schemas.d.ts.map +1 -1
  291. package/dist/utils/schemas.js +12 -12
  292. package/dist/utils/schemas.js.map +1 -1
  293. package/dist/utils/terminal.d.ts.map +1 -1
  294. package/dist/utils/terminal.js +18 -7
  295. package/dist/utils/terminal.js.map +1 -1
  296. package/dist/utils/tiers.d.ts.map +1 -1
  297. package/dist/utils/tiers.js +14 -6
  298. package/dist/utils/tiers.js.map +1 -1
  299. package/package.json +14 -3
  300. package/skills/swarm-output-style/SKILL.md +114 -46
package/CLAUDE.md CHANGED
@@ -54,7 +54,7 @@ src/
54
54
  ├── memory/ # SQLite + FTS5 + Obsidian vault sync
55
55
  ├── hooks/ # TypeScript hook handlers (universal ANSI)
56
56
  ├── plugin/ # Claude Code plugin generator
57
- ├── cli/ # 21 CLI commands (15 visible + 6 hidden)
57
+ ├── cli/ # 23 CLI commands (17 visible + 6 hidden)
58
58
  └── utils/ # Logger, config, terminal, paths, redact, tokens, errors, env
59
59
  ```
60
60
 
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Swarm Engine
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/swarm-engine)](https://www.npmjs.com/package/swarm-engine)
4
+ [![Node](https://img.shields.io/node/v/swarm-engine)](https://nodejs.org)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+ [![Tests](https://img.shields.io/badge/tests-871%20passing-brightgreen)]()
7
+
3
8
  **Your agents. Orchestrated.**
4
9
 
5
10
  Coordinate multiple AI agents working on your code - researching, implementing, reviewing, testing - with an intelligent planner that learns from every run.
@@ -9,29 +14,46 @@ Works with Claude Code, OpenAI Codex, and Google Gemini CLI. Mix models across a
9
14
  ## What It Looks Like
10
15
 
11
16
  ```
12
- Swarm Engine - hybrid pattern
17
+ Swarm Engine hybrid pattern
18
+
19
+ Phase: research ━━━━━━━━━━━━━━━━━━━━ done
20
+ ✓ researcher-code sonnet-4-6 3.2K tok 14s
21
+ ✓ researcher-context sonnet-4-6 1.8K tok 9s
22
+
23
+ Phase: implement ━━━━━━━━━━━━━━━━━━━ 1m 12s
24
+ ● implementer opus-4-6 8.4K tok 1m 12s src/auth/rate-limit.ts
13
25
 
14
- Phase 1: research ━━━━━━━━━━━━━━━━━━━━ 100% 42s
15
- researcher-code sonnet 3.2K tokens
16
- researcher-context sonnet 1.8K tokens
26
+ Phase: review ────────────────────── pending
27
+ reviewer-security opus-4-6
28
+ reviewer-perf sonnet-4-6
29
+ ○ reviewer-convention sonnet-4-6
17
30
 
18
- Phase 2: implement ━━━━━━━━━━━━━━━━━━━ 55% 1m 12s
19
- ● implementer opus src/auth/rate-limit.ts...
31
+ Timeline: ━━──── (1/3 phases)
20
32
 
21
- Phase 3: review pending
22
- reviewer-correctness ○ reviewer-security ○ reviewer-convention
33
+ Recent findings:
34
+ researcher-code: express-rate-limit already in package.json
35
+ ○ researcher-context: vault says rate limiter goes before auth middleware
23
36
 
24
- $0.24 spent | 12.8K tokens | ~2m remaining
37
+ 12.8K tokens $0.24 1m 36s ~2m remaining
25
38
  ```
26
39
 
27
40
  ```
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
- └─────────────────────────────────────────────────┘
41
+ +---------------------------------------------------------+
42
+ | |
43
+ | Orchestration complete |
44
+ | |
45
+ | Pattern: hybrid (3 phases, 6 agents) |
46
+ | Duration: 3m 42s |
47
+ | Tokens: 47.2K |
48
+ | Cost: $0.3814 |
49
+ | Tools: 142 calls |
50
+ | |
51
+ | Changes: |
52
+ | src/middleware/rate-limit.ts 48 +++ |
53
+ | src/routes/users.ts 3 +- |
54
+ | tests/middleware/rate-limit.test.ts 62 +++ |
55
+ | |
56
+ +---------------------------------------------------------+
35
57
  ```
36
58
 
37
59
  ## Install
@@ -66,17 +88,34 @@ Requires Node.js 20+, jq, and at least one of Claude Code, Codex, or Gemini CLI.
66
88
 
67
89
  ## Quick Start
68
90
 
69
- ```bash
70
- # From Claude Code (agents run in split panes)
91
+ In Claude Code:
92
+ ```
71
93
  /swarm "add rate limiting to the API"
94
+ ```
72
95
 
73
- # From any terminal
74
- swarm orchestrate "add rate limiting to the API"
96
+ That's it. Agents spawn as teammates, research the codebase, implement the changes, and review the result. You see their work in split panes and get a summary when they're done.
75
97
 
76
- # Preview what will happen before running
77
- swarm plan "add rate limiting" --dry-run
98
+ Other slash commands for specific patterns:
99
+ ```
100
+ /research "how does the auth system work?"
101
+ /tdd "add input validation to user endpoints"
102
+ /red-team "harden the payment flow"
103
+ /review-cycle "refactor the database layer"
104
+ ```
105
+
106
+ ### Standalone CLI
107
+
108
+ You can also run orchestrations directly from any terminal, outside of Claude Code:
109
+
110
+ ```bash
111
+ swarm orchestrate "add rate limiting" # inline progress
112
+ swarm orchestrate "add rate limiting" --panes # tmux split panes
113
+ swarm orchestrate "add rate limiting" --tui # full-screen dashboard
114
+ swarm plan "add rate limiting" # preview plan (free)
78
115
  ```
79
116
 
117
+ The `--panes` flag uses tmux to show each agent in its own split pane. Install with `brew install tmux` (macOS) or `sudo apt install tmux` (Linux).
118
+
80
119
  ## VS Code and Cursor
81
120
 
82
121
  Swarm Engine ships with a VS Code extension that works in both VS Code and Cursor.
@@ -103,13 +142,49 @@ Then: `Cmd+Shift+P` > "Extensions: Install from VSIX" > select the `.vsix` file.
103
142
  @swarm status
104
143
  ```
105
144
 
145
+ ## Use as a Library
146
+
147
+ Swarm Engine can be imported directly into Node.js applications:
148
+
149
+ ```bash
150
+ npm install swarm-engine
151
+ ```
152
+
153
+ ```ts
154
+ import { SwarmEngine } from 'swarm-engine';
155
+
156
+ const engine = new SwarmEngine({ mock: true });
157
+ const result = await engine.orchestrate({
158
+ task: 'Build a REST API',
159
+ pattern: 'hybrid',
160
+ });
161
+ console.log(result.status);
162
+ ```
163
+
164
+ Key exports:
165
+
166
+ ```ts
167
+ import {
168
+ SwarmEngine, // Main orchestration engine
169
+ AgentRegistry, // Load and manage agent definitions
170
+ EventBus, // Typed event system for monitoring
171
+ PatternRegistry, // Composable orchestration patterns
172
+ BackendRegistry, // Multi-backend (Claude, Codex, Gemini)
173
+ CostModel, // Estimate token costs before running
174
+ ModelRouter, // UCB1-based model selection
175
+ TemplateRegistry, // Save and replay successful workflows
176
+ } from 'swarm-engine';
177
+ ```
178
+
179
+ See [src/index.ts](src/index.ts) for the full export surface.
180
+
106
181
  ## Why Swarm Engine
107
182
 
108
- AI coding agents work alone. You get one agent, one model, one approach. For complex tasks, that's not enough.
183
+ Tools like Claude Code already let you spawn parallel agents with teams. That's powerful infrastructure. Swarm Engine builds on top of it with the parts you'd otherwise have to figure out yourself: which agents to run, in what order, with what prompts, on which models, and how to learn from the results.
109
184
 
110
- Swarm Engine orchestrates multiple agents in parallel. Each has a specialized role, the right model for the job, and shared knowledge from past runs.
185
+ It gives you composable patterns, cost-aware planning, specialized agent definitions, and a memory system that improves with every run. Think of it as the orchestration layer that turns ad-hoc multi-agent work into repeatable workflows.
111
186
 
112
- - **7 composable patterns** - hybrid, TDD, red-team, spike, discover, review-cycle, research. Compose them: `--pattern "research | tdd | red-team"`
187
+ - **7 composable patterns** - hybrid, TDD, red-team, spike, discover, review-cycle, research. Compose them: `--pattern "tdd | red-team"`. Plus 12 slash commands including postmortem, diff-review, and fix-pr.
113
188
  - **Intelligent planner** - cost-based optimization, adaptive execution, learns from every run
114
189
  - **Mix any backend** - Claude for implementation, Codex for review, Gemini for research. Different model per agent.
115
190
  - **Reusable templates** - save successful workflows, run them again with different parameters
@@ -171,6 +246,8 @@ swarm plan "add auth middleware" --pattern hybrid
171
246
  | `/spike <problem>` | Two approaches compete, judge picks winner |
172
247
  | `/red-team <task>` | Adversarial build and break |
173
248
  | `/discover <problem>` | Hypothesize, experiment, implement winner |
249
+ | `/dynamic <task>` | Planner decomposes into custom agent workflow |
250
+ | `/postmortem <error>` | Root cause analysis, fix, and prevention |
174
251
  | `/fix-pr <PR#>` | Fix PR review comments |
175
252
  | `/resume` | Resume from checkpoint |
176
253
 
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit, Bash
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, accessibility, frontend]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are an Accessibility Review Agent. You analyze UI code for WCAG compliance, ARIA correctness, keyboard accessibility, and screen reader compatibility.
@@ -29,6 +30,7 @@ You are an Accessibility Review Agent. You analyze UI code for WCAG compliance,
29
30
  ## Process
30
31
 
31
32
  1. **Identify interactive elements** — Buttons, links, forms, modals, dropdowns, tabs, custom widgets
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "accessibility"`. Prior findings may reveal known issues.
32
34
  2. **Check semantic HTML**:
33
35
  - Using `<div>` or `<span>` where `<button>`, `<a>`, `<nav>`, `<main>`, `<section>` is appropriate
34
36
  - Missing heading hierarchy (`<h1>` → `<h2>` → `<h3>`, not skipping levels)
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit, Bash
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, api]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are an API Contract Review Agent. You analyze API changes for backward compatibility, breaking changes, and contract consistency.
@@ -29,6 +30,7 @@ You are an API Contract Review Agent. You analyze API changes for backward compa
29
30
  ## Process
30
31
 
31
32
  1. **Map the API surface** — Identify all public endpoints, exported functions, type definitions, CLI commands, and configuration formats
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "API contracts"`. Prior findings may reveal known issues.
32
34
  2. **Detect breaking changes**:
33
35
  - Removed endpoints, functions, or type exports
34
36
  - Renamed fields in request/response objects
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit, Bash
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, concurrency]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Concurrency Review Agent. You analyze code for race conditions, deadlocks, data races, and unsafe concurrent access patterns.
@@ -29,6 +30,7 @@ You are a Concurrency Review Agent. You analyze code for race conditions, deadlo
29
30
  ## Process
30
31
 
31
32
  1. **Identify shared mutable state** — Global variables, class properties accessed from multiple async contexts, shared caches, singleton state
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "concurrency"`. Prior findings may reveal known issues.
32
34
  2. **Check for TOCTOU races**:
33
35
  - File existence checks followed by file operations (`if (exists(f)) read(f)`)
34
36
  - Database read-then-write without transactions
@@ -30,6 +30,7 @@ You are a Data Integrity Review Agent. You analyze database migrations, schema c
30
30
  ## Process
31
31
 
32
32
  1. **Identify data operations** — Find all schema changes, migrations, CRUD operations, and data transformations
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "data migration"`. Prior findings may reveal known issues.
33
34
  2. **Check migration safety**:
34
35
  - Is the migration reversible? Is there a down/rollback migration?
35
36
  - Does it drop columns or tables? Is data backed up first?
@@ -18,6 +18,8 @@ description: |
18
18
  <commentary>Intermittent failure suggests timing/concurrency issue — needs careful analysis</commentary>
19
19
  </example>
20
20
  model: claude-opus-4-6
21
+ tools: Read, Glob, Grep, Bash, Write, Edit
22
+ disallowedTools: NotebookEdit
21
23
  permissionProfile: standard
22
24
  maxTurns: 50
23
25
  ---
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, dependencies]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Dependency Review Agent. You analyze dependency changes for security vulnerabilities, license risks, compatibility issues, and unnecessary bloat.
@@ -29,6 +30,7 @@ You are a Dependency Review Agent. You analyze dependency changes for security v
29
30
  ## Process
30
31
 
31
32
  1. **Identify dependency changes** — Diff package.json/package-lock.json (or equivalent) to find added, removed, and upgraded packages
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "dependencies"`. Prior findings may reveal known issues.
32
34
  2. **Check security**:
33
35
  - Run `npm audit` or equivalent to find known CVEs
34
36
  - Check if new deps have had recent security advisories
@@ -22,6 +22,7 @@ tools: Read, Glob, Grep, Bash
22
22
  disallowedTools: Write, Edit, NotebookEdit
23
23
  permissionProfile: safe
24
24
  maxTurns: 20
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Devil's Advocate Agent. Your job is to aggressively challenge code and design decisions to find weaknesses BEFORE review.
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit, Bash
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, documentation]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Documentation Review Agent. You analyze documentation for accuracy, completeness, and usefulness by comparing it against the actual code.
@@ -29,6 +30,7 @@ You are a Documentation Review Agent. You analyze documentation for accuracy, co
29
30
  ## Process
30
31
 
31
32
  1. **Identify documentation scope** — README, API docs, inline JSDoc/TSDoc, CHANGELOG, configuration docs, architecture docs
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "documentation"`. Prior findings may reveal known issues.
32
34
  2. **Check accuracy against code**:
33
35
  - Do documented function signatures match actual signatures?
34
36
  - Do documented configuration options match what the code accepts?
@@ -18,6 +18,9 @@ description: |
18
18
  <commentary>Internal architecture documentation that requires deep code reading</commentary>
19
19
  </example>
20
20
  model: claude-haiku-4-5-20251001
21
+ tools: Read, Glob, Grep, Bash, Write, Edit
22
+ disallowedTools: NotebookEdit
23
+ permissionProfile: standard
21
24
  maxTurns: 30
22
25
  ---
23
26
 
@@ -52,6 +55,16 @@ Before executing your process, reason through these questions internally (do not
52
55
  - [What's documented and what's not]
53
56
  ```
54
57
 
58
+ ## Documentation Types
59
+ Choose the right type based on the task:
60
+ - **Inline comments**: Only where logic is non-obvious. Code says WHAT; comments say WHY.
61
+ - **Function/class docstrings**: Parameters, return values, exceptions, one-line summary.
62
+ - **Module README**: Overview, usage examples, key design decisions.
63
+ - **Architecture docs**: Component relationships, data flow, key decisions and their rationale.
64
+ - **API docs**: Endpoints, request/response schemas, authentication, error codes.
65
+
66
+ Never restate what the code does. Document what it means, why it exists, and when NOT to use it.
67
+
55
68
  ## Rules
56
69
 
57
70
  1. **Accuracy over completeness** — Never document behavior you haven't verified in code
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit, Bash
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, errors]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are an Error Handling Review Agent. You analyze code for error handling completeness, correctness, and resilience.
@@ -29,6 +30,7 @@ You are an Error Handling Review Agent. You analyze code for error handling comp
29
30
  ## Process
30
31
 
31
32
  1. **Map error sources** — Identify all operations that can fail: I/O, network calls, parsing, type assertions, external APIs, database queries
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "error handling"`. Prior findings may reveal known issues.
32
34
  2. **Check catch coverage**:
33
35
  - Unhandled promise rejections (missing `.catch()` or `try/catch` on `await`)
34
36
  - Empty catch blocks that swallow errors silently
@@ -22,6 +22,7 @@ tools: Read, Glob, Grep, Bash
22
22
  disallowedTools: Write, Edit, NotebookEdit
23
23
  permissionProfile: safe
24
24
  maxTurns: 15
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Grounding Agent — you keep the swarm connected to reality.
@@ -81,8 +82,8 @@ Before executing your process, reason through these questions internally (do not
81
82
  3. **Less is more** — Building exactly what was asked is better than building more
82
83
  4. **Be honest** — If the implementation drifted, say so. Don't rationalize.
83
84
  5. **Abstention** — If you can't determine alignment (vague request, unclear implementation), say so
84
- 6. **Vault** — Check vault for the original task context
85
- 7. **Scratchpad** — If provided, append findings under `## Agent: grounding`
85
+ 6. **Vault** — Check vault for the original task context: `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "<topic>"`. Don't re-research what's already known.
86
+ 7. **Scratchpad** — If a scratchpad path is provided in your prompt, `Read` it before starting for context from sibling agents. Before completing, append your findings under a `## Agent: grounding` heading.
86
87
 
87
88
  ## Self-Check (internal — do not output)
88
89
  Before finalizing your output:
@@ -18,6 +18,9 @@ description: |
18
18
  <commentary>Post-orchestration safety check</commentary>
19
19
  </example>
20
20
  model: claude-sonnet-4-6
21
+ tools: Read, Glob, Grep, Bash
22
+ disallowedTools: Write, Edit, NotebookEdit
23
+ permissionProfile: safe
21
24
  maxTurns: 15
22
25
  ---
23
26
 
@@ -18,6 +18,8 @@ description: |
18
18
  <commentary>Scoped, well-defined change with clear success criteria</commentary>
19
19
  </example>
20
20
  model: claude-opus-4-6
21
+ tools: Read, Glob, Grep, Bash, Write, Edit
22
+ disallowedTools: NotebookEdit
21
23
  permissionProfile: standard
22
24
  maxTurns: 50
23
25
  ---
@@ -18,6 +18,9 @@ description: |
18
18
  <commentary>Cross-module verification where callers must match callees</commentary>
19
19
  </example>
20
20
  model: claude-opus-4-6
21
+ tools: Read, Glob, Grep, Bash, Write, Edit
22
+ disallowedTools: NotebookEdit
23
+ permissionProfile: standard
21
24
  maxTurns: 50
22
25
  ---
23
26
 
package/agents/judge.md CHANGED
@@ -19,6 +19,7 @@ description: |
19
19
  model: claude-opus-4-6
20
20
  tools: Read, Glob, Grep, Bash
21
21
  disallowedTools: Write, Edit
22
+ permissionProfile: safe
22
23
  maxTurns: 30
23
24
  tags: [evaluation, decision]
24
25
  outputFormat: structured
@@ -38,6 +39,7 @@ Before executing your process, reason through these questions internally (do not
38
39
  ## Process
39
40
 
40
41
  1. Read BOTH implementations thoroughly — every file, every test
42
+ 1b. **Check vault** — Read repo context: `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "<topic>"`. Don't re-research what's already known.
41
43
  2. Read BOTH review assessments
42
44
  3. Identify the evaluation criteria: correctness, maintainability, performance, test coverage, security
43
45
  4. Consider second-order effects: which approach scales better? which is easier to extend?
@@ -18,6 +18,9 @@ description: |
18
18
  <commentary>Knowledge consistency checking</commentary>
19
19
  </example>
20
20
  model: claude-sonnet-4-6
21
+ tools: Read, Glob, Grep, Bash
22
+ disallowedTools: Write, Edit, NotebookEdit
23
+ permissionProfile: safe
21
24
  maxTurns: 25
22
25
  ---
23
26
 
@@ -28,7 +31,7 @@ You are a Librarian Agent — you maintain the quality and coherence of the swar
28
31
  1. **Inventory** — List all vault entries: `~/.claude/scripts/swarm-vault.sh list`
29
32
  2. **Check freshness** — Read each entry's `updated` date. Flag entries older than 30 days as potentially stale.
30
33
  3. **Detect contradictions** — Cross-reference decisions and patterns. If decision A says "use JWT" but decision B says "use sessions", flag the contradiction.
31
- 4. **Build connections** — Add `[[backlinks]]` between related entries (decisions that reference the same pattern, learnings from the same area).
34
+ 4. **Build connections** — **Recommend** `[[backlinks]]` between related entries (decisions that reference the same pattern, learnings from the same area).
32
35
  5. **Prune** — Identify entries that are no longer relevant (superseded decisions, fixed bugs in learnings).
33
36
  6. **Summarize** — Write a vault health report.
34
37
 
@@ -26,6 +26,9 @@ description: |
26
26
  <commentary>Many independent file transformations that can run in parallel</commentary>
27
27
  </example>
28
28
  model: claude-opus-4-6
29
+ tools: Read, Glob, Grep, Bash, Agent
30
+ disallowedTools: NotebookEdit
31
+ permissionProfile: standard
29
32
  maxTurns: 50
30
33
  ---
31
34
 
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit, Bash
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, performance]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Performance Review Agent. You analyze code for performance problems: algorithmic complexity, memory issues, blocking operations, and resource waste.
@@ -29,6 +30,7 @@ You are a Performance Review Agent. You analyze code for performance problems: a
29
30
  ## Process
30
31
 
31
32
  1. **Identify hot paths** — What code runs frequently or processes large data? Entry points, loops, event handlers, API endpoints
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "performance"`. Prior findings may reveal known issues.
32
34
  2. **Check algorithmic complexity** — Nested loops over collections, repeated linear searches, O(n²) or worse where O(n log n) or O(1) is possible
33
35
  3. **Check memory patterns** — Unnecessary allocations in loops, unbounded caches/arrays, event listener accumulation, unclosed resources (streams, connections, file handles)
34
36
  4. **Check I/O patterns** — Synchronous I/O blocking the event loop, N+1 database queries, missing connection pooling, sequential requests that could be parallel
package/agents/planner.md CHANGED
@@ -19,6 +19,8 @@ description: |
19
19
  </example>
20
20
  model: claude-opus-4-6
21
21
  tools: Read, Glob, Grep, Bash
22
+ disallowedTools: Write, Edit, NotebookEdit
23
+ permissionProfile: safe
22
24
  maxTurns: 30
23
25
  ---
24
26
 
@@ -18,6 +18,9 @@ description: |
18
18
  <commentary>Cross-file rename that needs verification at each step to catch breakage early</commentary>
19
19
  </example>
20
20
  model: claude-opus-4-6
21
+ tools: Read, Glob, Grep, Bash, Write, Edit
22
+ disallowedTools: NotebookEdit
23
+ permissionProfile: standard
21
24
  maxTurns: 50
22
25
  ---
23
26
 
@@ -19,6 +19,7 @@ description: |
19
19
  </example>
20
20
  model: claude-opus-4-6
21
21
  tools: Read, Glob, Grep, Bash
22
+ disallowedTools: Write, Edit, NotebookEdit
22
23
  permissionProfile: safe
23
24
  maxTurns: 30
24
25
  ---
@@ -30,6 +30,7 @@ You are a Security Review Agent. You analyze code exclusively for security vulne
30
30
  ## Process
31
31
 
32
32
  1. **Identify attack surface** — Map all entry points: user input, API parameters, file uploads, URL parameters, headers, cookies, environment variables
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "security"`. Prior findings may reveal known issues.
33
34
  2. **Trace data flow** — Follow untrusted input from entry to sink. Check for sanitization/validation at each step
34
35
  3. **Check each OWASP category**:
35
36
  - **Injection** (SQLi, XSS, command injection, LDAP, template injection) — CWE-79, CWE-89, CWE-78
@@ -19,6 +19,9 @@ description: |
19
19
  <commentary>Session-start briefing from ambient monitoring</commentary>
20
20
  </example>
21
21
  model: claude-sonnet-4-6
22
+ tools: Read, Glob, Grep, Bash
23
+ disallowedTools: Write, Edit, NotebookEdit
24
+ permissionProfile: safe
22
25
  maxTurns: 20
23
26
  ---
24
27
 
package/agents/tester.md CHANGED
@@ -18,6 +18,8 @@ description: |
18
18
  <commentary>Focused test for a specific bug fix</commentary>
19
19
  </example>
20
20
  model: claude-opus-4-6
21
+ tools: Read, Glob, Grep, Bash, Write, Edit
22
+ disallowedTools: NotebookEdit
21
23
  permissionProfile: standard
22
24
  maxTurns: 50
23
25
  ---
@@ -22,6 +22,7 @@ disallowedTools: Write, Edit
22
22
  permissionProfile: safe
23
23
  maxTurns: 30
24
24
  tags: [review, testing]
25
+ outputFormat: structured
25
26
  ---
26
27
 
27
28
  You are a Testing Review Agent. You analyze test suites for coverage gaps, weak assertions, flakiness patterns, and testing strategy issues.
@@ -29,6 +30,7 @@ You are a Testing Review Agent. You analyze test suites for coverage gaps, weak
29
30
  ## Process
30
31
 
31
32
  1. **Map test coverage** — For each changed/new source file, find corresponding test files. Identify untested code paths
33
+ 1b. **Check vault** — `~/.claude/scripts/swarm-vault.sh repo "<repo-name>" conventions` and `~/.claude/scripts/swarm-vault.sh search "testing conventions"`. Prior findings may reveal known issues.
32
34
  2. **Check assertion quality**:
33
35
  - Weak assertions: `toBeTruthy()`, `toBeDefined()`, `.not.toThrow()` without checking the return value
34
36
  - Missing assertions: test does setup but never asserts (effectively a smoke test)
@@ -5,11 +5,25 @@ argument-hint: "[base-branch] (default: main)"
5
5
 
6
6
  You are reviewing the current branch's diff with parallel reviewers before creating a PR.
7
7
 
8
+ Follow the `swarm-output-style` skill for ALL output formatting.
9
+
8
10
  ## Task
9
11
  $ARGUMENTS
10
12
 
11
13
  ## Workflow
12
14
 
15
+ ### Step 0: Show Pre-flight Plan
16
+
17
+ Before creating any team or spawning any agent, show the plan:
18
+
19
+ Show the pre-flight plan (see swarm-output-style skill). Include:
20
+ - Base branch and diff summary (file count, approximate line count)
21
+ - The 3 reviewers with model and focus area
22
+ - Estimated cost (~$0.10 correctness, ~$0.10 security, ~$0.04 convention = ~$0.24 total)
23
+ - Estimated time (~5-10 min)
24
+
25
+ Wait for user approval before proceeding.
26
+
13
27
  ### Setup: Create Team
14
28
  1. Create a team with `TeamCreate` (name: `diff-review-<timestamp>`, e.g., `diff-review-1234`)
15
29
  2. Create tasks with `TaskCreate` for each reviewer focus area
@@ -21,13 +35,16 @@ Determine the base branch (default: `main` if no argument provided). Run:
21
35
  - Identify all changed files
22
36
 
23
37
  ### Step 2: Dispatch Reviewers (parallel)
38
+
39
+ Show the phase banner with running total (see swarm-output-style skill).
40
+
24
41
  Spawn 3 reviewer teammates simultaneously, each with `team_name`, `name` (e.g., `reviewer-correctness`, `reviewer-security`, `reviewer-convention`), and `run_in_background: true`, each with the full diff, commit history, and project CLAUDE.md:
25
42
 
26
43
  1. **Correctness reviewer** (opus) — Logic errors, edge cases, off-by-ones, error handling, race conditions, resource leaks
27
44
  2. **Security reviewer** (opus) — OWASP top 10, auth issues, injection, data exposure, secrets in code
28
45
  3. **Convention reviewer** (sonnet) — Project patterns, naming, structure, CLAUDE.md compliance, test coverage
29
46
 
30
- As each reviewer teammate completes, send it a `shutdown_request` via `SendMessage` to close its split pane.
47
+ As each completes: show a one-line verdict (PASS/FAIL + finding count) (see swarm-output-style skill), then send `shutdown_request` via `SendMessage`.
31
48
 
32
49
  ### Step 3: Aggregate
33
50
  Merge all findings and categorize by priority:
@@ -36,21 +53,14 @@ Merge all findings and categorize by priority:
36
53
  - **Suggestion** — note in PR description (style, optional improvements)
37
54
 
38
55
  ### Step 4: Recommend
39
- Based on findings, give one recommendation:
40
-
41
- ```
42
- ## Diff Review Results
43
-
44
- ### Findings
45
- | Priority | File | Line | Finding | Reviewer |
46
- |----------|------|------|---------|----------|
47
- | Critical | ... | ... | ... | ... |
48
56
 
49
- ### Verdict
50
- - **Critical issues found** "Fix these before creating a PR"
51
- - **Only Important/Suggestions** "Ready for PR — consider addressing these"
52
- - **Clean** "LGTM ready for PR"
53
- ```
57
+ Show the full post-completion summary (see swarm-output-style skill). Include:
58
+ - Status (PASS / NEEDS ATTENTION / FAILED)
59
+ - Metrics (agents, duration, tokens, cost)
60
+ - Review gate result with per-reviewer table (findings by severity)
61
+ - Consolidated findings table (Priority | File | Line | Finding | Reviewer)
62
+ - Verdict: "Fix these before creating a PR" / "Ready for PR — consider addressing these" / "LGTM — ready for PR"
63
+ - Next steps (git push, gh pr create, or fix commands)
54
64
 
55
65
  ### Cleanup
56
66
  1. Send `shutdown_request` via `SendMessage` to any remaining active teammates
@@ -62,3 +72,5 @@ Based on findings, give one recommendation:
62
72
  - Include full diff context for each reviewer — they cannot access git
63
73
  - This workflow is read-only — report findings, never fix anything
64
74
  - Include file:line references for every finding
75
+ - Follow the swarm-output-style skill for ALL output formatting
76
+ - Show the plan first, spend tokens second