@triedotdev/mcp 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +271 -2421
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,2574 +1,424 @@
1
- # Trie
1
+ # Trie - Your Code Guardian
2
2
 
3
- **A guardian agent that follows you from Cursor to CI/CD and everything in between. Trie watches your codebases, remembers what broke before, and warns you before you ship something risky.**
3
+ **An AI-powered code assistant that watches your codebase, learns from your mistakes, and prevents bugs before they ship.**
4
4
 
5
- Download the Trie workspace: https://www.trie.dev
6
- Follow me on X: https://x.com/louiskishfy
5
+ [![Download Workspace](https://img.shields.io/badge/Download-Trie%20Workspace-blue)](https://www.trie.dev) [![Follow on X](https://img.shields.io/badge/Follow-@louiskishfy-1DA1F2?logo=x)](https://x.com/louiskishfy)
7
6
 
8
- ## More Info
7
+ ## What Trie Does
9
8
 
10
- Long article I wrote here about this emerging space in AI tooling, this project, and the problems I'm working on solving: https://www.linkedin.com/pulse/your-new-ai-tool-probably-prompt-pack-lou-kishfy-gxjac/?trackingId=Dcuh2kGsRaigIt06UTUw5Q%3D%3D
9
+ Trie is like having an experienced developer watching over your code 24/7. It:
11
10
 
12
- ## Why Trie Exists
13
-
14
- I shipped consumer apps that gained traction quickly with Cursor and Claude Code—real users, paying customers. AI-generated code helped me move fast, but it became a nightmare to maintain as one person. I'd fix something and forget why. The same bugs came back. My codebase grew faster than my memory of it. I burned through tokens like no tomorrow.
15
-
16
- I realized I needed something to watch over my projects so I could maintain them alone. A guardian that remembers what broke, warns me before I ship something risky, and doesn't require me to re-explain context every time I switch tools.
17
-
18
- I use Cursor, CLI, GitHub Actions—sometimes all in the same hour. It seemed ridiculous that my context couldn't follow me. Every tool had its own silo. I'd teach one thing to my IDE and lose it when I pushed to CI.
19
-
20
- So I built Trie with a few principles:
21
-
22
- **Memory that travels with git.** The `.trie/` directory commits to your repo. Same incident history, same patterns, same risk scores—whether you're in Cursor, VS Code, CLI, or CI/CD. No external service. No re-explaining. Your context is *yours*.
23
-
24
- **One guardian, not a committee.** Trie has 26 autonomous **scouts** (built-in analyzers) that intelligently scan and report findings up to one guardian agent that knows the full picture. Unlike simple skills, scouts are sophisticated analyzers with their own logic, severity scoring, and domain expertise. You can also add external skills from any repo you find online.
25
-
26
- **Fast enough for git hooks.** I chose a trie data structure because I needed O(m) lookups that don't slow down my workflow. File paths as tree branches. Hot zones light up where problems cluster. Under 10ms for pattern matching, under 500ms for pre-push checks.
27
-
28
- **Plain English.** When I'm tired at 2am and a user reports a bug, I don't want to parse cryptic linter output. Trie speaks like a teammate: "This file broke twice last month. The auth changes look risky. Maybe add a test before pushing."
29
-
30
- Trie is the guardian I wished I had when my apps took off and I was alone trying to keep them running in the middle of the night. I hope this helps you! @ me on X for feedback and requests.
31
-
32
- ### Key Capabilities
33
-
34
- **Memory that travels:**
35
- - `.trie/` directory committed to git = your project's incident history, patterns, and risk scores
36
- - Same context in Cursor, Claude Code, VS Code, CLI, and GitHub Actions
37
- - Cross-project learning: patterns discovered across all your projects inform each new one
38
- - No re-explaining. Trie knows what broke before, everywhere you work.
39
-
40
- **Autonomous guardian:**
41
- - **Watches**: Git hooks, file watchers, proactive nudging—acts without being asked
42
- - **Remembers**: `trie tell "users can't log in"` builds a searchable memory tree
43
- - **Learns**: After 3+ incidents, discovers patterns automatically. Confidence adjusts with feedback.
44
- - **Warns**: `trie check` runs < 500ms before push, no LLM calls in hooks
45
- - **Speaks plain English**: Non-technical founders understand every warning
46
-
47
- **Technical foundation:**
48
- - Trie data structure for O(m) lookups, prefix search, hot zone detection—all under 10ms
49
- - SQLite for detailed incident history and relationships
50
- - BM25 search for intelligent memory queries
51
- - Bayesian confidence updates for continuous improvement
52
-
53
- Trie's memory is a tree. The more incidents you report, the smarter the tree gets. Hot paths = risky areas.
54
-
55
- ## At a Glance
56
- - **Context that travels**: `.trie/` directory = single source of truth. Cursor → CLI → CI/CD → back to Cursor. Same memory everywhere.
57
- - **Cross-project learning**: Patterns discovered across all your projects. Fix a SQL injection in Project A, Trie warns about similar patterns in Project B.
58
- - **Core commands**: `trie init` (bootstrap + hooks), `trie check` (risk review before push), `trie tell "<incident>"` (build memory), `trie ok`/`trie bad` (feedback), `trie status` (health score).
59
- - **Guardian agent**: ONE agent that watches, learns, and warns. It has goals, observes changes, reasons about risk, and nudges you in plain English.
60
- - **Built-in scouts**: 26 autonomous analyzers (security, privacy, SOC2, accessibility, etc.) with sophisticated logic that intelligently report to the guardian agent.
61
- - **MCP integration**: `trie_scan`, `trie_check`, `trie_tell`, `trie_fix`, `trie_explain`, `trie_memory`, `trie_context`—all return plain English.
62
- - **Memory structure**: Prefix tree (trie) for O(m) file lookups + SQLite for detailed history. Fast enough for git hooks (< 500ms).
63
- - **Learning loop**: Confidence updates, pattern discovery, co-occurrence detection—all powered by trie traversal (< 10ms).
64
-
65
- ## What's New (January 2026)
66
-
67
- ### Hypothesis & Goals Improvements (Latest)
68
-
69
- **Bug Fixes**
70
- - **Goal progress calculation**: Reduction goals now display correctly. Previously "Reduce from 20 → 10, currently at 15" showed 150% instead of 50%. Fixed with proper reduction formula.
71
- - **Hypothesis status transitions**: Auto-generated hypotheses now properly transition from `proposed` → `testing` when first evidence is gathered.
72
-
73
- **Enhancements**
74
- - **Path-aware goal tracking**: Goals like "Improve code quality in the auth module" now correctly filter issues by directory path. Matches patterns like "in the auth module", "in src/", "in components folder".
75
- - **Progress bar clamping**: Progress bars now clamp to 0-100% to prevent display overflow for edge cases.
76
-
77
- ### Guardian Agency
78
-
79
- **Persistent Memory**
80
- - Zero data loss after restarts—insights, cooldowns, and dismissals survive
81
- - Goals and hypotheses persist across sessions
82
- - State loads in <100ms
83
-
84
- **Goals (Auto + Manual)**
85
- - Auto-generates goals from incident patterns (e.g., "Reduce auth/ incidents by 50%")
86
- - Add your own goals via CLI or TUI
87
- - Adaptive scan frequency based on risk level (1-10 minutes)
88
- - Goal tracking with achievement celebrations
89
-
90
- ```bash
91
- # CLI: Add manual goals
92
- trie goal add "Reduce auth issues by 50%"
93
- trie goal add "Eliminate all critical security issues"
94
- trie goal list
95
- trie goal complete <id>
96
-
97
- # TUI: Press o in watch mode
98
- # [a] add [Enter] complete [d] delete [b] back
99
- ```
100
-
101
- **Hypotheses (Auto + Manual)**
102
- - Auto-generates hypotheses from patterns
103
- - Add your own hypotheses via CLI or TUI
104
- - Guardian collects evidence and updates confidence over time
105
-
106
- ```bash
107
- # CLI: Add manual hypotheses
108
- trie hypothesis add "Mondays have more bugs than Fridays"
109
- trie hypothesis add "Code reviews reduce bug rate"
110
- trie hypothesis list
111
- trie hypothesis validate <id>
112
-
113
- # TUI: Press y in watch mode
114
- # [a] add [v] validate [x] invalidate [d] delete
115
- ```
116
-
117
- **Watch Mode TUI Panels**
118
-
119
- | Key | Panel | Description |
120
- |-----|-------|-------------|
121
- | `o` | Goals | View, add, complete, delete goals |
122
- | `y` | Hypotheses | View, add, validate/invalidate hypotheses |
123
- | `g` | Guardian | Alert history and insights |
124
- | `i` | Toolkit | Scouts (autonomous) + Skills (installable) |
125
- | `h` | Help | Full keyboard shortcuts |
126
-
127
- **Predictive Intelligence**
128
- - Multi-factor risk scoring: incident count, recency, severity, complexity, churn
129
- - Trend prediction (increasing/stable/decreasing)
130
- - Self-improving hypotheses that validate over time
131
- - Example: "Friday deployments cause 2.3x more issues" → validated with 89% confidence
132
-
133
- **Autonomous Actions**
134
- - Auto-escalates critical security issues to Slack/email/webhook
135
- - Respects quiet hours (9pm-8am) with bypass for critical issues
136
- - Meta-learning adjusts insight weights based on your feedback
137
- - Effectiveness tracking with recommendations
138
-
139
- ### Autonomy System
140
-
141
- **Push Blocking with Bypass**
142
- - Pre-push hook blocks on critical issues
143
- - Bypass with `TRIE_BYPASS=1 git push` or `git push --no-verify`
144
- - All bypasses logged for audit trail
145
-
146
- **Git Hooks - How They Work**
147
-
148
- Hooks are installed when you run `trie init`:
149
- - Written to `.git/hooks/` (local to your repo, not pushed to GitHub)
150
- - Works with terminal, GitHub Desktop, and any git client
151
- - Persists until you remove them
152
-
153
- | Hook | When it runs | What it does |
154
- |------|--------------|--------------|
155
- | `pre-commit` | Before each commit | Quick scan of staged files |
156
- | `post-commit` | After each commit | Updates context graph |
157
- | `pre-push` | Before push | Blocks on critical issues |
158
-
159
- **Bypassing hooks:**
160
- ```bash
161
- # Skip all hooks for this push
162
- git push --no-verify
163
-
164
- # Skip Trie blocking but still log the bypass
165
- TRIE_BYPASS=1 git push
166
-
167
- # Skip all hooks for this commit
168
- git commit --no-verify -m "message"
169
- ```
170
-
171
- **Removing hooks:**
172
- ```bash
173
- rm .git/hooks/pre-push
174
- rm .git/hooks/pre-commit
175
- rm .git/hooks/post-commit
176
- ```
177
-
178
- **Reinstalling hooks:**
179
- ```bash
180
- trie init
181
- ```
182
-
183
- > **Note:** Hooks are per-repo and local. Teammates need to run `trie init` after cloning to get hooks (git doesn't transfer hooks for security reasons).
184
-
185
- **Auto-Check in Watch Mode**
186
- - When critical issues detected, auto-runs full check
187
- - Configurable threshold and cooldown
188
- - No more "Run pre-push check" suggestions—it just runs
189
-
190
- **Auto-Fix with Human-in-the-Loop**
191
- - Detects trivial fixes (console.log, debugger, etc.)
192
- - Always asks before applying: `Fix 12 issues? (y)es / (r)eview / (n)o`
193
- - Review mode shows each fix before applying
194
-
195
- **Progressive Escalation**
196
- | Occurrence | Action |
197
- |------------|--------|
198
- | 1st | Suggest fix |
199
- | 3rd | Auto-run full check |
200
- | 5th | Escalate to Slack/email |
201
- | 10th | Block operations until fixed |
202
-
203
- **Configuration**
204
- ```json
205
- // .trie/config.json
206
- {
207
- "autonomy": {
208
- "level": "proactive",
209
- "autoCheck": { "enabled": true, "onCritical": true },
210
- "autoFix": { "enabled": true, "askFirst": true },
211
- "pushBlocking": { "enabled": true, "allowBypass": true }
212
- },
213
- "escalation": {
214
- "enabled": true,
215
- "targets": [
216
- {
217
- "type": "slack",
218
- "enabled": true,
219
- "config": {
220
- "webhookUrl": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
221
- "channel": "#security-alerts",
222
- "username": "Trie Guardian"
223
- },
224
- "forSeverities": ["critical"],
225
- "forCategories": ["security", "all"]
226
- }
227
- ],
228
- "cooldownMinutes": 15,
229
- "maxEscalationsPerHour": 5,
230
- "respectQuietHours": true,
231
- "criticalBypassQuietHours": true
232
- }
233
- }
234
- ```
235
-
236
- **Escalation Targets:**
237
- - `slack` - Send to Slack via webhook
238
- - `email` - Send via email (requires SMTP configuration)
239
- - `webhook` - POST to custom webhook endpoint
240
-
241
- Configure multiple targets for redundancy. Set up in `.trie/config.json` or via TUI (press `c` → `5` in watch mode).
242
-
243
- **What this means:**
244
- ```
245
- Traditional tools: "Found 15 issues" (same every time)
246
-
247
- Trie Guardian: "auth/login.ts has 5 past incidents (5x above average).
248
- Test coverage dropped from 85% → 72%.
249
- Recommendation: Request extra review before merge.
250
-
251
- 🎯 Goal progress: auth/ incidents 15 → 7 (53% reduction!)
252
- 🔮 Hypothesis validated: Friday deploys cause issues"
253
- ```
254
-
255
- ### Memory System Hardening & Management
256
- - **Atomic writes**: Temp file + rename pattern prevents data corruption on crash/interrupt
257
- - **SHA256 hashing**: Cryptographic deduplication (replaced collision-prone bit-shift hash)
258
- - **Intelligent deduplication**: Same issue pattern stored once with occurrence count (e.g., 2,481 `parseInt` issues → 1 pattern)
259
- - **Capacity management**: 1,000 issue cap with intelligent pruning (prioritizes recent, high-severity, unresolved)
260
- - **User notifications**: Clear warnings at 80%/100% capacity with actionable purge recommendations
261
- - **Backup rotation**: Automated 5-backup rotation with recovery commands
262
- - **Zod validation**: Schema validation for all memory data structures
263
- - **Memory purge**: Four strategies (smart/resolved/old/all) for managing storage via CLI and MCP
264
- - **Deduplication metrics**: See duplicates avoided and unique patterns in stats
265
- - **Why Phase 1 only**: JSON performs well at Trie's scale (1K-10K issues). SQLite, embeddings, and session management add complexity without proportional value for a security scanning CLI tool.
266
-
267
- ### Guardian + Visual QA Integration
268
- - **Automatic suggestions**: Guardian detects 2+ critical/serious accessibility issues and suggests visual QA
269
- - **Browser screenshots**: `trie_visual_qa_browser` captures mobile/tablet/desktop screenshots
270
- - **AI vision analysis**: AI analyzes screenshots to validate real-world accessibility impact
271
- - **Smart cooldowns**: 5-minute cooldown prevents duplicate suggestions
272
- - **Complete workflow**: Code analysis → Guardian insight → Screenshot capture → Vision analysis
273
-
274
- ### CI/CD Command
275
- - **New command**: `trie ci` generates GitHub Actions workflow with memory caching
276
- - **Cross-run learning**: Cache `.trie/memory` for pattern recognition across CI runs
277
- - **SARIF output**: Results appear in GitHub Security tab
278
- - **Memory benefits**: "This issue was introduced 3 PRs ago", "Similar issue fixed in PR #42"
279
- - **Minimal mode**: `trie ci --minimal` for simpler workflow
280
-
281
- ### Guardian Agent Enhancements
282
- - **Proactive insights**: Synthesizes patterns across multiple skills (security, accessibility, etc.)
283
- - **Verbose details**: Issue breakdowns, affected files, examples, trends in expanded view
284
- - **Conversational UX**: Speaks like a helpful colleague, not a system
285
- - **Priority scoring**: 1-10 priority levels with intelligent cooldowns
286
- - **Celebration mode**: Recognizes improvements and fixed issues
287
- - **Autonomous goal generation**: Creates goals from patterns, tracks progress, celebrates achievements
288
- - **Predictive risk scoring**: Multi-factor analysis identifies risky files before they break
289
- - **Hypothesis validation**: Generates and validates hypotheses about your codebase patterns
290
- - **Auto-escalation**: Critical security issues automatically sent to Slack/email during work hours
291
- - **Meta-learning**: Adjusts behavior based on your feedback (which insights you find helpful)
292
-
293
- ### Core Workflow
294
- ```bash
295
- # Report an incident
296
- $ trie tell "users can't log in after my push"
297
- 📝 Got it. Linked to auth/login.ts. Next time you change this file, I'll warn you.
298
-
299
- # Before pushing
300
- $ git push
301
- 🛡️ Trie: Hold on...
302
-
303
- You're changing auth/login.ts
304
- This file has broken 2 times before.
305
-
306
- Last time (Jan 15): 3 users couldn't log in for 2 hours
307
-
308
- My suggestion: Test the login flow before pushing.
309
-
310
- Risk: HIGH
311
-
312
- # Give feedback
313
- $ trie ok # Warning was helpful
314
- $ trie bad # Warning was not helpful
315
- ```
316
-
317
- ### Built-in Scouts vs External Skills
318
-
319
- **Scout Architecture (Built-in Analyzers):**
320
- - **26 autonomous scouts** live in `src/skills/built-in/` and extend `BaseSkill`
321
- - Each scout has **sophisticated logic**: severity scoring, domain expertise, contextual analysis
322
- - **Intelligent reporting**: Scouts analyze and synthesize findings before reporting to the Guardian
323
- - **Examples**: Security Scout detects injection patterns, Privacy Scout analyzes GDPR compliance
324
-
325
- **External Skills (Simple Rules):**
326
- - **Installable knowledge**: Downloaded from GitHub repos as static rules/patterns
327
- - **No autonomous logic**: Just detection patterns that Skills Review agent applies
328
- - **Examples**: React best practices, style guides, compliance docs
329
-
330
- **The Guardian decides** when to deploy scouts based on risk, context, and patterns. Scouts provide autonomous intelligence; external skills provide knowledge to apply.
331
-
332
- ---
333
-
334
- ## Table of Contents
335
-
336
- - [Why Trie](#why-trie)
337
- - [At a Glance](#at-a-glance)
338
- - [What's New](#whats-new-january-2026)
339
- - [The Guardian Architecture](#the-guardian-architecture)
340
- - [Features](#features)
341
- - [Quick Start](#quick-start)
342
- - [The Guardian Workflow](#the-guardian-workflow)
343
- - [Common Questions](#common-questions)
344
- - [What Each Scout Does](#what-each-scout-does-plain-english)
345
- - [MCP Tools](#mcp-tools)
346
- - [CLI Commands](#cli-commands)
347
- - [Built-in Scouts](#built-in-scouts)
348
- - [Accessibility Skill (v2.0)](#accessibility-skill-v20)
349
- - [Guardian + Visual QA Integration](#guardian--visual-qa-integration)
350
- - [Moneybags Skill](#moneybags-skill)
351
- - [Legal Skill (v2.0)](#legal-skill-v20)
352
- - [Design Engineer Skill (v2.0)](#design-engineer-skill-v20)
353
- - [Special Skills](#special-skills)
354
- - [Custom Skills](#custom-skills)
355
- - [External Skills](#external-skills)
356
- - [Bootstrap System](#bootstrap-system)
357
- - [Issue Memory](#issue-memory)
358
- - [Project Info Registry](#project-info-registry)
359
- - [AI-Enhanced Mode](#ai-enhanced-mode)
360
- - [VS Code Extension](#vs-code-extension)
361
- - [CI/CD Integration](#cicd-integration)
362
- - [Configuration](#configuration)
363
- - [License](#license)
364
-
365
- ---
366
-
367
- ## The Guardian Architecture
368
-
369
- Trie is **truly agentic**—it's not just a collection of linters. Here's what makes it an agent:
370
-
371
- | Property | How It Works | Why It's Agentic |
372
- |----------|--------------|------------------|
373
- | **Goals** | Auto-generates goals from patterns (e.g., "Reduce auth/ incidents by 50%") | Pursues objectives without step-by-step direction |
374
- | **Observation** | Git hooks, file watchers, CI events | Acts proactively, not just when asked |
375
- | **Reasoning** | Multi-factor risk prediction, hypothesis validation, trend analysis | Uses memory to understand situations |
376
- | **Action** | Warns, explains, suggests, blocks, auto-escalates critical issues | Takes action autonomously in plain English |
377
- | **Learning** | Meta-learning from feedback, hypothesis validation, confidence updates | Improves from experience |
378
- | **Prediction** | Risk scoring predicts which files are likely to break | Anticipates problems before they occur |
379
-
380
-
381
-
382
- ### The Memory Tree
383
-
384
-
385
- ```
386
- src/
387
- auth/
388
- login.ts → [3 incidents, confidence: 85%, last: Jan 15]
389
- session.ts → [1 incident, confidence: 45%, last: Dec 20]
390
- payment/
391
- checkout.ts → [5 incidents, confidence: 92%, last: Jan 10]
392
- stripe.ts → [2 incidents, confidence: 60%, last: Jan 8]
393
- ```
394
-
395
- This enables:
396
- - **O(m) lookups**: Check if `auth/login.ts` is risky in < 1ms
397
- - **Prefix matching**: Find all incidents in `auth/*` in < 5ms
398
- - **Hot zone detection**: Identify risky directories in < 10ms
399
- - **Pattern discovery**: Walk the tree, find patterns naturally in < 10ms
400
- - **Auto-complete**: `trie tell "auth"` → suggests files instantly
401
-
402
- ### Performance
403
-
404
- | Operation | Target | Why It Matters |
405
- |-----------|--------|----------------|
406
- | `trie check` (pre-push hook) | < 500ms | Developers won't bypass slow hooks |
407
- | File risk lookup | < 1ms | Real-time feedback while coding |
408
- | Directory incident count | < 5ms | Instant hot zone detection |
409
- | Pattern discovery | < 10ms | Continuous learning without blocking |
410
-
411
- ### What Makes This Different
412
-
413
- Most "agents" are just prompt chains. Trie is different because:
414
-
415
- 1. **Autonomous behavior**: Watches your changes continuously via hooks, not just when asked
416
- 2. **Persistent memory that travels**: `.trie/` directory follows your code. Same context in Cursor, CLI, CI/CD, VS Code—no re-explaining
417
- 3. **Cross-project learning**: Fix a pattern in one project, Trie warns about it in all future projects
418
- 4. **Proactive guidance**: Warns before you push, nudges during editing, explains in plain English
419
- 5. **Continuous learning**: Gets noticeably better after 10 incidents. Confidence adjusts with every `trie ok`/`trie bad`
420
- 6. **Instant lookups**: Trie data structure + SQLite = O(m) file lookups (< 1ms), pattern discovery (< 10ms)
421
- 7. **Predictive intelligence**: Multi-factor risk scoring predicts which files will break before they do
422
- 8. **Self-improving hypotheses**: Generates hypotheses about your codebase patterns and validates them over time
423
- 9. **Autonomous escalation**: Auto-escalates critical security issues to Slack/email (respects quiet hours)
424
- 10. **Meta-learning**: Adjusts insight weights based on which warnings you find helpful vs. dismiss
425
-
426
- **Trie's job is to be your guardian angel—watching over your shoulder, warning you about danger, predicting problems before they happen, and getting smarter every time something goes wrong.**
427
-
428
- ### Guardian Agency Architecture
429
-
430
- The Guardian is a **95% agentic system**—everything except direct code modification (which is intentional):
431
-
432
- ```
433
- ┌─────────────────────────────────────────────────────┐
434
- │ Guardian Agent │
435
- │ (Observes, Learns, Predicts) │
436
- └─────────────────────────────────────────────────────┘
437
-
438
- ┌───────────────┼───────────────┐
439
- ▼ ▼ ▼
440
- ┌─────────┐ ┌──────────┐ ┌──────────┐
441
- │ Memory │ │ Pattern │ │ Meta- │
442
- │ System │ │ Engine │ │ Learning │
443
- │ │ │ │ │ │
444
- │ • BM25 │ │ • Trends │ │ • Track │
445
- │ • Store │ │ • Hypo's │ │ outcomes │
446
- │ • Graph │ │ • Risk │ │ • Adjust │
447
- └─────────┘ └──────────┘ └──────────┘
448
- │ │ │
449
- └───────────────┼───────────────┘
450
-
451
- ┌──────────────────┐
452
- │ Skill Engine │
453
- │ (Scans codebase) │
454
- └──────────────────┘
455
- ```
456
-
457
- | Capability | Status |
458
- |------------|--------|
459
- | Memory & Persistence | ✅ Insights, goals, hypotheses survive restarts |
460
- | Pattern Recognition | ✅ BM25 + trend analysis |
461
- | Goal Setting | ✅ Auto-generates from patterns |
462
- | Prediction | ✅ Multi-factor risk scoring |
463
- | Learning | ✅ Meta-learning from feedback |
464
- | Autonomous Action | ✅ Auto-escalation to Slack/email |
465
- | Context Awareness | ✅ Quiet hours, crunch mode |
466
-
467
- ### Context That Travels
468
-
469
- The `.trie/` directory is your project's memory:
470
-
471
- ```
472
- your-project/
473
- ├── .trie/
474
- │ ├── memory/
475
- │ │ ├── issues.json # All incidents with BM25 search
476
- │ │ ├── patterns.json # Discovered patterns (3+ incidents)
477
- │ │ ├── guardian-insights.json # Persistent insights, cooldowns, dismissals
478
- │ │ ├── guardian-state.json # Goals, hypotheses, metrics, timing
479
- │ │ ├── compacted-summaries.json # Historical summaries
480
- │ │ └── 2024-01-15.md # Daily logs
481
- │ ├── context.db # SQLite graph (files, changes, incidents)
482
- │ └── config.json # Guardian configuration
483
- ├── .git/
484
- └── src/
485
- ```
486
-
487
- **This directory is committed to git**, which means:
488
-
489
- | Scenario | What Happens |
490
- |----------|--------------|
491
- | **Work in Cursor** | Report incident with `trie tell`, memory updates |
492
- | **Switch to CLI** | Run `trie check` → same memory, same patterns |
493
- | **Push to GitHub** | CI reads `.trie/` → focused checks on known problem areas |
494
- | **Teammate pulls** | Gets your incident history, patterns, risk scores |
495
- | **Clone on laptop** | Full context restored from `.trie/` directory |
496
- | **Open in VS Code** | Same guardian, same warnings, same memory |
497
-
498
- **Cross-project learning:**
499
-
500
- ```
501
- ~/.trie/memory/global-patterns.json
502
- ```
503
-
504
- Trie tracks patterns across ALL your projects. When you fix a SQL injection in Project A, Trie remembers. When you start Project B, it warns about similar patterns immediately—even if Project B has never seen that specific issue.
505
-
506
- ---
507
-
508
- ## Features
509
-
510
- ### Core Capabilities
511
-
512
- | Feature | Description |
513
- |---------|-------------|
514
- | **Context That Travels** | `.trie/` directory committed to git = same memory in Cursor, CLI, CI/CD, VS Code. No re-explaining. |
515
- | **Cross-Project Learning** | Global pattern tracking. Fix SQL injection in Project A → Trie warns in Project B. |
516
- | **26 Autonomous Scouts** | Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Moneybags, Production Ready, and more |
517
- | **Autonomous Observation** | Git hooks, file watchers, proactive nudging—acts without being asked |
518
- | **Learning Loop** | Bayesian confidence updates, automatic pattern discovery (3+ incidents), `trie ok`/`trie bad` feedback |
519
- | **Instant Performance** | Trie data structure: < 1ms file lookups, < 10ms pattern discovery, < 500ms git hooks |
520
- | **Memory Hardening** | Atomic writes, SHA256 hashing, backup rotation, Zod validation—data corruption prevented |
521
-
522
- ### Guardian Agency (95% Agentic)
523
-
524
- | Feature | Description |
525
- |---------|-------------|
526
- | **Autonomous Goals** | Auto-generates goals from patterns (e.g., "Reduce auth/ incidents by 50%"), tracks progress, celebrates achievements |
527
- | **Predictive Risk Scoring** | Multi-factor analysis (incidents, recency, severity, complexity, churn) identifies risky files before they break |
528
- | **Self-Improving Hypotheses** | Generates hypotheses about your codebase (e.g., "Friday deploys cause issues"), validates with evidence over time |
529
- | **Auto-Escalation** | Critical security issues automatically sent to Slack/email/webhook—respects quiet hours (9pm-8am) |
530
- | **Meta-Learning** | Adjusts insight weights based on your feedback—learns which warnings you find helpful |
531
- | **Adaptive Scanning** | Scan frequency adjusts to risk level (1-10 minutes)—scans more often when issues are critical |
532
- | **Contextual Timing** | Respects quiet hours, work days, and crunch mode—defers low-priority items when you're busy |
533
-
534
- ### Performance & Execution
535
-
536
- | Feature | Description |
537
- |---------|-------------|
538
- | **Parallel Execution** | True parallel execution with worker threads—3-5x faster scans |
539
- | **Result Caching** | File-based caching with SHA256 hashing—70% faster repeated scans |
540
- | **Smart Triaging** | Activates skills based on code context, issue history, and memory patterns |
541
- | **Streaming Progress** | Real-time progress updates as skills complete |
542
-
543
- ### Developer Experience
544
-
545
- | Feature | Description |
546
- |---------|-------------|
547
- | **Plain English** | 690-line glossary translates jargon. Non-technical founders understand every warning. |
548
- | **Guardian Insights** | Proactive, conversational feedback with priority scoring and cooldowns |
549
- | **Visual QA Integration** | Guardian auto-suggests browser screenshots when accessibility issues found |
550
- | **CI/CD Command** | `trie ci` generates GitHub Actions workflow with memory caching |
551
- | **Watch Mode** | Proactive nudging while you code (optional) |
552
- | **Custom Skills** | Create skills from PDFs, docs, or style guides |
553
- | **External Skills** | Install capabilities from Vercel, Anthropic, Expo, Stripe, 150+ skills across 12 categories |
554
- | **Works Everywhere** | Cursor, Claude Code, OpenCode, VS Code, CLI, CI/CD—adapts output automatically |
555
- | **AI-Enhanced Mode** | Optional deeper analysis with `ANTHROPIC_API_KEY` |
556
-
557
- ### Integrations
558
-
559
- | Feature | Description |
560
- |---------|-------------|
561
- | **MCP Protocol** | Native integration with Cursor, Claude Code, and all MCP-compatible tools |
562
- | **CI/CD Integration** | GitHub Actions, pre-commit hooks, SARIF output for GitHub Security tab, memory caching |
563
- | **VS Code Extension** | Inline diagnostics, quick-fix code actions, scan on save |
564
-
565
- ---
566
-
567
- ## Quick Start
568
-
569
- ### Step 1: Install Node.js (if you don't have it)
570
-
571
- Trie requires Node.js. Check if you have it by opening Terminal (Mac) or Command Prompt (Windows):
572
-
573
- ```bash
574
- node --version
575
- ```
576
-
577
- If you see a version number (like `v18.0.0`), skip to Step 2. If not:
578
- - **Mac**: Download from [nodejs.org](https://nodejs.org) or run `brew install node`
579
- - **Windows**: Download from [nodejs.org](https://nodejs.org)
580
-
581
- ### Step 2: Set Up Trie in Your AI Coding Tool
582
-
583
- Pick the tool you use:
584
-
585
- <details>
586
- <summary><strong>Cursor (click to expand)</strong></summary>
587
-
588
- 1. Open Cursor
589
- 2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows)
590
- 3. Type "settings" and select **Cursor Settings**
591
- 4. Click **MCP** in the left sidebar
592
- 5. Click **Add MCP Server**
593
- 6. Paste this configuration:
594
-
595
- ```json
596
- {
597
- "mcpServers": {
598
- "Trie": {
599
- "command": "npx",
600
- "args": ["@triedotdev/mcp"]
601
- }
602
- }
603
- }
604
- ```
605
-
606
- 7. **Restart Cursor** (Cmd+Q and reopen, or Ctrl+Q on Windows)
607
-
608
- **That's it!** Trie is now connected.
609
-
610
- </details>
611
-
612
- <details>
613
- <summary><strong>Claude Code (click to expand)</strong></summary>
614
-
615
- 1. Open Claude Code
616
- 2. Open the terminal inside Claude Code
617
- 3. Run this command:
618
-
619
- ```bash
620
- claude mcp add Trie --scope user -- npx @triedotdev/mcp
621
- ```
622
-
623
- 4. **Restart Claude Code**
624
-
625
- **That's it!** Trie is now connected.
626
-
627
- </details>
628
-
629
- <details>
630
- <summary><strong>Other AI Tools (Windsurf, OpenCode, etc.)</strong></summary>
631
-
632
- Most MCP-compatible tools have a settings page for MCP servers. Add:
633
-
634
- - **Command**: `npx`
635
- - **Arguments**: `@triedotdev/mcp`
636
-
637
- Or in JSON format:
638
- ```json
639
- {
640
- "command": "npx",
641
- "args": ["@triedotdev/mcp"]
642
- }
643
- ```
644
-
645
- </details>
646
-
647
- ### Step 3: Run Your First Scan
648
-
649
- Open your project in Cursor or Claude Code and type in the chat:
650
-
651
- ```
652
- Scan my code with Trie
653
- ```
654
-
655
- Trie will:
656
- 1. Analyze your entire codebase
657
- 2. Pick the right checks based on what your code does (payments, auth, user data, etc.)
658
- 3. Show you a prioritized list of issues
659
-
660
- **Example output:**
661
- ```
662
- 🔺 Trie Agent Scan Complete
663
-
664
- Scanned: 5 agents | Time: 12.3s | Risk: MEDIUM
665
-
666
- 🎯 3 Issues Found
667
-
668
- 🔴 Critical (1)
669
- ---
670
- Missing authentication on payment endpoint
671
-
672
- 📍 src/api/checkout.ts:47
673
-
674
- Fix: Add auth middleware before processing payment
675
- ```
676
-
677
- ### Step 4: Fix Issues
678
-
679
- For each issue, you can:
680
-
681
- **Option A: Ask your AI to fix it**
682
- ```
683
- Fix the authentication issue in checkout.ts that Trie found
684
- ```
685
-
686
- **Option B: Use Trie's auto-fix** (for high-confidence fixes)
687
- ```
688
- Run trie_fix to apply safe fixes
689
- ```
690
-
691
- **Option C: Get more details first**
692
- ```
693
- Explain the checkout.ts security issue
694
- ```
695
-
696
- ---
697
-
698
- ## The Guardian Workflow
699
-
700
- Trie is ONE agent with autonomous behavior. Here's how it works day-to-day.
701
-
702
- ### Teaching the Guardian
703
-
704
- When something breaks, tell Trie:
705
-
706
- ```bash
707
- $ trie tell "users can't log in after my last push"
708
-
709
- 📝 Got it. I'll remember that changes to auth/ caused this.
710
- Next time you change those files, I'll warn you.
711
- ```
712
-
713
- The guardian:
714
- 1. Links the incident to recent changes (git history)
715
- 2. Adds the incident to its memory tree (trie data structure)
716
- 3. Updates file risk scores
717
- 4. Discovers patterns after 3+ similar incidents
718
-
719
- ### Before You Push
720
-
721
- ```bash
722
- $ git push
723
-
724
- 🛡️ Trie: Hold on...
725
-
726
- You're changing auth/login.ts
727
- 📊 This file has broken 2 times before.
728
-
729
- Last time (Jan 15): 3 users couldn't log in for 2 hours
730
-
731
- 🌳 Pattern: auth/ is becoming a hot zone
732
-
733
- My suggestion: Test login AND session behavior
734
- (These files often break together)
735
-
736
- Risk: HIGH
737
-
738
- [Continue] [Cancel]
739
- ```
740
-
741
- The check runs in < 500ms:
742
- 1. **Trie lookup** (< 1ms): Finds file incident history
743
- 2. **Prefix search** (< 1ms): Checks directory-level patterns
744
- 3. **Hot zone detection** (< 5ms): Identifies risky areas
745
- 4. **Co-occurrence check** (< 10ms): Files that break together
746
- 5. **Generate warning** (< 50ms): Plain English explanation
747
-
748
- ### Giving Feedback
749
-
750
- ```bash
751
- # Warning was helpful
752
- $ trie ok
753
-
754
- # Warning was not helpful (false positive)
755
- $ trie bad
756
- ```
757
-
758
- This updates pattern confidence immediately. The agent gets smarter.
759
-
760
- ### Checking Health
761
-
762
- ```bash
763
- $ trie status
764
-
765
- 🌳 Your codebase memory tree:
766
-
767
- Hot zones (3+ incidents):
768
- 🔥 auth/ (3 incidents across 2 files)
769
- ├─ login.ts (2 incidents)
770
- └─ session.ts (1 incident)
771
-
772
- Files that break together:
773
- 🔗 auth/login.ts ↔ auth/session.ts (67% co-occurrence)
774
-
775
- Safest areas (0 incidents):
776
- ✅ components/
777
- ✅ utils/
778
- ✅ api/
779
- ```
780
-
781
- ### The Memory Tree
782
-
783
- Trie's memory is a **prefix tree** of your codebase's failure patterns:
784
-
785
- ```
786
- src/
787
- auth/
788
- login.ts → [3 incidents, confidence: 85%, last: Jan 15]
789
- session.ts → [1 incident, confidence: 45%, last: Dec 20]
790
- payment/
791
- checkout.ts → [5 incidents, confidence: 92%, last: Jan 10]
792
- ```
793
-
794
- This makes lookups instant (O(m) where m = path length) and enables:
795
- - Prefix matching: "Find all incidents in `auth/*`" → < 1ms
796
- - Hot zone detection: "Which directories have 3+ incidents?" → < 10ms
797
- - Auto-complete: `trie tell "auth"` → suggests `auth/login.ts`, `auth/session.ts`
798
- - Pattern discovery: Walk the tree, find hot paths naturally → < 10ms
799
-
800
- ---
801
-
802
- ## Common Questions
803
-
804
- <details>
805
- <summary><strong>How does the learning work?</strong></summary>
806
-
807
- Trie uses Bayesian confidence updates. When you report an incident (`trie tell`), it:
808
- 1. Links the incident to recent changes (git history)
809
- 2. Adds it to the memory tree (trie data structure)
810
- 3. Updates file risk scores
811
- 4. After 3+ similar incidents, discovers patterns automatically
812
-
813
- When you give feedback (`trie ok` / `trie bad`), confidence adjusts immediately. False positives decrease a pattern's confidence; true positives increase it.
814
-
815
- </details>
816
-
817
- <details>
818
- <summary><strong>Will Trie change my code automatically?</strong></summary>
819
-
820
- No. Trie scans and suggests—it never edits code on its own. You stay in control.
821
-
822
- **What Trie does:**
823
- - Warn about risky changes
824
- - Explain past incidents
825
- - Suggest what to test
826
- - Flag security issues
827
-
828
- **What about `trie_fix`?**
829
-
830
- `trie_fix` generates fix prompts that guide your AI assistant (Claude, Cursor) to apply changes. The AI does the editing, not Trie. You review and approve every change through your normal workflow.
831
-
832
- **What Trie doesn't do:**
833
- - Edit files directly
834
- - Create pull requests automatically
835
- - Run arbitrary commands
836
- - Make changes without your review
837
-
838
- </details>
839
-
840
- <details>
841
- <summary><strong>What if I don't understand a warning?</strong></summary>
842
-
843
- Ask for an explanation:
844
- ```
845
- $ trie explain
846
-
847
- 🛡️ Detailed Explanation
848
-
849
- You changed: auth/login.ts
850
-
851
- History:
852
- • Jan 15, 2024: 3 users couldn't log in for 2 hours
853
- - You changed session timeout logic
854
- - Users got logged out unexpectedly
855
- - Had to roll back
856
-
857
- • Dec 20, 2023: Login button stopped working
858
- - Missing null check on user object
859
- - 5 users affected
860
-
861
- Pattern: auth/ directory has 3 total incidents
862
- Files that break together: login.ts ↔ session.ts (67% of the time)
863
-
864
- My suggestion: Test both login AND session behavior together
865
- ```
866
-
867
- Everything is in plain English. No jargon.
868
-
869
- </details>
870
-
871
- <details>
872
- <summary><strong>Does it work offline?</strong></summary>
873
-
874
- Yes. The core guardian works entirely offline:
875
- - `trie check` in git hooks (< 500ms, no network)
876
- - Pattern matching and risk scoring (local database)
877
- - Memory queries (trie + SQLite, all local)
878
-
879
- The built-in skills can optionally use AI for deeper analysis when you have an API key, but it's not required.
880
-
881
- </details>
882
-
883
- <details>
884
- <summary><strong>How do I set up automatic checks on GitHub?</strong></summary>
885
-
886
- **Quick setup (recommended):**
887
-
888
- Run `trie ci` to generate a GitHub Actions workflow with memory caching:
889
-
890
- ```bash
891
- # Generate full workflow with SARIF output
892
- trie ci
893
-
894
- # Generate minimal workflow
895
- trie ci --minimal
896
-
897
- # Preview without creating files
898
- trie ci --dry-run
899
- ```
900
-
901
- This creates `.github/workflows/trie-scan.yml` that:
902
- - ✅ Caches Trie memory across runs for cross-run learning
903
- - ✅ Enables insights like "This issue was introduced 3 PRs ago"
904
- - ✅ Tracks trends: improving, stable, or declining
905
- - ✅ Uploads SARIF results to GitHub Security tab
906
-
907
- **Manual setup:**
908
-
909
- Or add this file to your repo at `.github/workflows/trie.yml`:
910
-
911
- ```yaml
912
- name: Trie Guardian
913
- on: [push, pull_request]
914
-
915
- jobs:
916
- check:
917
- runs-on: ubuntu-latest
918
- steps:
919
- - uses: actions/checkout@v4
920
- with:
921
- fetch-depth: 0 # Need history for incident context
922
-
923
- - uses: triedotdev/trie-action@v1
924
- with:
925
- # Fast check on every push
926
- command: check
927
- fail-on: critical
928
- ```
929
-
930
- The guardian reads your project's `.trie/` directory (incidents, patterns, memory) and uses that context in CI.
931
-
932
- </details>
933
-
934
- ---
935
-
936
- ## What Each Scout Does (Plain English)
937
-
938
- | When You Ask | What It Checks | Why It Matters |
939
- |--------------|----------------|----------------|
940
- | "Run security scan" | Login/password handling, data exposure, hack vulnerabilities | Prevents your app from being hacked |
941
- | "Run privacy scan" | User data handling, GDPR/CCPA compliance | Avoids fines up to $10,000+ per violation |
942
- | "Run bugs scan" | Logic errors, edge cases, crash points | Prevents app crashes for users |
943
- | "Run performance scan" | Slow queries, memory leaks, scaling issues | App stays fast with 1000+ users |
944
- | "Run legal scan" | Terms of service, license compliance, regulations | Avoids lawsuits |
945
- | "Run design scan" | UI patterns, accessibility, UX issues | Better user experience |
946
- | "Run accessibility scan" | WCAG 2.1 AA compliance, screen reader support | Makes your app usable by everyone |
947
- | "Run production-ready scan" | Health endpoints, graceful shutdown, security headers | Confirms you're ready to ship |
948
- | "Run moneybags scan" | Dollar cost of bugs at your user scale | Shows ROI of fixing issues now vs later |
949
-
950
- ---
951
-
952
- ## MCP Apps - Interactive UIs
953
-
954
- **New:** Trie now supports **MCP Apps**—interactive UI components that render directly in Claude, ChatGPT, VS Code, and other MCP clients.
955
-
956
- Instead of text-only output, Trie tools return rich, interactive interfaces:
957
-
958
- | Tool | UI App | What You Get |
959
- |------|--------|--------------|
960
- | `trie_scan` | **Scan Dashboard** | Filter by severity/agent, expand issues, one-click fix actions, export JSON |
961
- | `trie_memory` | **Memory Tree** | Hierarchical view with bar charts, cross-project patterns, collapsible sections |
962
- | `trie_pr_review` | **PR Review** | File tree, side-by-side diffs, inline comments, approve/request changes |
963
- | `trie_visual_qa_browser` | **Visual QA** | Screenshot gallery, viewport comparison, issue annotations |
964
-
965
- ### Memory Tree Visualization
966
-
967
- When you use `trie_memory`, you get an interactive tree view:
968
-
969
- ```
970
- MEMORY TREE [1000 issues]
971
- ├──────────────────────────────────────┤
972
- ▼ By Severity
973
- │ critical (5) █░░░░░░░░░░░░░░░
974
- │ high (10) █░░░░░░░░░░░░░░░
975
- │ medium (75) ███████████░░░░░
976
- └ low (110) ████████████████
977
- ▼ By File (Hot Spots)
978
- ├─ styles.css (57) ████████████████
979
- ├─ stack-detector.ts (23) ██████░░░░░░░░░░
980
- └─ attack-surface.ts (10) ███░░░░░░░░░░░░░
981
- ▼ Cross-Project Patterns (88 recurring)
982
- ├─ "Loose equality check..." - seen in 2 projects
983
- ├─ "Missing license header..." - seen in 2 projects
984
- └─ "Potential N+1 query..." - seen in 2 projects
985
- ```
986
-
987
- **Key features:**
988
- - Collapsible sections (severity, files, agents, patterns)
989
- - Visual bar charts showing issue distribution
990
- - **Cross-project patterns** - highlights recurring issues across your codebases
991
- - Click any category to drill down into specific issues
992
- - Resolve/unresolve actions inline
993
-
994
- ### Client Support
995
-
996
- MCP Apps work in:
997
- - **Claude Desktop** ✅
998
- - **Claude Web** ✅
999
- - **ChatGPT** ✅
1000
- - **VS Code Insiders** ✅
1001
- - **Goose** ✅
1002
-
1003
- ### How It Works
1004
-
1005
- 1. You call a Trie tool like `trie_scan` or `trie_memory`
1006
- 2. Your AI client detects the UI resource and fetches it
1007
- 3. An interactive dashboard renders in your chat
1008
- 4. You can filter, expand, click actions—all within the conversation
1009
- 5. The model sees your interactions and responds accordingly
1010
-
1011
- No configuration needed—the UIs work automatically when you use Trie via MCP.
1012
-
1013
- ---
1014
-
1015
- ## MCP Tools
1016
-
1017
- These tools are available when using Trie via MCP (Cursor, Claude Code, etc.).
1018
-
1019
- ### Scanning & Analysis
1020
-
1021
- | Tool | Description | UI App |
1022
- |------|-------------|--------|
1023
- | `trie_scan` | Full scan with intelligent skill selection | ✅ Interactive dashboard |
1024
- | `trie_watch` | Watch mode—proactive nudging as you code | — |
1025
- | `trie_check` | Quick risk check before push (< 500ms, no LLM) | — |
1026
- | `trie_fix` | Generate fix recommendations for detected issues | — |
1027
- | `trie_explain` | Explain code, issues, or changes in plain language | — |
1028
-
1029
- ### Memory & Learning
1030
-
1031
- | Tool | Description | UI App |
1032
- |------|-------------|--------|
1033
- | `trie_tell` | Report an incident to build the agent's memory | — |
1034
- | `trie_feedback` | Give thumbs up/down on warnings (updates confidence) | — |
1035
- | `trie_memory` | Search and manage issue memory across projects | ✅ Interactive tree |
1036
- | `trie_context` | Read full context (memory + patterns + history) | — |
1037
- | `trie_checkpoint` | Quick save context without running a full scan | — |
1038
-
1039
- ### Project & Configuration
1040
-
1041
- | Tool | Description |
1042
- |------|-------------|
1043
- | `trie_init` | Initialize bootstrap files, detect stack, suggest skills |
1044
- | `trie_project` | View and manage project info (.trie/PROJECT.md) |
1045
- | `trie_reconcile` | Sync from context.json after rebases or multi-device edits |
1046
-
1047
- ### Security & Compliance Skills
1048
-
1049
- | Tool | What It Analyzes |
1050
- |------|------------------|
1051
- | `trie_security` | SQL injection, XSS, hardcoded secrets, auth bypasses, OWASP Top 10 |
1052
- | `trie_privacy` | GDPR/CCPA/PCI-DSS compliance, PII exposure, logging sensitive data |
1053
- | `trie_soc2` | Access control gaps, missing audit logs, encryption issues |
1054
- | `trie_legal` | Licensing, ToS, accessibility, IP, GDPR/CCPA, e-commerce, marketing, COPPA |
1055
-
1056
- ### Code Quality Skills
1057
-
1058
- | Tool | What It Analyzes |
1059
- |------|------------------|
1060
- | `trie_bugs` | Null safety, edge cases, async issues, race conditions |
1061
- | `trie_types` | Type errors, missing annotations, null checks |
1062
- | `trie_architecture` | Code organization, SOLID principles, N+1 queries, scalability |
1063
- | `trie_performance` | Memory leaks, inefficient algorithms, bundle size |
1064
- | `trie_test` | Missing test coverage, test quality, edge case coverage |
1065
- | `trie_clean` | Clean up AI-generated "vibe code": find common mistakes and quick fixes |
1066
-
1067
- ### UI/UX Skills
1068
-
1069
- | Tool | What It Analyzes | UI App |
1070
- |------|------------------|--------|
1071
- | `trie_accessibility` | WCAG 2.1 AA: icon-only buttons, touch targets, heading levels, ARIA validation, 20+ checks. **Guardian auto-suggests visual QA when critical a11y issues found.** | — |
1072
- | `trie_design` | AI slop detection, verified token systems, contrast validation, design health scoring | — |
1073
- | `trie_ux` | User testing simulations: happy path, security tester, confused user, impatient user | — |
1074
- | `trie_visual_qa` | Static CSS/layout analysis: CLS risks, responsive patterns, overflow issues | — |
1075
- | `trie_visual_qa_browser` | **Browser screenshots** at mobile/tablet/desktop for Guardian visual analysis (requires dev server) | ✅ Screenshot gallery |
1076
- | `trie_e2e` | End-to-end test coverage, user flow validation | — |
1077
- | `trie_pr_review` | **PR reviews**: File-by-file diff viewer with inline actions | ✅ Interactive diff viewer |
1078
-
1079
- ### Operations Skills
1080
-
1081
- | Tool | What It Analyzes |
1082
- |------|------------------|
1083
- | `trie_devops` | Config issues, logging, environment variables, deployment patterns |
1084
- | `trie_data_flow` | Data flow analysis, state management, API contracts |
1085
- | `trie_production_ready` | Production gate: health endpoints, graceful shutdown, security headers, rate limiting |
1086
- | `trie_moneybags` | 💰 Estimates dollar cost of bugs scaled to your user count |
1087
- | `trie_comprehension` | Plain language explanations for non-technical stakeholders |
1088
-
1089
- ### Special Skills (Manually Invoked)
1090
-
1091
- | Tool | Description |
1092
- |------|-------------|
1093
- | `trie_super_reviewer` | Interactive PR reviews: walks through changes file-by-file with AI guidance |
1094
- | `trie_agent_smith` | Ultimate AI code enforcer—43 specialized hunters targeting AI-generated anti-patterns |
1095
-
1096
- ### Custom & External Skills
1097
-
1098
- | Tool | Description |
1099
- |------|-------------|
1100
- | `trie_create_skill` | Create a custom skill from a PDF, TXT, or MD document |
1101
- | `trie_save_skill` | Save a custom skill configuration |
1102
- | `trie_list_skills` | List all installed skills (external and custom) |
1103
- | `trie_skill_review` | Apply installed external/custom skills to code review |
1104
-
1105
- ---
1106
-
1107
- ## CLI Commands
1108
-
1109
- ```bash
1110
- # Bootstrap (installs git hooks, detects stack, suggests skills)
1111
- trie init
1112
-
1113
- # Report an incident (builds memory)
1114
- trie tell "users can't log in after my push"
1115
-
1116
- # Quick check before pushing (< 500ms, no LLM)
1117
- trie check
1118
-
1119
- # Generate CI/CD workflow (NEW!)
1120
- trie ci # Full workflow with SARIF + memory caching
1121
- trie ci --minimal # Minimal workflow
1122
- trie ci --dry-run # Preview without creating files
1123
-
1124
- # Give feedback on last warning
1125
- trie ok # Helpful - increases confidence
1126
- trie bad # Not helpful - decreases confidence
1127
-
1128
- # Pause warnings for 1 hour
1129
- trie quiet
1130
-
1131
- # View memory tree, patterns, and health
1132
- trie status
1133
-
1134
- # Full scan with intelligent skill selection
1135
- trie scan
1136
-
1137
- # Scan specific directory
1138
- trie scan --dir ./src
1139
-
1140
- # Scan with specific skills
1141
- trie scan --skills security,privacy,bugs
1142
-
1143
- # Watch mode (proactive nudging while you code)
1144
- trie watch
1145
-
1146
- # Output JSON report
1147
- trie scan --format json --output report.json
1148
-
1149
- # Quick save (checkpoint without full scan)
1150
- trie checkpoint "finished auth flow"
1151
-
1152
- # Search issue memory
1153
- trie memory search "SQL injection"
1154
-
1155
- # View memory statistics and capacity
1156
- trie memory stats
1157
-
1158
- # Manage memory capacity (NEW!)
1159
- trie memory purge smart # Remove resolved & old low-priority (recommended)
1160
- trie memory purge resolved # Remove all resolved issues
1161
- trie memory purge old 60 # Remove issues older than 60 days
1162
- trie memory purge all # Clear all issues (keeps summaries)
1163
-
1164
- # View cross-project patterns
1165
- trie memory global patterns
1166
-
1167
- # Guardian Agency commands
1168
- trie guardian goals # View active goals and progress
1169
- trie guardian hypotheses # View hypotheses and their confidence
1170
- trie guardian metrics # View agent effectiveness metrics
1171
- trie guardian risk src/auth # Get risk prediction for a file/directory
1172
-
1173
- # List available skills
1174
- trie skills list
1175
-
1176
- # Browse skill categories (150+ skills across 12 categories)
1177
- trie skills list categories
1178
-
1179
- # Install an external skill
1180
- trie skills add vercel-labs/agent-skills vercel-react-best-practices
1181
- ```
1182
-
1183
- ### CLI vs MCP Tools
1184
-
1185
- | Use Case | Tool | When to Use |
1186
- |----------|------|-------------|
1187
- | **Interactive coding** | MCP tools (`trie_scan`, `trie_check`, `trie_tell`) | Working inside Cursor/Claude Code |
1188
- | **Terminal/CI** | CLI (`trie scan`, `trie check`, `trie tell`) | Running from terminal, CI pipelines, scripts |
1189
- | **VS Code** | VS Code extension | Using VS Code (not Cursor/Claude Code) |
1190
-
1191
- ---
1192
-
1193
- ## Built-in Scouts
1194
-
1195
- Trie has ONE guardian agent that intelligently deploys these 26 autonomous scouts (sophisticated analyzers with domain expertise).
1196
-
1197
- ### Security & Compliance (4 scouts)
1198
-
1199
- | Scout | Description |
1200
- |-------|-------------|
1201
- | **Security** | SQL injection, XSS, hardcoded secrets, auth bypasses, OWASP Top 10 |
1202
- | **Privacy** | GDPR/CCPA/PCI-DSS compliance, PII exposure, data encryption |
1203
- | **SOC 2** | Access control gaps, missing audit logs, encryption, secrets management |
1204
- | **Legal** | Comprehensive app legal: licensing, ToS, accessibility, IP, GDPR/CCPA, e-commerce, COPPA, marketing compliance |
1205
-
1206
- ### Code Quality (6 scouts)
1207
-
1208
- | Scout | Description |
1209
- |-------|-------------|
1210
- | **TypeCheck** | Type errors, missing annotations, null checks |
1211
- | **Bug Finding** | Null safety, edge cases, async issues, race conditions |
1212
- | **Software Architect** | Code organization, SOLID principles, N+1 queries, scalability |
1213
- | **Test** | Missing test coverage, test quality, edge case coverage |
1214
- | **Performance** | Memory leaks, inefficient algorithms, bundle size |
1215
- | **Trie Clean** | Clean up AI-generated "vibe code": find common mistakes and quick fixes |
1216
-
1217
- ### UI/UX (5 scouts)
1218
-
1219
- | Scout | Description |
1220
- |-------|-------------|
1221
- | **Accessibility** | WCAG 2.1 AA compliance: icon-only buttons, touch targets, heading levels, ARIA validation, color-only indicators, keyboard nav, focus management, 20+ checks |
1222
- | **Design Engineer** | AI slop detection, verified token systems, contrast validation, design health scoring, domain-aware recommendations |
1223
- | **User Testing** | Simulate happy path, security tester, confused user, impatient user |
1224
- | **Visual QA** | Visual regression, responsive design, cross-browser issues |
1225
- | **E2E** | End-to-end test coverage, user flow validation |
1226
-
1227
- ### Operations (6 scouts)
1228
-
1229
- | Scout | Description |
1230
- |-------|-------------|
1231
- | **DevOps** | Config issues, logging, environment variables, deployment patterns |
1232
- | **Data Flow** | Data flow analysis, state management, API contracts |
1233
- | **Comprehension** | Plain language explanations for non-technical stakeholders |
1234
- | **Moneybags** | 💰 Estimates dollar cost of bugs scaled to your user count (default: 250). Use `--users` to configure |
1235
- | **Production Ready** | 🚀 Production gate: health endpoints, graceful shutdown, connection pooling, security headers, rate limiting, monitoring |
1236
- | **Skill Review** | Applies external and custom skills to code review |
1237
-
1238
- ---
1239
-
1240
- ## Accessibility Skill (v2.0)
1241
-
1242
- The Accessibility Skill has been completely rebuilt to provide comprehensive WCAG 2.1 AA compliance checking—matching and exceeding tools like rams.ai, axe-core, and Lighthouse.
1243
-
1244
- ### Severity Levels
1245
-
1246
- | Level | Description | Examples |
1247
- |-------|-------------|----------|
1248
- | **Critical** | Blocks access entirely | Images without alt, icon-only buttons without labels, empty links |
1249
- | **Serious** | Significantly impairs access | Focus outline removed, positive tabIndex, missing ARIA attributes |
1250
- | **Moderate** | Creates barriers | Skipped headings, color-only indicators, small touch targets |
1251
- | **Low** | Best practices | Missing semantic elements, external link warnings |
1252
-
1253
- ### What It Detects
1254
-
1255
- #### Critical Issues
1256
-
1257
- | Issue | WCAG | Description |
1258
- |-------|------|-------------|
1259
- | Images without alt text | 1.1.1 | Screen readers cannot describe the image |
1260
- | Icon-only buttons missing aria-label | 4.1.2 | Screen readers announce "button" with no purpose |
1261
- | Non-semantic click handlers | 2.1.1 | `div onClick` without keyboard support blocks keyboard users |
1262
- | Empty links | 2.4.4 | Links with no text content are unusable |
1263
- | Links without href | 2.4.4 | Anchor elements must have destinations |
1264
-
1265
- #### Serious Issues
1266
-
1267
- | Issue | WCAG | Description |
1268
- |-------|------|-------------|
1269
- | Focus outline removed | 2.4.7 | `outline: none` without replacement hides keyboard focus |
1270
- | Positive tabIndex values | 2.4.3 | `tabIndex={5}` disrupts natural tab order |
1271
- | Role without required ARIA | 4.1.2 | `role="slider"` needs `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
1272
- | Form inputs without labels | 1.3.1 | Inputs must have associated labels or aria-label |
1273
- | Color-only status indicators | 1.4.1 | Red/green for error/success excludes colorblind users |
1274
- | Placeholder as only label | 3.3.2 | Placeholder disappears when user types |
1275
- | Modal without Escape key | 2.1.2 | Keyboard users may be trapped in modal |
1276
-
1277
- #### Moderate Issues
1278
-
1279
- | Issue | WCAG | Description |
1280
- |-------|------|-------------|
1281
- | Skipped heading levels | 2.4.6 | h1 → h3 confuses screen reader navigation |
1282
- | First heading not h1 | 2.4.6 | Pages should start with h1 |
1283
- | Touch targets under 24px | 2.5.8 | Minimum 24×24px for WCAG AA |
1284
- | Missing autocomplete | 1.3.5 | Helps users fill forms faster |
1285
- | Generic link text | 2.4.4 | "Click here" is meaningless out of context |
1286
- | Missing prefers-reduced-motion | 2.3.3 | Animations can trigger vestibular disorders |
1287
- | Status messages without aria-live | 4.1.3 | Toasts/alerts not announced to screen readers |
1288
-
1289
- #### Low Issues
1290
-
1291
- | Issue | WCAG | Description |
1292
- |-------|------|-------------|
1293
- | Touch targets under 44px | 2.5.5 | Recommended 44×44px for AAA |
1294
- | Missing semantic elements | 1.3.1 | `<div class="nav">` should be `<nav>` |
1295
- | External links without warning | 3.2.5 | `target="_blank"` should indicate new window |
1296
- | Disabled elements without explanation | — | Users need to know why action is unavailable |
1297
-
1298
- ### ARIA Validation
1299
-
1300
- The agent validates that ARIA roles have their required attributes:
1301
-
1302
- | Role | Required Attributes |
1303
- |------|---------------------|
1304
- | `checkbox` | `aria-checked` |
1305
- | `slider` | `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
1306
- | `combobox` | `aria-expanded`, `aria-controls` |
1307
- | `progressbar` | `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
1308
- | `tab` | `aria-selected` |
1309
- | `switch` | `aria-checked` |
1310
-
1311
- ### Accessibility Score
1312
-
1313
- Each scan produces an **Accessibility Score** (0-100) based on issue severity:
1314
-
1315
- ```
1316
- ═══════════════════════════════════════════════════
1317
- ACCESSIBILITY REVIEW: src/components/
1318
- ═══════════════════════════════════════════════════
1319
-
1320
- CRITICAL (2 issues)
1321
- ───────────────────
1322
- [A11Y] Line 24: Icon-only button missing accessible name
1323
- <button><CloseIcon /></button>
1324
- Fix: Add aria-label="Close"
1325
- WCAG: 4.1.2 Name, Role, Value
1326
-
1327
- SERIOUS (1 issue)
1328
- ─────────────────
1329
- [A11Y] Line 48: Focus outline removed without replacement
1330
- className="outline-none"
1331
- Fix: Add focus-visible:ring-2 focus-visible:ring-offset-2
1332
- WCAG: 2.4.7 Focus Visible
1333
-
1334
- MODERATE (2 issues)
1335
- ───────────────────
1336
- [A11Y] Line 67: Skipped heading level: h1 to h3
1337
- <h3>Features</h3>
1338
-
1339
- Accessibility Score: 65/100
1340
- ℹ️ Consider running 'trie_visual_qa_browser' to capture screenshots for Guardian visual analysis of these accessibility issues.
1341
- ```
1342
-
1343
- ### Guardian + Visual QA Integration
1344
-
1345
- When the accessibility skill finds **critical or multiple serious issues**, the **Guardian agent automatically suggests** running browser-based visual QA:
1346
-
1347
- ```bash
1348
- # Guardian detects accessibility issues during scan
1349
- $ trie scan src/components/
1350
-
1351
- 🛡️ Guardian Insight
1352
- Priority: 7 | Category: quality
1353
-
1354
- Found 5 accessibility issues that could block users.
1355
- Screenshots would help validate real impact.
1356
-
1357
- Suggested Action: Capture screenshots for visual analysis
1358
- Command: trie_visual_qa_browser url:"http://localhost:3000"
1359
-
1360
- Affected Files:
1361
- • Button.tsx
1362
- • Modal.tsx
1363
- • Form.tsx
1364
-
1365
- Issue Breakdown:
1366
- • critical: 2
1367
- • serious: 3
1368
- ```
1369
-
1370
- **How it works:**
1371
-
1372
- 1. **Accessibility skill** runs static analysis on UI code (JSX, TSX, Vue, etc.)
1373
- 2. Finds critical/serious WCAG violations (missing alt text, no focus indicators, etc.)
1374
- 3. **Guardian** sees pattern: accessibility issues that need visual validation
1375
- 4. **Guardian suggests** running `trie_visual_qa_browser` to capture screenshots
1376
- 5. Run the command (requires your dev server running)
1377
- 6. **Guardian analyzes screenshots** with AI vision to verify real-world impact
1378
- 7. Get actionable feedback on actual rendering issues
1379
-
1380
- **Example workflow:**
1381
-
1382
- ```bash
1383
- # 1. Start your dev server
1384
- $ npm run dev
1385
- # Dev server running on http://localhost:3000
1386
-
1387
- # 2. Scan finds accessibility issues
1388
- $ trie scan src/components/
1389
- # Guardian: "Screenshots would help validate real impact"
1390
-
1391
- # 3. Capture screenshots at multiple viewports
1392
- $ trie_visual_qa_browser url:"http://localhost:3000"
1393
- # 📸 Capturing: mobile (375x812), tablet (768x1024), desktop (1440x900)
1394
-
1395
- # 4. Guardian analyzes with vision AI
1396
- # Returns: "Focus indicators invisible on mobile, icon button
1397
- # has no visible label, heading hierarchy broken causing
1398
- # screen reader confusion"
1399
- ```
1400
-
1401
- **Why this matters:**
1402
-
1403
- - **Static analysis** finds code patterns but can't see the rendered page
1404
- - **Browser screenshots** show what users actually experience
1405
- - **AI vision** validates whether issues truly impact accessibility
1406
- - **Guardian synthesizes** both code analysis + visual evidence for better insights
1407
-
1408
- ### Usage
1409
-
1410
- ```bash
1411
- # Run accessibility scan
1412
- trie scan --agents accessibility
1413
-
1414
- # Full UI scan (accessibility + design)
1415
- trie scan --agents accessibility,design-engineer
1416
-
1417
- # MCP usage
1418
- trie_accessibility
1419
- ```
1420
-
1421
- ---
1422
-
1423
- ## Moneybags Skill
1424
-
1425
- The Moneybags skill answers the question every CFO asks: **"How much will this bug cost us?"**
11
+ - **Learns from your mistakes** - Remember when you broke authentication last month? Trie does too.
12
+ - **Prevents repeat bugs** - Warns you before you make the same mistake twice
13
+ - **Works everywhere** - Same intelligence whether you're coding, committing, or deploying
14
+ - **Speaks plain English** - No cryptic error codes at 2 AM
1426
15
 
1427
- 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.**
16
+ ## Quick Start
1428
17
 
1429
- ### User Count Scaling
18
+ ### 1. Install Trie
1430
19
 
1431
- Costs are scaled based on your app's user count (default: 250 users). Use the `--users` flag to match your scale:
20
+ Make sure you have Node.js installed, then:
1432
21
 
1433
22
  ```bash
1434
- # Default (250 users - early stage app)
1435
- trie scan
1436
-
1437
- # Scale for your app size
1438
- trie scan --users 1000 # Growing app
1439
- trie scan --users 10000 # Traction
1440
- trie scan --users 100000 # Growth stage
1441
- trie scan -u 1000000 # Enterprise
1442
- ```
1443
-
1444
- | User Count | Multiplier | Stage |
1445
- |------------|------------|-------|
1446
- | 50 | 0.3x | MVP |
1447
- | **250** | **1x** | **Early stage (default)** |
1448
- | 1,000 | 2x | Growing |
1449
- | 5,000 | 4x | Traction |
1450
- | 25,000 | 8x | Scale-up |
1451
- | 100,000 | 15x | Growth |
1452
- | 1,000,000+ | 40x | Enterprise |
1453
-
1454
- ### Cost Model
1455
-
1456
- | Severity | Fix Now | If Production | Multiplier |
1457
- |----------|---------|---------------|------------|
1458
- | **Critical** | $5,000 | $150,000+ | 30x |
1459
- | **Serious** | $2,000 | $40,000+ | 20x |
1460
- | **Moderate** | $500 | $5,000+ | 10x |
1461
- | **Low** | $100 | $500+ | 5x |
1462
-
1463
- ### Category Multipliers
1464
-
1465
- | Category | Multiplier | Why |
1466
- |----------|------------|-----|
1467
- | **Payment Bugs** | 25x | Direct financial loss, fraud exposure |
1468
- | **Data Loss** | 20x | Irrecoverable, legally actionable |
1469
- | **Secrets Exposed** | 15x | Immediate rotation + audit required |
1470
- | **SQL Injection** | 12x | Full system compromise possible |
1471
- | **Privacy Violations** | 10x | GDPR fines up to 4% of revenue |
1472
- | **Auth Bypass** | 10x | Complete security failure |
1473
- | **Crashes** | 8x | $5,600/minute average downtime |
1474
-
1475
- ### What It Detects
1476
-
1477
- - Floating-point arithmetic for money (use integer cents!)
1478
- - Rounding errors in financial calculations
1479
- - Dangerous DELETE/TRUNCATE statements
1480
- - Empty catch blocks swallowing errors
1481
- - Assignment in conditions (= instead of ===)
1482
-
1483
- ### Example Output
1484
-
1485
- ```
1486
- 💰 COST ANALYSIS REPORT
1487
- ═══════════════════════════════════════
1488
- 👥 User Scale: 250 users (Early stage)
1489
- └─ Costs scaled 1x from 250 baseline
1490
-
1491
- 💵 COST IMPACT
1492
- ├─ Fix now: $3.2k
1493
- ├─ If production: $28k
1494
- └─ Savings by fixing now: $24.8k ⚡
23
+ # Install Trie globally
24
+ npm install -g trie
1495
25
 
1496
- 💡 Default: 250 users. Scale with: trie scan --users 10000
26
+ # Set up in your project
27
+ cd your-project
28
+ trie init
1497
29
  ```
1498
30
 
1499
- ### Research Sources
1500
-
1501
- - **IBM Systems Sciences Institute**: Production bugs cost 30x more to fix
1502
- - **NIST**: $15k average production bug fix vs $500 in development
1503
- - **Ponemon Institute 2023**: $4.45M average data breach cost
1504
- - **Gartner**: $5,600/minute average downtime cost
1505
-
1506
- ---
1507
-
1508
- ## Legal Skill (v2.0)
1509
-
1510
- The Legal Skill 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.
1511
-
1512
- ### What It Covers (21 Categories)
1513
-
1514
- #### License & Open Source
1515
-
1516
- | Issue | Description |
1517
- |-------|-------------|
1518
- | **GPL/Copyleft Detection** | Flags GPL/AGPL code that may require your project to be open-sourced |
1519
- | **AGPL Network Use** | Critical warning for AGPL's SaaS/network copyleft provisions |
1520
- | **License Headers** | Missing SPDX identifiers in source files |
1521
- | **Dependency Audit** | Recommends license-checker tools for third-party packages |
1522
- | **Attribution Requirements** | MIT/BSD/Apache attribution obligations |
1523
-
1524
- #### Terms & Legal Documents
1525
-
1526
- | Issue | Description |
1527
- |-------|-------------|
1528
- | **Missing ToS** | User registration without Terms of Service reference |
1529
- | **Pre-checked Consent** | ToS acceptance boxes that are pre-checked (unenforceable) |
1530
- | **Privacy Policy** | Data collection without privacy policy disclosure |
1531
- | **CalOPPA** | California Online Privacy Protection Act requirements |
1532
-
1533
- #### Third-Party & API Compliance
1534
-
1535
- | Issue | Description |
1536
- |-------|-------------|
1537
- | **API Terms** | Detects OpenAI, Stripe, Meta, Google, Twilio, AWS, YouTube usage |
1538
- | **Font Licensing** | Flags font files that may require commercial licenses |
1539
- | **Stock Assets** | Attribution requirements for Unsplash, Pexels, etc. |
1540
-
1541
- #### Intellectual Property
1542
-
1543
- | Issue | Description |
1544
- |-------|-------------|
1545
- | **Code Attribution** | Stack Overflow code (CC BY-SA), copied code comments |
1546
- | **Trademark Usage** | Apple, Google, Microsoft, Amazon brand guideline compliance |
1547
-
1548
- #### Accessibility (Legal)
1549
-
1550
- | Issue | Description |
1551
- |-------|-------------|
1552
- | **ADA/Section 508** | Images without alt text, keyboard accessibility |
1553
- | **WCAG Violations** | Color-only indicators, missing video captions |
1554
-
1555
- #### Data Protection
1556
-
1557
- | Issue | Description |
1558
- |-------|-------------|
1559
- | **GDPR/CCPA** | Consent management, data portability, right to erasure |
1560
- | **Analytics Consent** | Tracking scripts without cookie consent |
1561
- | **Data Retention** | Missing retention policies and deletion procedures |
1562
-
1563
- #### E-Commerce & Payments
1564
-
1565
- | Issue | Description |
1566
- |-------|-------------|
1567
- | **PCI DSS** | Direct card handling instead of tokenization (Stripe, etc.) |
1568
- | **Price Transparency** | Hidden taxes/fees before checkout |
1569
- | **Subscription Cancellation** | FTC Click-to-Cancel Rule compliance |
1570
- | **Refund Policy** | Missing return/refund policy disclosure |
1571
-
1572
- #### Marketing & Advertising
1573
-
1574
- | Issue | Description |
1575
- |-------|-------------|
1576
- | **CAN-SPAM** | Marketing emails without unsubscribe mechanism |
1577
- | **TCPA** | SMS marketing without express written consent |
1578
- | **FTC Disclosure** | Affiliate links, sponsored content without disclosure |
1579
- | **Fake Reviews** | Synthetic/AI-generated testimonials |
1580
-
1581
- #### Age & Child Safety
1582
-
1583
- | Issue | Description |
1584
- |-------|-------------|
1585
- | **COPPA** | Child-directed content without parental consent |
1586
- | **Age Verification** | Alcohol, gambling, adult content without age gates |
31
+ ### 2. Run Your First Scan
1587
32
 
1588
- #### Export & International
1589
-
1590
- | Issue | Description |
1591
- |-------|-------------|
1592
- | **Export Controls (EAR)** | Strong encryption with international distribution |
1593
- | **OFAC Sanctions** | Missing sanctions screening for international users |
1594
- | **GDPR (EU)** | EU market without GDPR compliance |
1595
- | **LGPD (Brazil)** | Brazil market without LGPD compliance |
1596
- | **Cross-Border Transfers** | International data transfers without SCCs |
1597
-
1598
- #### User Content & Moderation
1599
-
1600
- | Issue | Description |
1601
- |-------|-------------|
1602
- | **Content Moderation** | User-generated content without moderation system |
1603
- | **DMCA Safe Harbor** | File uploads without takedown procedures |
1604
-
1605
- #### Contracts & Liability
1606
-
1607
- | Issue | Description |
1608
- |-------|-------------|
1609
- | **Clickwrap Enforceability** | Agreement acceptance without scroll/read verification |
1610
- | **Consent Recording** | Terms acceptance without timestamp/version logging |
1611
- | **Warranty Disclaimers** | Missing "AS IS" and limitation of liability |
1612
- | **Security Disclosure** | Missing security.txt or vulnerability disclosure process |
1613
-
1614
- ### Severity Levels
1615
-
1616
- | Level | Examples |
1617
- |-------|----------|
1618
- | **Critical** | AGPL in SaaS, PCI violations, TCPA SMS marketing, fake reviews |
1619
- | **Serious** | Missing ToS, no consent management, CAN-SPAM violations, COPPA |
1620
- | **Moderate** | Missing data portability, license attribution, content moderation |
1621
- | **Low** | License headers, security.txt, warranty disclaimers |
1622
-
1623
- ---
1624
-
1625
- ## Design Engineer Skill (v2.0)
1626
-
1627
- The Design Engineer skill has been rebuilt with a comprehensive 5-layer design intelligence architecture to detect "AI slop" and enforce professional design standards.
1628
-
1629
- ### What It Detects
1630
-
1631
- | Issue | Description |
1632
- |-------|-------------|
1633
- | **Surface Hierarchy** | Dark-on-dark surfaces with <8% lightness delta |
1634
- | **Neon Colors** | Oversaturated colors (>80% saturation) that look amateur |
1635
- | **Purple Overuse** | >40% violet/purple palette (common AI tell) |
1636
- | **Accent Rainbow** | Multiple accent hue families (>1) in same view |
1637
- | **Typography Uniformity** | Single font-weight usage lacking hierarchy |
1638
- | **Missing Modern Fonts** | System-only font stacks without Inter/Geist |
1639
- | **Magic Numbers** | Spacing values not on 4px grid |
1640
- | **Low Contrast** | Text failing WCAG AA (4.5:1 ratio) |
1641
-
1642
- ### Design Health Score
1643
-
1644
- Each scan produces a **Design Health Score** (0-100) with breakdown:
1645
- - Token adoption %
1646
- - Contrast compliance %
1647
- - Spacing consistency %
1648
- - Typography system %
1649
- - Surface hierarchy %
1650
-
1651
- ### Domain-Aware Recommendations
1652
-
1653
- The agent detects your product type and provides tailored guidance:
1654
-
1655
- | Domain | Default Mode | Accent Suggestions | Reference |
1656
- |--------|--------------|-------------------|-----------|
1657
- | **Fitness** | Dark | Orange, Tomato, Amber | Strava, Peloton |
1658
- | **Fintech** | Light | Sky, Teal, Grass | Mercury, Stripe |
1659
- | **Creative Tools** | Dark | Violet, Pink, Sky | Figma, Linear |
1660
- | **E-commerce** | Light | Tomato, Pink, Amber | Shopify, Glossier |
1661
- | **Dashboard** | Light | Blue, Indigo, Cyan | Vercel, Linear |
1662
-
1663
- ### Verified Token Sources
1664
-
1665
- Instead of hardcoding colors, the agent references external sources:
1666
- - **Radix Colors** — radix-ui.com/colors (contrast-guaranteed)
1667
- - **Tailwind CSS** — tailwindcss.com/docs (zinc/slate scales)
1668
- - **shadcn/ui** — ui.shadcn.com (production themes)
1669
-
1670
- ### Exported Constants
33
+ ```bash
34
+ # Scan your entire codebase
35
+ trie scan
1671
36
 
1672
- Design tokens are exported for use in other tools:
1673
-
1674
- ```typescript
1675
- import {
1676
- DESIGN_TOKEN_SOURCES,
1677
- TYPOGRAPHY_TOKENS,
1678
- SPACING_TOKENS,
1679
- MOTION_DESIGN_TOKENS,
1680
- DOMAIN_DESIGN_RULES,
1681
- } from '@triedotdev/mcp/agents/design-engineer';
37
+ # Quick health check
38
+ trie status
1682
39
  ```
1683
40
 
1684
- ---
41
+ ### 3. Start Teaching Trie
1685
42
 
1686
- ## Special Skills
43
+ When bugs happen, tell Trie about them:
1687
44
 
1688
- These skills are **manually invoked**—they don't run during regular guardian checks.
1689
-
1690
- ### Super Reviewer
45
+ ```bash
46
+ # Report an incident
47
+ trie tell "Users can't log in after the password reset"
1691
48
 
1692
- Interactive PR reviews: walks through changes file-by-file with AI guidance.
49
+ # Before pushing code
50
+ trie check
1693
51
 
1694
- ```
1695
- Run trie_super_reviewer on this PR
52
+ # Give feedback on warnings
53
+ trie ok # This warning was helpful
54
+ trie bad # This was a false alarm
1696
55
  ```
1697
56
 
1698
- ### Agent Smith
57
+ ## Why Trie Exists
1699
58
 
1700
- The ultimate AI code enforcer—35+ specialized pattern hunters targeting AI-generated anti-patterns. Runs a swarm of hunters to find "vibe-coded" patterns.
59
+ Building apps with AI tools like Cursor and Claude is incredibly fast - but maintaining them alone is a nightmare. You fix a bug and forget why it happened. The same issues keep coming back. Your codebase grows faster than your memory of it.
1701
60
 
1702
- ```
1703
- Run trie_agent_smith on this codebase
1704
- ```
61
+ Trie solves this by being your **persistent memory**. It remembers what broke before, learns patterns across your projects, and warns you before you ship risky code.
1705
62
 
1706
- ---
63
+ ## Key Features
1707
64
 
1708
- ## Custom Skills
65
+ ### Smart Memory
66
+ - **Git-based storage** - Your project's memory travels with your code in `.trie/` folder
67
+ - **Cross-project learning** - Patterns discovered in one project help prevent bugs in others
68
+ - **Incident tracking** - Build a searchable history of what went wrong and why
1709
69
 
1710
- Create your own skills from PDFs, style guides, or documentation. Custom skills are portable review rules that travel with your project—they work in Cursor, Claude Code, CI/CD, and everywhere in between.
70
+ ### Intelligent Analysis
71
+ - **26 built-in scouts** - Automated analyzers for security, performance, accessibility, and more
72
+ - **Custom skills** - Add external analyzers from the community
73
+ - **Risk scoring** - Intelligent priority ranking based on your actual incident history
1711
74
 
1712
- ### Create a Custom Skill
75
+ ### Development Integration
76
+ - **Git hooks** - Automatic checks before commits and pushes
77
+ - **Watch mode** - Real-time monitoring while you code
78
+ - **Fast performance** - Sub-500ms checks, won't slow down your workflow
1713
79
 
1714
- ```
1715
- Create a custom skill from my-style-guide.pdf called "brand_guidelines"
1716
- ```
80
+ ### Developer Experience
81
+ - **Plain English warnings** - "This auth change broke twice before" instead of cryptic codes
82
+ - **Multiple interfaces** - CLI, MCP tools for Claude/Cursor, visual dashboards
83
+ - **Flexible workflow** - Works with any editor, any git workflow, any deployment setup
1717
84
 
1718
- Or use the MCP tool directly:
85
+ ## How It Works
1719
86
 
1720
- ```
1721
- trie_create_skill with filePath: "./docs/style-guide.pdf", skillName: "brand_guidelines"
1722
- ```
87
+ ### The Guardian System
1723
88
 
1724
- ### How It Works
89
+ Trie uses a "Guardian Agent" architecture:
1725
90
 
1726
- 1. **Parse** Trie extracts text from your document (PDF, TXT, MD)
1727
- 2. **Compress** AI distills the document into actionable rules
1728
- 3. **Register** The skill is saved to `.trie/skills/custom/` and runs automatically during scans
91
+ 1. **Scouts** continuously analyze your code for potential issues
92
+ 2. **Guardian** receives scout reports and decides what matters based on your history
93
+ 3. **Memory Tree** stores incident patterns using a trie data structure for fast lookups
94
+ 4. **Learning Loop** improves predictions based on your feedback
1729
95
 
1730
- ### List Custom Skills
96
+ ### Memory That Travels
1731
97
 
1732
98
  ```
1733
- trie_list_skills
99
+ your-project/
100
+ ├── .trie/
101
+ │ ├── memory/ # Incident history
102
+ │ ├── patterns/ # Learned patterns
103
+ │ ├── context.json # Project knowledge graph
104
+ │ └── config.json # Settings
105
+ ├── src/
106
+ └── .git/
1734
107
  ```
1735
108
 
1736
- Custom skills are stored in `.trie/skills/custom/` in your project directory.
1737
-
1738
- ---
1739
-
1740
- ## External Skills
1741
-
1742
- Install reusable capabilities from Vercel, Anthropic, Expo, Stripe, Supabase, or any GitHub repository. Skills are knowledge/instructions that agents apply during code review.
1743
-
1744
- ### Key Concept: Agents vs Skills
1745
-
1746
- | | Agent (Brain) | Skill (Knowledge) |
1747
- |---|---------------|-------------------|
1748
- | **Decides when to run** | Yes | No - invoked by agent |
1749
- | **Has its own logic** | Yes | No - detection patterns |
1750
- | **Makes decisions** | Yes | No - follows rules |
1751
- | **Examples** | SecurityAgent, TriagerAgent | react-best-practices, brand_guidelines |
1752
-
1753
- **Two types of skills:**
1754
- - **External Skills** — Installed from GitHub repos (e.g., `vercel-labs/agent-skills`)
1755
- - **Custom Skills** — Created from your documents (PDFs, style guides, books)
1756
-
1757
- Both skill types are applied by the **skill-review agent** during scans and travel with your project.
109
+ The `.trie/` folder commits with your code, so your project's intelligence is preserved and shared across:
110
+ - Local development
111
+ - CI/CD pipelines
112
+ - Team members
113
+ - Different machines
1758
114
 
1759
- ### Install a Skill
115
+ ## Core Workflow
1760
116
 
1761
- **CLI:**
117
+ ### 1. Teaching Phase
1762
118
  ```bash
1763
- # From Vercel's skills repository
1764
- trie-agent skills add vercel-labs/agent-skills vercel-react-best-practices
119
+ # Something breaks in production
120
+ trie tell "Payment processing failed for EU customers"
1765
121
 
1766
- # From Anthropic's skills
1767
- trie-agent skills add anthropics/skills frontend-design
1768
-
1769
- # From any GitHub repo with a SKILL.md
1770
- trie-agent skills add myorg/internal-standards code-style
1771
- ```
1772
-
1773
- **Using MCP (Cursor/Claude Code):**
1774
- ```
1775
- Install the vercel-react-best-practices skill from vercel-labs/agent-skills
1776
- ```
1777
-
1778
- ### Browse Available Skills
1779
-
1780
- Trie includes 150+ skills organized into 12 categories:
1781
-
1782
- ```bash
1783
- # List all categories
1784
- trie-agent skills list categories
1785
-
1786
- # Browse skills by category
1787
- trie-agent skills list marketing # 23 skills (SEO, copywriting, CRO, etc.)
1788
- trie-agent skills list development # 25 skills (TDD, debugging, code review, etc.)
1789
- trie-agent skills list security # 10 skills (semgrep, codeql, Trail of Bits, etc.)
1790
- trie-agent skills list design # 9 skills (canvas, brand, UI/UX, etc.)
1791
- trie-agent skills list documents # 5 skills (pdf, xlsx, pptx, docx, etc.)
1792
- trie-agent skills list productivity # 17 skills (meetings, diagrams, READMEs, etc.)
122
+ # Trie learns: "payments/" + "EU" + "failed" = high risk pattern
1793
123
  ```
1794
124
 
1795
- ### List Installed Skills
1796
-
125
+ ### 2. Prevention Phase
1797
126
  ```bash
1798
- trie-agent skills list
1799
- ```
127
+ # Later, you modify payment code
128
+ git add src/payments/eu-handler.js
129
+ git commit -m "Update EU payment logic"
1800
130
 
1801
- Output:
131
+ # Trie warns: "This area broke 2 weeks ago with EU payments. Consider extra testing."
1802
132
  ```
1803
- Installed Skills (2):
1804
-
1805
- vercel-react-best-practices (applied 12x)
1806
- React and Next.js performance optimization
1807
- Source: vercel-labs/agent-skills
1808
133
 
1809
- web-design-guidelines (applied 8x)
1810
- Modern web design patterns and accessibility
1811
- Source: vercel-labs/agent-skills
134
+ ### 3. Feedback Loop
135
+ ```bash
136
+ # Warning was helpful
137
+ trie ok
1812
138
 
1813
- These skills are applied by the skill-review agent during scans.
139
+ # Warning was wrong
140
+ trie bad
1814
141
 
1815
- Explore more: trie skills list categories
142
+ # Trie adjusts confidence for similar future warnings
1816
143
  ```
1817
144
 
1818
- ### How It Works
145
+ ## Advanced Features
1819
146
 
1820
- 1. **Install** - Skills are cloned from GitHub to `.trie/skills/`
1821
- 2. **Load** - The skill-review agent loads installed skills on startup
1822
- 3. **Apply** - During scans, the agent applies skill knowledge to code review
1823
- 4. **Track** - Usage is recorded in your project context
1824
-
1825
- ### Remove a Skill
147
+ ### Goals & Hypotheses
148
+ Set improvement goals and test theories:
1826
149
 
1827
150
  ```bash
1828
- trie-agent skills remove react-best-practices
1829
- ```
151
+ # Set a goal
152
+ trie goal add "Reduce authentication bugs by 50%"
1830
153
 
1831
- ### Skill Format
1832
-
1833
- Skills follow the [Agent Skills specification](https://agentskills.io/specification):
154
+ # Add a hypothesis
155
+ trie hypothesis add "Code reviews reduce bug rate"
1834
156
 
1835
- ```
1836
- skill-name/
1837
- SKILL.md # Required: YAML frontmatter + instructions
1838
- scripts/ # Optional: executable code
1839
- references/ # Optional: additional docs
1840
- assets/ # Optional: templates, data
157
+ # Trie tracks progress and validates hypotheses over time
1841
158
  ```
1842
159
 
1843
- Example SKILL.md:
1844
- ```yaml
1845
- ---
1846
- name: react-best-practices
1847
- description: React and Next.js performance optimization
1848
- ---
160
+ ### Watch Mode
161
+ Real-time monitoring with visual dashboard:
1849
162
 
1850
- # React Best Practices
1851
-
1852
- ## Guidelines
1853
- 1. Avoid creating components inside render
1854
- 2. Use React.memo for expensive components
1855
- 3. Prefer useCallback for event handlers
1856
- ...
163
+ ```bash
164
+ trie watch
1857
165
  ```
1858
166
 
1859
- ### MCP Resource
167
+ Interactive panels for goals, memory, scout activity, and more.
1860
168
 
1861
- Access installed skills via MCP:
1862
- ```
1863
- Read trie://skills
1864
- ```
169
+ ### Integration with AI Coding Tools
1865
170
 
1866
- ### Skill Sources
1867
-
1868
- Skills can come from any GitHub repository with a SKILL.md file:
1869
-
1870
- | Source | Examples |
1871
- |--------|----------|
1872
- | [Vercel](https://skills.sh) | vercel-react-best-practices, web-design-guidelines |
1873
- | [Anthropic](https://github.com/anthropics/skills) | frontend-design, webapp-testing, mcp-builder, pdf, xlsx, docx |
1874
- | [Expo](https://github.com/expo/skills) | building-native-ui, upgrading-expo, expo-deployment (9 skills) |
1875
- | [Stripe](https://github.com/stripe/ai) | stripe-best-practices |
1876
- | [Better Auth](https://github.com/better-auth/skills) | better-auth-best-practices, create-auth-skill |
1877
- | [Remotion](https://github.com/remotion-dev/skills) | remotion-best-practices |
1878
- | [Callstack](https://github.com/callstackincubator/agent-skills) | react-native-best-practices |
1879
- | [Supabase](https://github.com/supabase/agent-skills) | supabase-postgres-best-practices |
1880
- | [Trail of Bits](https://github.com/trailofbits/skills) | semgrep, codeql, secure-workflow-guide (10 skills) |
1881
- | [Vue/Nuxt](https://github.com/hyf0/vue-skills) | vue-best-practices, pinia-best-practices |
1882
- | [Three.js](https://github.com/cloudai-x/threejs-skills) | threejs-fundamentals, threejs-animation (10 skills) |
1883
- | [obra/superpowers](https://github.com/obra/superpowers) | test-driven-development, systematic-debugging (14 skills) |
1884
- | [Marketing](https://github.com/coreyhaines31/marketingskills) | seo-audit, copywriting, pricing-strategy (23 skills) |
1885
- | Your org | Internal standards, style guides, compliance docs |
1886
-
1887
- ### Auto-Suggested Skills
1888
-
1889
- When you run `trie init`, Trie automatically detects your dependencies and suggests relevant skills:
1890
-
1891
- | Dependency | Skills Suggested |
1892
- |------------|------------------|
1893
- | `next`, `react` | vercel-react-best-practices, web-design-guidelines, frontend-design |
1894
- | `vue`, `nuxt` | vue-best-practices, pinia-best-practices, nuxt skills |
1895
- | `expo` | 9 Expo skills (building-native-ui, upgrading-expo, etc.) |
1896
- | `three` | 10 Three.js skills (fundamentals, animation, shaders, etc.) |
1897
- | `@supabase/supabase-js` | supabase-postgres-best-practices |
1898
- | `stripe` | stripe-best-practices |
1899
- | `better-auth` | better-auth-best-practices |
1900
- | `playwright` | webapp-testing, e2e-testing-patterns |
1901
- | `tailwindcss` | tailwind-design-system, responsive-design |
1902
- | `typescript` | typescript-advanced-types |
1903
- | And 20+ more... | Run `trie init` to see suggestions for your stack |
1904
-
1905
- ### Skill Gating
1906
-
1907
- Skills can declare requirements in their frontmatter. Only skills whose requirements are met are loaded.
1908
-
1909
- **Simple (backwards compatible):**
1910
-
1911
- ```yaml
1912
- ---
1913
- name: react-best-practices
1914
- description: React and Next.js optimization
1915
- requires: [react, next]
1916
- ---
1917
- ```
171
+ Trie provides MCP (Model Context Protocol) tools for seamless integration with Claude, Cursor, and other AI assistants:
1918
172
 
1919
- **Extended requirements:**
1920
-
1921
- ```yaml
1922
- ---
1923
- name: docker-deploy-skill
1924
- description: Docker deployment best practices
1925
- requirements:
1926
- deps: [docker-compose] # npm deps (all required)
1927
- anyDeps: [react, vue, svelte] # At least one required
1928
- env: [DOCKER_HOST, CI] # Environment variables
1929
- bins: [docker, kubectl] # Binaries in PATH
1930
- configFiles: [Dockerfile] # Files that must exist
1931
- ---
1932
- ```
173
+ - `trie_scan` - Analyze code with AI-friendly output
174
+ - `trie_check` - Quick risk assessment
175
+ - `trie_tell` - Report incidents
176
+ - `trie_memory` - Search incident history
177
+ - `trie_fix` - Apply suggested fixes
1933
178
 
1934
- | Check | What It Does |
1935
- |-------|--------------|
1936
- | `deps` | All listed npm packages must be in package.json |
1937
- | `anyDeps` | At least one must be present (OR condition) |
1938
- | `env` | Environment variables must be set |
1939
- | `bins` | Binaries must be available in PATH |
1940
- | `configFiles` | Files must exist in project root |
179
+ ## Built-in Scouts
1941
180
 
1942
- When you install skills, they're automatically filtered based on your project:
1943
- - A React skill with `requires: [react]` only loads in React projects
1944
- - A Docker skill with `requirements.bins: [docker]` only loads when Docker is installed
1945
- - Skills without requirements always load
181
+ Trie includes 26 specialized analyzers:
1946
182
 
1947
- This prevents irrelevant skills from cluttering your scans.
183
+ ### Security & Compliance
184
+ - **Security Scout** - Vulnerabilities, injection risks, secrets
185
+ - **Privacy Scout** - PII handling, GDPR/HIPAA compliance
186
+ - **Legal Scout** - Regulatory compliance patterns
187
+ - **SOC2 Scout** - Access controls, audit trails
1948
188
 
1949
- ---
189
+ ### Code Quality
190
+ - **Bug Scout** - Common bugs, edge cases, null safety
191
+ - **Architecture Scout** - SOLID principles, scalability issues
192
+ - **Types Scout** - Type errors, missing annotations
193
+ - **Clean Scout** - AI-generated code cleanup
1950
194
 
1951
- ## Bootstrap System
195
+ ### User Experience
196
+ - **Accessibility Scout** - WCAG compliance, screen readers
197
+ - **UX Scout** - User journey analysis, usability issues
198
+ - **Design Scout** - Visual consistency, design systems
1952
199
 
1953
- Trie works out of the box - no setup required. Run `trie init` to optionally create context files for customization.
200
+ ### Operations
201
+ - **DevOps Scout** - Configuration issues, deployment patterns
202
+ - **Performance Scout** - Speed bottlenecks, optimization opportunities
1954
203
 
1955
- ### Files (all optional)
204
+ [View all scouts →](#built-in-scouts)
1956
205
 
1957
- | File | Purpose |
1958
- |------|---------|
1959
- | `.trie/RULES.md` | Your coding standards (edit to customize) |
1960
- | `.trie/TEAM.md` | Team ownership and escalation paths |
1961
- | `.trie/PROJECT.md` | Project overview and conventions |
1962
- | `.trie/BOOTSTRAP.md` | First-run checklist (auto-deleted when complete) |
206
+ ## Installation & Setup
1963
207
 
1964
- ### Initialize
208
+ ### Requirements
209
+ - Node.js 16 or higher
210
+ - Git repository
1965
211
 
1966
- **CLI:**
212
+ ### Installation
1967
213
  ```bash
1968
- trie init
1969
- ```
1970
-
1971
- **MCP:**
1972
- ```
1973
- trie_init
1974
- ```
1975
-
1976
- This auto-detects your stack and suggests relevant skills:
214
+ # Install globally
215
+ npm install -g trie
1977
216
 
217
+ # Or use npx for one-time runs
218
+ npx trie scan
1978
219
  ```
1979
- Detected Stack:
1980
- Framework: Next.js 14.0.0
1981
- Language: TypeScript
1982
- Database: Supabase
1983
- Auth: Better Auth
1984
-
1985
- Suggested Skills (based on your stack):
1986
- trie skills add vercel-labs/agent-skills vercel-react-best-practices
1987
- trie skills add vercel-labs/agent-skills web-design-guidelines
1988
- trie skills add supabase/agent-skills supabase-postgres-best-practices
1989
- trie skills add better-auth/skills better-auth-best-practices
1990
- trie skills add wshobson/agents typescript-advanced-types
1991
-
1992
- Explore skill categories:
1993
- trie skills list documents # 5 skills
1994
- trie skills list marketing # 23 skills
1995
- trie skills list development # 25 skills
1996
- trie skills list security # 10 skills
1997
- trie skills list productivity # 17 skills
1998
- trie skills list categories # see all 12 categories
1999
-
2000
- Browse all skills: https://skills.sh
2001
- ```
2002
-
2003
- ### Commands
2004
220
 
221
+ ### Project Setup
2005
222
  ```bash
2006
- # Initialize bootstrap files
223
+ # Initialize in your project
224
+ cd your-project
2007
225
  trie init
2008
226
 
2009
- # Check bootstrap status
2010
- trie init status
2011
-
2012
- # Mark bootstrap complete (deletes BOOTSTRAP.md)
2013
- trie init complete
227
+ # This creates:
228
+ # - .trie/ directory with initial config
229
+ # - Git hooks for automatic checking
230
+ # - Bootstrap files (optional)
2014
231
  ```
2015
232
 
2016
- ### MCP Resources
233
+ ### AI Tool Integration
2017
234
 
235
+ **For Claude (MCP)**:
236
+ Add to your MCP settings:
237
+ ```json
238
+ {
239
+ "mcpServers": {
240
+ "trie": {
241
+ "command": "trie",
242
+ "args": ["mcp"]
243
+ }
244
+ }
245
+ }
2018
246
  ```
2019
- trie://bootstrap # Bootstrap status
2020
- trie://rules # User-defined coding standards
2021
- trie://team # Team ownership info
2022
- ```
2023
-
2024
- ---
2025
-
2026
- ## Issue Memory
2027
-
2028
- Trie stores all detected incidents for search, pattern discovery, and cross-project learning. Uses BM25 ranking (same algorithm as Elasticsearch) for intelligent search with intelligent deduplication and capacity management.
2029
-
2030
- ### Memory System
2031
247
 
2032
- **Data Integrity & Capacity Management:**
2033
- - **Atomic writes**: Temp file + rename pattern prevents corruption on crash/interrupt
2034
- - **SHA256 hashing**: Cryptographic deduplication (no collision risk)
2035
- - **Intelligent deduplication**: Same pattern stored once with occurrence count (e.g., 2,481 `parseInt` issues → 1 pattern with count)
2036
- - **1,000 issue cap**: Automatic intelligent pruning prioritizes recent, high-severity, unresolved issues
2037
- - **Capacity warnings**: Clear notifications at 80%/100% with actionable recommendations
2038
- - **Memory purge**: Four strategies (smart/resolved/old/all) for managing storage
2039
- - **Deduplication metrics**: Track duplicates avoided and unique patterns
2040
- - **Backup rotation**: 5 automated backups with recovery commands
2041
- - **Zod validation**: Schema validation catches malformed data early
248
+ **For Cursor/VS Code**:
249
+ Install the Trie extension from your editor's marketplace.
2042
250
 
2043
- JSON files perform well at Trie's scale (1,000-10,000 issues). SQLite, vector embeddings, and session management add complexity without proportional value for a security scanning CLI tool.
251
+ ## CLI Reference
2044
252
 
2045
- ### Local Memory (`.trie/memory/`)
2046
-
2047
- Incidents from each `trie tell` command are stored locally:
2048
- - `issues.json` - Searchable incident index with BM25 ranking (max 1,000 active issues)
2049
- - `compacted-summaries.json` - Historical summaries from auto-compaction
2050
- - `patterns.json` - Discovered patterns (3+ incidents with confidence scores)
2051
- - `YYYY-MM-DD.md` - Daily incident logs (human-readable)
2052
-
2053
- ### Memory Capacity Management
2054
-
2055
- When approaching the 1,000 issue cap, Trie provides clear warnings and purge options:
2056
-
2057
- **CLI:**
253
+ ### Basic Commands
2058
254
  ```bash
2059
- # Check memory capacity and stats
2060
- trie memory stats
2061
-
2062
- # Smart purge (recommended): Remove resolved & old low-priority issues
2063
- trie memory purge smart
2064
-
2065
- # Remove all resolved issues
2066
- trie memory purge resolved
2067
-
2068
- # Remove issues older than N days (default 90)
2069
- trie memory purge old 60
2070
-
2071
- # Clear all issues (keeps historical summaries, requires --confirm)
2072
- trie memory purge all --confirm
255
+ trie init # Set up Trie in your project
256
+ trie scan # Analyze codebase with intelligent skill selection
257
+ trie status # View project health and memory stats
258
+ trie check # Quick risk check before pushing (< 500ms)
259
+ trie tell "<msg>" # Report an incident to build memory
2073
260
  ```
2074
261
 
2075
- **MCP:**
2076
- ```
2077
- trie_memory action="stats" # View capacity info
2078
- trie_memory action="purge" purgeStrategy="smart" # Smart purge
2079
- trie_memory action="purge" purgeStrategy="old" daysOld=60
2080
- ```
2081
-
2082
- **What happens at capacity:**
2083
- - **At 80%**: Info message suggesting smart purge
2084
- - **At 100%**: Warning with all purge options and automatic intelligent pruning
2085
- - **Automatic compaction**: Old issues (>30 days) automatically compacted into summaries
2086
- - **Intelligent pruning**: If still >1,000, keeps recent, high-severity, and unresolved issues
2087
-
2088
- ### Search Incidents
2089
-
2090
- **CLI:**
262
+ ### Memory Management
2091
263
  ```bash
2092
- # Search by keyword
2093
- trie memory search "SQL injection"
2094
-
2095
- # View recent incidents
2096
- trie memory recent
2097
-
2098
- # Show statistics and capacity
2099
- trie memory stats
264
+ trie memory search "auth" # Search incident history
265
+ trie memory stats # View memory statistics
266
+ trie memory purge smart # Clean up old/resolved issues
2100
267
  ```
2101
268
 
2102
- **MCP:**
2103
- ```
2104
- trie_memory action="search" query="SQL injection"
2105
- trie_memory action="stats"
2106
- trie_memory action="recent" limit=10
2107
- ```
2108
-
2109
- ### Cross-Project Memory (`~/.trie/memory/`)
2110
-
2111
- Patterns are tracked across all your projects. After each `trie scan` or `trie tell`, patterns are automatically recorded to your home directory (`~/.trie/memory/`) for cross-project learning—no manual sync needed.
2112
-
269
+ ### Goals & Learning
2113
270
  ```bash
2114
- # View patterns across projects
2115
- trie memory global patterns
2116
-
2117
- # List tracked projects
2118
- trie memory global projects
2119
-
2120
- # Search global patterns
2121
- trie memory global search "authentication"
2122
- ```
2123
-
2124
- ### How It Works
2125
-
2126
- 1. **Automatic Sync**: Every `trie scan` and `trie tell` writes to both local (`.trie/memory/`) and global (`~/.trie/memory/`) memory automatically
2127
- 2. **BM25 Search**: Uses term frequency, inverse document frequency, and document length normalization for ranking
2128
- 3. **Pattern Detection**: After 3+ incidents in same area, pattern is automatically created with confidence score
2129
- 4. **Cross-Project Tracking**: Same pattern in multiple projects increments occurrence count and tracks which projects have it
2130
- 5. **Confidence Updates**: `trie ok` / `trie bad` feedback adjusts pattern confidence immediately
2131
- 6. **Trie-Powered Discovery**: Hot path detection via tree traversal completes in < 10ms
2132
-
2133
- ### Memory Structure
2134
-
271
+ trie goal add "<goal>" # Set improvement goal
272
+ trie hypothesis add "<theory>" # Test a hypothesis
273
+ trie goal list # View progress
2135
274
  ```
2136
- .trie/memory/ # Local (per-project, committed to git)
2137
- ├── issues.json # All incidents with metadata
2138
- ├── compacted-summaries.json # Historical summaries (auto-compacted)
2139
- ├── 2024-01-15.md # Daily log
2140
- └── 2024-01-16.md
2141
-
2142
- ~/.trie/memory/ # Global (home directory, cross-project)
2143
- ├── global-patterns.json # Patterns seen across projects
2144
- ├── GLOBAL_MEMORY.md # Auto-generated summary
2145
- └── projects/ # Per-project summaries
2146
- ├── my-app.json
2147
- └── another-project.json
2148
- ```
2149
-
2150
- ---
2151
-
2152
- ## Project Info Registry
2153
-
2154
- Store important project-specific information in `.trie/PROJECT.md` that's automatically available to all AI tools.
2155
-
2156
- ### Why Project Info?
2157
-
2158
- When you work across multiple tools (Cursor, Claude Code, GitHub Actions, CLI), context gets lost. The Project Info Registry solves this by providing a single source of truth for:
2159
-
2160
- - Project description and purpose
2161
- - Technology stack and frameworks
2162
- - Architecture decisions and patterns
2163
- - Coding conventions and style guidelines
2164
- - Environment info (URLs, API endpoints)
2165
- - Team ownership and contacts
2166
- - Compliance requirements
2167
- - Custom instructions for AI assistants
2168
-
2169
- ### Create PROJECT.md
2170
275
 
2171
- **Using CLI:**
276
+ ### Feedback & Training
2172
277
  ```bash
2173
- trie-agent project init
278
+ trie ok # Last warning was helpful
279
+ trie bad # Last warning was wrong
280
+ trie pause # Disable warnings for 1 hour
2174
281
  ```
2175
282
 
2176
- **Using MCP (Cursor/Claude Code):**
2177
- ```
2178
- trie_project action="init"
2179
- ```
2180
-
2181
- This creates a template at `.trie/PROJECT.md` with sections ready to fill in.
2182
-
2183
- ### View Project Info
2184
-
2185
- **CLI:**
283
+ ### Watch Mode
2186
284
  ```bash
2187
- trie-agent project
2188
- ```
2189
-
2190
- **MCP:**
2191
- ```
2192
- trie_project action="view"
2193
- ```
2194
-
2195
- **MCP Resource:**
2196
- ```
2197
- Read trie://project
2198
- ```
2199
-
2200
- ### Update Sections
2201
-
2202
- **MCP:**
2203
- ```
2204
- trie_project action="update" section="Technology Stack" content="- **Language:** TypeScript\n- **Framework:** Next.js 14\n- **Database:** PostgreSQL"
2205
- ```
2206
-
2207
- ### How It Works
2208
-
2209
- ```
2210
- your-project/
2211
- ├── .trie/
2212
- │ └── PROJECT.md ← Your project context
2213
- ├── src/
2214
- └── package.json
2215
- ```
2216
-
2217
- The PROJECT.md file is:
2218
- - **Committed to git** — context travels with your code
2219
- - **Available via `trie://project`** — AI tools can read it directly
2220
- - **Integrated into `trie://context`** — included in overall project context
2221
- - **Per-project** — each project has its own file
2222
-
2223
- ### Template Sections
2224
-
2225
- | Section | What to Include |
2226
- |---------|-----------------|
2227
- | **Project Overview** | What does this project do? Who is it for? |
2228
- | **Technology Stack** | Languages, frameworks, databases, cloud services |
2229
- | **Architecture** | Key patterns, system design, important decisions |
2230
- | **Coding Conventions** | Style rules, naming conventions, patterns to follow |
2231
- | **Environment** | Dev/staging/prod URLs, API endpoints |
2232
- | **Team** | Who owns what, contact info |
2233
- | **Compliance** | GDPR, SOC2, HIPAA requirements |
2234
- | **AI Instructions** | Special instructions for AI assistants |
2235
-
2236
- ### Example PROJECT.md
2237
-
2238
- ```markdown
2239
- ## Project Overview
2240
-
2241
- E-commerce platform for sustainable products.
2242
- Focus on fast checkout and mobile-first UX.
2243
-
2244
- ## Technology Stack
2245
-
2246
- - **Language:** TypeScript
2247
- - **Framework:** Next.js 14 (App Router)
2248
- - **Database:** PostgreSQL with Prisma ORM
2249
- - **Hosting:** Vercel + Supabase
2250
-
2251
- ## Architecture
2252
-
2253
- - Server Components by default, Client Components only when needed
2254
- - tRPC for type-safe API calls
2255
- - Zustand for client state
2256
-
2257
- ## Coding Conventions
2258
-
2259
- - Use `pnpm` for package management
2260
- - Prefer named exports over default exports
2261
- - Use Tailwind CSS, no inline styles
2262
- - Tests required for payment-related code
2263
-
2264
- ## AI Instructions
2265
-
2266
- When working on this project:
2267
- 1. Always use Server Components unless client interactivity is needed
2268
- 2. Check for accessibility issues (we target WCAG AA)
2269
- 3. Payment code must be reviewed by security agent before commit
2270
- ```
2271
-
2272
- ### Multi-Project Support
2273
-
2274
- Each project has its own `.trie/PROJECT.md`:
2275
-
285
+ trie watch # Start interactive monitoring dashboard
2276
286
  ```
2277
- ~/projects/
2278
- ├── project-a/.trie/PROJECT.md ← Project A's context
2279
- ├── project-b/.trie/PROJECT.md ← Project B's context
2280
- └── project-c/.trie/PROJECT.md ← Project C's context
2281
- ```
2282
-
2283
- When you open Project A in Cursor, it reads Project A's context. Switch to Project B, and it reads Project B's context. No configuration needed.
2284
-
2285
- ---
2286
-
2287
- ## AI-Enhanced Mode
2288
-
2289
- Trie works in two modes:
2290
-
2291
- | Mode | Description |
2292
- |------|-------------|
2293
- | **Pattern-Only** (default) | Fast regex matching for specific patterns (exposed secrets, async forEach, etc.). Limited coverage. |
2294
- | **AI-Enhanced** | Full analysis: pattern detection + AI validation + deeper issue discovery. **Recommended.** |
2295
287
 
2296
- ### Enable AI Mode
2297
-
2298
- **For MCP usage (Cursor/Claude Code):**
2299
-
2300
- Add the API key to your MCP configuration:
288
+ ## Configuration
2301
289
 
290
+ ### Scan Behavior
291
+ Create `.trie/config.json`:
2302
292
  ```json
2303
293
  {
2304
- "mcpServers": {
2305
- "Trie": {
2306
- "command": "npx",
2307
- "args": ["@triedotdev/mcp"],
2308
- "env": {
2309
- "ANTHROPIC_API_KEY": "sk-ant-..."
2310
- }
2311
- }
294
+ "scanOptions": {
295
+ "maxConcurrency": 4,
296
+ "timeoutMs": 30000,
297
+ "includeNodeModules": false
298
+ },
299
+ "autoEscalation": {
300
+ "enabled": true,
301
+ "webhookUrl": "https://hooks.slack.com/...",
302
+ "quietHours": { "start": "21:00", "end": "08:00" }
2312
303
  }
2313
304
  }
2314
305
  ```
2315
306
 
2316
- **For CLI usage (terminal/CI):**
2317
-
2318
- Add the API key to your project's `.env.local` file:
307
+ ### Git Hooks
308
+ Installed automatically with `trie init`:
2319
309
 
2320
- ```bash
2321
- echo 'ANTHROPIC_API_KEY=sk-ant-...' >> .env.local
2322
- ```
2323
-
2324
- Then load it before running CLI commands:
310
+ - **pre-commit** - Quick scan of staged files
311
+ - **post-commit** - Update context graph
312
+ - **pre-push** - Block critical issues (can be bypassed)
2325
313
 
314
+ To bypass:
2326
315
  ```bash
2327
- set -a; source .env.local; set +a
2328
- trie-agent scan
316
+ git push --no-verify # Skip all hooks
317
+ TRIE_BYPASS=1 git push # Skip Trie but log bypass
2329
318
  ```
2330
319
 
2331
- > **Important:** MCP config only applies to the MCP server. CLI commands need the key in your shell environment.
2332
-
2333
- When AI is enabled, you'll see:
2334
- - `AI-powered analysis enabled` in output
2335
- - `[AI VALIDATED]` and `[AI FOUND]` tags on issues
2336
- - Richer fix recommendations
2337
-
2338
- ---
2339
-
2340
320
  ## CI/CD Integration
2341
321
 
2342
- The guardian agent works in CI/CD by reading your project's `.trie/` directory—the same memory, patterns, and incident history you've built locally.
2343
-
2344
- ### Quick Setup (Recommended)
2345
-
2346
- Use the `trie ci` command to generate a GitHub Actions workflow:
2347
-
322
+ ### GitHub Actions
2348
323
  ```bash
2349
- # Generate full workflow with SARIF + memory caching
2350
- trie ci
324
+ # Generate workflow file
325
+ trie ci github
2351
326
 
2352
- # Generate minimal workflow
2353
- trie ci --minimal
327
+ # Creates .github/workflows/trie.yml with:
328
+ # - Full codebase scan
329
+ # - Memory caching for speed
330
+ # - SARIF upload for GitHub Security tab
331
+ ```
2354
332
 
2355
- # Preview without creating files
2356
- trie ci --dry-run
333
+ ### Custom CI
334
+ ```bash
335
+ # In your CI pipeline
336
+ npm install -g trie
337
+ trie scan --output=sarif > trie-results.sarif
2357
338
  ```
2358
339
 
2359
- **What it creates:**
340
+ ## Memory System
2360
341
 
2361
- `.github/workflows/trie-scan.yml` with:
2362
- - Memory caching across runs (enables cross-run learning)
2363
- - SARIF output for GitHub Security tab
2364
- - Pattern recognition: "This issue was introduced 3 PRs ago"
2365
- - Trend tracking: improving, stable, or declining
2366
- - ✅ Historical context: "Similar issue fixed in PR #42"
342
+ ### Local Memory
343
+ Each project stores its own memory in `.trie/memory/`:
344
+ - Incident reports and patterns
345
+ - Risk scores and confidence levels
346
+ - Performance over time
2367
347
 
2368
- **Next steps after running `trie ci`:**
348
+ ### Cross-Project Memory
349
+ Global patterns stored in `~/.trie/memory/`:
350
+ - Patterns that apply across projects
351
+ - Skill effectiveness data
352
+ - Your personal coding patterns
2369
353
 
2370
- 1. Add `ANTHROPIC_API_KEY` to GitHub Secrets (Settings → Secrets → Actions)
2371
- 2. Commit and push:
2372
- ```bash
2373
- git add .github/workflows/trie-scan.yml
2374
- git commit -m "Add Trie security scan with memory"
2375
- git push
2376
- ```
354
+ ### Memory Management
355
+ ```bash
356
+ # View capacity (default: 10,000 issues)
357
+ trie memory stats
2377
358
 
2378
- ### GitHub Actions
359
+ # Smart cleanup (removes resolved + old low-priority)
360
+ trie memory purge smart
2379
361
 
2380
- **Manual setup (alternative):**
2381
-
2382
- Or manually add to `.github/workflows/trie.yml`:
2383
-
2384
- ```yaml
2385
- name: Trie Guardian
2386
- on: [push, pull_request]
2387
-
2388
- jobs:
2389
- check:
2390
- runs-on: ubuntu-latest
2391
- steps:
2392
- - uses: actions/checkout@v4
2393
- with:
2394
- fetch-depth: 0 # Need git history for incident context
2395
-
2396
- - name: Guardian Check
2397
- run: |
2398
- npx @triedotdev/mcp check --fail-on=critical
2399
- ```
362
+ # Remove all resolved issues
363
+ trie memory purge resolved
2400
364
 
2401
- ### What Happens in CI
2402
-
2403
- 1. **Reads memory**: Loads `.trie/memory/` (incidents, patterns)
2404
- 2. **Checks changes**: Analyzes files in current commit
2405
- 3. **Risk assessment**: Uses incident history + patterns for scoring
2406
- 4. **Plain English**: Reports warnings just like locally
2407
- 5. **Fails build**: If critical issues detected (configurable)
2408
-
2409
- ### Memory Caching Benefits
2410
-
2411
- When you use `trie ci` to generate workflows, memory is cached across runs:
2412
-
2413
- - **Pattern recognition**: "This issue was introduced 3 PRs ago"
2414
- - **Historical context**: "Similar issue was fixed in PR #42"
2415
- - **Trend tracking**: Improving, stable, or declining
2416
- - **Resolution tracking**: Knows when issues get fixed
2417
- - **Cross-PR learning**: Patterns from one PR inform future PRs
2418
-
2419
- ### Advanced Examples
2420
-
2421
- See `.github/workflows/examples.md` for comprehensive workflow examples:
2422
- - Multi-environment scanning (dev/staging/prod)
2423
- - Scheduled security audits
2424
- - Custom output processing
2425
- - Integration with existing tools (ESLint, Snyk, etc.)
2426
- - Memory persistence strategies
2427
- - Organization-wide memory sharing
2428
- - Compliance reporting (SOC2, etc.)
2429
-
2430
- ### Full Skill Scan
2431
-
2432
- For deeper analysis (security, privacy, etc.), add a weekly/nightly job:
2433
-
2434
- ```yaml
2435
- name: Weekly Guardian Scan
2436
- on:
2437
- schedule:
2438
- - cron: '0 2 * * 1' # Monday 2am
2439
-
2440
- jobs:
2441
- full-scan:
2442
- runs-on: ubuntu-latest
2443
- steps:
2444
- - uses: actions/checkout@v4
2445
- - name: Run full scan
2446
- run: |
2447
- npx @triedotdev/mcp scan --skills security,privacy,soc2
365
+ # Remove issues older than 90 days
366
+ trie memory purge old --days=90
2448
367
  ```
2449
368
 
2450
- ---
2451
-
2452
- ## Configuration
2453
-
2454
- ### Scan Options
2455
-
2456
- | Option | Description | Default |
2457
- |--------|-------------|---------|
2458
- | `parallel` | Run agents in parallel | `true` |
2459
- | `cache` | Enable result caching | `true` |
2460
- | `maxConcurrency` | Max parallel agents | `4` |
2461
- | `timeoutMs` | Agent timeout in milliseconds | `120000` |
2462
- | `streaming` | Stream progress updates | `true` |
2463
- | `workers` | Use worker threads | `true` |
2464
-
2465
- ### Auto-Escalation Setup
369
+ ## Custom Skills
2466
370
 
2467
- Auto-escalate critical security issues to Slack, email, or webhooks.
371
+ ### Adding External Skills
372
+ ```bash
373
+ # From skill repositories
374
+ trie skill install vercel/ai-best-practices
375
+ trie skill install anthropic/typescript-patterns
2468
376
 
2469
- **Quick Setup:**
377
+ # From any GitHub repo
378
+ trie skill install username/repo-name
379
+ ```
2470
380
 
2471
- 1. Create `.trie/config.json` in your project root
2472
- 2. Add escalation configuration:
381
+ ### Creating Your Own Skills
382
+ ```bash
383
+ # Create from documentation
384
+ trie skill create my-skill --doc=./coding-standards.md
2473
385
 
2474
- ```json
2475
- {
2476
- "escalation": {
2477
- "enabled": true,
2478
- "targets": [
2479
- {
2480
- "type": "slack",
2481
- "enabled": true,
2482
- "config": {
2483
- "webhookUrl": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
2484
- "channel": "#security-alerts",
2485
- "username": "Trie Guardian"
2486
- },
2487
- "forSeverities": ["critical"],
2488
- "forCategories": ["security", "all"]
2489
- }
2490
- ],
2491
- "cooldownMinutes": 15,
2492
- "maxEscalationsPerHour": 5,
2493
- "respectQuietHours": true,
2494
- "criticalBypassQuietHours": true
2495
- }
2496
- }
386
+ # This creates a custom analyzer based on your documentation
2497
387
  ```
2498
388
 
2499
- **Target Types:**
2500
-
2501
- | Type | Description | Required Config |
2502
- |------|-------------|-----------------|
2503
- | `slack` | Slack webhook | `webhookUrl`, optional `channel`, `username` |
2504
- | `webhook` | Custom POST endpoint | `webhookUrl` |
2505
- | `email` | Email notification | `email` (SMTP config in env) |
389
+ ### Skill Format
390
+ Skills are simple markdown files with detection rules:
2506
391
 
2507
- **Get Slack Webhook URL:**
392
+ ```markdown
393
+ # My Custom Skill
2508
394
 
2509
- 1. Go to https://api.slack.com/apps
2510
- 2. Create new app or select existing
2511
- 3. Enable "Incoming Webhooks"
2512
- 4. Add webhook to workspace
2513
- 5. Copy webhook URL
395
+ ## Detection Rules
396
+ - File patterns: `*.js`, `*.ts`
397
+ - Code patterns: `console.log`, `debugger`
2514
398
 
2515
- **Multiple Targets:**
399
+ ## Analysis
400
+ Look for debugging statements left in production code.
2516
401
 
2517
- ```json
2518
- {
2519
- "escalation": {
2520
- "targets": [
2521
- {
2522
- "type": "slack",
2523
- "enabled": true,
2524
- "config": { "webhookUrl": "..." },
2525
- "forSeverities": ["critical"],
2526
- "forCategories": ["security"]
2527
- },
2528
- {
2529
- "type": "webhook",
2530
- "enabled": true,
2531
- "config": { "webhookUrl": "https://your-api.com/alerts" },
2532
- "forSeverities": ["critical", "serious"],
2533
- "forCategories": ["all"]
2534
- }
2535
- ]
2536
- }
2537
- }
402
+ ## Fix Suggestions
403
+ Remove or replace with proper logging.
2538
404
  ```
2539
405
 
2540
- **Configuration Options:**
406
+ ## Troubleshooting
2541
407
 
2542
- | Option | Description | Default |
2543
- |--------|-------------|---------|
2544
- | `enabled` | Enable auto-escalation | `true` |
2545
- | `cooldownMinutes` | Minutes between escalations of same file | `15` |
2546
- | `maxEscalationsPerHour` | Max escalations per hour | `5` |
2547
- | `respectQuietHours` | Respect quiet hours (9pm-8am) | `true` |
2548
- | `criticalBypassQuietHours` | Critical issues bypass quiet hours | `true` |
408
+ ### Common Issues
2549
409
 
2550
- **Test Your Configuration:**
410
+ **Trie not finding issues**: Your codebase might be very clean, or you haven't taught Trie about your specific patterns yet. Try `trie tell` to report some known issues.
2551
411
 
2552
- ```bash
2553
- # Watch mode will show escalation status
2554
- trie watch
2555
-
2556
- # Check Guardian insights panel (press 'g')
2557
- # You'll see "Auto-escalation: enabled (1 target)" if configured correctly
2558
- ```
412
+ **Scans are slow**: Reduce concurrency with `--max-concurrency=2` or exclude large directories in config.
2559
413
 
2560
- **TUI Configuration:**
414
+ **Too many false positives**: Use `trie bad` to train Trie, and consider adjusting scout sensitivity in config.
2561
415
 
2562
- Press `c` in watch mode to open Guardian Agent configuration menu (escalation configuration UI coming soon).
2563
-
2564
- ### Example
2565
-
2566
- ```
2567
- trie_scan with parallel: true, cache: true, maxConcurrency: 8
2568
- ```
416
+ **Hooks not working**: Reinstall with `trie init`. Make sure you have write permissions to `.git/hooks/`.
2569
417
 
2570
- ---
418
+ ### Getting Help
419
+ - GitHub Issues: [Report bugs and request features](https://x.com/louiskishfy)
420
+ - Twitter: [@louiskishfy](https://x.com/louiskishfy) for quick questions
2571
421
 
2572
422
  ## License
2573
423
 
2574
- MIT
424
+ MIT License - see [LICENSE](LICENSE) file for details.