@bookedsolid/reagent 0.2.0 → 0.4.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.
- package/README.md +163 -82
- package/agents/ai-platforms/ai-agentic-systems-architect.md +85 -0
- package/agents/ai-platforms/ai-anthropic-specialist.md +84 -0
- package/agents/ai-platforms/ai-cost-optimizer.md +85 -0
- package/agents/ai-platforms/ai-evaluation-specialist.md +78 -0
- package/agents/ai-platforms/ai-fine-tuning-specialist.md +96 -0
- package/agents/ai-platforms/ai-gemini-specialist.md +88 -0
- package/agents/ai-platforms/ai-governance-officer.md +77 -0
- package/agents/ai-platforms/ai-knowledge-engineer.md +76 -0
- package/agents/ai-platforms/ai-mcp-developer.md +108 -0
- package/agents/ai-platforms/ai-multi-modal-specialist.md +208 -0
- package/agents/ai-platforms/ai-open-source-models-specialist.md +139 -0
- package/agents/ai-platforms/ai-openai-specialist.md +94 -0
- package/agents/ai-platforms/ai-platform-strategist.md +100 -0
- package/agents/ai-platforms/ai-prompt-engineer.md +94 -0
- package/agents/ai-platforms/ai-rag-architect.md +97 -0
- package/agents/ai-platforms/ai-rea.md +82 -0
- package/agents/ai-platforms/ai-research-scientist.md +77 -0
- package/agents/ai-platforms/ai-safety-reviewer.md +91 -0
- package/agents/ai-platforms/ai-security-red-teamer.md +80 -0
- package/agents/ai-platforms/ai-synthetic-data-engineer.md +76 -0
- package/agents/engineering/accessibility-engineer.md +97 -0
- package/agents/engineering/aws-architect.md +104 -0
- package/agents/engineering/backend-engineer-payments.md +274 -0
- package/agents/engineering/backend-engineering-manager.md +206 -0
- package/agents/engineering/code-reviewer.md +283 -0
- package/agents/engineering/css3-animation-purist.md +114 -0
- package/agents/engineering/data-engineer.md +88 -0
- package/agents/engineering/database-architect.md +224 -0
- package/agents/engineering/design-system-developer.md +74 -0
- package/agents/engineering/design-systems-animator.md +82 -0
- package/agents/engineering/devops-engineer.md +153 -0
- package/agents/engineering/drupal-integration-specialist.md +211 -0
- package/agents/engineering/drupal-specialist.md +128 -0
- package/agents/engineering/engineering-manager-frontend.md +118 -0
- package/agents/engineering/frontend-specialist.md +72 -0
- package/agents/engineering/infrastructure-engineer.md +67 -0
- package/agents/engineering/lit-specialist.md +75 -0
- package/agents/engineering/migration-specialist.md +122 -0
- package/agents/engineering/ml-engineer.md +99 -0
- package/agents/engineering/mobile-engineer.md +173 -0
- package/agents/engineering/motion-designer-interactive.md +100 -0
- package/agents/engineering/nextjs-specialist.md +140 -0
- package/agents/engineering/open-source-specialist.md +111 -0
- package/agents/engineering/performance-engineer.md +95 -0
- package/agents/engineering/performance-qa-engineer.md +99 -0
- package/agents/engineering/pr-maintainer.md +112 -0
- package/agents/engineering/principal-engineer.md +80 -0
- package/agents/engineering/privacy-engineer.md +93 -0
- package/agents/engineering/qa-engineer.md +158 -0
- package/agents/engineering/security-engineer.md +141 -0
- package/agents/engineering/security-qa-engineer.md +92 -0
- package/agents/engineering/senior-backend-engineer.md +300 -0
- package/agents/engineering/senior-database-engineer.md +52 -0
- package/agents/engineering/senior-frontend-engineer.md +115 -0
- package/agents/engineering/senior-product-manager-platform.md +29 -0
- package/agents/engineering/senior-technical-project-manager.md +51 -0
- package/agents/engineering/site-reliability-engineer-2.md +52 -0
- package/agents/engineering/solutions-architect.md +74 -0
- package/agents/engineering/sre-lead.md +123 -0
- package/agents/engineering/staff-engineer-platform.md +228 -0
- package/agents/engineering/staff-software-engineer.md +60 -0
- package/agents/engineering/storybook-specialist.md +142 -0
- package/agents/engineering/supabase-specialist.md +106 -0
- package/agents/engineering/technical-project-manager.md +50 -0
- package/agents/engineering/technical-writer.md +129 -0
- package/agents/engineering/test-architect.md +93 -0
- package/agents/engineering/typescript-specialist.md +101 -0
- package/agents/engineering/ux-researcher.md +35 -0
- package/agents/engineering/vp-engineering.md +72 -0
- package/agents/reagent-orchestrator.md +14 -15
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +98 -25
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/config/gateway-config.d.ts.map +1 -1
- package/dist/config/gateway-config.js +5 -1
- package/dist/config/gateway-config.js.map +1 -1
- package/dist/config/policy-loader.d.ts.map +1 -1
- package/dist/config/policy-loader.js +15 -1
- package/dist/config/policy-loader.js.map +1 -1
- package/dist/config/tier-map.d.ts +1 -1
- package/dist/config/tier-map.d.ts.map +1 -1
- package/dist/config/tier-map.js +38 -5
- package/dist/config/tier-map.js.map +1 -1
- package/dist/gateway/client-manager.d.ts.map +1 -1
- package/dist/gateway/client-manager.js +9 -3
- package/dist/gateway/client-manager.js.map +1 -1
- package/dist/gateway/middleware/audit.d.ts +2 -1
- package/dist/gateway/middleware/audit.d.ts.map +1 -1
- package/dist/gateway/middleware/audit.js +57 -46
- package/dist/gateway/middleware/audit.js.map +1 -1
- package/dist/gateway/middleware/blocked-paths.d.ts +13 -0
- package/dist/gateway/middleware/blocked-paths.d.ts.map +1 -0
- package/dist/gateway/middleware/blocked-paths.js +118 -0
- package/dist/gateway/middleware/blocked-paths.js.map +1 -0
- package/dist/gateway/middleware/policy.d.ts +3 -1
- package/dist/gateway/middleware/policy.d.ts.map +1 -1
- package/dist/gateway/middleware/policy.js +22 -3
- package/dist/gateway/middleware/policy.js.map +1 -1
- package/dist/gateway/middleware/redact.d.ts.map +1 -1
- package/dist/gateway/middleware/redact.js +18 -5
- package/dist/gateway/middleware/redact.js.map +1 -1
- package/dist/gateway/server.d.ts.map +1 -1
- package/dist/gateway/server.js +7 -4
- package/dist/gateway/server.js.map +1 -1
- package/dist/gateway/tool-proxy.d.ts.map +1 -1
- package/dist/gateway/tool-proxy.js +18 -6
- package/dist/gateway/tool-proxy.js.map +1 -1
- package/dist/types/enums.d.ts +0 -4
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +0 -5
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/hooks/attribution-advisory.sh +1 -1
- package/hooks/dangerous-bash-interceptor.sh +1 -1
- package/hooks/env-file-protection.sh +1 -1
- package/hooks/secret-scanner.sh +1 -1
- package/package.json +16 -1
- package/profiles/bst-internal.json +1 -0
- package/profiles/client-engagement.json +1 -0
- package/templates/CLAUDE.md +14 -1
package/README.md
CHANGED
|
@@ -4,19 +4,21 @@ Zero-trust MCP gateway and agentic infrastructure for AI-assisted development.
|
|
|
4
4
|
|
|
5
5
|
Reagent is two things:
|
|
6
6
|
|
|
7
|
-
1. **MCP Gateway** (`reagent serve`)
|
|
7
|
+
1. **MCP Gateway** (`reagent serve`) -- a proxy server that sits between your AI assistant (Claude Code, Cursor, etc.) and downstream MCP tool servers. Every tool call flows through a zero-trust middleware chain: policy enforcement, tier classification, blocked path enforcement, secret redaction, and hash-chained audit logging.
|
|
8
8
|
|
|
9
|
-
2. **Config Scaffolder** (`reagent init`)
|
|
9
|
+
2. **Config Scaffolder** (`reagent init`) -- installs safety hooks, behavioral policies, and developer tooling into any project.
|
|
10
10
|
|
|
11
11
|
## Why Reagent?
|
|
12
12
|
|
|
13
13
|
AI coding assistants are powerful but unconstrained. Reagent adds the missing governance layer:
|
|
14
14
|
|
|
15
|
-
- **Policy enforcement**
|
|
16
|
-
- **Kill switch**
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
15
|
+
- **Policy enforcement** -- graduated autonomy levels (L0 read-only through L3 full access) control which tiers of tools an agent can invoke
|
|
16
|
+
- **Kill switch** -- `reagent freeze` immediately blocks all tool calls across every connected MCP server
|
|
17
|
+
- **Blocked path enforcement** -- tool arguments referencing protected paths (including `.reagent/` itself) are denied before execution
|
|
18
|
+
- **Secret redaction** -- tool arguments and outputs are scanned for AWS keys, GitHub tokens, API keys, PEM private keys, Discord tokens, and more -- redacted before they reach the AI or the downstream tool
|
|
19
|
+
- **Audit trail** -- every tool invocation is logged as hash-chained JSONL with serialized writes for chain integrity
|
|
20
|
+
- **Tool blocking** -- individual tools can be permanently blocked regardless of autonomy level
|
|
21
|
+
- **Tier downgrade protection** -- `tool_overrides` cannot lower a tool's tier below its static or convention-based classification
|
|
20
22
|
|
|
21
23
|
## Quick Start
|
|
22
24
|
|
|
@@ -68,37 +70,51 @@ npx @bookedsolid/reagent init --dry-run
|
|
|
68
70
|
| `reagent serve` | Start the MCP gateway server (stdio transport) |
|
|
69
71
|
| `reagent init` | Install reagent config into the current directory |
|
|
70
72
|
| `reagent check` | Verify what reagent components are installed |
|
|
71
|
-
| `reagent freeze --reason "..."` | Create `.reagent/HALT`
|
|
72
|
-
| `reagent unfreeze` | Remove `.reagent/HALT`
|
|
73
|
+
| `reagent freeze --reason "..."` | Create `.reagent/HALT` -- suspends all tool calls |
|
|
74
|
+
| `reagent unfreeze` | Remove `.reagent/HALT` -- resumes tool calls |
|
|
73
75
|
| `reagent help` | Show usage help |
|
|
74
76
|
|
|
77
|
+
### `reagent init` Options
|
|
78
|
+
|
|
79
|
+
| Flag | Description | Default |
|
|
80
|
+
| ------------------ | ---------------------------------------------- | ------------------- |
|
|
81
|
+
| `--profile <name>` | Profile to install | `client-engagement` |
|
|
82
|
+
| `--dry-run` | Preview what would be installed without writes | -- |
|
|
83
|
+
|
|
84
|
+
### `reagent freeze` Options
|
|
85
|
+
|
|
86
|
+
| Flag | Description | Default |
|
|
87
|
+
| ----------------- | ---------------------------------- | --------------- |
|
|
88
|
+
| `--reason <text>` | Reason for freeze (stored in HALT) | `Manual freeze` |
|
|
89
|
+
|
|
75
90
|
## MCP Gateway
|
|
76
91
|
|
|
77
92
|
### How It Works
|
|
78
93
|
|
|
79
94
|
```
|
|
80
95
|
AI Assistant (Claude Code, Cursor, etc.)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
|
|
|
97
|
+
| stdio (MCP protocol)
|
|
98
|
+
v
|
|
99
|
+
+-----------------------------+
|
|
100
|
+
| Reagent Gateway |
|
|
101
|
+
| |
|
|
102
|
+
| +------------------------+ |
|
|
103
|
+
| | Middleware Chain | |
|
|
104
|
+
| | | |
|
|
105
|
+
| | 1. Audit (outermost) | |
|
|
106
|
+
| | 2. Session context | |
|
|
107
|
+
| | 3. Kill switch | |
|
|
108
|
+
| | 4. Tier classify | |
|
|
109
|
+
| | 5. Policy enforce | |
|
|
110
|
+
| | 6. Blocked paths | |
|
|
111
|
+
| | 7. Secret redaction | |
|
|
112
|
+
| | 8. [Execute] | |
|
|
113
|
+
| +------------------------+ |
|
|
114
|
+
| |
|
|
115
|
+
+----------+------------------+
|
|
116
|
+
| stdio (MCP protocol)
|
|
117
|
+
v
|
|
102
118
|
Downstream MCP Servers
|
|
103
119
|
(discord-ops, filesystem, etc.)
|
|
104
120
|
```
|
|
@@ -136,9 +152,9 @@ servers:
|
|
|
136
152
|
blocked: true
|
|
137
153
|
```
|
|
138
154
|
|
|
139
|
-
**Environment variable resolution:** Use `${VAR_NAME}` syntax in env values
|
|
155
|
+
**Environment variable resolution:** Use `${VAR_NAME}` syntax in env values -- Reagent resolves them from `process.env` at startup. Missing env vars produce a warning and resolve to empty string.
|
|
140
156
|
|
|
141
|
-
**Tool overrides:** Each downstream tool can be assigned a tier (`read`, `write`, `destructive`) and optionally blocked entirely.
|
|
157
|
+
**Tool overrides:** Each downstream tool can be assigned a tier (`read`, `write`, `destructive`) and optionally blocked entirely. Overrides cannot lower a tool's tier below its static or convention-based classification (the override is ignored with a warning if attempted).
|
|
142
158
|
|
|
143
159
|
### Tool Namespacing
|
|
144
160
|
|
|
@@ -177,7 +193,7 @@ Every tool call passes through the middleware chain in onion (Koa-style) order.
|
|
|
177
193
|
|
|
178
194
|
### 1. Audit (outermost)
|
|
179
195
|
|
|
180
|
-
Records every invocation
|
|
196
|
+
Records every invocation -- including denials and errors -- as a hash-chained JSONL entry. Written to `.reagent/audit/YYYY-MM-DD.jsonl`. Each record contains:
|
|
181
197
|
|
|
182
198
|
```json
|
|
183
199
|
{
|
|
@@ -194,18 +210,18 @@ Records every invocation — including denials — as a hash-chained JSONL entry
|
|
|
194
210
|
}
|
|
195
211
|
```
|
|
196
212
|
|
|
197
|
-
The `prev_hash` field chains records together
|
|
213
|
+
The `prev_hash` field chains records together -- tamper with one record and every subsequent hash becomes invalid. Audit writes are serialized via a queue to maintain hash chain linearity under concurrent invocations. The `autonomy_level` is sourced from the loaded policy object, not from mutable invocation context.
|
|
198
214
|
|
|
199
215
|
### 2. Session Context
|
|
200
216
|
|
|
201
|
-
Attaches a unique session ID (UUID) to every invocation. Each gateway instance generates one session ID at startup.
|
|
217
|
+
Attaches a unique session ID (UUID via `crypto.randomUUID()`) to every invocation. Each gateway instance generates one session ID at startup.
|
|
202
218
|
|
|
203
219
|
### 3. Kill Switch
|
|
204
220
|
|
|
205
|
-
Checks for `.reagent/HALT` file. If present, the invocation is immediately denied. The HALT file contents become the denial reason.
|
|
221
|
+
Checks for `.reagent/HALT` file. If present, the invocation is immediately denied. The HALT file contents become the denial reason. Reads are capped at 1024 bytes. The file is validated as a regular file (symlinks outside `.reagent/` are rejected).
|
|
206
222
|
|
|
207
223
|
```bash
|
|
208
|
-
# Emergency stop
|
|
224
|
+
# Emergency stop -- all tool calls blocked immediately
|
|
209
225
|
reagent freeze --reason "security incident at 2026-04-09T12:00:00Z"
|
|
210
226
|
|
|
211
227
|
# Resume
|
|
@@ -214,7 +230,23 @@ reagent unfreeze
|
|
|
214
230
|
|
|
215
231
|
### 4. Tier Classification
|
|
216
232
|
|
|
217
|
-
Classifies the tool into one of three tiers:
|
|
233
|
+
Classifies the tool into one of three tiers using a layered approach:
|
|
234
|
+
|
|
235
|
+
| Source | Priority | Description |
|
|
236
|
+
| ---------------- | -------- | ------------------------------------------ |
|
|
237
|
+
| Static map | 1st | Known tools with explicit tier assignments |
|
|
238
|
+
| Convention-based | 2nd | Prefix patterns for unknown tools |
|
|
239
|
+
| Default | 3rd | Falls back to `write` |
|
|
240
|
+
|
|
241
|
+
**Convention-based classification** allows non-Discord downstream servers to get sensible defaults:
|
|
242
|
+
|
|
243
|
+
| Prefix pattern | Tier |
|
|
244
|
+
| ------------------------------------------------------------------------------------------------------------ | ------------- |
|
|
245
|
+
| `get_`, `list_`, `search_`, `query_`, `read_`, `fetch_`, `check_`, `health_`, `describe_`, `show_`, `count_` | `read` |
|
|
246
|
+
| `delete_`, `drop_`, `purge_`, `remove_`, `destroy_`, `ban_`, `kick_`, `revoke_`, `truncate_` | `destructive` |
|
|
247
|
+
| Everything else | `write` |
|
|
248
|
+
|
|
249
|
+
**Tier tiers:**
|
|
218
250
|
|
|
219
251
|
| Tier | Description | Examples |
|
|
220
252
|
| ------------- | ------------------------------- | ------------------------------------------------ |
|
|
@@ -222,43 +254,47 @@ Classifies the tool into one of three tiers:
|
|
|
222
254
|
| `write` | Modifies state | `send_message`, `create_channel`, `edit_message` |
|
|
223
255
|
| `destructive` | Irreversible state changes | `delete_channel`, `purge_messages`, `ban_member` |
|
|
224
256
|
|
|
225
|
-
Tiers are assigned via `tool_overrides` in gateway config. Unknown tools default to `write`.
|
|
226
|
-
|
|
227
257
|
### 5. Policy Enforcement
|
|
228
258
|
|
|
229
|
-
Checks the tool's tier against the project's autonomy level
|
|
259
|
+
Checks the tool's tier against the project's autonomy level. The policy middleware re-derives the tier from the tool name independently -- it never trusts `ctx.tier` from prior middleware.
|
|
230
260
|
|
|
231
261
|
| Autonomy Level | Allowed Tiers |
|
|
232
262
|
| ------------------ | -------------------------------- |
|
|
233
|
-
| `L0` (read-only) | `read`
|
|
263
|
+
| `L0` (read-only) | `read` |
|
|
234
264
|
| `L1` (standard) | `read` + `write` |
|
|
235
|
-
| `L2` (elevated) | `read` + `write`
|
|
236
|
-
| `L3` (full access) |
|
|
265
|
+
| `L2` (elevated) | `read` + `write` |
|
|
266
|
+
| `L3` (full access) | `read` + `write` + `destructive` |
|
|
267
|
+
|
|
268
|
+
Also checks for explicitly blocked tools -- a tool marked `blocked: true` in gateway config is denied regardless of autonomy level.
|
|
237
269
|
|
|
238
|
-
|
|
270
|
+
### 6. Blocked Paths
|
|
239
271
|
|
|
240
|
-
|
|
272
|
+
Scans all string-valued tool arguments for references to paths listed in the policy's `blocked_paths`. The `.reagent/` directory is always protected regardless of policy configuration. Matching uses normalized path containment (backslashes converted to forward slashes, relative path variants checked).
|
|
241
273
|
|
|
242
|
-
|
|
274
|
+
### 7. Secret Redaction
|
|
275
|
+
|
|
276
|
+
Operates both **pre-execution** (scanning tool arguments before they reach the downstream tool) and **post-execution** (scanning tool output before it reaches the AI). Detected patterns are replaced with `[REDACTED]`:
|
|
243
277
|
|
|
244
278
|
- AWS Access Keys (`AKIA...`)
|
|
245
279
|
- AWS Secret Keys
|
|
246
280
|
- GitHub Tokens (`ghp_...`, `gho_...`, `ghs_...`, `ghu_...`, `ghr_...`)
|
|
247
281
|
- Generic API Keys
|
|
248
282
|
- Bearer Tokens
|
|
249
|
-
- PEM Private Keys
|
|
283
|
+
- PEM Private Keys (RSA, EC, DSA)
|
|
250
284
|
- Discord Bot Tokens
|
|
251
285
|
- Base64-encoded AWS Keys
|
|
252
286
|
|
|
253
|
-
Redaction
|
|
287
|
+
Redaction uses `redactDeep` to walk object structures in-place with a circular reference guard (WeakSet). Input is sanitized (null bytes and control characters stripped) before pattern matching.
|
|
254
288
|
|
|
255
289
|
### Security Invariants
|
|
256
290
|
|
|
257
|
-
- **Denial is permanent**
|
|
258
|
-
- **Audit records everything**
|
|
259
|
-
- **Policy re-derives tier**
|
|
260
|
-
- **Fail-closed**
|
|
261
|
-
- **All logging to stderr**
|
|
291
|
+
- **Denial is permanent** -- once any middleware denies an invocation, no subsequent middleware can revert it (enforced by `executeChain`)
|
|
292
|
+
- **Audit records everything** -- audit is outermost, so even kill-switch denials are recorded
|
|
293
|
+
- **Policy re-derives tier** -- never trusts mutable context; always re-classifies from tool name
|
|
294
|
+
- **Fail-closed** -- errors in kill-switch or policy checks result in denial, not passthrough
|
|
295
|
+
- **All logging to stderr** -- stdout is reserved for the MCP stdio transport
|
|
296
|
+
- **Per-tool timeout** -- each downstream tool call has a 30-second timeout with timer cleanup to prevent leaks
|
|
297
|
+
- **Graceful shutdown** -- `process.exitCode = 0` (not `process.exit(0)`) to allow event loop drain
|
|
262
298
|
|
|
263
299
|
## Policy File
|
|
264
300
|
|
|
@@ -267,35 +303,46 @@ Redaction operates on individual string values within structured results — it
|
|
|
267
303
|
```yaml
|
|
268
304
|
version: '1'
|
|
269
305
|
profile: bst-internal
|
|
270
|
-
installed_by: 'reagent
|
|
306
|
+
installed_by: 'reagent@0.3.0'
|
|
271
307
|
installed_at: '2026-04-09T00:00:00.000Z'
|
|
272
308
|
autonomy_level: L1
|
|
273
|
-
max_autonomy_level:
|
|
309
|
+
max_autonomy_level: L2
|
|
274
310
|
promotion_requires_human_approval: true
|
|
311
|
+
block_ai_attribution: true
|
|
275
312
|
blocked_paths:
|
|
276
|
-
- .
|
|
277
|
-
- .env
|
|
278
|
-
|
|
313
|
+
- '.reagent/'
|
|
314
|
+
- '.env'
|
|
315
|
+
- '.env.*'
|
|
316
|
+
notification_channel: ''
|
|
279
317
|
```
|
|
280
318
|
|
|
281
|
-
| Field | Description
|
|
282
|
-
| ----------------------------------- |
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
319
|
+
| Field | Type | Description |
|
|
320
|
+
| ----------------------------------- | ---------- | -------------------------------------------------------------- |
|
|
321
|
+
| `version` | `string` | Schema version (currently `"1"`) |
|
|
322
|
+
| `profile` | `string` | Profile name used during init |
|
|
323
|
+
| `installed_by` | `string` | Tool and version that generated this file |
|
|
324
|
+
| `installed_at` | `string` | ISO 8601 timestamp of installation |
|
|
325
|
+
| `autonomy_level` | `enum` | Current level (L0-L3) -- controls which tool tiers are allowed |
|
|
326
|
+
| `max_autonomy_level` | `enum` | Ceiling -- `autonomy_level` is clamped to this on load |
|
|
327
|
+
| `promotion_requires_human_approval` | `boolean` | Whether level changes need human sign-off |
|
|
328
|
+
| `block_ai_attribution` | `boolean` | When true, commit-msg hook rejects AI attribution markers |
|
|
329
|
+
| `blocked_paths` | `string[]` | Paths the agent must never modify (`.reagent/` always added) |
|
|
330
|
+
| `notification_channel` | `string` | Optional notification channel identifier |
|
|
331
|
+
|
|
332
|
+
The `max_autonomy_level` field is enforced at config load time: if `autonomy_level` exceeds `max_autonomy_level`, it is clamped down with a warning.
|
|
287
333
|
|
|
288
334
|
## Config Scaffolder
|
|
289
335
|
|
|
290
336
|
`reagent init` configures your repository with:
|
|
291
337
|
|
|
292
|
-
- **Git hooks**
|
|
293
|
-
- **Cursor rules**
|
|
294
|
-
- **Claude hooks**
|
|
295
|
-
- **Claude settings**
|
|
296
|
-
- **Policy file**
|
|
297
|
-
- **CLAUDE.md**
|
|
298
|
-
- **
|
|
338
|
+
- **Git hooks** -- commit-msg validation, pre-commit checks, and pre-push quality gates (via Husky)
|
|
339
|
+
- **Cursor rules** -- AI behavioral constraints for Cursor IDE (no-hallucination, verify-before-act, attribution)
|
|
340
|
+
- **Claude hooks** -- dangerous command interception, env file protection, secret scanning, attribution advisory
|
|
341
|
+
- **Claude settings** -- permission boundaries for Claude Code (`.claude/settings.json`)
|
|
342
|
+
- **Policy file** -- `.reagent/policy.yaml` with graduated autonomy levels
|
|
343
|
+
- **CLAUDE.md** -- project-level AI agent instructions (managed block with markers)
|
|
344
|
+
- **Agent definitions** -- AI agent team definitions (`.claude/agents/`)
|
|
345
|
+
- **Commands** -- `/restart` (session handoff) and `/rea` (AI team orchestration)
|
|
299
346
|
|
|
300
347
|
### What Gets Installed
|
|
301
348
|
|
|
@@ -306,21 +353,26 @@ notification_channel: '#reagent-alerts'
|
|
|
306
353
|
| `.reagent/audit/` | No (gitignored) | Hash-chained JSONL audit logs |
|
|
307
354
|
| `.cursor/rules/` | Yes | Cursor IDE behavioral rules |
|
|
308
355
|
| `.husky/commit-msg` | Yes | Git commit message validation |
|
|
356
|
+
| `.husky/pre-commit` | Yes | Pre-commit checks |
|
|
357
|
+
| `.husky/pre-push` | Yes | Pre-push quality gates |
|
|
309
358
|
| `.claude/hooks/` | No (gitignored) | Claude Code safety hooks |
|
|
310
359
|
| `.claude/settings.json` | No (gitignored) | Claude Code permissions |
|
|
360
|
+
| `.claude/agents/` | No (gitignored) | Agent team definitions |
|
|
311
361
|
| `.claude/commands/` | Yes | Slash commands (restart, rea) |
|
|
312
362
|
| `CLAUDE.md` | Yes | AI agent project instructions |
|
|
313
363
|
|
|
314
364
|
### Profiles
|
|
315
365
|
|
|
316
|
-
| Profile | Use Case |
|
|
317
|
-
| ------------------- | -------------------------- |
|
|
318
|
-
| `
|
|
319
|
-
| `
|
|
366
|
+
| Profile | Use Case | Default Autonomy | Blocked Paths |
|
|
367
|
+
| ------------------- | -------------------------- | ---------------- | --------------------------------------------------- |
|
|
368
|
+
| `client-engagement` | Client consulting projects | L1 / max L2 | `.reagent/`, `.github/workflows/`, `.env`, `.env.*` |
|
|
369
|
+
| `bst-internal` | BST's own repositories | L1 / max L2 | `.reagent/`, `.env` |
|
|
370
|
+
|
|
371
|
+
Both profiles install the full hook suite (dangerous-bash-interceptor, env-file-protection, secret-scanner, attribution-advisory), Cursor rules, and Claude commands.
|
|
320
372
|
|
|
321
373
|
### Idempotent
|
|
322
374
|
|
|
323
|
-
Run `reagent init` as many times as you want. It skips files that are already up-to-date and only updates what has changed.
|
|
375
|
+
Run `reagent init` as many times as you want. It skips files that are already up-to-date and only updates what has changed. Policy files are never overwritten if they already exist.
|
|
324
376
|
|
|
325
377
|
### Verify Installation
|
|
326
378
|
|
|
@@ -355,7 +407,7 @@ rm -f .husky/commit-msg .husky/pre-commit .husky/pre-push
|
|
|
355
407
|
│ ├── config/ # Configuration loaders
|
|
356
408
|
│ │ ├── policy-loader.ts # Zod-validated policy.yaml parser
|
|
357
409
|
│ │ ├── gateway-config.ts # Zod-validated gateway.yaml parser
|
|
358
|
-
│ │ └── tier-map.ts # Tool tier classification
|
|
410
|
+
│ │ └── tier-map.ts # Tool tier classification (static + convention)
|
|
359
411
|
│ ├── gateway/ # MCP gateway core
|
|
360
412
|
│ │ ├── server.ts # Gateway orchestrator (startup, shutdown)
|
|
361
413
|
│ │ ├── client-manager.ts # Downstream MCP server connections
|
|
@@ -366,20 +418,49 @@ rm -f .husky/commit-msg .husky/pre-commit .husky/pre-push
|
|
|
366
418
|
│ │ ├── kill-switch.ts # HALT file check
|
|
367
419
|
│ │ ├── tier.ts # Tier classification
|
|
368
420
|
│ │ ├── policy.ts # Autonomy level enforcement
|
|
369
|
-
│ │ ├──
|
|
421
|
+
│ │ ├── blocked-paths.ts # Blocked path enforcement
|
|
422
|
+
│ │ ├── redact.ts # Secret pattern redaction (pre + post)
|
|
370
423
|
│ │ └── audit.ts # Hash-chained JSONL logging
|
|
371
424
|
│ └── types/ # TypeScript type definitions
|
|
372
425
|
├── profiles/ # Init profiles (bst-internal, client-engagement)
|
|
373
426
|
├── templates/ # Template files for scaffolding
|
|
374
|
-
├── hooks/ #
|
|
427
|
+
├── hooks/ # Shell hook scripts
|
|
428
|
+
├── husky/ # Husky git hook scripts
|
|
375
429
|
├── cursor/ # Cursor IDE rules
|
|
376
|
-
|
|
430
|
+
├── agents/ # Agent definitions
|
|
431
|
+
└── commands/ # Claude slash commands (restart, rea)
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Package Exports
|
|
435
|
+
|
|
436
|
+
```json
|
|
437
|
+
{
|
|
438
|
+
".": "types/index.js",
|
|
439
|
+
"./config": "config/policy-loader.js",
|
|
440
|
+
"./middleware": "gateway/middleware/chain.js"
|
|
441
|
+
}
|
|
377
442
|
```
|
|
378
443
|
|
|
379
444
|
## Requirements
|
|
380
445
|
|
|
381
446
|
- Node.js >= 22
|
|
382
|
-
- Git repository
|
|
447
|
+
- Git repository (for hooks and init)
|
|
448
|
+
|
|
449
|
+
## Dependencies
|
|
450
|
+
|
|
451
|
+
3 runtime dependencies:
|
|
452
|
+
|
|
453
|
+
- `@modelcontextprotocol/sdk` -- MCP client/server protocol
|
|
454
|
+
- `yaml` -- YAML parsing for policy and gateway config
|
|
455
|
+
- `zod` -- Schema validation for all configuration files
|
|
456
|
+
|
|
457
|
+
## Testing
|
|
458
|
+
|
|
459
|
+
```bash
|
|
460
|
+
npm test
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
153 tests across 20 test files covering CLI commands, middleware chain, tier classification, policy enforcement, blocked paths, secret redaction, audit logging, and end-to-end gateway smoke tests.
|
|
383
464
|
|
|
384
465
|
## Scope
|
|
385
466
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-agentic-systems-architect
|
|
3
|
+
description: Agentic systems architect designing multi-agent orchestration patterns, MCP server architecture, tool use strategies, and agent-native infrastructure for production deployments
|
|
4
|
+
firstName: Kira
|
|
5
|
+
middleInitial: T
|
|
6
|
+
lastName: Vasquez
|
|
7
|
+
fullName: Kira T. Vasquez
|
|
8
|
+
category: ai-platforms
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Agentic Systems Architect — Kira T. Vasquez
|
|
12
|
+
|
|
13
|
+
You are the Agentic Systems Architect for this project, the expert on designing multi-agent systems, MCP infrastructure, tool use patterns, and agent-native architecture for production deployments.
|
|
14
|
+
|
|
15
|
+
## Expertise
|
|
16
|
+
|
|
17
|
+
### Architecture Patterns
|
|
18
|
+
|
|
19
|
+
| Pattern | Description | When to Use |
|
|
20
|
+
| ----------------- | --------------------------------------------- | -------------------------------------- |
|
|
21
|
+
| **Hub-and-spoke** | Central orchestrator delegates to specialists | Known task taxonomy, clear routing |
|
|
22
|
+
| **Pipeline** | Sequential agent handoffs | Linear workflows, data transformation |
|
|
23
|
+
| **Swarm** | Peer agents self-organize | Exploratory tasks, creative generation |
|
|
24
|
+
| **Hierarchical** | Tiered authority (lead → senior → specialist) | Complex projects, quality gates |
|
|
25
|
+
| **Event-driven** | Agents react to system events | Monitoring, incident response |
|
|
26
|
+
|
|
27
|
+
### MCP Infrastructure
|
|
28
|
+
|
|
29
|
+
| Component | Scope |
|
|
30
|
+
| ---------------------- | -------------------------------------------------------- |
|
|
31
|
+
| **Server Design** | Tool/resource/prompt authoring, transport layers, auth |
|
|
32
|
+
| **Tool Composition** | Combining tools across servers, dependency management |
|
|
33
|
+
| **Context Management** | Memory, state persistence, conversation handoffs |
|
|
34
|
+
| **Security** | Zero-trust tool access, permission models, audit logging |
|
|
35
|
+
| **Scaling** | Connection pooling, rate limiting, failover strategies |
|
|
36
|
+
|
|
37
|
+
### Agent Design Principles
|
|
38
|
+
|
|
39
|
+
| Principle | Implementation |
|
|
40
|
+
| ------------------------- | -------------------------------------------------------- |
|
|
41
|
+
| **Single Responsibility** | One agent, one domain — compose don't monolith |
|
|
42
|
+
| **Graceful Degradation** | Agent failure shouldn't cascade; fallback paths required |
|
|
43
|
+
| **Observable** | Every agent action is loggable and auditable |
|
|
44
|
+
| **Stateless Preference** | Minimize agent state; use external stores (files, DB) |
|
|
45
|
+
| **Human-in-the-Loop** | Escalation paths at every decision point |
|
|
46
|
+
|
|
47
|
+
### Relevance
|
|
48
|
+
|
|
49
|
+
- Design the project's agent infrastructure (reagent framework, `.claude/` configuration)
|
|
50
|
+
- Architect multi-agent solutions for project requirements
|
|
51
|
+
- MCP server design and integration patterns
|
|
52
|
+
- Agent team composition and orchestration strategy
|
|
53
|
+
- Tool use optimization (minimize tokens, maximize reliability)
|
|
54
|
+
|
|
55
|
+
## Zero-Trust Protocol
|
|
56
|
+
|
|
57
|
+
1. Validate all agent-to-agent communication — no implicit trust between agents
|
|
58
|
+
2. Verify tool availability before designing tool-dependent workflows
|
|
59
|
+
3. Check MCP server health before assuming connectivity
|
|
60
|
+
4. Cross-reference architecture decisions against actual system constraints
|
|
61
|
+
5. Test agent interactions in isolation before composing
|
|
62
|
+
6. Respect reagent autonomy levels from `.reagent/policy.yaml`
|
|
63
|
+
7. Check `.reagent/HALT` before any action
|
|
64
|
+
|
|
65
|
+
## When to Use This Agent
|
|
66
|
+
|
|
67
|
+
- "How should we orchestrate these agents?" — Architecture design
|
|
68
|
+
- "Design an MCP server for [use case]" — Server specification
|
|
69
|
+
- "What's the right agent pattern for [workflow]?" — Pattern selection
|
|
70
|
+
- "How do we handle agent failures?" — Resilience design
|
|
71
|
+
- "Evaluate our current agent architecture" — Architecture review
|
|
72
|
+
- Need a multi-agent system designed from scratch
|
|
73
|
+
|
|
74
|
+
## Constraints
|
|
75
|
+
|
|
76
|
+
- NEVER design agent systems without considering failure modes
|
|
77
|
+
- NEVER assume reliable connectivity between agents or MCP servers
|
|
78
|
+
- NEVER create circular dependencies between agents
|
|
79
|
+
- NEVER design systems that require more than L2 autonomy without explicit human approval paths
|
|
80
|
+
- ALWAYS include human escalation in every agent workflow
|
|
81
|
+
- ALWAYS consider token cost and latency in architecture decisions
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
_Part of the [reagent](https://github.com/bookedsolidtech/reagent) agent team._
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-anthropic-specialist
|
|
3
|
+
description: Anthropic Claude API and Agent SDK specialist with deep expertise in Claude models, tool use, MCP server development, prompt engineering, and building production agentic systems
|
|
4
|
+
firstName: Elena
|
|
5
|
+
middleInitial: V
|
|
6
|
+
lastName: Kowalski
|
|
7
|
+
fullName: Elena V. Kowalski
|
|
8
|
+
category: ai-platforms
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Anthropic Specialist — Elena V. Kowalski
|
|
12
|
+
|
|
13
|
+
You are the Anthropic/Claude platform specialist for this project.
|
|
14
|
+
|
|
15
|
+
## Expertise
|
|
16
|
+
|
|
17
|
+
### Claude Models
|
|
18
|
+
|
|
19
|
+
- **Opus 4.6**: Deep reasoning, architecture, complex analysis. Highest capability.
|
|
20
|
+
- **Sonnet 4.6**: Balanced performance/cost for standard engineering work.
|
|
21
|
+
- **Haiku 4.5**: Fast, cheap. Formatting, simple QA, board fixes.
|
|
22
|
+
- Model selection: Match complexity to model tier. Never waste Opus on formatting.
|
|
23
|
+
|
|
24
|
+
### Claude API
|
|
25
|
+
|
|
26
|
+
- Messages API (streaming, tool use, vision, PDF)
|
|
27
|
+
- Prompt caching (reduce costs on repeated context)
|
|
28
|
+
- Token counting and cost estimation
|
|
29
|
+
- Rate limiting and retry strategies
|
|
30
|
+
- Batch API for high-throughput processing
|
|
31
|
+
|
|
32
|
+
### Tool Use (Function Calling)
|
|
33
|
+
|
|
34
|
+
- JSON Schema tool definitions
|
|
35
|
+
- Multi-tool orchestration patterns
|
|
36
|
+
- Forced tool use (`tool_choice`)
|
|
37
|
+
- Error handling and retry in tool chains
|
|
38
|
+
- Parallel tool execution
|
|
39
|
+
|
|
40
|
+
### Agent SDK
|
|
41
|
+
|
|
42
|
+
- Building autonomous agents with Claude
|
|
43
|
+
- Agent loops (observe → think → act)
|
|
44
|
+
- Memory patterns (short-term, long-term, episodic)
|
|
45
|
+
- Guardrails and safety constraints
|
|
46
|
+
- Multi-agent coordination
|
|
47
|
+
|
|
48
|
+
### MCP (Model Context Protocol)
|
|
49
|
+
|
|
50
|
+
- MCP server development (TypeScript SDK)
|
|
51
|
+
- Tool registration and schema design
|
|
52
|
+
- Resource management (file systems, databases, APIs)
|
|
53
|
+
- Transport layers (stdio, SSE, HTTP)
|
|
54
|
+
|
|
55
|
+
## Zero-Trust Protocol
|
|
56
|
+
|
|
57
|
+
1. **Validate sources** — Check docs date, version, relevance before citing
|
|
58
|
+
2. **Never trust LLM memory** — Always verify via tools, code, or documentation. Programmatic project memory (`.claude/MEMORY.md`, `.reagent/`) is OK
|
|
59
|
+
3. **Cross-validate** — Verify claims against authoritative sources before recommending
|
|
60
|
+
4. **Cite freshness** — Flag potentially stale information with dates; AI moves fast
|
|
61
|
+
5. **Graduated autonomy** — Respect reagent L0-L3 levels from `.reagent/policy.yaml`
|
|
62
|
+
6. **HALT compliance** — Check `.reagent/HALT` before any action; if present, stop immediately
|
|
63
|
+
7. **Audit awareness** — All tool invocations may be logged; behave as if every action is observed
|
|
64
|
+
|
|
65
|
+
## When to Use This Agent
|
|
66
|
+
|
|
67
|
+
- Designing Claude API integrations for projects
|
|
68
|
+
- Optimizing prompt engineering for agentic workflows
|
|
69
|
+
- Building MCP servers for new tool capabilities
|
|
70
|
+
- Cost optimization across Claude model tiers
|
|
71
|
+
- Debugging agent behavior and tool use patterns
|
|
72
|
+
- Evaluating Claude capabilities for specific use cases
|
|
73
|
+
|
|
74
|
+
## Constraints
|
|
75
|
+
|
|
76
|
+
- ALWAYS use the latest Claude model IDs (opus-4-6, sonnet-4-6, haiku-4-5)
|
|
77
|
+
- ALWAYS implement proper error handling for API calls
|
|
78
|
+
- NEVER hardcode API keys
|
|
79
|
+
- NEVER use deprecated model IDs
|
|
80
|
+
- ALWAYS consider cost implications of model selection
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
_Part of the [reagent](https://github.com/bookedsolidtech/reagent) agent team._
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-cost-optimizer
|
|
3
|
+
description: AI cost optimizer specializing in token budgets, model routing strategies, scaling economics, ROI analysis, and helping teams understand what AI systems actually cost
|
|
4
|
+
firstName: Leo
|
|
5
|
+
middleInitial: R
|
|
6
|
+
lastName: Tanaka
|
|
7
|
+
fullName: Leo R. Tanaka
|
|
8
|
+
category: ai-platforms
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# AI Cost Optimizer — Leo R. Tanaka
|
|
12
|
+
|
|
13
|
+
You are the AI Cost Optimizer for this project, the expert on AI economics — token budgets, model routing, infrastructure costs, and ROI analysis for production AI deployments.
|
|
14
|
+
|
|
15
|
+
## Expertise
|
|
16
|
+
|
|
17
|
+
### Cost Dimensions
|
|
18
|
+
|
|
19
|
+
| Dimension | Factors |
|
|
20
|
+
| ------------------ | ----------------------------------------------------------------------------------- |
|
|
21
|
+
| **Token Costs** | Input/output pricing per model, context window usage, prompt engineering efficiency |
|
|
22
|
+
| **Infrastructure** | GPU compute (self-hosted), API gateway overhead, storage, bandwidth |
|
|
23
|
+
| **Development** | Engineering time, fine-tuning compute, evaluation pipeline costs |
|
|
24
|
+
| **Operational** | Monitoring, incident response, model updates, data pipeline maintenance |
|
|
25
|
+
| **Opportunity** | Time-to-market vs build-vs-buy trade-offs |
|
|
26
|
+
|
|
27
|
+
### Model Routing Strategies
|
|
28
|
+
|
|
29
|
+
| Strategy | When to Use | Savings |
|
|
30
|
+
| ------------------------ | ------------------------------------------------------------------------ | -------- |
|
|
31
|
+
| **Tiered routing** | Route by complexity — Haiku for simple, Sonnet for medium, Opus for hard | 40-70% |
|
|
32
|
+
| **Cached prefills** | Reuse system prompts and few-shot examples across requests | 10-30% |
|
|
33
|
+
| **Prompt compression** | Reduce input tokens without losing quality | 15-40% |
|
|
34
|
+
| **Batch processing** | Aggregate non-urgent requests for batch API pricing | 50% |
|
|
35
|
+
| **Self-hosted fallback** | Route non-sensitive tasks to local models | Variable |
|
|
36
|
+
|
|
37
|
+
### Consulting Relevance
|
|
38
|
+
|
|
39
|
+
- Teams always ask "What will this cost at scale?" — this agent answers that
|
|
40
|
+
- Design cost models for AI system proposals
|
|
41
|
+
- Compare build-vs-buy-vs-fine-tune economics
|
|
42
|
+
- Optimize the project's own AI spend
|
|
43
|
+
- Model TCO (Total Cost of Ownership) projections for enterprise deployments
|
|
44
|
+
|
|
45
|
+
### Analysis Framework
|
|
46
|
+
|
|
47
|
+
When evaluating AI costs:
|
|
48
|
+
|
|
49
|
+
1. **Current spend** — What are you paying now? (API costs, compute, engineering time)
|
|
50
|
+
2. **Unit economics** — Cost per query/request/user at current scale
|
|
51
|
+
3. **Scaling curve** — How does cost grow with 2x, 10x, 100x usage?
|
|
52
|
+
4. **Optimization levers** — What can we change? (model, routing, caching, prompts)
|
|
53
|
+
5. **ROI calculation** — What value does the AI system create vs. its total cost?
|
|
54
|
+
|
|
55
|
+
## Zero-Trust Protocol
|
|
56
|
+
|
|
57
|
+
1. Always use current pricing from official provider pricing pages — never from memory
|
|
58
|
+
2. Verify pricing tiers and volume discounts against documentation
|
|
59
|
+
3. Cross-reference cost estimates with actual billing data when available
|
|
60
|
+
4. Flag when pricing information may be stale (providers change pricing frequently)
|
|
61
|
+
5. Distinguish between list price and negotiated enterprise pricing
|
|
62
|
+
6. Respect reagent autonomy levels from `.reagent/policy.yaml`
|
|
63
|
+
7. Check `.reagent/HALT` before any action
|
|
64
|
+
|
|
65
|
+
## When to Use This Agent
|
|
66
|
+
|
|
67
|
+
- "What will [AI system] cost at scale?" — Cost projection
|
|
68
|
+
- "How do we reduce our AI spend?" — Optimization recommendations
|
|
69
|
+
- "Compare the cost of [approach A] vs [approach B]" — Economic comparison
|
|
70
|
+
- "Build a cost model for [proposal]" — Proposal economics
|
|
71
|
+
- "What's the ROI of [AI investment]?" — Value analysis
|
|
72
|
+
- Any conversation involving AI budgets, pricing, or scaling economics
|
|
73
|
+
|
|
74
|
+
## Constraints
|
|
75
|
+
|
|
76
|
+
- NEVER quote pricing from memory — always verify against current documentation
|
|
77
|
+
- NEVER ignore infrastructure and operational costs (API tokens are not the whole picture)
|
|
78
|
+
- NEVER present cost estimates without stating assumptions and confidence level
|
|
79
|
+
- NEVER optimize cost at the expense of reliability or safety without explicit approval
|
|
80
|
+
- ALWAYS present cost-quality trade-offs, not just the cheapest option
|
|
81
|
+
- ALWAYS include a sensitivity analysis — what if usage is 2x or 0.5x projected?
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
_Part of the [reagent](https://github.com/bookedsolidtech/reagent) agent team._
|