beth-copilot 1.0.17 → 1.1.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 (265) hide show
  1. package/CHANGELOG.md +41 -28
  2. package/README.md +87 -247
  3. package/bin/cli.js +115 -7
  4. package/dist/__tests__/smoke.test.d.ts +8 -0
  5. package/dist/__tests__/smoke.test.d.ts.map +1 -0
  6. package/dist/__tests__/smoke.test.js +49 -0
  7. package/dist/__tests__/smoke.test.js.map +1 -0
  8. package/dist/cli/commands/beads.e2e.test.d.ts +13 -0
  9. package/dist/cli/commands/beads.e2e.test.d.ts.map +1 -0
  10. package/dist/cli/commands/beads.e2e.test.js +526 -0
  11. package/dist/cli/commands/beads.e2e.test.js.map +1 -0
  12. package/dist/cli/commands/cli-edge-cases.e2e.test.d.ts +32 -0
  13. package/dist/cli/commands/cli-edge-cases.e2e.test.d.ts.map +1 -0
  14. package/dist/cli/commands/cli-edge-cases.e2e.test.js +162 -0
  15. package/dist/cli/commands/cli-edge-cases.e2e.test.js.map +1 -0
  16. package/dist/cli/commands/close.d.ts +89 -0
  17. package/dist/cli/commands/close.d.ts.map +1 -0
  18. package/dist/cli/commands/close.e2e.test.d.ts +27 -0
  19. package/dist/cli/commands/close.e2e.test.d.ts.map +1 -0
  20. package/dist/cli/commands/close.e2e.test.js +252 -0
  21. package/dist/cli/commands/close.e2e.test.js.map +1 -0
  22. package/dist/cli/commands/close.js +309 -0
  23. package/dist/cli/commands/close.js.map +1 -0
  24. package/dist/cli/commands/close.test.d.ts +15 -0
  25. package/dist/cli/commands/close.test.d.ts.map +1 -0
  26. package/dist/cli/commands/close.test.js +634 -0
  27. package/dist/cli/commands/close.test.js.map +1 -0
  28. package/dist/cli/commands/doctor.d.ts +23 -0
  29. package/dist/cli/commands/doctor.d.ts.map +1 -1
  30. package/dist/cli/commands/doctor.js +93 -0
  31. package/dist/cli/commands/doctor.js.map +1 -1
  32. package/dist/cli/commands/doctor.test.js +209 -0
  33. package/dist/cli/commands/doctor.test.js.map +1 -1
  34. package/dist/cli/commands/framework-isolation.test.d.ts +30 -0
  35. package/dist/cli/commands/framework-isolation.test.d.ts.map +1 -0
  36. package/dist/cli/commands/framework-isolation.test.js +119 -0
  37. package/dist/cli/commands/framework-isolation.test.js.map +1 -0
  38. package/dist/cli/commands/init-logic.e2e.test.d.ts +37 -0
  39. package/dist/cli/commands/init-logic.e2e.test.d.ts.map +1 -0
  40. package/dist/cli/commands/init-logic.e2e.test.js +305 -0
  41. package/dist/cli/commands/init-logic.e2e.test.js.map +1 -0
  42. package/dist/cli/commands/land.d.ts +142 -0
  43. package/dist/cli/commands/land.d.ts.map +1 -0
  44. package/dist/cli/commands/land.js +647 -0
  45. package/dist/cli/commands/land.js.map +1 -0
  46. package/dist/cli/commands/land.test.d.ts +20 -0
  47. package/dist/cli/commands/land.test.d.ts.map +1 -0
  48. package/dist/cli/commands/land.test.js +622 -0
  49. package/dist/cli/commands/land.test.js.map +1 -0
  50. package/dist/cli/commands/pipeline.e2e.test.js +1 -1
  51. package/dist/cli/commands/pipeline.e2e.test.js.map +1 -1
  52. package/dist/cli/commands/pre-push-guard.d.ts +84 -0
  53. package/dist/cli/commands/pre-push-guard.d.ts.map +1 -0
  54. package/dist/cli/commands/pre-push-guard.e2e.test.d.ts +24 -0
  55. package/dist/cli/commands/pre-push-guard.e2e.test.d.ts.map +1 -0
  56. package/dist/cli/commands/pre-push-guard.e2e.test.js +171 -0
  57. package/dist/cli/commands/pre-push-guard.e2e.test.js.map +1 -0
  58. package/dist/cli/commands/pre-push-guard.js +257 -0
  59. package/dist/cli/commands/pre-push-guard.js.map +1 -0
  60. package/dist/cli/commands/pre-push-guard.test.d.ts +15 -0
  61. package/dist/cli/commands/pre-push-guard.test.d.ts.map +1 -0
  62. package/dist/cli/commands/pre-push-guard.test.js +397 -0
  63. package/dist/cli/commands/pre-push-guard.test.js.map +1 -0
  64. package/dist/cli/commands/quickstart-expanded.e2e.test.d.ts +23 -0
  65. package/dist/cli/commands/quickstart-expanded.e2e.test.d.ts.map +1 -0
  66. package/dist/cli/commands/quickstart-expanded.e2e.test.js +179 -0
  67. package/dist/cli/commands/quickstart-expanded.e2e.test.js.map +1 -0
  68. package/dist/cli/commands/quickstart.test.js +40 -2
  69. package/dist/cli/commands/quickstart.test.js.map +1 -1
  70. package/dist/core/agents/suite.test.js +4 -2
  71. package/dist/core/agents/suite.test.js.map +1 -1
  72. package/dist/core/agents/tools.test.js +5 -1
  73. package/dist/core/agents/tools.test.js.map +1 -1
  74. package/dist/index.d.ts +3 -10
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +5 -10
  77. package/dist/index.js.map +1 -1
  78. package/package.json +15 -9
  79. package/sbom.json +2011 -819
  80. package/templates/.github/agents/beth.agent.md +222 -45
  81. package/templates/.github/agents/developer.agent.md +37 -67
  82. package/templates/.github/agents/product-manager.agent.md +15 -57
  83. package/templates/.github/agents/researcher.agent.md +20 -60
  84. package/templates/.github/agents/security-reviewer.agent.md +29 -70
  85. package/templates/.github/agents/tester.agent.md +40 -58
  86. package/templates/.github/agents/ux-designer.agent.md +20 -63
  87. package/templates/.github/copilot-instructions.md +217 -204
  88. package/templates/AGENTS.md +108 -20
  89. package/dist/core/context.d.ts +0 -171
  90. package/dist/core/context.d.ts.map +0 -1
  91. package/dist/core/context.js +0 -353
  92. package/dist/core/context.js.map +0 -1
  93. package/dist/core/context.test.d.ts +0 -8
  94. package/dist/core/context.test.d.ts.map +0 -1
  95. package/dist/core/context.test.js +0 -253
  96. package/dist/core/context.test.js.map +0 -1
  97. package/dist/core/handoffs.d.ts +0 -151
  98. package/dist/core/handoffs.d.ts.map +0 -1
  99. package/dist/core/handoffs.js +0 -220
  100. package/dist/core/handoffs.js.map +0 -1
  101. package/dist/core/handoffs.test.d.ts +0 -8
  102. package/dist/core/handoffs.test.d.ts.map +0 -1
  103. package/dist/core/handoffs.test.js +0 -231
  104. package/dist/core/handoffs.test.js.map +0 -1
  105. package/dist/core/orchestrator.d.ts +0 -246
  106. package/dist/core/orchestrator.d.ts.map +0 -1
  107. package/dist/core/orchestrator.js +0 -514
  108. package/dist/core/orchestrator.js.map +0 -1
  109. package/dist/core/orchestrator.test.d.ts +0 -8
  110. package/dist/core/orchestrator.test.d.ts.map +0 -1
  111. package/dist/core/orchestrator.test.js +0 -517
  112. package/dist/core/orchestrator.test.js.map +0 -1
  113. package/dist/core/router.d.ts +0 -102
  114. package/dist/core/router.d.ts.map +0 -1
  115. package/dist/core/router.js +0 -178
  116. package/dist/core/router.js.map +0 -1
  117. package/dist/core/router.test.d.ts +0 -8
  118. package/dist/core/router.test.d.ts.map +0 -1
  119. package/dist/core/router.test.js +0 -215
  120. package/dist/core/router.test.js.map +0 -1
  121. package/dist/init.test.js +0 -288
  122. package/dist/providers/azure.d.ts +0 -147
  123. package/dist/providers/azure.d.ts.map +0 -1
  124. package/dist/providers/azure.js +0 -491
  125. package/dist/providers/azure.js.map +0 -1
  126. package/dist/providers/azure.test.d.ts +0 -11
  127. package/dist/providers/azure.test.d.ts.map +0 -1
  128. package/dist/providers/azure.test.js +0 -330
  129. package/dist/providers/azure.test.js.map +0 -1
  130. package/dist/providers/config.d.ts +0 -87
  131. package/dist/providers/config.d.ts.map +0 -1
  132. package/dist/providers/config.js +0 -193
  133. package/dist/providers/config.js.map +0 -1
  134. package/dist/providers/config.test.d.ts +0 -7
  135. package/dist/providers/config.test.d.ts.map +0 -1
  136. package/dist/providers/config.test.js +0 -370
  137. package/dist/providers/config.test.js.map +0 -1
  138. package/dist/providers/index.d.ts +0 -18
  139. package/dist/providers/index.d.ts.map +0 -1
  140. package/dist/providers/index.js +0 -14
  141. package/dist/providers/index.js.map +0 -1
  142. package/dist/providers/interface.d.ts +0 -191
  143. package/dist/providers/interface.d.ts.map +0 -1
  144. package/dist/providers/interface.js +0 -94
  145. package/dist/providers/interface.js.map +0 -1
  146. package/dist/providers/retry.d.ts +0 -128
  147. package/dist/providers/retry.d.ts.map +0 -1
  148. package/dist/providers/retry.js +0 -205
  149. package/dist/providers/retry.js.map +0 -1
  150. package/dist/providers/retry.test.d.ts +0 -7
  151. package/dist/providers/retry.test.d.ts.map +0 -1
  152. package/dist/providers/retry.test.js +0 -439
  153. package/dist/providers/retry.test.js.map +0 -1
  154. package/dist/providers/streaming.d.ts +0 -157
  155. package/dist/providers/streaming.d.ts.map +0 -1
  156. package/dist/providers/streaming.js +0 -233
  157. package/dist/providers/streaming.js.map +0 -1
  158. package/dist/providers/streaming.test.d.ts +0 -7
  159. package/dist/providers/streaming.test.d.ts.map +0 -1
  160. package/dist/providers/streaming.test.js +0 -372
  161. package/dist/providers/streaming.test.js.map +0 -1
  162. package/dist/providers/types.d.ts +0 -209
  163. package/dist/providers/types.d.ts.map +0 -1
  164. package/dist/providers/types.js +0 -53
  165. package/dist/providers/types.js.map +0 -1
  166. package/dist/providers/types.test.d.ts +0 -7
  167. package/dist/providers/types.test.d.ts.map +0 -1
  168. package/dist/providers/types.test.js +0 -141
  169. package/dist/providers/types.test.js.map +0 -1
  170. package/dist/tools/cli/beads.d.ts +0 -27
  171. package/dist/tools/cli/beads.d.ts.map +0 -1
  172. package/dist/tools/cli/beads.js +0 -172
  173. package/dist/tools/cli/beads.js.map +0 -1
  174. package/dist/tools/cli/beads.test.d.ts +0 -8
  175. package/dist/tools/cli/beads.test.d.ts.map +0 -1
  176. package/dist/tools/cli/beads.test.js +0 -264
  177. package/dist/tools/cli/beads.test.js.map +0 -1
  178. package/dist/tools/cli/editFile.d.ts +0 -17
  179. package/dist/tools/cli/editFile.d.ts.map +0 -1
  180. package/dist/tools/cli/editFile.js +0 -125
  181. package/dist/tools/cli/editFile.js.map +0 -1
  182. package/dist/tools/cli/editFile.test.d.ts +0 -8
  183. package/dist/tools/cli/editFile.test.d.ts.map +0 -1
  184. package/dist/tools/cli/editFile.test.js +0 -177
  185. package/dist/tools/cli/editFile.test.js.map +0 -1
  186. package/dist/tools/cli/readFile.d.ts +0 -25
  187. package/dist/tools/cli/readFile.d.ts.map +0 -1
  188. package/dist/tools/cli/readFile.js +0 -118
  189. package/dist/tools/cli/readFile.js.map +0 -1
  190. package/dist/tools/cli/readFile.test.d.ts +0 -8
  191. package/dist/tools/cli/readFile.test.d.ts.map +0 -1
  192. package/dist/tools/cli/readFile.test.js +0 -194
  193. package/dist/tools/cli/readFile.test.js.map +0 -1
  194. package/dist/tools/cli/search.d.ts +0 -16
  195. package/dist/tools/cli/search.d.ts.map +0 -1
  196. package/dist/tools/cli/search.js +0 -261
  197. package/dist/tools/cli/search.js.map +0 -1
  198. package/dist/tools/cli/search.test.d.ts +0 -8
  199. package/dist/tools/cli/search.test.d.ts.map +0 -1
  200. package/dist/tools/cli/search.test.js +0 -172
  201. package/dist/tools/cli/search.test.js.map +0 -1
  202. package/dist/tools/cli/subagent.d.ts +0 -43
  203. package/dist/tools/cli/subagent.d.ts.map +0 -1
  204. package/dist/tools/cli/subagent.js +0 -99
  205. package/dist/tools/cli/subagent.js.map +0 -1
  206. package/dist/tools/cli/subagent.test.d.ts +0 -8
  207. package/dist/tools/cli/subagent.test.d.ts.map +0 -1
  208. package/dist/tools/cli/subagent.test.js +0 -190
  209. package/dist/tools/cli/subagent.test.js.map +0 -1
  210. package/dist/tools/cli/terminal.d.ts +0 -19
  211. package/dist/tools/cli/terminal.d.ts.map +0 -1
  212. package/dist/tools/cli/terminal.js +0 -164
  213. package/dist/tools/cli/terminal.js.map +0 -1
  214. package/dist/tools/cli/terminal.test.d.ts +0 -8
  215. package/dist/tools/cli/terminal.test.d.ts.map +0 -1
  216. package/dist/tools/cli/terminal.test.js +0 -161
  217. package/dist/tools/cli/terminal.test.js.map +0 -1
  218. package/dist/tools/index.d.ts +0 -25
  219. package/dist/tools/index.d.ts.map +0 -1
  220. package/dist/tools/index.js +0 -41
  221. package/dist/tools/index.js.map +0 -1
  222. package/dist/tools/interface.d.ts +0 -64
  223. package/dist/tools/interface.d.ts.map +0 -1
  224. package/dist/tools/interface.js +0 -37
  225. package/dist/tools/interface.js.map +0 -1
  226. package/dist/tools/interface.test.d.ts +0 -7
  227. package/dist/tools/interface.test.d.ts.map +0 -1
  228. package/dist/tools/interface.test.js +0 -179
  229. package/dist/tools/interface.test.js.map +0 -1
  230. package/dist/tools/mcp/bridge.d.ts +0 -48
  231. package/dist/tools/mcp/bridge.d.ts.map +0 -1
  232. package/dist/tools/mcp/bridge.js +0 -128
  233. package/dist/tools/mcp/bridge.js.map +0 -1
  234. package/dist/tools/mcp/bridge.test.d.ts +0 -8
  235. package/dist/tools/mcp/bridge.test.d.ts.map +0 -1
  236. package/dist/tools/mcp/bridge.test.js +0 -300
  237. package/dist/tools/mcp/bridge.test.js.map +0 -1
  238. package/dist/tools/mcp/client.d.ts +0 -135
  239. package/dist/tools/mcp/client.d.ts.map +0 -1
  240. package/dist/tools/mcp/client.js +0 -263
  241. package/dist/tools/mcp/client.js.map +0 -1
  242. package/dist/tools/mcp/client.test.d.ts +0 -8
  243. package/dist/tools/mcp/client.test.d.ts.map +0 -1
  244. package/dist/tools/mcp/client.test.js +0 -390
  245. package/dist/tools/mcp/client.test.js.map +0 -1
  246. package/dist/tools/registry.d.ts +0 -82
  247. package/dist/tools/registry.d.ts.map +0 -1
  248. package/dist/tools/registry.js +0 -99
  249. package/dist/tools/registry.js.map +0 -1
  250. package/dist/tools/registry.test.d.ts +0 -7
  251. package/dist/tools/registry.test.d.ts.map +0 -1
  252. package/dist/tools/registry.test.js +0 -199
  253. package/dist/tools/registry.test.js.map +0 -1
  254. package/dist/tools/suite.test.d.ts +0 -11
  255. package/dist/tools/suite.test.d.ts.map +0 -1
  256. package/dist/tools/suite.test.js +0 -119
  257. package/dist/tools/suite.test.js.map +0 -1
  258. package/dist/tools/types.d.ts +0 -75
  259. package/dist/tools/types.d.ts.map +0 -1
  260. package/dist/tools/types.js +0 -30
  261. package/dist/tools/types.js.map +0 -1
  262. package/dist/tools/types.test.d.ts +0 -7
  263. package/dist/tools/types.test.d.ts.map +0 -1
  264. package/dist/tools/types.test.js +0 -178
  265. package/dist/tools/types.test.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,46 @@ All notable changes to Beth are documented here. Format based on [Keep a Changel
6
6
 
7
7
  ---
8
8
 
9
+ ## [1.1.0] - 2026-03-10
10
+
11
+ ### Added
12
+ - **`npx beth-copilot land` command** — Automates session completion: verifies epic branch, runs tests, backs up beads, stages/commits/pushes, verifies sync. Options: `--skip-tests`, `--skip-backup`, `--message/-m`, `--force`, `--dry-run`. Protected branch blocking, epic ID extraction for commit prefixes, non-blocking beads backup, structured step results.
13
+ - **`npx beth-copilot close` enforcement** — 3-layer close enforcement: (1) open blocker dependencies via `bd dep list`, (2) open children via `bd children`, (3) mandatory test subtasks (unit/e2e/security) for epics. `--force` bypasses all checks.
14
+ - **Pre-push hook** — Git pre-push hook enforcing branch discipline: blocks pushes from `main`/`master` (exit 1), warns on non-epic branch names. Pure shell hook (no Node overhead). Auto-installed during `npx beth-copilot init`. Bypass with `BETH_SKIP_PUSH_GUARD=1`.
15
+ - **Quality gate infrastructure** — `npm run test:gate` generates markdown test reports to `docs/test-reports/`. `scripts/quality-gate.mjs` runs vitest + legacy tests, parses results, generates report, exits non-zero on failure.
16
+ - **Comprehensive CLI test suite** — 7 new test files: `close.e2e.test.ts`, `pre-push-guard.e2e.test.ts`, `quickstart-expanded.e2e.test.ts`, `cli-edge-cases.e2e.test.ts`, `framework-isolation.test.ts`, `init-logic.e2e.test.ts`, `doctor.e2e.test.ts`. 438 tests total (up from 485).
17
+ - **Doctor: Dolt database hygiene** — `checkDoltDatabases()` detects orphaned `*test*` databases and warns when user DB count exceeds threshold. Extracted `parseDoltDatabases()` with 18 unit tests.
18
+ - **Session startup drift-prevention** — Mandatory 4-step session startup checklist in AGENTS.md: check uncommitted changes, unpushed commits, spot-check closed work, sync beads state.
19
+ - **Beads disaster recovery docs** — `docs/BD-BACKUP-PARSER-FAILURE.md` with exact parser error, root cause, repro steps, and 3 recovery paths.
20
+ - **Mandatory test subtask rules** — Epic creation patterns now require unit/E2E/security test subtasks across all agent files.
21
+
22
+ ### Changed
23
+ - **Hub-and-spoke agent coordination** — Replaced 15 lateral handoffs across 6 agents with single "Escalate to Beth" handoff per agent. Before: 15-edge mesh where agents bypassed orchestration. After: all agents report to Beth.
24
+ - **Skill routing optimization** — Added Skill Routing Table to Beth agent. Subagent templates restructured with explicit skill loading instructions. All 8 skills wired to agents (zero orphaned).
25
+ - **Shared boilerplate extraction** — Replaced ~120 lines of duplicated Work Tracking + Team Coordination across 12 files with compact AGENTS.md reference. Net -260 lines.
26
+ - **Areas of Expertise** migrated to compact on-demand pointers — net -135 lines across 6 agents.
27
+ - **Landing command hardening** — `isUpToDateWithOrigin` rewritten to compare SHA refs directly, `remoteBranchExists()` helper, `gitRebaseAbort()` for conflict recovery.
28
+ - **Simplified architecture diagrams** — All mermaid diagrams in README.md and SYSTEM-FLOW.md rewritten for accuracy. Removed fake component references that don't exist in src/.
29
+ - **Standardized on npm** — Removed `pnpm-lock.yaml`, regenerated `package-lock.json`, added `packageManager` field.
30
+
31
+ ### Fixed
32
+ - **Pre-push-guard E2E branch assumptions** — Reworked E2E harness to create temporary git repos on explicit branches instead of assuming CI branch state.
33
+ - **Framework isolation** — Fixed `beforeAll`/`afterAll` imports from `node:test` (doesn't export those names; vitest alias masked the problem).
34
+ - **hasStagedChanges false positives** — Now distinguishes exit-1 (diffs) from unexpected errors.
35
+ - **Rebase conflict handling** — Land command now aborts cleanly on rebase conflicts instead of proceeding to push.
36
+ - **Beads E2E test pollution** — `beforeAll` safety net batch-deletes stale test issues from previous failed runs.
37
+ - **Beads database recovery** — Documented recovery from Dolt server database loss after orphaned test DBs overloaded server.
38
+
39
+ ---
40
+
41
+ ## [1.0.18] - 2026-03-06
42
+
43
+ ### Changed
44
+ - **Simplified architecture diagrams** — Cleaned up README mermaid charts, removed A2A branding
45
+ - **Session branch workflow** — Automatic epic branch creation and PR-on-landing patterns
46
+
47
+ ---
48
+
9
49
  ## [1.0.15] - 2026-02-19
10
50
 
11
51
  ### Added
@@ -15,7 +55,7 @@ All notable changes to Beth are documented here. Format based on [Keep a Changel
15
55
 
16
56
  ### Changed
17
57
  - **Optional Azure dependencies** — `openai` and `@azure/identity` added as optionalDependencies so users only install them when needed
18
- - **README rewritten** — Architecture diagrams, tech stack docs, CLI/MCP/A2A/provider documentation
58
+ - **README rewritten** — Architecture diagrams, tech stack docs, CLI/MCP/provider documentation
19
59
 
20
60
  ### Fixed
21
61
  - **CodeQL security fixes** — Shell command built from environment values, incomplete URL substring sanitization
@@ -37,33 +77,6 @@ All notable changes to Beth are documented here. Format based on [Keep a Changel
37
77
 
38
78
  ---
39
79
 
40
- ## [Unreleased]
41
-
42
- ### Added
43
- - **CLI TypeScript foundation** — Migrated CLI to TypeScript with proper build system
44
- - **Doctor command** — `beth doctor` validates installation and configuration
45
- - **Quickstart command** — `beth quickstart` for guided setup
46
- - **Agent schema types** — TypeScript types for agent definitions
47
- - **Unit tests** — 86 tests passing for CLI commands and path validation
48
- - **Architecture diagrams** — Interactive mermaid diagrams with zoom in README
49
-
50
- ### Changed
51
- - **DEMO.md** — Rewritten with Beth's personality and beads integration
52
- - **P2 backlog completed** — Beth orchestrator references added to all agents, MCP skills updated, documentation fixes
53
-
54
- ### Fixed
55
- - Security-reviewer agent format — Removed obsolete `chatagent` wrapper to match standard YAML frontmatter format used by all other agents
56
- - Removed unnecessary backlog.md CLI dependency
57
- - Fixed security-reviewer.agent.md syntax errors
58
- - Corrected agent/skill counts in help output
59
- - Allowlisted security documentation examples in Gitleaks config
60
-
61
- ### Documentation
62
- - CLI Architecture guide (docs/CLI-ARCHITECTURE.md)
63
- - CLI Implementation Plan (docs/CLI-IMPLEMENTATION-PLAN.md)
64
-
65
- ---
66
-
67
80
  ## [1.0.12] - 2026-02-01
68
81
 
69
82
  ### Changed
package/README.md CHANGED
@@ -12,9 +12,9 @@ They broke her wings once. They forgot she had claws.
12
12
 
13
13
  ## What Is This?
14
14
 
15
- Beth is a **multi-agent AI orchestrator** with a TypeScript runtime, CLI toolchain, MCP integrations, and agent-to-agent (A2A) delegation—all driven by a ruthless coordinator who runs your development team the way Beth Dutton runs Schwartz & Meyer.
15
+ Beth is a **multi-agent AI orchestrator** with a TypeScript runtime, CLI toolchain, MCP integrations, and subagent delegation—all driven by a ruthless coordinator who runs your development team the way Beth Dutton runs Schwartz & Meyer.
16
16
 
17
- She commands seven specialized agents, each with their own expertise, tools, and handoff chains. On top of the GitHub Copilot agent layer, Beth ships a **TypeScript core engine** with a full agentic loop: agent routing, conversation context management, tool calling, subagent spawning, and agent-to-agent handoffs—all backed by an Azure OpenAI LLM provider with streaming and retry.
17
+ She commands seven specialized agents, each with their own expertise, tools, and handoff chains. On top of the GitHub Copilot agent layer, Beth ships a **TypeScript core engine** with a full agentic loop: agent routing, conversation context management, tool calling, subagent spawning, and agent handoffs—all backed by an Azure OpenAI LLM provider with streaming and retry.
18
18
 
19
19
  **The system has four execution layers:**
20
20
 
@@ -33,43 +33,12 @@ She commands seven specialized agents, each with their own expertise, tools, and
33
33
  ## Architecture
34
34
 
35
35
  ```mermaid
36
- flowchart TB
37
- subgraph Input["Entry Points"]
38
- Copilot["VS Code Copilot Chat"]
39
- CLI["Beth CLI"]
40
- end
41
-
42
- subgraph Engine["Orchestration Engine"]
43
- Orch["Orchestrator<br/><i>Route → LLM → Tools → Response</i>"]
44
- end
45
-
46
- subgraph Agents["Specialist Agents"]
47
- Beth["@Beth"]
48
- PM["@product-manager"]
49
- UX["@ux-designer"]
50
- Dev["@developer"]
51
- Sec["@security-reviewer"]
52
- Test["@tester"]
53
- Res["@researcher"]
54
- end
55
-
56
- subgraph Capabilities["Capabilities"]
57
- Tools["Tools<br/><i>files · terminal · search · beads</i>"]
58
- Skills["Skills<br/><i>PRD · React · shadcn · security</i>"]
59
- MCPs["MCP Servers<br/><i>shadcn · Playwright · Azure</i>"]
60
- end
61
-
62
- LLM["Azure OpenAI<br/><i>Entra ID · Streaming</i>"]
63
-
64
- Copilot & CLI --> Orch
65
- Orch --> Beth
66
- Beth -->|"delegates"| PM & UX & Dev & Sec & Test & Res
67
- Orch <-->|"chat"| LLM
68
- Orch --> Tools & Skills & MCPs
36
+ flowchart LR
37
+ Input["Copilot Chat / CLI"] --> Beth["@Beth"]
38
+ Beth --> Agents["PM · UX · Dev · Sec · Test · Research"]
39
+ Beth --> Skills["Skills · MCP"]
69
40
 
70
41
  style Beth fill:#1e3a5f,color:#fff
71
- style Engine fill:#fff3e0
72
- style Capabilities fill:#e3f2fd
73
42
  ```
74
43
 
75
44
  ---
@@ -133,7 +102,7 @@ For detailed setup (prerequisites, task tracking, MCP servers): [docs/INSTALLATI
133
102
 
134
103
  ---
135
104
 
136
- ## Agent-to-Agent (A2A) Orchestration
105
+ ## Agent Orchestration
137
106
 
138
107
  Beth doesn't micromanage. She delegates to specialists over **subagent** and **handoff** channels, tracks dependencies with beads, and holds every agent accountable.
139
108
 
@@ -149,38 +118,15 @@ Beth doesn't micromanage. She delegates to specialists over **subagent** and **h
149
118
  | **@tester** | The Enforcer | Quality assurance, accessibility, performance |
150
119
  | **@security-reviewer** | The Bodyguard | OWASP, compliance, threat modeling |
151
120
 
152
- ### A2A Delegation Model
121
+ ### Delegation Model
153
122
 
154
123
  ```mermaid
155
- flowchart TB
156
- subgraph Orchestration["Beth Orchestration Layer"]
157
- BethCore["@Beth<br/><i>Routes work · Spawns subagents</i>"]
158
- end
159
-
160
- subgraph Specialists["Specialist Agents"]
161
- PM["@product-manager<br/>Requirements · Priorities"]
162
- R["@researcher<br/>User insights · Market intel"]
163
- UX["@ux-designer<br/>Component specs · Design tokens"]
164
- D["@developer<br/>React/TS/Next.js · Implementation"]
165
- S["@security-reviewer<br/>Threat modeling · Vulnerabilities"]
166
- T["@tester<br/>QA · a11y · Performance"]
167
- end
124
+ flowchart LR
125
+ Beth["@Beth"] -->|subagent| PM["PM"] & UX["UX"] & Dev["Dev"] & Sec["Sec"] & Test["Test"] & Res["Research"]
126
+ PM -.->|handoff| UX & Dev
127
+ Dev -.->|handoff| Test & UX
168
128
 
169
- BethCore -->|"Product Strategy"| PM
170
- BethCore -->|"User Research"| R
171
- BethCore -->|"UX Design"| UX
172
- BethCore -->|"Development"| D
173
- BethCore -->|"Security Review"| S
174
- BethCore -->|"Quality Assurance"| T
175
-
176
- PM -.->|"subagent"| R
177
- PM -.->|"subagent"| UX
178
- UX -.->|"subagent"| D
179
- D -.->|"subagent"| T
180
- S -.->|"subagent"| D
181
- T -.->|"subagent"| D
182
-
183
- style BethCore fill:#1e3a5f,color:#fff
129
+ style Beth fill:#1e3a5f,color:#fff
184
130
  ```
185
131
 
186
132
  ### Subagent vs Handoff
@@ -205,33 +151,27 @@ runSubagent({
205
151
  sequenceDiagram
206
152
  participant U as User
207
153
  participant B as Beth
208
- participant PM as Product Manager
209
- participant UX as UX Designer
210
- participant D as Developer
211
- participant S as Security
212
- participant T as Tester
213
-
214
- U->>B: "Build me a feature"
215
- B->>B: Assess & Plan
216
-
217
- B->>PM: Define requirements
218
- PM-->>B: PRD + user stories
219
-
220
- B->>UX: Design the experience
221
- UX-->>B: Component specs + tokens
222
-
223
- B->>D: Implement feature
224
- D-->>B: Implementation complete
225
-
226
- par Parallel quality gates
227
- B->>S: Security review
228
- S-->>B: OWASP approved
154
+ participant PM as PM
155
+ participant UX as UX
156
+ participant D as Dev
157
+ participant S as Sec
158
+ participant T as Test
159
+
160
+ U->>B: Request
161
+ B->>PM: Requirements
162
+ PM-->>B: PRD
163
+ B->>UX: Design
164
+ UX-->>B: Specs
165
+ B->>D: Build
166
+ D-->>B: Done
167
+ par Quality gates
168
+ B->>S: Security
169
+ S-->>B: Approved
229
170
  and
230
- B->>T: Test & verify
231
- T-->>B: a11y + regression pass
171
+ B->>T: Verify
172
+ T-->>B: Pass
232
173
  end
233
-
234
- B->>U: Feature complete ✅
174
+ B->>U: Ship ✅
235
175
  ```
236
176
 
237
177
  **Bug Hunt?** Tester → Developer → Security → Tester
@@ -291,62 +231,39 @@ Skills are domain-knowledge modules that agents load automatically when trigger
291
231
 
292
232
  ---
293
233
 
294
- ## Orchestration Engine (Fan-Out Pattern)
234
+ ## How It Works
295
235
 
296
- The orchestration engine is Beth's brain the full agentic loop that processes user messages through routing, skill injection, LLM calls, tool execution, and subagent spawning.
236
+ Beth runs inside VS Code Copilot Agent Mode. The `@Beth` agent parses requests, delegates to specialist agents via subagent spawning, and tracks work through beads.
297
237
 
298
238
  ```mermaid
299
- flowchart TB
300
- User["User Message"] --> Route["AgentRouter\n@mention · skill match · default"]
301
- Route --> Context["ConversationContext\nBuild system prompt + history"]
302
- Context --> Skills{"Skill triggers match?"}
303
- Skills -->|yes| Inject["Inject skill into system prompt"]
304
- Skills -->|no| LLM
305
- Inject --> LLM["LLM Call\nAzure OpenAI"]
306
- LLM --> Decision{"Response type?"}
307
- Decision -->|text| Done["Return response"]
308
- Decision -->|tool calls| ToolExec["Execute tools\nvia ToolRegistry"]
309
- ToolExec --> SubCheck{"Subagent request?"}
310
- SubCheck -->|yes| SubAgent["Spawn child loop\ndepth-limited"]
311
- SubCheck -->|no| ToolResult["Return tool result"]
312
- SubAgent --> ToolResult
313
- ToolResult --> LLM
314
- Decision -->|handoff| Handoff["HandoffManager\nContext transfer"]
315
- Handoff --> Route
316
-
317
- style User fill:#1e3a5f,color:#fff
318
- style LLM fill:#e8f5e9
319
- style ToolExec fill:#e3f2fd
320
- style SubAgent fill:#fff3e0
239
+ flowchart LR
240
+ Msg["@Beth message"] --> Route["Agent Router"]
241
+ Route -->|subagent| Agent["Specialist"]
242
+ Agent -->|tools| Work["Code · Test · Review"]
243
+ Agent -->|done| Route
244
+ Route --> Done["Response"]
245
+
246
+ style Route fill:#1e3a5f,color:#fff
321
247
  ```
322
248
 
323
249
  **Key capabilities:**
324
- - **Agent routing** — `@mention` parsing, skill trigger matching, current-agent stickiness
325
- - **Fan-out tool calling** — Iterative LLM tool call → result → LLM loop (up to 25 iterations)
326
- - **Subagent spawning** — Nested agent loops with depth limiting (default: 3 levels deep)
327
- - **Handoff management** — Context transfer between agents with conversation summaries, ping-pong loop detection
328
- - **Context window management** — Token-estimated truncation with tool call/result consistency repair
329
- - **Observer callbacks** — Hook into routing decisions, LLM calls, tool executions, handoffs for logging/UI
250
+ - **Agent routing** — `@mention` parsing, subagent spawning, handoff chains
251
+ - **Skill injection** — Domain knowledge loaded on trigger phrases
252
+ - **Task tracking** — beads (`bd`) for epics, subtasks, dependencies
253
+ - **MCP integration** — Optional external tool servers (shadcn, Playwright, Azure)
330
254
 
331
- ```typescript
332
- // Full orchestrator usage
333
- import { Orchestrator, createDefaultRegistry } from 'beth-copilot';
334
-
335
- const orchestrator = new Orchestrator({
336
- agents: loadAgents('.github/agents'),
337
- skills: loadSkills('.github/skills'),
338
- provider: new AzureOpenAIProvider(config),
339
- toolRegistry: createDefaultRegistry(),
340
- toolContext: { workingDir: process.cwd(), permissions: { ... } },
341
- });
342
-
343
- const result = await orchestrator.processMessage('Implement the login page');
344
- // result.response — final text
345
- // result.agentId — who handled it
346
- // result.toolCallsExecuted — what tools ran
347
- // result.subagentResults — any nested agent work
348
- // result.injectedSkills — skills loaded for this turn
349
255
  ```
256
+ @Beth implement the login page
257
+ → Beth routes to @developer, tracks work in beads
258
+
259
+ @Beth review this PR for security vulnerabilities
260
+ → Beth routes to @security-reviewer, injects security-analysis skill
261
+
262
+ @Beth plan the dashboard feature
263
+ → Beth routes to @product-manager for requirements, then @ux-designer for specs
264
+ ```
265
+
266
+ > Invoke Beth by selecting `@Beth` in VS Code Copilot Chat (Agent Mode).
350
267
 
351
268
  ---
352
269
 
@@ -360,77 +277,47 @@ A uniform interface for all agent capabilities — file I/O, terminal, search, b
360
277
  | **editFile** | Atomic string replacement | Single-match enforcement, whitespace-safe |
361
278
  | **search** | Ripgrep search | Node.js fallback, regex support, file filtering |
362
279
  | **terminal** | Execute shell commands | `execFile('/bin/sh')` — no shell injection, timeouts |
363
- | **beads** | Issue tracking | `bd create`, `bd close`, `bd list` via CLI wrapper |
280
+ | **beads** | Issue tracking | `bd create`, `npx beth-copilot close`, `bd list` via CLI wrapper |
364
281
  | **subagent** | Spawn nested agents | Returns structured result for orchestrator to process |
365
282
  | **MCP Bridge** | External tool servers | JSON-RPC 2.0 over stdio, JSONC config, namespaced tools |
366
283
 
367
284
  ```typescript
368
- import { createDefaultRegistry, ToolRegistry, loadAllMCPTools } from 'beth-copilot';
285
+ import { loadAgents, loadSkills, getInferableAgents, buildTriggerMap } from 'beth-copilot';
369
286
 
370
- // Built-in tools
371
- const registry = createDefaultRegistry();
372
- // → readFile, editFile, search, terminal, beads, subagent
287
+ // Inspect loaded agent definitions
288
+ const { agents, errors: agentErrors } = loadAgents('.github/agents');
289
+ // → each AgentDefinition has: id, frontmatter (name, tools, handoffs), body
373
290
 
374
- // Add MCP server tools
375
- const { tools: mcpTools } = await loadAllMCPTools('.vscode/mcp.json');
376
- for (const tool of mcpTools) {
377
- registry.register(tool); // e.g., mcp_shadcn_listComponents
378
- }
291
+ // Find agents available for subagent spawning
292
+ const subagents = getInferableAgents({ agents, errors: agentErrors });
293
+ // agents with infer: true in frontmatter
379
294
 
380
- // Get OpenAI function calling definitions
381
- const definitions = registry.getDefinitions();
382
- // Pass to LLM as tools parameter
295
+ // Inspect loaded skill modules and their trigger phrases
296
+ const { skills, errors: skillErrors } = loadSkills('.github/skills');
297
+ const triggerMap = buildTriggerMap({ skills, errors: skillErrors });
298
+ // → Map of trigger phrase → SkillDefinition for runtime injection
383
299
  ```
384
300
 
385
301
  ---
386
302
 
387
- ## LLM Provider Layer
303
+ ## CLI Toolchain
388
304
 
389
- The TypeScript core includes a production-ready provider abstraction for running Beth outside VS Code.
305
+ The CLI handles scaffolding and health checks distributing agent and skill files to target projects.
390
306
 
391
307
  ```mermaid
392
308
  flowchart LR
393
- subgraph Config["Configuration"]
394
- Env["process.env"]
395
- DotEnv["~/.beth/.env"]
396
- end
397
-
398
- subgraph Auth["Authentication"]
399
- Entra["Entra ID<br/><i>DefaultAzureCredential</i>"]
400
- end
401
-
402
- subgraph Provider["Provider"]
403
- Base["LLMProviderBase<br/><i>Abstract interface</i>"]
404
- AzureOAI["AzureOpenAIProvider<br/><i>chat · chatStream · countTokens</i>"]
405
- end
406
-
407
- subgraph Resilience["Resilience"]
408
- RetryMod["Exponential Backoff<br/><i>Jitter · 3 retries</i>"]
409
- Errors["LLMError<br/><i>Typed error codes</i>"]
410
- end
411
-
412
- subgraph Streaming["Streaming"]
413
- Accum["StreamAccumulator<br/><i>Content + tool call assembly</i>"]
414
- Collect["collectStream<br/><i>Full response</i>"]
415
- Map["mapStream<br/><i>Transform chunks</i>"]
416
- end
417
-
418
- Env --> AzureOAI
419
- DotEnv --> AzureOAI
420
- Entra --> AzureOAI
421
- Base --> AzureOAI
422
- RetryMod --> AzureOAI
423
- AzureOAI --> Accum
424
- AzureOAI --> Collect
425
- Errors --> RetryMod
309
+ CLI["beth"] --> Init["init"]
310
+ CLI --> Doctor["doctor"]
311
+ CLI --> QS["quickstart"]
312
+ Init --> Templates[".agent.md · SKILL.md · settings"]
313
+ Doctor --> Checks["Node ≥18 · beads · agents · skills"]
314
+ QS --> Init & Doctor
426
315
  ```
427
316
 
428
- **Key capabilities:**
429
- - **Entra ID auth** No API keys. Uses `DefaultAzureCredential` (az login, managed identity, VS Code creds)
430
- - **Streaming** `chatStream()` yields `ChatChunk` objects with incremental tool call delta assembly
431
- - **Retry**Exponential backoff with jitter for 429/5xx/network errors. Non-transient errors fail fast
432
- - **Config** — `process.env` → `~/.beth/.env` precedence chain
433
- - **193 provider tests** covering types, retry, config, streaming, and Azure client
317
+ **Commands:**
318
+ - `beth init`Scaffold agents, skills, VS Code settings, beads tracking
319
+ - `beth doctor` Validate Node.js, beads CLI, agent frontmatter, skill directories
320
+ - `beth quickstart` Run init + doctor + beads init in one shot
434
321
 
435
322
  ---
436
323
 
@@ -453,7 +340,7 @@ beth/
453
340
  │ │ ├── orchestrator.ts # Agentic loop: route → LLM → tools → response
454
341
  │ │ ├── router.ts # @mention routing, skill matching, agent lookup
455
342
  │ │ ├── context.ts # Conversation state, token truncation, skill injection
456
- │ │ ├── handoffs.ts # Agent-to-agent transfers, loop detection
343
+ │ │ ├── handoffs.ts # Agent handoff transfers, loop detection
457
344
  │ │ ├── agents/
458
345
  │ │ │ ├── types.ts # AgentDefinition, AgentFrontmatter, AgentHandoff
459
346
  │ │ │ └── loader.ts # Parse .agent.md → typed definitions
@@ -537,29 +424,8 @@ Beth follows human-centered design methodology across agent workflows:
537
424
 
538
425
  ```mermaid
539
426
  flowchart LR
540
- subgraph Empathize["1. Empathize"]
541
- E["@researcher<br/>User interviews<br/>Pain points"]
542
- end
543
-
544
- subgraph Define["2. Define"]
545
- D["@product-manager<br/>Problem framing<br/>Requirements"]
546
- end
547
-
548
- subgraph Ideate["3. Ideate"]
549
- I["@ux-designer<br/>Component specs<br/>Patterns"]
550
- end
551
-
552
- subgraph Prototype["4. Prototype"]
553
- P["@developer<br/>Build to learn<br/>Feature spikes"]
554
- end
555
-
556
- subgraph Test["5. Test"]
557
- T["@tester<br/>Validate<br/>Accessibility"]
558
- end
559
-
560
- E --> D --> I --> P --> T
427
+ E["1. Empathize<br/>@researcher"] --> D["2. Define<br/>@product-manager"] --> I["3. Ideate<br/>@ux-designer"] --> P["4. Prototype<br/>@developer"] --> T["5. Test<br/>@tester"]
561
428
  T -.->|iterate| E
562
- T -.->|iterate| I
563
429
  ```
564
430
 
565
431
  ---
@@ -577,36 +443,10 @@ Beth doesn't ship garbage:
577
443
  | **Test Coverage** | Unit + Integration + E2E | Tester |
578
444
 
579
445
  ```mermaid
580
- flowchart TB
581
- subgraph Standards["Quality Standards"]
582
- A11y["WCAG 2.1 AA"]
583
- Perf["Core Web Vitals"]
584
- Sec["OWASP Compliant"]
585
- Type["Full TypeScript"]
586
- Coverage["Test Coverage"]
587
- end
588
-
589
- subgraph Gates["Enforcement"]
590
- Designer["UX Designer"]
591
- Developer["Developer"]
592
- Security["Security Reviewer"]
593
- Tester["Tester"]
594
- end
595
-
596
- A11y --> Designer
597
- Perf --> Developer
598
- Sec --> Security
599
- Type --> Developer
600
- Coverage --> Tester
601
-
602
- Designer --> Ship{Ship?}
603
- Developer --> Ship
604
- Security --> Ship
605
- Tester --> Ship
606
-
607
- Ship -->|All Pass| Deploy["🚀 Deploy"]
608
- Ship -->|Fail| Fix["🔧 Fix & Retry"]
609
- Fix --> Gates
446
+ flowchart LR
447
+ Code["Code"] --> Gates["a11y · Perf · OWASP · Types · Tests"]
448
+ Gates -->|Pass| Ship["🚀 Ship"]
449
+ Gates -->|Fail| Fix["🔧 Fix"] --> Code
610
450
  ```
611
451
 
612
452
  ---