beth-copilot 1.0.14 → 1.0.16
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.
- package/CHANGELOG.md +195 -177
- package/README.md +528 -185
- package/bin/cli.js +47 -0
- package/dist/cli/commands/doctor.e2e.test.d.ts +8 -0
- package/dist/cli/commands/doctor.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/doctor.e2e.test.js +428 -0
- package/dist/cli/commands/doctor.e2e.test.js.map +1 -0
- package/dist/cli/commands/doctor.test.js +1 -1
- package/dist/cli/commands/help.e2e.test.d.ts +9 -0
- package/dist/cli/commands/help.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/help.e2e.test.js +150 -0
- package/dist/cli/commands/help.e2e.test.js.map +1 -0
- package/dist/cli/commands/init.test.d.ts +6 -0
- package/dist/cli/commands/init.test.d.ts.map +1 -0
- package/dist/cli/commands/init.test.js +289 -0
- package/dist/cli/commands/init.test.js.map +1 -0
- package/dist/cli/commands/mcp.e2e.test.d.ts +9 -0
- package/dist/cli/commands/mcp.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/mcp.e2e.test.js +139 -0
- package/dist/cli/commands/mcp.e2e.test.js.map +1 -0
- package/dist/cli/commands/pipeline.e2e.test.d.ts +9 -0
- package/dist/cli/commands/pipeline.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/pipeline.e2e.test.js +192 -0
- package/dist/cli/commands/pipeline.e2e.test.js.map +1 -0
- package/dist/cli/commands/quickstart.test.d.ts +6 -0
- package/dist/cli/commands/quickstart.test.d.ts.map +1 -0
- package/dist/cli/commands/quickstart.test.js +232 -0
- package/dist/cli/commands/quickstart.test.js.map +1 -0
- package/dist/core/agents/frontmatter.test.d.ts +8 -0
- package/dist/core/agents/frontmatter.test.d.ts.map +1 -0
- package/dist/core/agents/frontmatter.test.js +589 -0
- package/dist/core/agents/frontmatter.test.js.map +1 -0
- package/dist/core/agents/handoffs.test.d.ts +8 -0
- package/dist/core/agents/handoffs.test.d.ts.map +1 -0
- package/dist/core/agents/handoffs.test.js +320 -0
- package/dist/core/agents/handoffs.test.js.map +1 -0
- package/dist/core/agents/loader.test.js +1 -1
- package/dist/core/agents/suite.test.d.ts +8 -0
- package/dist/core/agents/suite.test.d.ts.map +1 -0
- package/dist/core/agents/suite.test.js +207 -0
- package/dist/core/agents/suite.test.js.map +1 -0
- package/dist/core/agents/tools.test.d.ts +8 -0
- package/dist/core/agents/tools.test.d.ts.map +1 -0
- package/dist/core/agents/tools.test.js +332 -0
- package/dist/core/agents/tools.test.js.map +1 -0
- package/dist/core/context.d.ts +171 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +353 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/context.test.d.ts +8 -0
- package/dist/core/context.test.d.ts.map +1 -0
- package/dist/core/context.test.js +253 -0
- package/dist/core/context.test.js.map +1 -0
- package/dist/core/handoffs.d.ts +151 -0
- package/dist/core/handoffs.d.ts.map +1 -0
- package/dist/core/handoffs.js +220 -0
- package/dist/core/handoffs.js.map +1 -0
- package/dist/core/handoffs.test.d.ts +8 -0
- package/dist/core/handoffs.test.d.ts.map +1 -0
- package/dist/core/handoffs.test.js +231 -0
- package/dist/core/handoffs.test.js.map +1 -0
- package/dist/core/orchestrator.d.ts +246 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +514 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/orchestrator.test.d.ts +8 -0
- package/dist/core/orchestrator.test.d.ts.map +1 -0
- package/dist/core/orchestrator.test.js +517 -0
- package/dist/core/orchestrator.test.js.map +1 -0
- package/dist/core/router.d.ts +102 -0
- package/dist/core/router.d.ts.map +1 -0
- package/dist/core/router.js +178 -0
- package/dist/core/router.js.map +1 -0
- package/dist/core/router.test.d.ts +8 -0
- package/dist/core/router.test.d.ts.map +1 -0
- package/dist/core/router.test.js +215 -0
- package/dist/core/router.test.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/init.test.js +288 -0
- package/dist/providers/azure.d.ts +147 -0
- package/dist/providers/azure.d.ts.map +1 -0
- package/dist/providers/azure.js +491 -0
- package/dist/providers/azure.js.map +1 -0
- package/dist/providers/azure.test.d.ts +11 -0
- package/dist/providers/azure.test.d.ts.map +1 -0
- package/dist/providers/azure.test.js +330 -0
- package/dist/providers/azure.test.js.map +1 -0
- package/dist/providers/config.d.ts +87 -0
- package/dist/providers/config.d.ts.map +1 -0
- package/dist/providers/config.js +193 -0
- package/dist/providers/config.js.map +1 -0
- package/dist/providers/config.test.d.ts +7 -0
- package/dist/providers/config.test.d.ts.map +1 -0
- package/dist/providers/config.test.js +370 -0
- package/dist/providers/config.test.js.map +1 -0
- package/dist/providers/index.d.ts +18 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +14 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/interface.d.ts +191 -0
- package/dist/providers/interface.d.ts.map +1 -0
- package/dist/providers/interface.js +94 -0
- package/dist/providers/interface.js.map +1 -0
- package/dist/providers/retry.d.ts +128 -0
- package/dist/providers/retry.d.ts.map +1 -0
- package/dist/providers/retry.js +205 -0
- package/dist/providers/retry.js.map +1 -0
- package/dist/providers/retry.test.d.ts +7 -0
- package/dist/providers/retry.test.d.ts.map +1 -0
- package/dist/providers/retry.test.js +439 -0
- package/dist/providers/retry.test.js.map +1 -0
- package/dist/providers/streaming.d.ts +157 -0
- package/dist/providers/streaming.d.ts.map +1 -0
- package/dist/providers/streaming.js +233 -0
- package/dist/providers/streaming.js.map +1 -0
- package/dist/providers/streaming.test.d.ts +7 -0
- package/dist/providers/streaming.test.d.ts.map +1 -0
- package/dist/providers/streaming.test.js +372 -0
- package/dist/providers/streaming.test.js.map +1 -0
- package/dist/providers/types.d.ts +209 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +53 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/providers/types.test.d.ts +7 -0
- package/dist/providers/types.test.d.ts.map +1 -0
- package/dist/providers/types.test.js +141 -0
- package/dist/providers/types.test.js.map +1 -0
- package/dist/tools/cli/beads.d.ts +27 -0
- package/dist/tools/cli/beads.d.ts.map +1 -0
- package/dist/tools/cli/beads.js +172 -0
- package/dist/tools/cli/beads.js.map +1 -0
- package/dist/tools/cli/beads.test.d.ts +8 -0
- package/dist/tools/cli/beads.test.d.ts.map +1 -0
- package/dist/tools/cli/beads.test.js +264 -0
- package/dist/tools/cli/beads.test.js.map +1 -0
- package/dist/tools/cli/editFile.d.ts +17 -0
- package/dist/tools/cli/editFile.d.ts.map +1 -0
- package/dist/tools/cli/editFile.js +125 -0
- package/dist/tools/cli/editFile.js.map +1 -0
- package/dist/tools/cli/editFile.test.d.ts +8 -0
- package/dist/tools/cli/editFile.test.d.ts.map +1 -0
- package/dist/tools/cli/editFile.test.js +177 -0
- package/dist/tools/cli/editFile.test.js.map +1 -0
- package/dist/tools/cli/readFile.d.ts +25 -0
- package/dist/tools/cli/readFile.d.ts.map +1 -0
- package/dist/tools/cli/readFile.js +118 -0
- package/dist/tools/cli/readFile.js.map +1 -0
- package/dist/tools/cli/readFile.test.d.ts +8 -0
- package/dist/tools/cli/readFile.test.d.ts.map +1 -0
- package/dist/tools/cli/readFile.test.js +194 -0
- package/dist/tools/cli/readFile.test.js.map +1 -0
- package/dist/tools/cli/search.d.ts +16 -0
- package/dist/tools/cli/search.d.ts.map +1 -0
- package/dist/tools/cli/search.js +261 -0
- package/dist/tools/cli/search.js.map +1 -0
- package/dist/tools/cli/search.test.d.ts +8 -0
- package/dist/tools/cli/search.test.d.ts.map +1 -0
- package/dist/tools/cli/search.test.js +172 -0
- package/dist/tools/cli/search.test.js.map +1 -0
- package/dist/tools/cli/subagent.d.ts +43 -0
- package/dist/tools/cli/subagent.d.ts.map +1 -0
- package/dist/tools/cli/subagent.js +99 -0
- package/dist/tools/cli/subagent.js.map +1 -0
- package/dist/tools/cli/subagent.test.d.ts +8 -0
- package/dist/tools/cli/subagent.test.d.ts.map +1 -0
- package/dist/tools/cli/subagent.test.js +190 -0
- package/dist/tools/cli/subagent.test.js.map +1 -0
- package/dist/tools/cli/terminal.d.ts +19 -0
- package/dist/tools/cli/terminal.d.ts.map +1 -0
- package/dist/tools/cli/terminal.js +164 -0
- package/dist/tools/cli/terminal.js.map +1 -0
- package/dist/tools/cli/terminal.test.d.ts +8 -0
- package/dist/tools/cli/terminal.test.d.ts.map +1 -0
- package/dist/tools/cli/terminal.test.js +161 -0
- package/dist/tools/cli/terminal.test.js.map +1 -0
- package/dist/tools/index.d.ts +25 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +41 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/interface.d.ts +64 -0
- package/dist/tools/interface.d.ts.map +1 -0
- package/dist/tools/interface.js +37 -0
- package/dist/tools/interface.js.map +1 -0
- package/dist/tools/interface.test.d.ts +7 -0
- package/dist/tools/interface.test.d.ts.map +1 -0
- package/dist/tools/interface.test.js +179 -0
- package/dist/tools/interface.test.js.map +1 -0
- package/dist/tools/mcp/bridge.d.ts +48 -0
- package/dist/tools/mcp/bridge.d.ts.map +1 -0
- package/dist/tools/mcp/bridge.js +128 -0
- package/dist/tools/mcp/bridge.js.map +1 -0
- package/dist/tools/mcp/bridge.test.d.ts +8 -0
- package/dist/tools/mcp/bridge.test.d.ts.map +1 -0
- package/dist/tools/mcp/bridge.test.js +300 -0
- package/dist/tools/mcp/bridge.test.js.map +1 -0
- package/dist/tools/mcp/client.d.ts +135 -0
- package/dist/tools/mcp/client.d.ts.map +1 -0
- package/dist/tools/mcp/client.js +263 -0
- package/dist/tools/mcp/client.js.map +1 -0
- package/dist/tools/mcp/client.test.d.ts +8 -0
- package/dist/tools/mcp/client.test.d.ts.map +1 -0
- package/dist/tools/mcp/client.test.js +390 -0
- package/dist/tools/mcp/client.test.js.map +1 -0
- package/dist/tools/registry.d.ts +82 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +99 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/registry.test.d.ts +7 -0
- package/dist/tools/registry.test.d.ts.map +1 -0
- package/dist/tools/registry.test.js +199 -0
- package/dist/tools/registry.test.js.map +1 -0
- package/dist/tools/suite.test.d.ts +11 -0
- package/dist/tools/suite.test.d.ts.map +1 -0
- package/dist/tools/suite.test.js +119 -0
- package/dist/tools/suite.test.js.map +1 -0
- package/dist/tools/types.d.ts +75 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +30 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/types.test.d.ts +7 -0
- package/dist/tools/types.test.d.ts.map +1 -0
- package/dist/tools/types.test.js +178 -0
- package/dist/tools/types.test.js.map +1 -0
- package/package.json +60 -56
- package/sbom.json +3302 -8
- package/templates/.github/agents/beth.agent.md +329 -329
- package/templates/.github/agents/developer.agent.md +572 -572
- package/templates/.github/agents/product-manager.agent.md +272 -272
- package/templates/.github/agents/researcher.agent.md +338 -338
- package/templates/.github/agents/security-reviewer.agent.md +465 -465
- package/templates/.github/agents/tester.agent.md +496 -496
- package/templates/.github/agents/ux-designer.agent.md +393 -393
- package/templates/mcp.json.example +4 -0
package/README.md
CHANGED
|
@@ -12,21 +12,91 @@ They broke her wings once. They forgot she had claws.
|
|
|
12
12
|
|
|
13
13
|
## What Is This?
|
|
14
14
|
|
|
15
|
-
Beth is a
|
|
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.
|
|
16
16
|
|
|
17
|
-
She commands
|
|
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.
|
|
18
18
|
|
|
19
|
-
**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
19
|
+
**The system has four execution layers:**
|
|
20
|
+
|
|
21
|
+
| Layer | What It Does | Status |
|
|
22
|
+
|-------|-------------|--------|
|
|
23
|
+
| **Copilot Agents** | `.agent.md` definitions running in VS Code Agent Mode | Live |
|
|
24
|
+
| **CLI Toolchain** | `beth init`, `beth doctor`, `beth quickstart` — TypeScript commands | Live |
|
|
25
|
+
| **Orchestration Engine** | Fan-out routing, tool calling loop, subagent spawning, handoffs | Live |
|
|
26
|
+
| **Tool Abstraction** | 6 CLI tools + MCP bridge — uniform interface for all agent capabilities | Live |
|
|
27
|
+
| **LLM Provider** | Azure OpenAI with Entra ID auth, streaming, retry, tool calling | Live |
|
|
28
|
+
|
|
29
|
+
**814 tests.** 813 pass, 1 skip, 0 fail.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Architecture
|
|
34
|
+
|
|
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
|
|
69
|
+
|
|
70
|
+
style Beth fill:#1e3a5f,color:#fff
|
|
71
|
+
style Engine fill:#fff3e0
|
|
72
|
+
style Capabilities fill:#e3f2fd
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Tech Stack
|
|
78
|
+
|
|
79
|
+
| Category | Technology | Notes |
|
|
80
|
+
|----------|-----------|-------|
|
|
81
|
+
| **Runtime** | Node.js ≥ 18 | ES modules, built-in test runner |
|
|
82
|
+
| **Language** | TypeScript (strict mode) | No `any`. Zod for runtime validation |
|
|
83
|
+
| **Target Framework** | React 19 + Next.js App Router | Server Components, Server Actions, Suspense, streaming |
|
|
84
|
+
| **Styling** | Tailwind CSS + `class-variance-authority` (cva) | Utility-first with typed variants |
|
|
85
|
+
| **Components** | shadcn/ui | Radix primitives, copy-paste ownership |
|
|
86
|
+
| **LLM Provider** | Azure OpenAI via `openai` SDK | Entra ID auth (no API keys), streaming + tool calling |
|
|
87
|
+
| **Auth** | `@azure/identity` DefaultAzureCredential | az login, managed identity, VS Code creds |
|
|
88
|
+
| **Frontmatter** | `gray-matter` | Parses `.agent.md` and `SKILL.md` YAML |
|
|
89
|
+
| **Testing** | Node.js built-in test runner | 814 tests — unit, integration, E2E |
|
|
90
|
+
| **Task Tracking** | beads (`bd` CLI) | Dependency-aware issue tracking for agents |
|
|
91
|
+
| **Package Manager** | pnpm | Lockfile committed |
|
|
92
|
+
|
|
93
|
+
**Production dependencies:** 1 (`gray-matter`). That's it. Minimal attack surface by design.
|
|
94
|
+
|
|
95
|
+
---
|
|
26
96
|
|
|
27
97
|
## Getting Started
|
|
28
98
|
|
|
29
|
-
**
|
|
99
|
+
**One command:**
|
|
30
100
|
```bash
|
|
31
101
|
npx beth-copilot init
|
|
32
102
|
```
|
|
@@ -39,87 +109,97 @@ beth init
|
|
|
39
109
|
|
|
40
110
|
Then open VS Code, switch Copilot Chat to **Agent mode**, and type `@Beth`.
|
|
41
111
|
|
|
42
|
-
|
|
112
|
+
**Verify everything works:**
|
|
113
|
+
```bash
|
|
114
|
+
beth doctor # Health check: Node.js, beads, agents, skills
|
|
115
|
+
beth quickstart # Init + doctor + beads setup in one shot
|
|
116
|
+
```
|
|
43
117
|
|
|
44
|
-
|
|
118
|
+
For detailed setup (prerequisites, task tracking, MCP servers): [docs/INSTALLATION.md](docs/INSTALLATION.md)
|
|
45
119
|
|
|
46
|
-
|
|
120
|
+
---
|
|
47
121
|
|
|
48
|
-
|
|
49
|
-
|-------|------|--------------|
|
|
50
|
-
| **@Beth** | The Boss | Orchestrates everything. Routes work. Takes names. |
|
|
51
|
-
| **@product-manager** | The Strategist | WHAT to build: PRDs, user stories, priorities, success metrics. |
|
|
52
|
-
| **@researcher** | The Intelligence | Competitive analysis, user insights, market dirt. |
|
|
53
|
-
| **@ux-designer** | The Architect | HOW it works: component specs, design tokens, accessibility. |
|
|
54
|
-
| **@developer** | The Builder | React/TypeScript/Next.js - UI and full-stack. Gets it done. |
|
|
55
|
-
| **@tester** | The Enforcer | Quality assurance, accessibility, performance. Finds every crack. |
|
|
56
|
-
| **@security-reviewer** | The Bodyguard | Enterprise security. Vulnerabilities, compliance, threat modeling. |
|
|
122
|
+
## CLI Commands
|
|
57
123
|
|
|
58
|
-
|
|
124
|
+
| Command | What It Does |
|
|
125
|
+
|---------|-------------|
|
|
126
|
+
| `beth init` | Install agents, skills, VS Code settings, beads tracking |
|
|
127
|
+
| `beth init --force` | Overwrite existing files |
|
|
128
|
+
| `beth doctor` | Validate Node.js ≥18, beads CLI, agents frontmatter, skills directories |
|
|
129
|
+
| `beth quickstart` | Run init + doctor + beads init in one shot |
|
|
130
|
+
| `beth help` | Show all commands and options |
|
|
59
131
|
|
|
60
|
-
|
|
61
|
-
|---|---|---|
|
|
62
|
-
| **Focus** | WHAT to build, WHY, WHEN | HOW it looks, feels, behaves |
|
|
63
|
-
| **Outputs** | PRDs, user stories, priorities | Component specs, design tokens, accessibility |
|
|
64
|
-
| **Example** | "Users need date filtering" | "Date picker: variants, states, ARIA" |
|
|
132
|
+
**Flags:** `--force`, `--skip-backlog`, `--skip-mcp`, `--skip-beads`, `--verbose`
|
|
65
133
|
|
|
66
|
-
|
|
134
|
+
---
|
|
67
135
|
|
|
68
|
-
|
|
136
|
+
## Agent-to-Agent (A2A) Orchestration
|
|
69
137
|
|
|
70
|
-
|
|
71
|
-
|-------|---------|
|
|
72
|
-
| **PRD Generation** | Write requirements docs that don't waste anyone's time |
|
|
73
|
-
| **Framer Components** | Build custom React components with property controls |
|
|
74
|
-
| **React/Next.js Best Practices** | Vercel-grade performance patterns |
|
|
75
|
-
| **Web Design Guidelines** | WCAG compliance, UI review, accessibility |
|
|
76
|
-
| **shadcn/ui** | Component library patterns, installation, and best practices |
|
|
77
|
-
| **Security Analysis** | OWASP, threat modeling, vulnerability assessment |
|
|
138
|
+
Beth doesn't micromanage. She delegates to specialists over **subagent** and **handoff** channels, tracks dependencies with beads, and holds every agent accountable.
|
|
78
139
|
|
|
79
|
-
|
|
140
|
+
### The Family
|
|
80
141
|
|
|
81
|
-
|
|
142
|
+
| Agent | Role | What They Do |
|
|
143
|
+
|-------|------|--------------|
|
|
144
|
+
| **@Beth** | The Boss | Orchestrates everything. Routes work. Takes names. |
|
|
145
|
+
| **@product-manager** | The Strategist | WHAT to build: PRDs, user stories, priorities, success metrics |
|
|
146
|
+
| **@researcher** | The Intelligence | Competitive analysis, user insights, market dirt |
|
|
147
|
+
| **@ux-designer** | The Architect | HOW it works: component specs, design tokens, accessibility |
|
|
148
|
+
| **@developer** | The Builder | React/TypeScript/Next.js — UI and full-stack |
|
|
149
|
+
| **@tester** | The Enforcer | Quality assurance, accessibility, performance |
|
|
150
|
+
| **@security-reviewer** | The Bodyguard | OWASP, compliance, threat modeling |
|
|
82
151
|
|
|
83
|
-
###
|
|
152
|
+
### A2A Delegation Model
|
|
84
153
|
|
|
85
154
|
```mermaid
|
|
86
155
|
flowchart TB
|
|
87
|
-
subgraph
|
|
88
|
-
|
|
156
|
+
subgraph Orchestration["Beth Orchestration Layer"]
|
|
157
|
+
BethCore["@Beth<br/><i>Routes work · Spawns subagents</i>"]
|
|
89
158
|
end
|
|
90
159
|
|
|
91
|
-
subgraph
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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"]
|
|
96
167
|
end
|
|
97
168
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
|
184
|
+
```
|
|
106
185
|
|
|
107
|
-
|
|
108
|
-
Beth --> Assess --> Plan --> Route
|
|
109
|
-
|
|
110
|
-
Route --> PM
|
|
111
|
-
Route --> Researcher
|
|
112
|
-
Route --> Designer
|
|
113
|
-
Route --> Developer
|
|
114
|
-
Route --> Security
|
|
115
|
-
Route --> Tester
|
|
186
|
+
### Subagent vs Handoff
|
|
116
187
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
188
|
+
| Mechanism | Control | Use When |
|
|
189
|
+
|-----------|---------|----------|
|
|
190
|
+
| **Subagent** | Beth decides | Task can run autonomously, no human review needed |
|
|
191
|
+
| **Handoff** | User decides | User needs to review before proceeding |
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
// Beth spawns a specialist — autonomous execution
|
|
195
|
+
runSubagent({
|
|
196
|
+
agentName: "developer",
|
|
197
|
+
prompt: "Implement JWT auth flow with refresh token rotation...",
|
|
198
|
+
description: "Implement auth"
|
|
199
|
+
})
|
|
120
200
|
```
|
|
121
201
|
|
|
122
|
-
###
|
|
202
|
+
### Workflow: New Feature
|
|
123
203
|
|
|
124
204
|
```mermaid
|
|
125
205
|
sequenceDiagram
|
|
@@ -133,125 +213,327 @@ sequenceDiagram
|
|
|
133
213
|
|
|
134
214
|
U->>B: "Build me a feature"
|
|
135
215
|
B->>B: Assess & Plan
|
|
216
|
+
|
|
136
217
|
B->>PM: Define requirements
|
|
137
|
-
PM-->>B:
|
|
218
|
+
PM-->>B: PRD + user stories
|
|
219
|
+
|
|
138
220
|
B->>UX: Design the experience
|
|
139
|
-
UX-->>B:
|
|
221
|
+
UX-->>B: Component specs + tokens
|
|
222
|
+
|
|
140
223
|
B->>D: Implement feature
|
|
141
224
|
D-->>B: Implementation complete
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
225
|
+
|
|
226
|
+
par Parallel quality gates
|
|
227
|
+
B->>S: Security review
|
|
228
|
+
S-->>B: OWASP approved
|
|
229
|
+
and
|
|
230
|
+
B->>T: Test & verify
|
|
231
|
+
T-->>B: a11y + regression pass
|
|
232
|
+
end
|
|
233
|
+
|
|
146
234
|
B->>U: Feature complete ✅
|
|
147
235
|
```
|
|
148
236
|
|
|
149
|
-
**Bug Hunt?** Tester → Developer → Security → Tester
|
|
150
|
-
**Security Audit?** Security → Developer → Tester → Security
|
|
237
|
+
**Bug Hunt?** Tester → Developer → Security → Tester
|
|
238
|
+
**Security Audit?** Security → Developer → Tester → Security sign-off
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## MCP Integrations
|
|
243
|
+
|
|
244
|
+
Model Context Protocol servers extend agent capabilities. All **optional** — agents gracefully degrade without them.
|
|
245
|
+
|
|
246
|
+
| Server | Agent | Capability |
|
|
247
|
+
|--------|-------|-----------|
|
|
248
|
+
| **shadcn/ui** | Developer | Component browsing & installation |
|
|
249
|
+
| **Playwright** | Tester | Browser automation, E2E testing |
|
|
250
|
+
| **Azure** | Developer, Security | Cloud resource management |
|
|
251
|
+
| **Brave Search** | Researcher | Internet research |
|
|
252
|
+
| **DeepWiki** | All | Repository documentation lookup |
|
|
253
|
+
|
|
254
|
+
### Quick Setup
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Copy example config and enable what you need
|
|
258
|
+
cp mcp.json.example .vscode/mcp.json
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"servers": {
|
|
264
|
+
"shadcn": { "command": "npx", "args": ["shadcn@latest", "mcp"] },
|
|
265
|
+
"playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] },
|
|
266
|
+
"azure": { "command": "npx", "args": ["@azure/mcp-server"] },
|
|
267
|
+
"web-search": { "command": "npx", "args": ["@brave/brave-search-mcp-server"] },
|
|
268
|
+
"deepwiki": { "url": "https://mcp.deepwiki.com/mcp" }
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Full details: [docs/MCP-SETUP.md](docs/MCP-SETUP.md)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Skills (On-Demand Knowledge)
|
|
278
|
+
|
|
279
|
+
Skills are domain-knowledge modules that agents load automatically when trigger phrases match. Each skill lives in `.github/skills/<name>/SKILL.md`.
|
|
151
280
|
|
|
152
|
-
|
|
281
|
+
| Skill | Triggers On | Used By |
|
|
282
|
+
|-------|------------|---------|
|
|
283
|
+
| **PRD Generation** | "create a prd", "product requirements" | Product Manager |
|
|
284
|
+
| **Framer Components** | "framer component", "property controls" | UX Designer |
|
|
285
|
+
| **React/Next.js Best Practices** | React performance, Next.js patterns | Developer |
|
|
286
|
+
| **Web Design Guidelines** | "review my UI", "check accessibility" | UX Designer |
|
|
287
|
+
| **shadcn/ui** | "shadcn", "ui component" | Developer |
|
|
288
|
+
| **Security Analysis** | "security review", "OWASP", "threat model" | Security Reviewer |
|
|
289
|
+
| **Azure Operations** | Azure resource management | Developer |
|
|
290
|
+
| **Web Search** | Internet research via Brave | Researcher |
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Orchestration Engine (Fan-Out Pattern)
|
|
295
|
+
|
|
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.
|
|
153
297
|
|
|
154
298
|
```mermaid
|
|
155
299
|
flowchart TB
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
|
321
|
+
```
|
|
159
322
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
323
|
+
**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
|
|
330
|
+
|
|
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
|
+
```
|
|
163
350
|
|
|
164
|
-
|
|
165
|
-
RCore["User insights<br/>Market intel"]
|
|
166
|
-
end
|
|
351
|
+
---
|
|
167
352
|
|
|
168
|
-
|
|
169
|
-
UXCore["Component specs<br/>Design tokens"]
|
|
170
|
-
end
|
|
353
|
+
## Tool Abstraction Layer
|
|
171
354
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
355
|
+
A uniform interface for all agent capabilities — file I/O, terminal, search, beads, subagent spawning, and MCP server tools. Tools expose OpenAI-compatible function calling schemas so the LLM can invoke them directly.
|
|
356
|
+
|
|
357
|
+
| Tool | What It Does | Key Features |
|
|
358
|
+
|------|-------------|-------------- |
|
|
359
|
+
| **readFile** | Read file contents | Line ranges, path validation, traversal guards |
|
|
360
|
+
| **editFile** | Atomic string replacement | Single-match enforcement, whitespace-safe |
|
|
361
|
+
| **search** | Ripgrep search | Node.js fallback, regex support, file filtering |
|
|
362
|
+
| **terminal** | Execute shell commands | `execFile('/bin/sh')` — no shell injection, timeouts |
|
|
363
|
+
| **beads** | Issue tracking | `bd create`, `bd close`, `bd list` via CLI wrapper |
|
|
364
|
+
| **subagent** | Spawn nested agents | Returns structured result for orchestrator to process |
|
|
365
|
+
| **MCP Bridge** | External tool servers | JSON-RPC 2.0 over stdio, JSONC config, namespaced tools |
|
|
366
|
+
|
|
367
|
+
```typescript
|
|
368
|
+
import { createDefaultRegistry, ToolRegistry, loadAllMCPTools } from 'beth-copilot';
|
|
369
|
+
|
|
370
|
+
// Built-in tools
|
|
371
|
+
const registry = createDefaultRegistry();
|
|
372
|
+
// → readFile, editFile, search, terminal, beads, subagent
|
|
175
373
|
|
|
176
|
-
|
|
177
|
-
|
|
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
|
+
}
|
|
379
|
+
|
|
380
|
+
// Get OpenAI function calling definitions
|
|
381
|
+
const definitions = registry.getDefinitions();
|
|
382
|
+
// Pass to LLM as tools parameter
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## LLM Provider Layer
|
|
388
|
+
|
|
389
|
+
The TypeScript core includes a production-ready provider abstraction for running Beth outside VS Code.
|
|
390
|
+
|
|
391
|
+
```mermaid
|
|
392
|
+
flowchart LR
|
|
393
|
+
subgraph Config["Configuration"]
|
|
394
|
+
Env["process.env"]
|
|
395
|
+
DotEnv["~/.beth/.env"]
|
|
178
396
|
end
|
|
179
397
|
|
|
180
|
-
subgraph
|
|
181
|
-
|
|
398
|
+
subgraph Auth["Authentication"]
|
|
399
|
+
Entra["Entra ID<br/><i>DefaultAzureCredential</i>"]
|
|
182
400
|
end
|
|
183
401
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
BethCore -->|"Security Review"| SCore
|
|
189
|
-
BethCore -->|"Quality Assurance"| TCore
|
|
190
|
-
|
|
191
|
-
PMCore -.->|"subagent"| RCore
|
|
192
|
-
PMCore -.->|"subagent"| UXCore
|
|
193
|
-
UXCore -.->|"subagent"| DCore
|
|
194
|
-
DCore -.->|"subagent"| TCore
|
|
195
|
-
SCore -.->|"subagent"| DCore
|
|
196
|
-
```
|
|
402
|
+
subgraph Provider["Provider"]
|
|
403
|
+
Base["LLMProviderBase<br/><i>Abstract interface</i>"]
|
|
404
|
+
AzureOAI["AzureOpenAIProvider<br/><i>chat · chatStream · countTokens</i>"]
|
|
405
|
+
end
|
|
197
406
|
|
|
198
|
-
|
|
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
|
|
199
411
|
|
|
200
|
-
|
|
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
|
|
201
417
|
|
|
202
|
-
|
|
203
|
-
|
|
418
|
+
Env --> AzureOAI
|
|
419
|
+
DotEnv --> AzureOAI
|
|
420
|
+
Entra --> AzureOAI
|
|
421
|
+
Base --> AzureOAI
|
|
422
|
+
RetryMod --> AzureOAI
|
|
423
|
+
AzureOAI --> Accum
|
|
424
|
+
AzureOAI --> Collect
|
|
425
|
+
Errors --> RetryMod
|
|
204
426
|
```
|
|
205
427
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
|
209
434
|
|
|
210
|
-
|
|
211
|
-
@developer Implement a drag-and-drop task board. Make it fast.
|
|
212
|
-
```
|
|
435
|
+
---
|
|
213
436
|
|
|
214
|
-
|
|
215
|
-
@security-reviewer OWASP top 10 assessment on our API endpoints.
|
|
216
|
-
```
|
|
437
|
+
## TypeScript Core
|
|
217
438
|
|
|
218
|
-
|
|
219
|
-
@tester Accessibility audit. WCAG 2.1 AA. No excuses.
|
|
220
|
-
```
|
|
439
|
+
The engine that powers everything. Parses agent and skill definitions, manages conversations, routes requests, executes tools, and provides typed APIs for the full agentic loop.
|
|
221
440
|
|
|
222
|
-
|
|
441
|
+
### Project Structure
|
|
223
442
|
|
|
224
443
|
```
|
|
225
|
-
|
|
226
|
-
├──
|
|
227
|
-
│
|
|
228
|
-
|
|
229
|
-
│ ├──
|
|
230
|
-
│ ├──
|
|
231
|
-
│ ├──
|
|
232
|
-
│
|
|
233
|
-
│
|
|
234
|
-
├──
|
|
235
|
-
│ ├──
|
|
236
|
-
│ ├──
|
|
237
|
-
│ ├──
|
|
238
|
-
│ ├──
|
|
239
|
-
│
|
|
240
|
-
└──
|
|
444
|
+
beth/
|
|
445
|
+
├── bin/
|
|
446
|
+
│ └── cli.js # CLI entry point (init, doctor, quickstart, help)
|
|
447
|
+
├── src/
|
|
448
|
+
│ ├── index.ts # Barrel exports (all public API)
|
|
449
|
+
│ ├── cli/commands/
|
|
450
|
+
│ │ ├── doctor.ts # System health validation
|
|
451
|
+
│ │ └── quickstart.ts # Guided setup flow
|
|
452
|
+
│ ├── core/
|
|
453
|
+
│ │ ├── orchestrator.ts # Agentic loop: route → LLM → tools → response
|
|
454
|
+
│ │ ├── router.ts # @mention routing, skill matching, agent lookup
|
|
455
|
+
│ │ ├── context.ts # Conversation state, token truncation, skill injection
|
|
456
|
+
│ │ ├── handoffs.ts # Agent-to-agent transfers, loop detection
|
|
457
|
+
│ │ ├── agents/
|
|
458
|
+
│ │ │ ├── types.ts # AgentDefinition, AgentFrontmatter, AgentHandoff
|
|
459
|
+
│ │ │ └── loader.ts # Parse .agent.md → typed definitions
|
|
460
|
+
│ │ └── skills/
|
|
461
|
+
│ │ ├── types.ts # SkillDefinition, TriggerMap
|
|
462
|
+
│ │ └── loader.ts # Parse SKILL.md, extract triggers, match queries
|
|
463
|
+
│ ├── lib/
|
|
464
|
+
│ │ └── pathValidation.ts # Traversal/injection guards
|
|
465
|
+
│ ├── tools/
|
|
466
|
+
│ │ ├── interface.ts # Tool interface + toToolDefinition()
|
|
467
|
+
│ │ ├── types.ts # ToolError, ToolResult, ToolContext, ToolPermissions
|
|
468
|
+
│ │ ├── registry.ts # ToolRegistry: register, get, list, getDefinitions
|
|
469
|
+
│ │ ├── cli/
|
|
470
|
+
│ │ │ ├── readFile.ts # File reading with line ranges
|
|
471
|
+
│ │ │ ├── editFile.ts # Atomic string replacement
|
|
472
|
+
│ │ │ ├── search.ts # Ripgrep with Node.js fallback
|
|
473
|
+
│ │ │ ├── terminal.ts # Secure command execution
|
|
474
|
+
│ │ │ ├── beads.ts # Issue tracking via bd CLI
|
|
475
|
+
│ │ │ └── subagent.ts # Agent spawning interface
|
|
476
|
+
│ │ └── mcp/
|
|
477
|
+
│ │ ├── client.ts # JSON-RPC 2.0 over stdio
|
|
478
|
+
│ │ └── bridge.ts # JSONC config, tool namespacing
|
|
479
|
+
│ └── providers/
|
|
480
|
+
│ ├── interface.ts # LLMProviderBase abstract class
|
|
481
|
+
│ ├── azure.ts # AzureOpenAIProvider (Entra ID, streaming, tools)
|
|
482
|
+
│ ├── types.ts # 17 types: ChatMessage, ToolCall, LLMError, etc.
|
|
483
|
+
│ ├── retry.ts # Exponential backoff with jitter
|
|
484
|
+
│ ├── config.ts # Environment + dotfile config loader
|
|
485
|
+
│ └── streaming.ts # StreamAccumulator, collectStream, mapStream
|
|
486
|
+
├── templates/
|
|
487
|
+
│ └── .github/
|
|
488
|
+
│ ├── agents/ # 7 agent definitions (.agent.md)
|
|
489
|
+
│ └── skills/ # 8 skill modules (SKILL.md)
|
|
490
|
+
└── docs/
|
|
491
|
+
├── INSTALLATION.md
|
|
492
|
+
├── MCP-SETUP.md
|
|
493
|
+
├── CLI-ARCHITECTURE.md
|
|
494
|
+
└── SYSTEM-FLOW.md
|
|
241
495
|
```
|
|
242
496
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
497
|
+
### Test Coverage
|
|
498
|
+
|
|
499
|
+
**814 tests** (813 pass, 1 skip, 0 fail):
|
|
500
|
+
|
|
501
|
+
| Suite | Tests | What It Covers |
|
|
502
|
+
|-------|-------|---------------|
|
|
503
|
+
| **Orchestration** | | |
|
|
504
|
+
| Orchestrator | 30+ | Agentic loop, tool calling, subagent spawning, iteration limits |
|
|
505
|
+
| AgentRouter | 30+ | @mention routing, skill matching, agent resolution |
|
|
506
|
+
| ConversationContext | 30+ | Token truncation, skill injection, tool call repair |
|
|
507
|
+
| HandoffManager | 30+ | Context transfer, depth limits, ping-pong detection |
|
|
508
|
+
| **Tools** | | |
|
|
509
|
+
| Tool interface | 20+ | Tool → ToolDefinition conversion, schema validation |
|
|
510
|
+
| ToolRegistry | 20+ | Register, get, list, definitions, duplicate detection |
|
|
511
|
+
| readFile | 30+ | Line ranges, path validation, encoding |
|
|
512
|
+
| editFile | 30+ | String replacement, single-match enforcement |
|
|
513
|
+
| search | 30+ | Ripgrep, Node.js fallback, regex, file filtering |
|
|
514
|
+
| terminal | 30+ | Command execution, timeouts, output capture |
|
|
515
|
+
| beads | 30+ | bd CLI wrapper, create/close/list/ready |
|
|
516
|
+
| subagent | 30+ | Spawn interface, result marking, agent validation |
|
|
517
|
+
| MCP client | 30+ | JSON-RPC 2.0, protocol handshake, tool listing |
|
|
518
|
+
| MCP bridge | 30+ | JSONC parsing, tool namespacing, error handling |
|
|
519
|
+
| Tool suite | 10+ | createDefaultRegistry, integration tests |
|
|
520
|
+
| **Providers** | | |
|
|
521
|
+
| Provider types | 40+ | LLMError codes, ChatMessage shapes, ToolDefinition schemas |
|
|
522
|
+
| Provider retry | 40+ | Exponential backoff, jitter, transient error detection |
|
|
523
|
+
| Provider config | 30+ | Env precedence, dotenv parsing, URL validation |
|
|
524
|
+
| Provider streaming | 40+ | Chunk accumulation, tool call delta assembly |
|
|
525
|
+
| Provider Azure | 30+ | Message mapping, response mapping, error wrapping |
|
|
526
|
+
| **Core & CLI** | | |
|
|
527
|
+
| Agent loader | 30+ | Frontmatter parsing, validation, code fence stripping, handoffs |
|
|
528
|
+
| Skill loader | 30+ | Trigger extraction, query matching, trigger map building |
|
|
529
|
+
| CLI E2E | 52 | Init/doctor pipeline, MCP template validation, help output |
|
|
530
|
+
| Path validation | 33 | Traversal detection, injection prevention, allowlists |
|
|
246
531
|
|
|
247
|
-
|
|
248
|
-
2. **No weakness** — Tests, security, accessibility. Cover every flank.
|
|
249
|
-
3. **Move fast, break enemies** — Parallel execution, aggressive timelines.
|
|
250
|
-
4. **Loyalty earns trust** — Agents that perform get the good work.
|
|
532
|
+
---
|
|
251
533
|
|
|
252
|
-
|
|
534
|
+
## IDEO Design Thinking
|
|
253
535
|
|
|
254
|
-
Beth follows human-centered design methodology:
|
|
536
|
+
Beth follows human-centered design methodology across agent workflows:
|
|
255
537
|
|
|
256
538
|
```mermaid
|
|
257
539
|
flowchart LR
|
|
@@ -277,35 +559,38 @@ flowchart LR
|
|
|
277
559
|
|
|
278
560
|
E --> D --> I --> P --> T
|
|
279
561
|
T -.->|iterate| E
|
|
280
|
-
T -.->|iterate| D
|
|
281
562
|
T -.->|iterate| I
|
|
282
563
|
```
|
|
283
564
|
|
|
565
|
+
---
|
|
566
|
+
|
|
284
567
|
## Quality Standards
|
|
285
568
|
|
|
286
569
|
Beth doesn't ship garbage:
|
|
287
570
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
571
|
+
| Standard | Gate | Enforced By |
|
|
572
|
+
|----------|------|-------------|
|
|
573
|
+
| **WCAG 2.1 AA** | Accessibility compliance | UX Designer + Tester |
|
|
574
|
+
| **Core Web Vitals** | LCP < 2.5s, FID < 100ms, CLS < 0.1 | Developer |
|
|
575
|
+
| **OWASP Top 10** | Zero known vulnerabilities | Security Reviewer |
|
|
576
|
+
| **TypeScript Strict** | No `any` | Developer |
|
|
577
|
+
| **Test Coverage** | Unit + Integration + E2E | Tester |
|
|
293
578
|
|
|
294
579
|
```mermaid
|
|
295
580
|
flowchart TB
|
|
296
581
|
subgraph Standards["Quality Standards"]
|
|
297
|
-
A11y["WCAG 2.1 AA
|
|
298
|
-
Perf["Core Web Vitals
|
|
299
|
-
Sec["OWASP Compliant
|
|
300
|
-
Type["Full TypeScript
|
|
301
|
-
Coverage["Test Coverage
|
|
582
|
+
A11y["WCAG 2.1 AA"]
|
|
583
|
+
Perf["Core Web Vitals"]
|
|
584
|
+
Sec["OWASP Compliant"]
|
|
585
|
+
Type["Full TypeScript"]
|
|
586
|
+
Coverage["Test Coverage"]
|
|
302
587
|
end
|
|
303
588
|
|
|
304
589
|
subgraph Gates["Enforcement"]
|
|
305
|
-
Designer["UX Designer
|
|
306
|
-
Developer["Developer
|
|
307
|
-
Security["Security Reviewer
|
|
308
|
-
Tester["Tester
|
|
590
|
+
Designer["UX Designer"]
|
|
591
|
+
Developer["Developer"]
|
|
592
|
+
Security["Security Reviewer"]
|
|
593
|
+
Tester["Tester"]
|
|
309
594
|
end
|
|
310
595
|
|
|
311
596
|
A11y --> Designer
|
|
@@ -324,13 +609,41 @@ flowchart TB
|
|
|
324
609
|
Fix --> Gates
|
|
325
610
|
```
|
|
326
611
|
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## Quick Commands
|
|
615
|
+
|
|
616
|
+
Don't waste her time. Be direct.
|
|
617
|
+
|
|
618
|
+
```
|
|
619
|
+
@Beth Build me a dashboard for user analytics with real-time updates.
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
```
|
|
623
|
+
@Beth Security review for our authentication flow. Find the holes.
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
```
|
|
627
|
+
@developer Implement a drag-and-drop task board. Make it fast.
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
```
|
|
631
|
+
@security-reviewer OWASP top 10 assessment on our API endpoints.
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
```
|
|
635
|
+
@tester Accessibility audit. WCAG 2.1 AA. No excuses.
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
327
640
|
## Why Beth?
|
|
328
641
|
|
|
329
642
|
<p align="center">
|
|
330
643
|
<img src="assets/beth-questioning.png" alt="Beth" width="500">
|
|
331
644
|
</p>
|
|
332
645
|
|
|
333
|
-
Look, you *could* try to coordinate seven specialists yourself. You could context-switch between product strategy, security reviews, and accessibility audits while keeping your sanity intact.
|
|
646
|
+
Look, you *could* try to coordinate seven specialists yourself. You could context-switch between product strategy, security reviews, and accessibility audits while keeping your sanity intact.
|
|
334
647
|
|
|
335
648
|
Or you could let Beth handle it.
|
|
336
649
|
|
|
@@ -344,30 +657,60 @@ Is it magic? No. It's just competence with very good hair.
|
|
|
344
657
|
|
|
345
658
|
## Requirements
|
|
346
659
|
|
|
347
|
-
-
|
|
348
|
-
- GitHub Copilot
|
|
349
|
-
-
|
|
660
|
+
- **Node.js** ≥ 18
|
|
661
|
+
- **VS Code** with GitHub Copilot extension
|
|
662
|
+
- **GitHub Copilot Chat** in Agent mode
|
|
663
|
+
- [**beads**](https://github.com/steveyegge/beads) for task tracking (`bd` CLI)
|
|
350
664
|
|
|
351
|
-
###
|
|
665
|
+
### Installing Beads
|
|
352
666
|
|
|
353
|
-
|
|
667
|
+
```bash
|
|
668
|
+
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
|
|
669
|
+
```
|
|
354
670
|
|
|
355
|
-
|
|
356
|
-
|--------|--------------|-------|
|
|
357
|
-
| **shadcn/ui** | Component browsing & installation | `npx shadcn@latest mcp init --client vscode` |
|
|
358
|
-
| **Playwright** | Browser automation for testing | See [MCP Setup Guide](docs/MCP-SETUP.md) |
|
|
359
|
-
| **Azure** | Cloud resource management | See [MCP Setup Guide](docs/MCP-SETUP.md) |
|
|
360
|
-
| **Web Search** | Internet research | See [MCP Setup Guide](docs/MCP-SETUP.md) |
|
|
671
|
+
**CGO Troubleshooting (Linux/WSL):** Beads uses Dolt (a Git-for-data database) which requires CGO. If `bd init` or `bd doctor` fails with CGO-related errors:
|
|
361
672
|
|
|
362
|
-
|
|
673
|
+
```bash
|
|
674
|
+
# Install C compiler toolchain (required for CGO)
|
|
675
|
+
sudo apt-get update && sudo apt-get install -y build-essential gcc
|
|
676
|
+
|
|
677
|
+
# Verify CGO is available
|
|
678
|
+
export CGO_ENABLED=1
|
|
679
|
+
go env CGO_ENABLED # should print 1
|
|
680
|
+
|
|
681
|
+
# Re-install beads
|
|
682
|
+
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
**Common beads issues:**
|
|
686
|
+
- `bd: command not found` — Add `~/.local/bin` to your PATH: `export PATH="$HOME/.local/bin:$PATH"`
|
|
687
|
+
- `bd doctor` warnings about metadata — Run `bd doctor --fix` to auto-repair
|
|
688
|
+
- Dolt migration errors — Delete `.beads/` and re-initialize with `bd init`
|
|
689
|
+
|
|
690
|
+
```bash
|
|
691
|
+
# Verify beads is working
|
|
692
|
+
bd doctor
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### Optional: MCP Servers
|
|
696
|
+
|
|
697
|
+
See [MCP Integrations](#mcp-integrations) above or [docs/MCP-SETUP.md](docs/MCP-SETUP.md) for setup.
|
|
698
|
+
|
|
699
|
+
---
|
|
363
700
|
|
|
364
701
|
## Documentation
|
|
365
702
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
703
|
+
| Doc | Purpose |
|
|
704
|
+
|-----|---------|
|
|
705
|
+
| [Installation Guide](docs/INSTALLATION.md) | Full setup: prerequisites, VS Code config, beads |
|
|
706
|
+
| [MCP Setup](docs/MCP-SETUP.md) | Optional server integrations |
|
|
707
|
+
| [CLI Architecture](docs/CLI-ARCHITECTURE.md) | Dual-interface design, implementation phases |
|
|
708
|
+
| [System Flow](docs/SYSTEM-FLOW.md) | Agent orchestration diagrams |
|
|
709
|
+
| [Contributing Guide](CONTRIBUTING.md) | How to contribute (PR process, review checklist) |
|
|
710
|
+
| [Changelog](CHANGELOG.md) | Version history |
|
|
711
|
+
| [Security Policy](SECURITY.md) | Vulnerability reporting |
|
|
712
|
+
|
|
713
|
+
---
|
|
371
714
|
|
|
372
715
|
## License
|
|
373
716
|
|