@triedotdev/mcp 1.0.36 → 1.0.38
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 +619 -38
- package/dist/{chunk-ZTQ2QWUQ.js → chunk-HRNBSXN2.js} +3340 -725
- package/dist/chunk-HRNBSXN2.js.map +1 -0
- package/dist/{chunk-OKCVAJDR.js → chunk-TGEI55FP.js} +536 -61
- package/dist/chunk-TGEI55FP.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-OKCVAJDR.js.map +0 -1
- package/dist/chunk-ZTQ2QWUQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,17 +2,21 @@
|
|
|
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
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
- Agent
|
|
14
|
+
|
|
15
|
+
- **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.
|
|
16
|
+
|
|
17
|
+
- **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).
|
|
18
|
+
|
|
19
|
+
- **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.
|
|
16
20
|
|
|
17
21
|
---
|
|
18
22
|
|
|
@@ -24,11 +28,16 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
24
28
|
- [MCP Tools](#mcp-tools)
|
|
25
29
|
- [CLI](#cli)
|
|
26
30
|
- [Built-in Agents](#built-in-agents)
|
|
31
|
+
- [Moneybags Agent (v1.1)](#moneybags-agent-v11)
|
|
32
|
+
- [Legal Agent (v2.0)](#legal-agent-v20)
|
|
33
|
+
- [Design Engineer (v2.0)](#design-engineer-v20)
|
|
27
34
|
- [Special Agents](#special-agents)
|
|
28
35
|
- [Custom Agents](#custom-agents)
|
|
29
36
|
- [AI-Enhanced Mode](#ai-enhanced-mode)
|
|
30
37
|
- [CI/CD Integration](#cicd-integration)
|
|
31
38
|
- [VS Code Extension](#vs-code-extension)
|
|
39
|
+
- [Agent Context System](#agent-context-system)
|
|
40
|
+
- [Production Shipping](#production-shipping)
|
|
32
41
|
- [Configuration](#configuration)
|
|
33
42
|
- [License](#license)
|
|
34
43
|
|
|
@@ -40,7 +49,7 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
40
49
|
|
|
41
50
|
| Feature | Description |
|
|
42
51
|
|---------|-------------|
|
|
43
|
-
| **
|
|
52
|
+
| **22 Built-in Agents** | Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Moneybags, Production Ready, and more |
|
|
44
53
|
| **Parallel Execution** | True parallel execution with worker threads—3-5x faster scans |
|
|
45
54
|
| **Result Caching** | File-based caching with SHA256 hashing—70% faster repeated scans |
|
|
46
55
|
| **Smart Triaging** | Only activates relevant agents based on code context |
|
|
@@ -66,15 +75,31 @@ I like Claude Code Skills, but I found myself wanting more control. Trie keeps o
|
|
|
66
75
|
|
|
67
76
|
## Quick Start
|
|
68
77
|
|
|
69
|
-
### Install
|
|
78
|
+
### Step 1: Install Node.js (if you don't have it)
|
|
79
|
+
|
|
80
|
+
Trie requires Node.js. Check if you have it by opening Terminal (Mac) or Command Prompt (Windows):
|
|
70
81
|
|
|
71
82
|
```bash
|
|
72
|
-
|
|
83
|
+
node --version
|
|
73
84
|
```
|
|
74
85
|
|
|
75
|
-
|
|
86
|
+
If you see a version number (like `v18.0.0`), skip to Step 2. If not:
|
|
87
|
+
- **Mac**: Download from [nodejs.org](https://nodejs.org) or run `brew install node`
|
|
88
|
+
- **Windows**: Download from [nodejs.org](https://nodejs.org)
|
|
89
|
+
|
|
90
|
+
### Step 2: Set Up Trie in Your AI Coding Tool
|
|
91
|
+
|
|
92
|
+
Pick the tool you use:
|
|
76
93
|
|
|
77
|
-
|
|
94
|
+
<details>
|
|
95
|
+
<summary><strong>Cursor (click to expand)</strong></summary>
|
|
96
|
+
|
|
97
|
+
1. Open Cursor
|
|
98
|
+
2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows)
|
|
99
|
+
3. Type "settings" and select **Cursor Settings**
|
|
100
|
+
4. Click **MCP** in the left sidebar
|
|
101
|
+
5. Click **Add MCP Server**
|
|
102
|
+
6. Paste this configuration:
|
|
78
103
|
|
|
79
104
|
```json
|
|
80
105
|
{
|
|
@@ -87,54 +112,262 @@ Settings → MCP Servers → Add:
|
|
|
87
112
|
}
|
|
88
113
|
```
|
|
89
114
|
|
|
90
|
-
**Restart Cursor
|
|
115
|
+
7. **Restart Cursor** (Cmd+Q and reopen, or Ctrl+Q on Windows)
|
|
116
|
+
|
|
117
|
+
**That's it!** Trie is now connected.
|
|
118
|
+
|
|
119
|
+
</details>
|
|
91
120
|
|
|
92
|
-
|
|
121
|
+
<details>
|
|
122
|
+
<summary><strong>Claude Code (click to expand)</strong></summary>
|
|
123
|
+
|
|
124
|
+
1. Open Claude Code
|
|
125
|
+
2. Open the terminal inside Claude Code
|
|
126
|
+
3. Run this command:
|
|
93
127
|
|
|
94
128
|
```bash
|
|
95
129
|
claude mcp add Trie --scope user -- npx @triedotdev/mcp
|
|
96
130
|
```
|
|
97
131
|
|
|
98
|
-
**Restart Claude Code
|
|
132
|
+
4. **Restart Claude Code**
|
|
99
133
|
|
|
100
|
-
|
|
134
|
+
**That's it!** Trie is now connected.
|
|
101
135
|
|
|
102
|
-
|
|
136
|
+
</details>
|
|
103
137
|
|
|
104
|
-
|
|
105
|
-
|
|
138
|
+
<details>
|
|
139
|
+
<summary><strong>Other AI Tools (Windsurf, OpenCode, etc.)</strong></summary>
|
|
140
|
+
|
|
141
|
+
Most MCP-compatible tools have a settings page for MCP servers. Add:
|
|
142
|
+
|
|
143
|
+
- **Command**: `npx`
|
|
144
|
+
- **Arguments**: `@triedotdev/mcp`
|
|
145
|
+
|
|
146
|
+
Or in JSON format:
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["@triedotdev/mcp"]
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
</details>
|
|
155
|
+
|
|
156
|
+
### Step 3: Run Your First Scan
|
|
157
|
+
|
|
158
|
+
Open your project in Cursor or Claude Code and type in the chat:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Scan my code with Trie
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Trie will:
|
|
165
|
+
1. Analyze your entire codebase
|
|
166
|
+
2. Pick the right checks based on what your code does (payments, auth, user data, etc.)
|
|
167
|
+
3. Show you a prioritized list of issues
|
|
168
|
+
|
|
169
|
+
**Example output:**
|
|
106
170
|
```
|
|
171
|
+
🔺 Trie Agent Scan Complete
|
|
172
|
+
|
|
173
|
+
Scanned: 5 agents | Time: 12.3s | Risk: MEDIUM
|
|
174
|
+
|
|
175
|
+
🎯 3 Issues Found
|
|
107
176
|
|
|
177
|
+
🔴 Critical (1)
|
|
108
178
|
---
|
|
179
|
+
Missing authentication on payment endpoint
|
|
180
|
+
|
|
181
|
+
📍 src/api/checkout.ts:47
|
|
182
|
+
|
|
183
|
+
Fix: Add auth middleware before processing payment
|
|
184
|
+
```
|
|
109
185
|
|
|
110
|
-
|
|
186
|
+
### Step 4: Fix Issues
|
|
111
187
|
|
|
112
|
-
|
|
188
|
+
For each issue, you can:
|
|
113
189
|
|
|
190
|
+
**Option A: Ask your AI to fix it**
|
|
114
191
|
```
|
|
115
|
-
|
|
192
|
+
Fix the authentication issue in checkout.ts that Trie found
|
|
116
193
|
```
|
|
117
194
|
|
|
118
|
-
|
|
195
|
+
**Option B: Use Trie's auto-fix** (for high-confidence fixes)
|
|
196
|
+
```
|
|
197
|
+
Run trie_fix to apply safe fixes
|
|
198
|
+
```
|
|
119
199
|
|
|
200
|
+
**Option C: Get more details first**
|
|
120
201
|
```
|
|
121
|
-
|
|
122
|
-
Run trie_soc2 to check compliance
|
|
202
|
+
Explain the checkout.ts security issue
|
|
123
203
|
```
|
|
124
204
|
|
|
125
|
-
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Your Ongoing Workflow
|
|
126
208
|
|
|
127
|
-
|
|
128
|
-
- `trie` / `/trie` with `{ action: "scan", files?: [], directory?: "" }` runs a full triaged scan.
|
|
129
|
-
- `trie` / `/trie` with `{ action: "<agent>", files?: [] }` runs one agent (e.g., `security`, `ux`, `soc2`, `agent_smith`).
|
|
209
|
+
Once set up, here's how to use Trie day-to-day.
|
|
130
210
|
|
|
131
|
-
### How
|
|
211
|
+
### How Trie Remembers Your Project
|
|
212
|
+
|
|
213
|
+
**You don't have to remember anything.** Trie automatically tracks:
|
|
214
|
+
|
|
215
|
+
| What Trie Remembers | Why It Matters |
|
|
216
|
+
|---------------------|----------------|
|
|
217
|
+
| Last scan results | AI knows what issues exist without re-scanning |
|
|
218
|
+
| **Health score (0-100)** | Controls what agents run (see below) |
|
|
219
|
+
| Which files have issues | AI focuses on problem areas first |
|
|
220
|
+
| What type of code you have | Runs the right checks (payments, auth, etc.) automatically |
|
|
221
|
+
| Scan history | See if issues are getting better or worse |
|
|
222
|
+
|
|
223
|
+
**This works everywhere automatically:**
|
|
224
|
+
- ✅ Cursor remembers between sessions
|
|
225
|
+
- ✅ Claude Code picks up where you left off
|
|
226
|
+
- ✅ CLI shows the same status
|
|
227
|
+
- ✅ GitHub Actions uses the same context
|
|
228
|
+
|
|
229
|
+
**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.
|
|
230
|
+
|
|
231
|
+
### Health Score: The Priority System
|
|
232
|
+
|
|
233
|
+
Your **health score** isn't just a number—it actively controls how Trie works across all your tools:
|
|
234
|
+
|
|
235
|
+
| Health Score | What Happens |
|
|
236
|
+
|--------------|--------------|
|
|
237
|
+
| **80-100** | Normal mode: Trie runs targeted checks based on your code |
|
|
238
|
+
| **50-79** | Cautious mode: Agents that found issues before run again automatically |
|
|
239
|
+
| **Below 50** | Full scan mode: ALL agents run regardless of context |
|
|
240
|
+
|
|
241
|
+
**How it works across tools:**
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
Cursor: Scan finds 14 issues → Health drops to 56%
|
|
245
|
+
↓
|
|
246
|
+
Claude Code: Opens same project → Sees 56% health
|
|
247
|
+
↓
|
|
248
|
+
Trie automatically runs more thorough checks
|
|
249
|
+
↓
|
|
250
|
+
GitHub Actions: Same health score → Stricter CI gates
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Why this matters:**
|
|
254
|
+
|
|
255
|
+
| Scenario | Without Health Score | With Health Score |
|
|
256
|
+
|----------|---------------------|-------------------|
|
|
257
|
+
| Quick fix in Cursor | Might skip security check | Knows security found issues → runs it |
|
|
258
|
+
| Switch to Claude Code | Starts fresh, no context | Picks up your 56% health, stays vigilant |
|
|
259
|
+
| Push to GitHub | Generic checks | Focused on your known problem areas |
|
|
132
260
|
|
|
133
|
-
|
|
261
|
+
The health score ensures your project's context **travels with you** across every tool.
|
|
134
262
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Before Pushing Code
|
|
266
|
+
|
|
267
|
+
Ask Trie:
|
|
268
|
+
```
|
|
269
|
+
Scan my changes before I push
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Before Launching to Users
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
Run a full Trie scan - I'm about to launch
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
This runs security, privacy, performance, and architecture checks.
|
|
279
|
+
|
|
280
|
+
### When Something Breaks
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
Trie, check this file for bugs: src/api/orders.ts
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Weekly Maintenance
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Give me a Trie health report
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
This reads from `.trie/AGENTS.md` which tracks your project state over time.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## What Each Check Does (Plain English)
|
|
297
|
+
|
|
298
|
+
| When You Ask | What It Checks | Why It Matters |
|
|
299
|
+
|--------------|----------------|----------------|
|
|
300
|
+
| "Run security scan" | Login/password handling, data exposure, hack vulnerabilities | Prevents your app from being hacked |
|
|
301
|
+
| "Run privacy scan" | User data handling, GDPR/CCPA compliance | Avoids fines up to $10,000+ per violation |
|
|
302
|
+
| "Run bugs scan" | Logic errors, edge cases, crash points | Prevents app crashes for users |
|
|
303
|
+
| "Run performance scan" | Slow queries, memory leaks, scaling issues | App stays fast with 1000+ users |
|
|
304
|
+
| "Run legal scan" | Terms of service, license compliance, regulations | Avoids lawsuits |
|
|
305
|
+
| "Run design scan" | UI patterns, accessibility, UX issues | Better user experience |
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Common Questions
|
|
310
|
+
|
|
311
|
+
<details>
|
|
312
|
+
<summary><strong>Do I need to pay for an API key?</strong></summary>
|
|
313
|
+
|
|
314
|
+
No. Trie works without any API keys using pattern matching.
|
|
315
|
+
|
|
316
|
+
For deeper AI analysis, you can optionally add an Anthropic API key:
|
|
317
|
+
1. Get a key from [console.anthropic.com](https://console.anthropic.com)
|
|
318
|
+
2. Add to your environment: `export ANTHROPIC_API_KEY=your-key-here`
|
|
319
|
+
|
|
320
|
+
This enables AI-enhanced scanning with better accuracy.
|
|
321
|
+
|
|
322
|
+
</details>
|
|
323
|
+
|
|
324
|
+
<details>
|
|
325
|
+
<summary><strong>Will Trie change my code automatically?</strong></summary>
|
|
326
|
+
|
|
327
|
+
No. Trie only scans and reports. It never modifies code without you asking. When you want fixes:
|
|
328
|
+
- Ask your AI assistant to apply specific fixes
|
|
329
|
+
- Or run `trie_fix` which only applies high-confidence, safe fixes
|
|
330
|
+
|
|
331
|
+
</details>
|
|
332
|
+
|
|
333
|
+
<details>
|
|
334
|
+
<summary><strong>What if I don't understand an issue?</strong></summary>
|
|
335
|
+
|
|
336
|
+
Ask for an explanation:
|
|
337
|
+
```
|
|
338
|
+
Explain the issue Trie found in checkout.ts in simple terms
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Or ask what could go wrong:
|
|
342
|
+
```
|
|
343
|
+
What's the worst case if I don't fix this security issue?
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
</details>
|
|
347
|
+
|
|
348
|
+
<details>
|
|
349
|
+
<summary><strong>How do I set up automatic checks on GitHub?</strong></summary>
|
|
350
|
+
|
|
351
|
+
Add this file to your repo at `.github/workflows/trie.yml`:
|
|
352
|
+
|
|
353
|
+
```yaml
|
|
354
|
+
name: Trie Check
|
|
355
|
+
on: [push, pull_request]
|
|
356
|
+
|
|
357
|
+
jobs:
|
|
358
|
+
scan:
|
|
359
|
+
runs-on: ubuntu-latest
|
|
360
|
+
steps:
|
|
361
|
+
- uses: actions/checkout@v4
|
|
362
|
+
- uses: triedotdev/trie-action@v1
|
|
363
|
+
with:
|
|
364
|
+
agents: security,privacy,bugs
|
|
365
|
+
fail-on: critical
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Now every push is automatically checked.
|
|
369
|
+
|
|
370
|
+
</details>
|
|
138
371
|
|
|
139
372
|
---
|
|
140
373
|
|
|
@@ -168,14 +401,14 @@ Run a specific agent directly:
|
|
|
168
401
|
| `trie_security` | SQL injection, XSS, hardcoded secrets, auth bypasses, OWASP Top 10 |
|
|
169
402
|
| `trie_privacy` | GDPR/CCPA/PCI-DSS compliance, PII exposure, logging sensitive data |
|
|
170
403
|
| `trie_soc2` | Access control gaps, missing audit logs, encryption issues |
|
|
171
|
-
| `trie_legal` |
|
|
404
|
+
| `trie_legal` | Licensing, ToS, accessibility, IP, GDPR/CCPA, e-commerce, marketing, COPPA |
|
|
172
405
|
| `trie_accessibility` | WCAG 2.1 compliance, keyboard nav, screen readers, color contrast |
|
|
173
406
|
| `trie_architecture` | Code organization, SOLID principles, N+1 queries, scalability |
|
|
174
407
|
| `trie_bugs` | Null safety, edge cases, async issues, common bugs |
|
|
175
408
|
| `trie_types` | Type errors, missing annotations, null checks |
|
|
176
409
|
| `trie_devops` | Config issues, logging, environment variables, deployment patterns |
|
|
177
410
|
| `trie_clean` | Clean up AI-generated code: find vibe-coded patterns and quick fixes |
|
|
178
|
-
| `trie_design` |
|
|
411
|
+
| `trie_design` | Design intelligence with AI slop detection, verified token systems, contrast validation |
|
|
179
412
|
| `trie_ux` | Simulate happy path, security tester, confused user, impatient user |
|
|
180
413
|
|
|
181
414
|
---
|
|
@@ -233,7 +466,7 @@ trie-agent agents
|
|
|
233
466
|
| **Security** | SQL injection, XSS, hardcoded secrets, auth bypasses, OWASP Top 10 |
|
|
234
467
|
| **Privacy** | GDPR/CCPA/PCI-DSS compliance, PII exposure, data encryption |
|
|
235
468
|
| **SOC 2** | Access control gaps, missing audit logs, encryption, secrets management |
|
|
236
|
-
| **Legal** |
|
|
469
|
+
| **Legal** | Comprehensive app legal: licensing, ToS, accessibility, IP, GDPR/CCPA, e-commerce, COPPA, marketing compliance |
|
|
237
470
|
|
|
238
471
|
### Code Quality (6 agents)
|
|
239
472
|
|
|
@@ -251,18 +484,283 @@ trie-agent agents
|
|
|
251
484
|
| Agent | Description |
|
|
252
485
|
|-------|-------------|
|
|
253
486
|
| **Accessibility** | WCAG 2.1 compliance, keyboard nav, screen readers, color contrast |
|
|
254
|
-
| **Design Engineer** |
|
|
487
|
+
| **Design Engineer** | AI slop detection, verified token systems, contrast validation, design health scoring, domain-aware recommendations |
|
|
255
488
|
| **User Testing** | Simulate happy path, security tester, confused user, impatient user |
|
|
256
489
|
| **Visual QA** | Visual regression, responsive design, cross-browser issues |
|
|
257
490
|
| **E2E** | End-to-end test coverage, user flow validation |
|
|
258
491
|
|
|
259
|
-
### Operations (
|
|
492
|
+
### Operations (5 agents)
|
|
260
493
|
|
|
261
494
|
| Agent | Description |
|
|
262
495
|
|-------|-------------|
|
|
263
496
|
| **DevOps** | Config issues, logging, environment variables, deployment patterns |
|
|
264
497
|
| **Data Flow** | Data flow analysis, state management, API contracts |
|
|
265
498
|
| **Comprehension** | Plain language explanations for non-technical stakeholders |
|
|
499
|
+
| **Moneybags** | 💰 Estimates dollar cost of bugs scaled to your user count (default: 250). Use `--users` to configure |
|
|
500
|
+
| **Production Ready** | 🚀 Production gate: health endpoints, graceful shutdown, connection pooling, security headers, rate limiting, monitoring |
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## Moneybags Agent
|
|
505
|
+
|
|
506
|
+
The Moneybags agent answers the question every CFO asks: **"How much will this bug cost us?"**
|
|
507
|
+
|
|
508
|
+
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.**
|
|
509
|
+
|
|
510
|
+
### User Count Scaling
|
|
511
|
+
|
|
512
|
+
Costs are scaled based on your app's user count (default: 250 users). Use the `--users` flag to match your scale:
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
# Default (250 users - early stage app)
|
|
516
|
+
trie scan
|
|
517
|
+
|
|
518
|
+
# Scale for your app size
|
|
519
|
+
trie scan --users 1000 # Growing app
|
|
520
|
+
trie scan --users 10000 # Traction
|
|
521
|
+
trie scan --users 100000 # Growth stage
|
|
522
|
+
trie scan -u 1000000 # Enterprise
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
| User Count | Multiplier | Stage |
|
|
526
|
+
|------------|------------|-------|
|
|
527
|
+
| 50 | 0.3x | MVP |
|
|
528
|
+
| **250** | **1x** | **Early stage (default)** |
|
|
529
|
+
| 1,000 | 2x | Growing |
|
|
530
|
+
| 5,000 | 4x | Traction |
|
|
531
|
+
| 25,000 | 8x | Scale-up |
|
|
532
|
+
| 100,000 | 15x | Growth |
|
|
533
|
+
| 1,000,000+ | 40x | Enterprise |
|
|
534
|
+
|
|
535
|
+
### Cost Model
|
|
536
|
+
|
|
537
|
+
| Severity | Fix Now | If Production | Multiplier |
|
|
538
|
+
|----------|---------|---------------|------------|
|
|
539
|
+
| **Critical** | $5,000 | $150,000+ | 30x |
|
|
540
|
+
| **Serious** | $2,000 | $40,000+ | 20x |
|
|
541
|
+
| **Moderate** | $500 | $5,000+ | 10x |
|
|
542
|
+
| **Low** | $100 | $500+ | 5x |
|
|
543
|
+
|
|
544
|
+
### Category Multipliers
|
|
545
|
+
|
|
546
|
+
| Category | Multiplier | Why |
|
|
547
|
+
|----------|------------|-----|
|
|
548
|
+
| **Payment Bugs** | 25x | Direct financial loss, fraud exposure |
|
|
549
|
+
| **Data Loss** | 20x | Irrecoverable, legally actionable |
|
|
550
|
+
| **Secrets Exposed** | 15x | Immediate rotation + audit required |
|
|
551
|
+
| **SQL Injection** | 12x | Full system compromise possible |
|
|
552
|
+
| **Privacy Violations** | 10x | GDPR fines up to 4% of revenue |
|
|
553
|
+
| **Auth Bypass** | 10x | Complete security failure |
|
|
554
|
+
| **Crashes** | 8x | $5,600/minute average downtime |
|
|
555
|
+
|
|
556
|
+
### What It Detects
|
|
557
|
+
|
|
558
|
+
- Floating-point arithmetic for money (use integer cents!)
|
|
559
|
+
- Rounding errors in financial calculations
|
|
560
|
+
- Dangerous DELETE/TRUNCATE statements
|
|
561
|
+
- Empty catch blocks swallowing errors
|
|
562
|
+
- Assignment in conditions (= instead of ===)
|
|
563
|
+
|
|
564
|
+
### Example Output
|
|
565
|
+
|
|
566
|
+
```
|
|
567
|
+
💰 COST ANALYSIS REPORT
|
|
568
|
+
═══════════════════════════════════════
|
|
569
|
+
👥 User Scale: 250 users (Early stage)
|
|
570
|
+
└─ Costs scaled 1x from 250 baseline
|
|
571
|
+
|
|
572
|
+
💵 COST IMPACT
|
|
573
|
+
├─ Fix now: $3.2k
|
|
574
|
+
├─ If production: $28k
|
|
575
|
+
└─ Savings by fixing now: $24.8k ⚡
|
|
576
|
+
|
|
577
|
+
💡 Default: 250 users. Scale with: trie scan --users 10000
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
### Research Sources
|
|
581
|
+
|
|
582
|
+
- **IBM Systems Sciences Institute**: Production bugs cost 30x more to fix
|
|
583
|
+
- **NIST**: $15k average production bug fix vs $500 in development
|
|
584
|
+
- **Ponemon Institute 2023**: $4.45M average data breach cost
|
|
585
|
+
- **Gartner**: $5,600/minute average downtime cost
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Legal Agent (v2.0)
|
|
590
|
+
|
|
591
|
+
The Legal Agent has been completely rebuilt to be the most comprehensive legal compliance scanner for app development—covering everything from open source licensing to international data protection.
|
|
592
|
+
|
|
593
|
+
### What It Covers (21 Categories)
|
|
594
|
+
|
|
595
|
+
#### License & Open Source
|
|
596
|
+
|
|
597
|
+
| Issue | Description |
|
|
598
|
+
|-------|-------------|
|
|
599
|
+
| **GPL/Copyleft Detection** | Flags GPL/AGPL code that may require your project to be open-sourced |
|
|
600
|
+
| **AGPL Network Use** | Critical warning for AGPL's SaaS/network copyleft provisions |
|
|
601
|
+
| **License Headers** | Missing SPDX identifiers in source files |
|
|
602
|
+
| **Dependency Audit** | Recommends license-checker tools for third-party packages |
|
|
603
|
+
| **Attribution Requirements** | MIT/BSD/Apache attribution obligations |
|
|
604
|
+
|
|
605
|
+
#### Terms & Legal Documents
|
|
606
|
+
|
|
607
|
+
| Issue | Description |
|
|
608
|
+
|-------|-------------|
|
|
609
|
+
| **Missing ToS** | User registration without Terms of Service reference |
|
|
610
|
+
| **Pre-checked Consent** | ToS acceptance boxes that are pre-checked (unenforceable) |
|
|
611
|
+
| **Privacy Policy** | Data collection without privacy policy disclosure |
|
|
612
|
+
| **CalOPPA** | California Online Privacy Protection Act requirements |
|
|
613
|
+
|
|
614
|
+
#### Third-Party & API Compliance
|
|
615
|
+
|
|
616
|
+
| Issue | Description |
|
|
617
|
+
|-------|-------------|
|
|
618
|
+
| **API Terms** | Detects OpenAI, Stripe, Meta, Google, Twilio, AWS, YouTube usage |
|
|
619
|
+
| **Font Licensing** | Flags font files that may require commercial licenses |
|
|
620
|
+
| **Stock Assets** | Attribution requirements for Unsplash, Pexels, etc. |
|
|
621
|
+
|
|
622
|
+
#### Intellectual Property
|
|
623
|
+
|
|
624
|
+
| Issue | Description |
|
|
625
|
+
|-------|-------------|
|
|
626
|
+
| **Code Attribution** | Stack Overflow code (CC BY-SA), copied code comments |
|
|
627
|
+
| **Trademark Usage** | Apple, Google, Microsoft, Amazon brand guideline compliance |
|
|
628
|
+
|
|
629
|
+
#### Accessibility (Legal)
|
|
630
|
+
|
|
631
|
+
| Issue | Description |
|
|
632
|
+
|-------|-------------|
|
|
633
|
+
| **ADA/Section 508** | Images without alt text, keyboard accessibility |
|
|
634
|
+
| **WCAG Violations** | Color-only indicators, missing video captions |
|
|
635
|
+
|
|
636
|
+
#### Data Protection
|
|
637
|
+
|
|
638
|
+
| Issue | Description |
|
|
639
|
+
|-------|-------------|
|
|
640
|
+
| **GDPR/CCPA** | Consent management, data portability, right to erasure |
|
|
641
|
+
| **Analytics Consent** | Tracking scripts without cookie consent |
|
|
642
|
+
| **Data Retention** | Missing retention policies and deletion procedures |
|
|
643
|
+
|
|
644
|
+
#### E-Commerce & Payments
|
|
645
|
+
|
|
646
|
+
| Issue | Description |
|
|
647
|
+
|-------|-------------|
|
|
648
|
+
| **PCI DSS** | Direct card handling instead of tokenization (Stripe, etc.) |
|
|
649
|
+
| **Price Transparency** | Hidden taxes/fees before checkout |
|
|
650
|
+
| **Subscription Cancellation** | FTC Click-to-Cancel Rule compliance |
|
|
651
|
+
| **Refund Policy** | Missing return/refund policy disclosure |
|
|
652
|
+
|
|
653
|
+
#### Marketing & Advertising
|
|
654
|
+
|
|
655
|
+
| Issue | Description |
|
|
656
|
+
|-------|-------------|
|
|
657
|
+
| **CAN-SPAM** | Marketing emails without unsubscribe mechanism |
|
|
658
|
+
| **TCPA** | SMS marketing without express written consent |
|
|
659
|
+
| **FTC Disclosure** | Affiliate links, sponsored content without disclosure |
|
|
660
|
+
| **Fake Reviews** | Synthetic/AI-generated testimonials |
|
|
661
|
+
|
|
662
|
+
#### Age & Child Safety
|
|
663
|
+
|
|
664
|
+
| Issue | Description |
|
|
665
|
+
|-------|-------------|
|
|
666
|
+
| **COPPA** | Child-directed content without parental consent |
|
|
667
|
+
| **Age Verification** | Alcohol, gambling, adult content without age gates |
|
|
668
|
+
|
|
669
|
+
#### Export & International
|
|
670
|
+
|
|
671
|
+
| Issue | Description |
|
|
672
|
+
|-------|-------------|
|
|
673
|
+
| **Export Controls (EAR)** | Strong encryption with international distribution |
|
|
674
|
+
| **OFAC Sanctions** | Missing sanctions screening for international users |
|
|
675
|
+
| **GDPR (EU)** | EU market without GDPR compliance |
|
|
676
|
+
| **LGPD (Brazil)** | Brazil market without LGPD compliance |
|
|
677
|
+
| **Cross-Border Transfers** | International data transfers without SCCs |
|
|
678
|
+
|
|
679
|
+
#### User Content & Moderation
|
|
680
|
+
|
|
681
|
+
| Issue | Description |
|
|
682
|
+
|-------|-------------|
|
|
683
|
+
| **Content Moderation** | User-generated content without moderation system |
|
|
684
|
+
| **DMCA Safe Harbor** | File uploads without takedown procedures |
|
|
685
|
+
|
|
686
|
+
#### Contracts & Liability
|
|
687
|
+
|
|
688
|
+
| Issue | Description |
|
|
689
|
+
|-------|-------------|
|
|
690
|
+
| **Clickwrap Enforceability** | Agreement acceptance without scroll/read verification |
|
|
691
|
+
| **Consent Recording** | Terms acceptance without timestamp/version logging |
|
|
692
|
+
| **Warranty Disclaimers** | Missing "AS IS" and limitation of liability |
|
|
693
|
+
| **Security Disclosure** | Missing security.txt or vulnerability disclosure process |
|
|
694
|
+
|
|
695
|
+
### Severity Levels
|
|
696
|
+
|
|
697
|
+
| Level | Examples |
|
|
698
|
+
|-------|----------|
|
|
699
|
+
| **Critical** | AGPL in SaaS, PCI violations, TCPA SMS marketing, fake reviews |
|
|
700
|
+
| **Serious** | Missing ToS, no consent management, CAN-SPAM violations, COPPA |
|
|
701
|
+
| **Moderate** | Missing data portability, license attribution, content moderation |
|
|
702
|
+
| **Low** | License headers, security.txt, warranty disclaimers |
|
|
703
|
+
|
|
704
|
+
---
|
|
705
|
+
|
|
706
|
+
## Design Engineer (v2.0)
|
|
707
|
+
|
|
708
|
+
The Design Engineer agent has been rebuilt with a comprehensive 5-layer design intelligence architecture to detect "AI slop" and enforce professional design standards.
|
|
709
|
+
|
|
710
|
+
### What It Detects
|
|
711
|
+
|
|
712
|
+
| Issue | Description |
|
|
713
|
+
|-------|-------------|
|
|
714
|
+
| **Surface Hierarchy** | Dark-on-dark surfaces with <8% lightness delta |
|
|
715
|
+
| **Neon Colors** | Oversaturated colors (>80% saturation) that look amateur |
|
|
716
|
+
| **Purple Overuse** | >40% violet/purple palette (common AI tell) |
|
|
717
|
+
| **Accent Rainbow** | Multiple accent hue families (>1) in same view |
|
|
718
|
+
| **Typography Uniformity** | Single font-weight usage lacking hierarchy |
|
|
719
|
+
| **Missing Modern Fonts** | System-only font stacks without Inter/Geist |
|
|
720
|
+
| **Magic Numbers** | Spacing values not on 4px grid |
|
|
721
|
+
| **Low Contrast** | Text failing WCAG AA (4.5:1 ratio) |
|
|
722
|
+
|
|
723
|
+
### Design Health Score
|
|
724
|
+
|
|
725
|
+
Each scan produces a **Design Health Score** (0-100) with breakdown:
|
|
726
|
+
- Token adoption %
|
|
727
|
+
- Contrast compliance %
|
|
728
|
+
- Spacing consistency %
|
|
729
|
+
- Typography system %
|
|
730
|
+
- Surface hierarchy %
|
|
731
|
+
|
|
732
|
+
### Domain-Aware Recommendations
|
|
733
|
+
|
|
734
|
+
The agent detects your product type and provides tailored guidance:
|
|
735
|
+
|
|
736
|
+
| Domain | Default Mode | Accent Suggestions | Reference |
|
|
737
|
+
|--------|--------------|-------------------|-----------|
|
|
738
|
+
| **Fitness** | Dark | Orange, Tomato, Amber | Strava, Peloton |
|
|
739
|
+
| **Fintech** | Light | Sky, Teal, Grass | Mercury, Stripe |
|
|
740
|
+
| **Creative Tools** | Dark | Violet, Pink, Sky | Figma, Linear |
|
|
741
|
+
| **E-commerce** | Light | Tomato, Pink, Amber | Shopify, Glossier |
|
|
742
|
+
| **Dashboard** | Light | Blue, Indigo, Cyan | Vercel, Linear |
|
|
743
|
+
|
|
744
|
+
### Verified Token Sources
|
|
745
|
+
|
|
746
|
+
Instead of hardcoding colors, the agent references external sources:
|
|
747
|
+
- **Radix Colors** — radix-ui.com/colors (contrast-guaranteed)
|
|
748
|
+
- **Tailwind CSS** — tailwindcss.com/docs (zinc/slate scales)
|
|
749
|
+
- **shadcn/ui** — ui.shadcn.com (production themes)
|
|
750
|
+
|
|
751
|
+
### Exported Constants
|
|
752
|
+
|
|
753
|
+
Design tokens are exported for use in other tools:
|
|
754
|
+
|
|
755
|
+
```typescript
|
|
756
|
+
import {
|
|
757
|
+
DESIGN_TOKEN_SOURCES,
|
|
758
|
+
TYPOGRAPHY_TOKENS,
|
|
759
|
+
SPACING_TOKENS,
|
|
760
|
+
MOTION_DESIGN_TOKENS,
|
|
761
|
+
DOMAIN_DESIGN_RULES,
|
|
762
|
+
} from '@triedotdev/mcp/agents/design-engineer';
|
|
763
|
+
```
|
|
266
764
|
|
|
267
765
|
---
|
|
268
766
|
|
|
@@ -410,6 +908,89 @@ Native VS Code extension with inline diagnostics and quick fixes.
|
|
|
410
908
|
|
|
411
909
|
---
|
|
412
910
|
|
|
911
|
+
## Agent Context System
|
|
912
|
+
|
|
913
|
+
> **Simple version:** Trie remembers your project state automatically. See [How Trie Remembers Your Project](#how-trie-remembers-your-project) for the plain-English explanation.
|
|
914
|
+
|
|
915
|
+
### What Gets Saved
|
|
916
|
+
|
|
917
|
+
Every time you scan, Trie updates a file in your project (`.trie/AGENTS.md`) with:
|
|
918
|
+
|
|
919
|
+
| Tracked | Example |
|
|
920
|
+
|---------|---------|
|
|
921
|
+
| Health score | "Your project is at 85/100" |
|
|
922
|
+
| Critical issues | "2 security issues need fixing" |
|
|
923
|
+
| Hot files | "checkout.ts has 3 issues" |
|
|
924
|
+
| Priorities | "Fix payment auth before launching" |
|
|
925
|
+
| Last scan | "Scanned yesterday, 47 files checked" |
|
|
926
|
+
|
|
927
|
+
### What This Means For You
|
|
928
|
+
|
|
929
|
+
| Scenario | What Happens |
|
|
930
|
+
|----------|--------------|
|
|
931
|
+
| Open Cursor tomorrow | AI already knows your project state |
|
|
932
|
+
| Switch to Claude Code | Same context, no re-scanning needed |
|
|
933
|
+
| Push to GitHub | CI/CD knows what to focus on |
|
|
934
|
+
| Ask Trie "what should I fix?" | Gives prioritized answer based on your history |
|
|
935
|
+
|
|
936
|
+
### For Developers: Technical Details
|
|
937
|
+
|
|
938
|
+
<details>
|
|
939
|
+
<summary>MCP Resources (click to expand)</summary>
|
|
940
|
+
|
|
941
|
+
```
|
|
942
|
+
trie://context # AGENTS.md content (read this first)
|
|
943
|
+
trie://context/state # Detailed JSON state
|
|
944
|
+
trie://agents # Available agents
|
|
945
|
+
trie://config # Current configuration
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
Files stored:
|
|
949
|
+
- `.trie/AGENTS.md` - Human-readable context
|
|
950
|
+
- `.trie/state.json` - Machine-readable state for programmatic access
|
|
951
|
+
|
|
952
|
+
</details>
|
|
953
|
+
|
|
954
|
+
---
|
|
955
|
+
|
|
956
|
+
## Production Shipping
|
|
957
|
+
|
|
958
|
+
Trie solves the "last mile" of shipping to production. See [PRODUCTION_SHIPPING.md](./PRODUCTION_SHIPPING.md) for the complete guide.
|
|
959
|
+
|
|
960
|
+
### Quick Production Check
|
|
961
|
+
|
|
962
|
+
```bash
|
|
963
|
+
# Full production readiness scan
|
|
964
|
+
trie scan --agents security,privacy,bugs,performance --fail-on serious
|
|
965
|
+
|
|
966
|
+
# Or via MCP
|
|
967
|
+
trie_scan with agents: ["security", "privacy", "bugs", "performance"]
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
### What It Covers
|
|
971
|
+
|
|
972
|
+
| Area | What's Checked |
|
|
973
|
+
|------|----------------|
|
|
974
|
+
| **Security Hardening** | SQL injection, XSS, auth bypass, secrets, dependencies |
|
|
975
|
+
| **Scalability** | Connection pooling, stateless design, N+1 queries |
|
|
976
|
+
| **Architecture** | Circular dependencies, god classes, coupling |
|
|
977
|
+
| **Reliability** | Error handling, health checks, timeouts |
|
|
978
|
+
| **Revenue Protection** | Payment security, data compliance, business logic |
|
|
979
|
+
|
|
980
|
+
### CI/CD Gate
|
|
981
|
+
|
|
982
|
+
Add to your workflow:
|
|
983
|
+
|
|
984
|
+
```yaml
|
|
985
|
+
- uses: triedotdev/trie-action@v1
|
|
986
|
+
with:
|
|
987
|
+
agents: security,privacy,bugs,performance,architecture
|
|
988
|
+
fail-on: serious
|
|
989
|
+
upload-sarif: true
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
---
|
|
993
|
+
|
|
413
994
|
## Configuration
|
|
414
995
|
|
|
415
996
|
### Scan Options
|