@triedotdev/mcp 1.0.37 → 1.0.39
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 +592 -34
- package/dist/{chunk-QFTSX2BX.js → chunk-B3MBKB2U.js} +2016 -172
- package/dist/chunk-B3MBKB2U.js.map +1 -0
- package/dist/{chunk-VSCPOIWS.js → chunk-HG5AWUH7.js} +536 -61
- package/dist/chunk-HG5AWUH7.js.map +1 -0
- package/dist/cli/main.js +5 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +9 -2
- package/dist/cli/yolo-daemon.js.map +1 -1
- package/dist/index.js +62 -6
- package/dist/index.js.map +1 -1
- package/dist/workers/agent-worker.js +1 -1
- package/package.json +2 -3
- package/QUICK_START.md +0 -228
- package/dist/chunk-QFTSX2BX.js.map +0 -1
- package/dist/chunk-VSCPOIWS.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
**Customizable Parallel Agents for AI Code Review**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Specialized agents scan your code for security, privacy, compliance, and bugs—all running in parallel with intelligent caching and real-time streaming.
|
|
6
6
|
|
|
7
7
|
## Why Trie
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Trie is purpose-built for the last mile of shipping AI-generated code.
|
|
10
|
+
|
|
11
|
+
The last mile of shipping is where things break—not because your code doesn't work, but because the context you captured while building doesn't travel with you. Trie fixes that. One registry and triager runs identically in Cursor, Claude Code, the CLI, and GitHub Actions—master files that every surface can see, not scattered configs you forget to sync. Ingest your compliance docs, style guides, or internal policies (PDF/TXT/MD/RTF) and Trie compresses them into enforceable agents saved to `.trie/agents/`. Version them in TypeScript, test them locally, deploy them to CI with identical behavior. Triager logs show exactly which agents fired and why—no black-box routing. Built for people who need signal that their AI-generated code is reliable and right for the context they've captured, while they're still building.
|
|
10
12
|
|
|
11
13
|
## What's New (latest updates)
|
|
12
|
-
- **Legal Agent v2.0**: Complete rewrite, now the most comprehensive legal compliance agent for app development. Covers 21 categories: open source licensing (GPL/AGPL/MIT), Terms of Service, API terms compliance, intellectual property, ADA/WCAG accessibility, GDPR/CCPA data protection, e-commerce/PCI, CAN-SPAM/TCPA marketing, COPPA child safety, export controls, DMCA, and more.
|
|
13
14
|
|
|
14
|
-
- **
|
|
15
|
+
- **Accessibility Agent (v2.0)**: Comprehensive WCAG 2.1 AA compliance. Detects icon-only buttons, touch targets, skipped headings, positive tabIndex, ARIA validation, color-only indicators, and 20+ more checks with WCAG criterion references.
|
|
16
|
+
|
|
17
|
+
- **Health Score Triaging**: Your health score (0-100) now actively controls what agents run. Below 50%? All agents run automatically. Agents that found issues before get boosted priority in future scans.
|
|
18
|
+
|
|
19
|
+
- **Moneybags Agent**: Estimates dollar cost of bugs using IBM/NIST research. Costs scale with your user count—use `--users 10000` to match your scale (default: 250 users).
|
|
20
|
+
|
|
21
|
+
- **Production Ready Agent**: Production gate that checks for health endpoints, graceful shutdown, connection pooling, security headers, rate limiting, and monitoring. Get a ship/no-ship verdict before every deploy.
|
|
15
22
|
|
|
16
23
|
---
|
|
17
24
|
|
|
@@ -23,6 +30,8 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
23
30
|
- [MCP Tools](#mcp-tools)
|
|
24
31
|
- [CLI](#cli)
|
|
25
32
|
- [Built-in Agents](#built-in-agents)
|
|
33
|
+
- [Accessibility Agent (v2.0)](#accessibility-agent-v20)
|
|
34
|
+
- [Moneybags Agent (v1.1)](#moneybags-agent-v11)
|
|
26
35
|
- [Legal Agent (v2.0)](#legal-agent-v20)
|
|
27
36
|
- [Design Engineer (v2.0)](#design-engineer-v20)
|
|
28
37
|
- [Special Agents](#special-agents)
|
|
@@ -30,6 +39,8 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
30
39
|
- [AI-Enhanced Mode](#ai-enhanced-mode)
|
|
31
40
|
- [CI/CD Integration](#cicd-integration)
|
|
32
41
|
- [VS Code Extension](#vs-code-extension)
|
|
42
|
+
- [Agent Context System](#agent-context-system)
|
|
43
|
+
- [Production Shipping](#production-shipping) (Production Ready Agent)
|
|
33
44
|
- [Configuration](#configuration)
|
|
34
45
|
- [License](#license)
|
|
35
46
|
|
|
@@ -41,7 +52,7 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
41
52
|
|
|
42
53
|
| Feature | Description |
|
|
43
54
|
|---------|-------------|
|
|
44
|
-
| **
|
|
55
|
+
| **22 Built-in Agents** | Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Moneybags, Production Ready, and more |
|
|
45
56
|
| **Parallel Execution** | True parallel execution with worker threads—3-5x faster scans |
|
|
46
57
|
| **Result Caching** | File-based caching with SHA256 hashing—70% faster repeated scans |
|
|
47
58
|
| **Smart Triaging** | Only activates relevant agents based on code context |
|
|
@@ -67,15 +78,31 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
67
78
|
|
|
68
79
|
## Quick Start
|
|
69
80
|
|
|
70
|
-
### Install
|
|
81
|
+
### Step 1: Install Node.js (if you don't have it)
|
|
82
|
+
|
|
83
|
+
Trie requires Node.js. Check if you have it by opening Terminal (Mac) or Command Prompt (Windows):
|
|
71
84
|
|
|
72
85
|
```bash
|
|
73
|
-
|
|
86
|
+
node --version
|
|
74
87
|
```
|
|
75
88
|
|
|
76
|
-
|
|
89
|
+
If you see a version number (like `v18.0.0`), skip to Step 2. If not:
|
|
90
|
+
- **Mac**: Download from [nodejs.org](https://nodejs.org) or run `brew install node`
|
|
91
|
+
- **Windows**: Download from [nodejs.org](https://nodejs.org)
|
|
92
|
+
|
|
93
|
+
### Step 2: Set Up Trie in Your AI Coding Tool
|
|
77
94
|
|
|
78
|
-
|
|
95
|
+
Pick the tool you use:
|
|
96
|
+
|
|
97
|
+
<details>
|
|
98
|
+
<summary><strong>Cursor (click to expand)</strong></summary>
|
|
99
|
+
|
|
100
|
+
1. Open Cursor
|
|
101
|
+
2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows)
|
|
102
|
+
3. Type "settings" and select **Cursor Settings**
|
|
103
|
+
4. Click **MCP** in the left sidebar
|
|
104
|
+
5. Click **Add MCP Server**
|
|
105
|
+
6. Paste this configuration:
|
|
79
106
|
|
|
80
107
|
```json
|
|
81
108
|
{
|
|
@@ -88,54 +115,262 @@ Settings → MCP Servers → Add:
|
|
|
88
115
|
}
|
|
89
116
|
```
|
|
90
117
|
|
|
91
|
-
**Restart Cursor
|
|
118
|
+
7. **Restart Cursor** (Cmd+Q and reopen, or Ctrl+Q on Windows)
|
|
119
|
+
|
|
120
|
+
**That's it!** Trie is now connected.
|
|
121
|
+
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
<details>
|
|
125
|
+
<summary><strong>Claude Code (click to expand)</strong></summary>
|
|
92
126
|
|
|
93
|
-
|
|
127
|
+
1. Open Claude Code
|
|
128
|
+
2. Open the terminal inside Claude Code
|
|
129
|
+
3. Run this command:
|
|
94
130
|
|
|
95
131
|
```bash
|
|
96
132
|
claude mcp add Trie --scope user -- npx @triedotdev/mcp
|
|
97
133
|
```
|
|
98
134
|
|
|
99
|
-
**Restart Claude Code
|
|
135
|
+
4. **Restart Claude Code**
|
|
100
136
|
|
|
101
|
-
|
|
137
|
+
**That's it!** Trie is now connected.
|
|
102
138
|
|
|
103
|
-
|
|
139
|
+
</details>
|
|
104
140
|
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
<details>
|
|
142
|
+
<summary><strong>Other AI Tools (Windsurf, OpenCode, etc.)</strong></summary>
|
|
143
|
+
|
|
144
|
+
Most MCP-compatible tools have a settings page for MCP servers. Add:
|
|
145
|
+
|
|
146
|
+
- **Command**: `npx`
|
|
147
|
+
- **Arguments**: `@triedotdev/mcp`
|
|
148
|
+
|
|
149
|
+
Or in JSON format:
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"command": "npx",
|
|
153
|
+
"args": ["@triedotdev/mcp"]
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
</details>
|
|
158
|
+
|
|
159
|
+
### Step 3: Run Your First Scan
|
|
160
|
+
|
|
161
|
+
Open your project in Cursor or Claude Code and type in the chat:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
Scan my code with Trie
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Trie will:
|
|
168
|
+
1. Analyze your entire codebase
|
|
169
|
+
2. Pick the right checks based on what your code does (payments, auth, user data, etc.)
|
|
170
|
+
3. Show you a prioritized list of issues
|
|
171
|
+
|
|
172
|
+
**Example output:**
|
|
107
173
|
```
|
|
174
|
+
🔺 Trie Agent Scan Complete
|
|
175
|
+
|
|
176
|
+
Scanned: 5 agents | Time: 12.3s | Risk: MEDIUM
|
|
108
177
|
|
|
178
|
+
🎯 3 Issues Found
|
|
179
|
+
|
|
180
|
+
🔴 Critical (1)
|
|
109
181
|
---
|
|
182
|
+
Missing authentication on payment endpoint
|
|
183
|
+
|
|
184
|
+
📍 src/api/checkout.ts:47
|
|
110
185
|
|
|
111
|
-
|
|
186
|
+
Fix: Add auth middleware before processing payment
|
|
187
|
+
```
|
|
112
188
|
|
|
113
|
-
|
|
189
|
+
### Step 4: Fix Issues
|
|
114
190
|
|
|
191
|
+
For each issue, you can:
|
|
192
|
+
|
|
193
|
+
**Option A: Ask your AI to fix it**
|
|
115
194
|
```
|
|
116
|
-
|
|
195
|
+
Fix the authentication issue in checkout.ts that Trie found
|
|
117
196
|
```
|
|
118
197
|
|
|
119
|
-
|
|
198
|
+
**Option B: Use Trie's auto-fix** (for high-confidence fixes)
|
|
199
|
+
```
|
|
200
|
+
Run trie_fix to apply safe fixes
|
|
201
|
+
```
|
|
120
202
|
|
|
203
|
+
**Option C: Get more details first**
|
|
121
204
|
```
|
|
122
|
-
|
|
123
|
-
Run trie_soc2 to check compliance
|
|
205
|
+
Explain the checkout.ts security issue
|
|
124
206
|
```
|
|
125
207
|
|
|
126
|
-
|
|
208
|
+
---
|
|
127
209
|
|
|
128
|
-
|
|
129
|
-
- `trie` / `/trie` with `{ action: "scan", files?: [], directory?: "" }` runs a full triaged scan.
|
|
130
|
-
- `trie` / `/trie` with `{ action: "<agent>", files?: [] }` runs one agent (e.g., `security`, `ux`, `soc2`, `agent_smith`).
|
|
210
|
+
## Your Ongoing Workflow
|
|
131
211
|
|
|
132
|
-
|
|
212
|
+
Once set up, here's how to use Trie day-to-day.
|
|
213
|
+
|
|
214
|
+
### How Trie Remembers Your Project
|
|
215
|
+
|
|
216
|
+
**You don't have to remember anything.** Trie automatically tracks:
|
|
217
|
+
|
|
218
|
+
| What Trie Remembers | Why It Matters |
|
|
219
|
+
|---------------------|----------------|
|
|
220
|
+
| Last scan results | AI knows what issues exist without re-scanning |
|
|
221
|
+
| **Health score (0-100)** | Controls what agents run (see below) |
|
|
222
|
+
| Which files have issues | AI focuses on problem areas first |
|
|
223
|
+
| What type of code you have | Runs the right checks (payments, auth, etc.) automatically |
|
|
224
|
+
| Scan history | See if issues are getting better or worse |
|
|
225
|
+
|
|
226
|
+
**This works everywhere automatically:**
|
|
227
|
+
- ✅ Cursor remembers between sessions
|
|
228
|
+
- ✅ Claude Code picks up where you left off
|
|
229
|
+
- ✅ CLI shows the same status
|
|
230
|
+
- ✅ GitHub Actions uses the same context
|
|
231
|
+
|
|
232
|
+
**Where it's stored:** A file called `.trie/AGENTS.md` in your project. You can look at it anytime to see your project's health status.
|
|
233
|
+
|
|
234
|
+
### Health Score: The Priority System
|
|
235
|
+
|
|
236
|
+
Your **health score** isn't just a number—it actively controls how Trie works across all your tools:
|
|
237
|
+
|
|
238
|
+
| Health Score | What Happens |
|
|
239
|
+
|--------------|--------------|
|
|
240
|
+
| **80-100** | Normal mode: Trie runs targeted checks based on your code |
|
|
241
|
+
| **50-79** | Cautious mode: Agents that found issues before run again automatically |
|
|
242
|
+
| **Below 50** | Full scan mode: ALL agents run regardless of context |
|
|
133
243
|
|
|
134
|
-
|
|
244
|
+
**How it works across tools:**
|
|
135
245
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
246
|
+
```
|
|
247
|
+
Cursor: Scan finds 14 issues → Health drops to 56%
|
|
248
|
+
↓
|
|
249
|
+
Claude Code: Opens same project → Sees 56% health
|
|
250
|
+
↓
|
|
251
|
+
Trie automatically runs more thorough checks
|
|
252
|
+
↓
|
|
253
|
+
GitHub Actions: Same health score → Stricter CI gates
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Why this matters:**
|
|
257
|
+
|
|
258
|
+
| Scenario | Without Health Score | With Health Score |
|
|
259
|
+
|----------|---------------------|-------------------|
|
|
260
|
+
| Quick fix in Cursor | Might skip security check | Knows security found issues → runs it |
|
|
261
|
+
| Switch to Claude Code | Starts fresh, no context | Picks up your 56% health, stays vigilant |
|
|
262
|
+
| Push to GitHub | Generic checks | Focused on your known problem areas |
|
|
263
|
+
|
|
264
|
+
The health score ensures your project's context **travels with you** across every tool.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### Before Pushing Code
|
|
269
|
+
|
|
270
|
+
Ask Trie:
|
|
271
|
+
```
|
|
272
|
+
Scan my changes before I push
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Before Launching to Users
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
Run a full Trie scan - I'm about to launch
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
This runs security, privacy, performance, and architecture checks.
|
|
282
|
+
|
|
283
|
+
### When Something Breaks
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
Trie, check this file for bugs: src/api/orders.ts
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Weekly Maintenance
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
Give me a Trie health report
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
This reads from `.trie/AGENTS.md` which tracks your project state over time.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## What Each Check Does (Plain English)
|
|
300
|
+
|
|
301
|
+
| When You Ask | What It Checks | Why It Matters |
|
|
302
|
+
|--------------|----------------|----------------|
|
|
303
|
+
| "Run security scan" | Login/password handling, data exposure, hack vulnerabilities | Prevents your app from being hacked |
|
|
304
|
+
| "Run privacy scan" | User data handling, GDPR/CCPA compliance | Avoids fines up to $10,000+ per violation |
|
|
305
|
+
| "Run bugs scan" | Logic errors, edge cases, crash points | Prevents app crashes for users |
|
|
306
|
+
| "Run performance scan" | Slow queries, memory leaks, scaling issues | App stays fast with 1000+ users |
|
|
307
|
+
| "Run legal scan" | Terms of service, license compliance, regulations | Avoids lawsuits |
|
|
308
|
+
| "Run design scan" | UI patterns, accessibility, UX issues | Better user experience |
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Common Questions
|
|
313
|
+
|
|
314
|
+
<details>
|
|
315
|
+
<summary><strong>Do I need to pay for an API key?</strong></summary>
|
|
316
|
+
|
|
317
|
+
No. Trie works without any API keys using pattern matching.
|
|
318
|
+
|
|
319
|
+
For deeper AI analysis, you can optionally add an Anthropic API key:
|
|
320
|
+
1. Get a key from [console.anthropic.com](https://console.anthropic.com)
|
|
321
|
+
2. Add to your environment: `export ANTHROPIC_API_KEY=your-key-here`
|
|
322
|
+
|
|
323
|
+
This enables AI-enhanced scanning with better accuracy.
|
|
324
|
+
|
|
325
|
+
</details>
|
|
326
|
+
|
|
327
|
+
<details>
|
|
328
|
+
<summary><strong>Will Trie change my code automatically?</strong></summary>
|
|
329
|
+
|
|
330
|
+
No. Trie only scans and reports. It never modifies code without you asking. When you want fixes:
|
|
331
|
+
- Ask your AI assistant to apply specific fixes
|
|
332
|
+
- Or run `trie_fix` which only applies high-confidence, safe fixes
|
|
333
|
+
|
|
334
|
+
</details>
|
|
335
|
+
|
|
336
|
+
<details>
|
|
337
|
+
<summary><strong>What if I don't understand an issue?</strong></summary>
|
|
338
|
+
|
|
339
|
+
Ask for an explanation:
|
|
340
|
+
```
|
|
341
|
+
Explain the issue Trie found in checkout.ts in simple terms
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Or ask what could go wrong:
|
|
345
|
+
```
|
|
346
|
+
What's the worst case if I don't fix this security issue?
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
</details>
|
|
350
|
+
|
|
351
|
+
<details>
|
|
352
|
+
<summary><strong>How do I set up automatic checks on GitHub?</strong></summary>
|
|
353
|
+
|
|
354
|
+
Add this file to your repo at `.github/workflows/trie.yml`:
|
|
355
|
+
|
|
356
|
+
```yaml
|
|
357
|
+
name: Trie Check
|
|
358
|
+
on: [push, pull_request]
|
|
359
|
+
|
|
360
|
+
jobs:
|
|
361
|
+
scan:
|
|
362
|
+
runs-on: ubuntu-latest
|
|
363
|
+
steps:
|
|
364
|
+
- uses: actions/checkout@v4
|
|
365
|
+
- uses: triedotdev/trie-action@v1
|
|
366
|
+
with:
|
|
367
|
+
agents: security,privacy,bugs
|
|
368
|
+
fail-on: critical
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
Now every push is automatically checked.
|
|
372
|
+
|
|
373
|
+
</details>
|
|
139
374
|
|
|
140
375
|
---
|
|
141
376
|
|
|
@@ -170,7 +405,7 @@ Run a specific agent directly:
|
|
|
170
405
|
| `trie_privacy` | GDPR/CCPA/PCI-DSS compliance, PII exposure, logging sensitive data |
|
|
171
406
|
| `trie_soc2` | Access control gaps, missing audit logs, encryption issues |
|
|
172
407
|
| `trie_legal` | Licensing, ToS, accessibility, IP, GDPR/CCPA, e-commerce, marketing, COPPA |
|
|
173
|
-
| `trie_accessibility` | WCAG 2.1
|
|
408
|
+
| `trie_accessibility` | WCAG 2.1 AA: icon-only buttons, touch targets, heading levels, ARIA validation, focus management, 20+ checks |
|
|
174
409
|
| `trie_architecture` | Code organization, SOLID principles, N+1 queries, scalability |
|
|
175
410
|
| `trie_bugs` | Null safety, edge cases, async issues, common bugs |
|
|
176
411
|
| `trie_types` | Type errors, missing annotations, null checks |
|
|
@@ -251,19 +486,228 @@ trie-agent agents
|
|
|
251
486
|
|
|
252
487
|
| Agent | Description |
|
|
253
488
|
|-------|-------------|
|
|
254
|
-
| **Accessibility** | WCAG 2.1 compliance, keyboard nav,
|
|
489
|
+
| **Accessibility** | WCAG 2.1 AA compliance: icon-only buttons, touch targets, heading levels, ARIA validation, color-only indicators, keyboard nav, focus management, 20+ checks |
|
|
255
490
|
| **Design Engineer** | AI slop detection, verified token systems, contrast validation, design health scoring, domain-aware recommendations |
|
|
256
491
|
| **User Testing** | Simulate happy path, security tester, confused user, impatient user |
|
|
257
492
|
| **Visual QA** | Visual regression, responsive design, cross-browser issues |
|
|
258
493
|
| **E2E** | End-to-end test coverage, user flow validation |
|
|
259
494
|
|
|
260
|
-
### Operations (
|
|
495
|
+
### Operations (5 agents)
|
|
261
496
|
|
|
262
497
|
| Agent | Description |
|
|
263
498
|
|-------|-------------|
|
|
264
499
|
| **DevOps** | Config issues, logging, environment variables, deployment patterns |
|
|
265
500
|
| **Data Flow** | Data flow analysis, state management, API contracts |
|
|
266
501
|
| **Comprehension** | Plain language explanations for non-technical stakeholders |
|
|
502
|
+
| **Moneybags** | 💰 Estimates dollar cost of bugs scaled to your user count (default: 250). Use `--users` to configure |
|
|
503
|
+
| **Production Ready** | 🚀 Production gate: health endpoints, graceful shutdown, connection pooling, security headers, rate limiting, monitoring |
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
## Accessibility Agent (v2.0)
|
|
508
|
+
|
|
509
|
+
The Accessibility Agent has been completely rebuilt to provide comprehensive WCAG 2.1 AA compliance checking—matching and exceeding tools like rams.ai, axe-core, and Lighthouse.
|
|
510
|
+
|
|
511
|
+
### Severity Levels
|
|
512
|
+
|
|
513
|
+
| Level | Description | Examples |
|
|
514
|
+
|-------|-------------|----------|
|
|
515
|
+
| **Critical** | Blocks access entirely | Images without alt, icon-only buttons without labels, empty links |
|
|
516
|
+
| **Serious** | Significantly impairs access | Focus outline removed, positive tabIndex, missing ARIA attributes |
|
|
517
|
+
| **Moderate** | Creates barriers | Skipped headings, color-only indicators, small touch targets |
|
|
518
|
+
| **Low** | Best practices | Missing semantic elements, external link warnings |
|
|
519
|
+
|
|
520
|
+
### What It Detects
|
|
521
|
+
|
|
522
|
+
#### Critical Issues
|
|
523
|
+
|
|
524
|
+
| Issue | WCAG | Description |
|
|
525
|
+
|-------|------|-------------|
|
|
526
|
+
| Images without alt text | 1.1.1 | Screen readers cannot describe the image |
|
|
527
|
+
| Icon-only buttons missing aria-label | 4.1.2 | Screen readers announce "button" with no purpose |
|
|
528
|
+
| Non-semantic click handlers | 2.1.1 | `div onClick` without keyboard support blocks keyboard users |
|
|
529
|
+
| Empty links | 2.4.4 | Links with no text content are unusable |
|
|
530
|
+
| Links without href | 2.4.4 | Anchor elements must have destinations |
|
|
531
|
+
|
|
532
|
+
#### Serious Issues
|
|
533
|
+
|
|
534
|
+
| Issue | WCAG | Description |
|
|
535
|
+
|-------|------|-------------|
|
|
536
|
+
| Focus outline removed | 2.4.7 | `outline: none` without replacement hides keyboard focus |
|
|
537
|
+
| Positive tabIndex values | 2.4.3 | `tabIndex={5}` disrupts natural tab order |
|
|
538
|
+
| Role without required ARIA | 4.1.2 | `role="slider"` needs `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
|
|
539
|
+
| Form inputs without labels | 1.3.1 | Inputs must have associated labels or aria-label |
|
|
540
|
+
| Color-only status indicators | 1.4.1 | Red/green for error/success excludes colorblind users |
|
|
541
|
+
| Placeholder as only label | 3.3.2 | Placeholder disappears when user types |
|
|
542
|
+
| Modal without Escape key | 2.1.2 | Keyboard users may be trapped in modal |
|
|
543
|
+
|
|
544
|
+
#### Moderate Issues
|
|
545
|
+
|
|
546
|
+
| Issue | WCAG | Description |
|
|
547
|
+
|-------|------|-------------|
|
|
548
|
+
| Skipped heading levels | 2.4.6 | h1 → h3 confuses screen reader navigation |
|
|
549
|
+
| First heading not h1 | 2.4.6 | Pages should start with h1 |
|
|
550
|
+
| Touch targets under 24px | 2.5.8 | Minimum 24×24px for WCAG AA |
|
|
551
|
+
| Missing autocomplete | 1.3.5 | Helps users fill forms faster |
|
|
552
|
+
| Generic link text | 2.4.4 | "Click here" is meaningless out of context |
|
|
553
|
+
| Missing prefers-reduced-motion | 2.3.3 | Animations can trigger vestibular disorders |
|
|
554
|
+
| Status messages without aria-live | 4.1.3 | Toasts/alerts not announced to screen readers |
|
|
555
|
+
|
|
556
|
+
#### Low Issues
|
|
557
|
+
|
|
558
|
+
| Issue | WCAG | Description |
|
|
559
|
+
|-------|------|-------------|
|
|
560
|
+
| Touch targets under 44px | 2.5.5 | Recommended 44×44px for AAA |
|
|
561
|
+
| Missing semantic elements | 1.3.1 | `<div class="nav">` should be `<nav>` |
|
|
562
|
+
| External links without warning | 3.2.5 | `target="_blank"` should indicate new window |
|
|
563
|
+
| Disabled elements without explanation | — | Users need to know why action is unavailable |
|
|
564
|
+
|
|
565
|
+
### ARIA Validation
|
|
566
|
+
|
|
567
|
+
The agent validates that ARIA roles have their required attributes:
|
|
568
|
+
|
|
569
|
+
| Role | Required Attributes |
|
|
570
|
+
|------|---------------------|
|
|
571
|
+
| `checkbox` | `aria-checked` |
|
|
572
|
+
| `slider` | `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
|
|
573
|
+
| `combobox` | `aria-expanded`, `aria-controls` |
|
|
574
|
+
| `progressbar` | `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
|
|
575
|
+
| `tab` | `aria-selected` |
|
|
576
|
+
| `switch` | `aria-checked` |
|
|
577
|
+
|
|
578
|
+
### Accessibility Score
|
|
579
|
+
|
|
580
|
+
Each scan produces an **Accessibility Score** (0-100) based on issue severity:
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
═══════════════════════════════════════════════════
|
|
584
|
+
ACCESSIBILITY REVIEW: src/components/
|
|
585
|
+
═══════════════════════════════════════════════════
|
|
586
|
+
|
|
587
|
+
CRITICAL (2 issues)
|
|
588
|
+
───────────────────
|
|
589
|
+
[A11Y] Line 24: Icon-only button missing accessible name
|
|
590
|
+
<button><CloseIcon /></button>
|
|
591
|
+
Fix: Add aria-label="Close"
|
|
592
|
+
WCAG: 4.1.2 Name, Role, Value
|
|
593
|
+
|
|
594
|
+
SERIOUS (1 issue)
|
|
595
|
+
─────────────────
|
|
596
|
+
[A11Y] Line 48: Focus outline removed without replacement
|
|
597
|
+
className="outline-none"
|
|
598
|
+
Fix: Add focus-visible:ring-2 focus-visible:ring-offset-2
|
|
599
|
+
WCAG: 2.4.7 Focus Visible
|
|
600
|
+
|
|
601
|
+
MODERATE (2 issues)
|
|
602
|
+
───────────────────
|
|
603
|
+
[A11Y] Line 67: Skipped heading level: h1 to h3
|
|
604
|
+
<h3>Features</h3>
|
|
605
|
+
Fix: Use h2 after h1
|
|
606
|
+
WCAG: 2.4.6 Headings and Labels
|
|
607
|
+
|
|
608
|
+
═══════════════════════════════════════════════════
|
|
609
|
+
SUMMARY: 2 critical, 1 serious, 2 moderate
|
|
610
|
+
Score: 55/100
|
|
611
|
+
═══════════════════════════════════════════════════
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### Usage
|
|
615
|
+
|
|
616
|
+
```bash
|
|
617
|
+
# Run accessibility scan
|
|
618
|
+
trie scan --agents accessibility
|
|
619
|
+
|
|
620
|
+
# Full UI scan (accessibility + design)
|
|
621
|
+
trie scan --agents accessibility,design-engineer
|
|
622
|
+
|
|
623
|
+
# MCP usage
|
|
624
|
+
trie_accessibility
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
---
|
|
628
|
+
|
|
629
|
+
## Moneybags Agent
|
|
630
|
+
|
|
631
|
+
The Moneybags agent answers the question every CFO asks: **"How much will this bug cost us?"**
|
|
632
|
+
|
|
633
|
+
Built on industry research from IBM, NIST, Ponemon Institute, and Gartner, it calculates the actual dollar cost of each issue—both the cost to fix now and the cost if it reaches production. **Costs scale based on your user count.**
|
|
634
|
+
|
|
635
|
+
### User Count Scaling
|
|
636
|
+
|
|
637
|
+
Costs are scaled based on your app's user count (default: 250 users). Use the `--users` flag to match your scale:
|
|
638
|
+
|
|
639
|
+
```bash
|
|
640
|
+
# Default (250 users - early stage app)
|
|
641
|
+
trie scan
|
|
642
|
+
|
|
643
|
+
# Scale for your app size
|
|
644
|
+
trie scan --users 1000 # Growing app
|
|
645
|
+
trie scan --users 10000 # Traction
|
|
646
|
+
trie scan --users 100000 # Growth stage
|
|
647
|
+
trie scan -u 1000000 # Enterprise
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
| User Count | Multiplier | Stage |
|
|
651
|
+
|------------|------------|-------|
|
|
652
|
+
| 50 | 0.3x | MVP |
|
|
653
|
+
| **250** | **1x** | **Early stage (default)** |
|
|
654
|
+
| 1,000 | 2x | Growing |
|
|
655
|
+
| 5,000 | 4x | Traction |
|
|
656
|
+
| 25,000 | 8x | Scale-up |
|
|
657
|
+
| 100,000 | 15x | Growth |
|
|
658
|
+
| 1,000,000+ | 40x | Enterprise |
|
|
659
|
+
|
|
660
|
+
### Cost Model
|
|
661
|
+
|
|
662
|
+
| Severity | Fix Now | If Production | Multiplier |
|
|
663
|
+
|----------|---------|---------------|------------|
|
|
664
|
+
| **Critical** | $5,000 | $150,000+ | 30x |
|
|
665
|
+
| **Serious** | $2,000 | $40,000+ | 20x |
|
|
666
|
+
| **Moderate** | $500 | $5,000+ | 10x |
|
|
667
|
+
| **Low** | $100 | $500+ | 5x |
|
|
668
|
+
|
|
669
|
+
### Category Multipliers
|
|
670
|
+
|
|
671
|
+
| Category | Multiplier | Why |
|
|
672
|
+
|----------|------------|-----|
|
|
673
|
+
| **Payment Bugs** | 25x | Direct financial loss, fraud exposure |
|
|
674
|
+
| **Data Loss** | 20x | Irrecoverable, legally actionable |
|
|
675
|
+
| **Secrets Exposed** | 15x | Immediate rotation + audit required |
|
|
676
|
+
| **SQL Injection** | 12x | Full system compromise possible |
|
|
677
|
+
| **Privacy Violations** | 10x | GDPR fines up to 4% of revenue |
|
|
678
|
+
| **Auth Bypass** | 10x | Complete security failure |
|
|
679
|
+
| **Crashes** | 8x | $5,600/minute average downtime |
|
|
680
|
+
|
|
681
|
+
### What It Detects
|
|
682
|
+
|
|
683
|
+
- Floating-point arithmetic for money (use integer cents!)
|
|
684
|
+
- Rounding errors in financial calculations
|
|
685
|
+
- Dangerous DELETE/TRUNCATE statements
|
|
686
|
+
- Empty catch blocks swallowing errors
|
|
687
|
+
- Assignment in conditions (= instead of ===)
|
|
688
|
+
|
|
689
|
+
### Example Output
|
|
690
|
+
|
|
691
|
+
```
|
|
692
|
+
💰 COST ANALYSIS REPORT
|
|
693
|
+
═══════════════════════════════════════
|
|
694
|
+
👥 User Scale: 250 users (Early stage)
|
|
695
|
+
└─ Costs scaled 1x from 250 baseline
|
|
696
|
+
|
|
697
|
+
💵 COST IMPACT
|
|
698
|
+
├─ Fix now: $3.2k
|
|
699
|
+
├─ If production: $28k
|
|
700
|
+
└─ Savings by fixing now: $24.8k ⚡
|
|
701
|
+
|
|
702
|
+
💡 Default: 250 users. Scale with: trie scan --users 10000
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
### Research Sources
|
|
706
|
+
|
|
707
|
+
- **IBM Systems Sciences Institute**: Production bugs cost 30x more to fix
|
|
708
|
+
- **NIST**: $15k average production bug fix vs $500 in development
|
|
709
|
+
- **Ponemon Institute 2023**: $4.45M average data breach cost
|
|
710
|
+
- **Gartner**: $5,600/minute average downtime cost
|
|
267
711
|
|
|
268
712
|
---
|
|
269
713
|
|
|
@@ -589,6 +1033,120 @@ Native VS Code extension with inline diagnostics and quick fixes.
|
|
|
589
1033
|
|
|
590
1034
|
---
|
|
591
1035
|
|
|
1036
|
+
## Agent Context System
|
|
1037
|
+
|
|
1038
|
+
> **Simple version:** Trie remembers your project state automatically. See [How Trie Remembers Your Project](#how-trie-remembers-your-project) for the plain-English explanation.
|
|
1039
|
+
|
|
1040
|
+
### What Gets Saved
|
|
1041
|
+
|
|
1042
|
+
Every time you scan, Trie updates a file in your project (`.trie/AGENTS.md`) with:
|
|
1043
|
+
|
|
1044
|
+
| Tracked | Example |
|
|
1045
|
+
|---------|---------|
|
|
1046
|
+
| Health score | "Your project is at 85/100" |
|
|
1047
|
+
| Critical issues | "2 security issues need fixing" |
|
|
1048
|
+
| Hot files | "checkout.ts has 3 issues" |
|
|
1049
|
+
| Priorities | "Fix payment auth before launching" |
|
|
1050
|
+
| Last scan | "Scanned yesterday, 47 files checked" |
|
|
1051
|
+
|
|
1052
|
+
### What This Means For You
|
|
1053
|
+
|
|
1054
|
+
| Scenario | What Happens |
|
|
1055
|
+
|----------|--------------|
|
|
1056
|
+
| Open Cursor tomorrow | AI already knows your project state |
|
|
1057
|
+
| Switch to Claude Code | Same context, no re-scanning needed |
|
|
1058
|
+
| Push to GitHub | CI/CD knows what to focus on |
|
|
1059
|
+
| Ask Trie "what should I fix?" | Gives prioritized answer based on your history |
|
|
1060
|
+
|
|
1061
|
+
### File Size Management
|
|
1062
|
+
|
|
1063
|
+
The context system uses automatic limits to prevent unbounded growth:
|
|
1064
|
+
|
|
1065
|
+
| Limit | Value | What Happens |
|
|
1066
|
+
|-------|-------|--------------|
|
|
1067
|
+
| Max tracked issues | 500 | Oldest issues pruned when exceeded |
|
|
1068
|
+
| Locations per issue | 5 | Only most recent locations kept |
|
|
1069
|
+
| Scan history | 20 scans | Older scan records removed |
|
|
1070
|
+
| Hot files | 10 files | Only top 10 shown |
|
|
1071
|
+
| Issue age | 30 days | Stale resolved issues pruned |
|
|
1072
|
+
|
|
1073
|
+
You don't need to manage this - Trie automatically prunes old data on each scan.
|
|
1074
|
+
|
|
1075
|
+
### Multiple Projects
|
|
1076
|
+
|
|
1077
|
+
Each project has its own isolated context:
|
|
1078
|
+
|
|
1079
|
+
| Scenario | How It Works |
|
|
1080
|
+
|----------|--------------|
|
|
1081
|
+
| Switch between projects | Each project has its own `.trie/` folder |
|
|
1082
|
+
| Clone on new machine | Context restored from committed `.trie/` files |
|
|
1083
|
+
| Monorepo with workspaces | Each workspace can have its own `.trie/` |
|
|
1084
|
+
| Team collaboration | Same context when pulling changes |
|
|
1085
|
+
|
|
1086
|
+
Trie auto-detects your project root by looking for `package.json`, `.git`, `Cargo.toml`, `go.mod`, or similar project indicators.
|
|
1087
|
+
|
|
1088
|
+
### For Developers: Technical Details
|
|
1089
|
+
|
|
1090
|
+
<details>
|
|
1091
|
+
<summary>MCP Resources (click to expand)</summary>
|
|
1092
|
+
|
|
1093
|
+
```
|
|
1094
|
+
trie://context # AGENTS.md content (read this first)
|
|
1095
|
+
trie://context/state # Detailed JSON state
|
|
1096
|
+
trie://agents # Available agents
|
|
1097
|
+
trie://config # Current configuration
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
Files stored:
|
|
1101
|
+
- `.trie/AGENTS.md` - Human-readable context
|
|
1102
|
+
- `.trie/state.json` - Machine-readable state for programmatic access
|
|
1103
|
+
|
|
1104
|
+
</details>
|
|
1105
|
+
|
|
1106
|
+
---
|
|
1107
|
+
|
|
1108
|
+
## Production Shipping
|
|
1109
|
+
|
|
1110
|
+
Trie solves the "last mile" of shipping to production with the **Production Ready** agent.
|
|
1111
|
+
|
|
1112
|
+
### Quick Production Check
|
|
1113
|
+
|
|
1114
|
+
```bash
|
|
1115
|
+
# Run production readiness scan
|
|
1116
|
+
trie scan --agents production-ready
|
|
1117
|
+
|
|
1118
|
+
# Full production scan with cost analysis
|
|
1119
|
+
trie scan --agents production-ready,moneybags,security --users 10000
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1122
|
+
### What Production Ready Checks
|
|
1123
|
+
|
|
1124
|
+
| Area | What's Checked |
|
|
1125
|
+
|------|----------------|
|
|
1126
|
+
| **Health Endpoints** | `/health`, `/ready`, `/live` endpoints for orchestrators |
|
|
1127
|
+
| **Graceful Shutdown** | SIGTERM handling, connection draining |
|
|
1128
|
+
| **Connection Pooling** | Database pool configuration |
|
|
1129
|
+
| **Security Headers** | CSP, HSTS, X-Frame-Options, etc. |
|
|
1130
|
+
| **Rate Limiting** | API rate limiting configuration |
|
|
1131
|
+
| **Monitoring** | Error tracking, APM integration |
|
|
1132
|
+
| **Session Storage** | External session store (not in-memory) |
|
|
1133
|
+
| **Error Handling** | Global error handlers, no empty catch blocks |
|
|
1134
|
+
| **Anti-patterns** | console.log, localhost URLs, TODO comments |
|
|
1135
|
+
|
|
1136
|
+
### CI/CD Gate
|
|
1137
|
+
|
|
1138
|
+
Add to your workflow:
|
|
1139
|
+
|
|
1140
|
+
```yaml
|
|
1141
|
+
- uses: triedotdev/trie-action@v1
|
|
1142
|
+
with:
|
|
1143
|
+
agents: production-ready,security,privacy,moneybags
|
|
1144
|
+
fail-on: serious
|
|
1145
|
+
upload-sarif: true
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
---
|
|
1149
|
+
|
|
592
1150
|
## Configuration
|
|
593
1151
|
|
|
594
1152
|
### Scan Options
|