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