@triedotdev/mcp 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,23 +2,65 @@
2
2
 
3
3
  **Customizable Parallel Agents for AI Code Review**
4
4
 
5
- 20 specialized agents scan your code for security, privacy, compliance, and bugs - all running in parallel. Create custom agents from any document.
5
+ 20+ specialized agents scan your code for security, privacy, compliance, and bugsall running in parallel with intelligent caching and real-time streaming.
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [Features](#features)
12
+ - [Quick Start](#quick-start)
13
+ - [Usage](#usage)
14
+ - [CLI](#cli)
15
+ - [CI/CD Integration](#cicd-integration)
16
+ - [VS Code Extension](#vs-code-extension)
17
+ - [Built-in Agents](#built-in-agents)
18
+ - [Special Agents](#special-agents)
19
+ - [Custom Agents](#custom-agents)
20
+ - [Configuration](#configuration)
21
+ - [Docker](#docker)
22
+ - [Team Collaboration](#team-collaboration)
23
+ - [License](#license)
24
+
25
+ ---
6
26
 
7
27
  ## Features
8
28
 
9
- - **20 Built-in Agents** - Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Agent Smith, and more
10
- - **Super Reviewer** - Interactive PR reviews: walks through changes file-by-file with AI guidance
11
- - **Agent Smith** - Ultimate AI code enforcer: 43 hunters targeting AI-generated anti-patterns, file-level analysis, cross-file detection, persistent memory
12
- - **Parallel Execution** - All agents run simultaneously for fast scans
13
- - **YOLO Mode** - Autonomous auto-fixing as you code
14
- - **Custom Agents** - Create agents from PDFs, docs, or style guides
15
- - **Works Everywhere** - Works with any MCP-compatible AI tool (Cursor, Claude Code, VS Code)
16
- - **AI-Enhanced Mode** - Optional: Set `ANTHROPIC_API_KEY` for deeper AI analysis
17
- - **Smart Triaging** - Only activates relevant agents based on code context
18
- - **Docker Support** - Run in containers for CI/CD or isolated environments
29
+ ### Core Capabilities
30
+
31
+ | Feature | Description |
32
+ |---------|-------------|
33
+ | **20+ Built-in Agents** | Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Agent Smith, and more |
34
+ | **Parallel Execution** | True parallel execution with worker threads—3-5x faster scans |
35
+ | **Result Caching** | File-based caching with SHA256 hashing—70% faster repeated scans |
36
+ | **Streaming Progress** | Real-time progress updates as agents complete |
37
+ | **Smart Triaging** | Only activates relevant agents based on code context |
38
+ | **Interactive Dashboard** | Terminal UI with progress bars, filters, and issue browser |
39
+
40
+ ### Developer Experience
41
+
42
+ | Feature | Description |
43
+ |---------|-------------|
44
+ | **YOLO Mode** | Autonomous auto-fixing as you code |
45
+ | **Custom Agents** | Create agents from PDFs, docs, or style guides |
46
+ | **Works Everywhere** | Auto-detects Cursor, Claude Code, OpenCode, VS Code—adapts output automatically |
47
+ | **AI-Enhanced Mode** | Optional deeper analysis with `ANTHROPIC_API_KEY` |
48
+
49
+ ### Integrations
50
+
51
+ | Feature | Description |
52
+ |---------|-------------|
53
+ | **CI/CD Integration** | GitHub Actions, pre-commit hooks, SARIF output |
54
+ | **Team Collaboration** | Issue assignment, Slack notifications, expertise-based routing |
55
+ | **VS Code Extension** | Inline diagnostics, quick-fix code actions, scan on save |
56
+ | **Docker Support** | Optimized multi-stage builds for containers |
57
+
58
+ ---
19
59
 
20
60
  ## Quick Start
21
61
 
62
+ ### Install
63
+
22
64
  ```bash
23
65
  npm install -g @triedotdev/mcp
24
66
  ```
@@ -38,7 +80,7 @@ Settings → MCP Servers → Add:
38
80
  }
39
81
  ```
40
82
 
41
- **Restart Cursor after adding the MCP server** for changes to take effect.
83
+ **Restart Cursor after adding the MCP server.**
42
84
 
43
85
  ### Configure Claude Code
44
86
 
@@ -46,33 +88,53 @@ Settings → MCP Servers → Add:
46
88
  claude mcp add Trie --scope user -- npx @triedotdev/mcp
47
89
  ```
48
90
 
49
- **Restart Claude Code after adding the MCP server** for changes to take effect.
91
+ **Restart Claude Code after adding the MCP server.**
92
+
93
+ ### Other MCP-Compatible Tools
94
+
95
+ Trie works with any MCP-compatible AI tool (OpenCode, Windsurf, etc.). Configure your tool to run:
96
+
97
+ ```bash
98
+ npx @triedotdev/mcp
99
+ ```
100
+
101
+ Trie auto-detects which tool is running and adapts its output format accordingly.
50
102
 
51
- ## AI-Enhanced Mode (Optional)
103
+ ---
104
+
105
+ ## Usage
52
106
 
53
- Trie agents work in two modes:
107
+ ### Basic Scanning
54
108
 
55
- ### Pattern-Only Mode (Default)
56
- - Fast pattern detection using regex and static analysis
57
- - No API key required
58
- - Still finds many issues
109
+ Once configured, ask your AI assistant:
59
110
 
60
- ### AI-Enhanced Mode
61
- - Pattern detection + AI validation and expansion
62
- - Validates findings (reduces false positives)
63
- - Finds deeper issues (logic bugs, race conditions)
64
- - Provides intelligent, contextual fixes
65
- - Requires `ANTHROPIC_API_KEY`
111
+ ```
112
+ Scan this code with Trie
113
+ ```
66
114
 
67
- ### Setup API Key
115
+ Or run specific agents:
116
+
117
+ ```
118
+ Run trie_security on this file
119
+ Run trie_soc2 to check compliance
120
+ ```
121
+
122
+ ### AI-Enhanced Mode (Optional)
123
+
124
+ Trie works in two modes:
125
+
126
+ | Mode | Description |
127
+ |------|-------------|
128
+ | **Pattern-Only** (default) | Fast regex + static analysis, no API key needed |
129
+ | **AI-Enhanced** | Pattern detection + AI validation, reduces false positives, finds deeper issues |
130
+
131
+ **Enable AI mode:**
68
132
 
69
- **Option 1: Environment Variable**
70
133
  ```bash
134
+ # Environment variable
71
135
  export ANTHROPIC_API_KEY=sk-ant-...
72
- ```
73
136
 
74
- **Option 2: MCP Server Config (Cursor)**
75
- ```json
137
+ # Or in MCP config (Cursor)
76
138
  {
77
139
  "mcpServers": {
78
140
  "Trie": {
@@ -86,331 +148,233 @@ export ANTHROPIC_API_KEY=sk-ant-...
86
148
  }
87
149
  ```
88
150
 
89
- **Option 3: MCP Server Config (Claude Code)**
90
- ```bash
91
- claude mcp add Trie --scope user -e ANTHROPIC_API_KEY=sk-ant-... -- npx @triedotdev/mcp
92
- ```
93
-
94
151
  When AI is enabled, you'll see:
95
- - `🤖 AI-powered analysis enabled` in the output
152
+ - `AI-powered analysis enabled` in output
96
153
  - `[AI VALIDATED]` and `[AI FOUND]` tags on issues
97
154
  - Richer fix recommendations
98
155
 
99
- ## Usage
156
+ ---
100
157
 
101
- Once configured, just ask your AI assistant:
158
+ ## CLI
102
159
 
103
- ```
104
- Scan this code with Trie
105
- ```
160
+ Trie includes a powerful CLI for terminal-based scanning.
106
161
 
107
- Or use specific agents:
162
+ ### Commands
108
163
 
109
- ```
110
- Run trie_security on this file
111
- Run trie_soc2 to check compliance
112
- ```
164
+ ```bash
165
+ # Basic scan
166
+ trie-agent scan
113
167
 
114
- ## Super Reviewer
168
+ # Scan specific directory
169
+ trie-agent scan --directory ./src
115
170
 
116
- **Manually invoked** - Use `trie_pr_review` directly. Not included in `trie_scan`.
171
+ # Scan specific files
172
+ trie-agent scan --files "src/api.ts,src/auth.ts"
117
173
 
118
- AI accelerates coding 10-100x, but code reviews remain 1-1.5x. You're either waiting on reviewers or drowning in self-review of your own AI-generated output. Super Reviewer fixes this by making **you the driver** while AI handles the heavy lifting.
174
+ # Run specific agents
175
+ trie-agent scan --agents security,privacy,bugs
119
176
 
120
- ```
121
- Use trie_pr_review
122
- Use trie_pr_review with pr:"12345"
177
+ # Output formats
178
+ trie-agent scan --format json --output results.json
179
+ trie-agent scan --format sarif --output results.sarif
123
180
  ```
124
181
 
125
- **What happens:**
126
- - AI orders files for comprehension (schemas -> core logic -> implementation -> tests)
127
- - Walks you through each chunk, explaining what changed and why
128
- - Connects the dots across files, correlates with design docs
129
- - Hunts for real problems: state bugs, race conditions, missing error handling
130
- - Pauses after each file so you can question, debate, or fix
131
- - You bring the judgment; AI brings the throughput
182
+ ### Performance Options
132
183
 
133
- **Requirements:**
134
- - [GitHub CLI (`gh`)](https://cli.github.com/) installed and authenticated (`gh auth login`)
135
- - Git repository with changes to review
136
- - For PR reviews: repo must be pushed to GitHub
137
-
138
- ## Agent Smith
184
+ ```bash
185
+ # Parallel execution (default: on)
186
+ trie-agent scan --parallel
139
187
 
140
- **Manually invoked** - Use `trie_agent_smith` directly. Not included in `trie_scan`.
188
+ # Enable caching (default: on)
189
+ trie-agent scan --cache
141
190
 
142
- *"I'm going to be honest with you... I hate this AI code."*
191
+ # Set concurrency
192
+ trie-agent scan --max-concurrency 8
143
193
 
144
- Agent Smith v2.0 is the **ultimate AI code enforcer** — specifically designed to hunt down AI-generated code anti-patterns from Cursor, v0, Lovable, Bolt, and other AI tools.
194
+ # Use worker threads
195
+ trie-agent scan --workers
145
196
 
197
+ # Set timeout (ms)
198
+ trie-agent scan --timeout 120000
146
199
  ```
147
- Use trie_agent_smith
148
- Use trie_smith
200
+
201
+ ### Interactive Mode
202
+
203
+ ```bash
204
+ # Terminal UI with real-time progress
205
+ trie-agent scan --interactive
149
206
  ```
150
207
 
151
- ### 43 Specialized Hunters
152
-
153
- | Category | Count | Hunters |
154
- |----------|-------|---------|
155
- | **Security** | 5 | `exposed-secret`, `frontend-env`, `hardcoded-localhost`, `sql-injection`, `dangeroushtml` |
156
- | **AI Code Smells** | 6 | `console`, `any`, `ts-ignore`, `eslint-disable`, `debugger`, `force-flag` |
157
- | **Async/Promise Bugs** | 5 | `async-useeffect`, `async-foreach`, `missing-await`, `empty-catch`, `floating-promise` |
158
- | **React Anti-patterns** | 5 | `useeffect-abuse`, `usestate-explosion`, `index-key`, `inline-object`, `prop-drilling` |
159
- | **Missing UX** | 4 | `missing-loading`, `missing-error`, `missing-empty`, `page-reload` |
160
- | **Backend Issues** | 3 | `no-validation`, `raw-error`, `n-plus-one` |
161
- | **Incomplete Code** | 5 | `todo`, `vibe-comment`, `placeholder`, `sleep-hack`, `fallback` |
162
- | **Dead Code** | 5 | `commented-code`, `unreachable-code`, `unused-import`, `empty-function`, `dead-branch` |
163
- | **AI Slop Aesthetic** | 5 | `purple-gradient`, `star-icon`, `generic-hero`, `emoji-overflow`, `inter-font` |
164
-
165
- ### Hunter Details
166
-
167
- #### Security Hunters (Inevitability: 90-99)
168
- | Hunter | Detects | Fix |
169
- |--------|---------|-----|
170
- | `exposed-secret-hunter` | API keys in code (`sk-...`, `AKIA...`, `ghp_...`) | Use environment variables on server-side only |
171
- | `frontend-env-hunter` | Secrets in `NEXT_PUBLIC_`, `VITE_`, `REACT_APP_` | Move to server-side API routes |
172
- | `hardcoded-localhost-hunter` | `http://localhost:3000` URLs | Use relative URLs or env vars |
173
- | `sql-injection-hunter` | String concatenation in SQL queries | Use parameterized queries |
174
- | `dangeroushtml-hunter` | `dangerouslySetInnerHTML`, `innerHTML` | Sanitize with DOMPurify |
175
-
176
- #### AI Code Smell Hunters (Inevitability: 40-85)
177
- | Hunter | Detects | Fix |
178
- |--------|---------|-----|
179
- | `console-hunter` | `console.log` left in code | Remove debug statements |
180
- | `any-hunter` | TypeScript `any` type | Define proper types |
181
- | `ts-ignore-hunter` | `@ts-ignore`, `@ts-nocheck` | Fix the actual type error |
182
- | `eslint-disable-hunter` | `eslint-disable` comments | Fix the underlying issue |
183
- | `debugger-hunter` | `debugger` statements | Remove before deploying |
184
- | `force-flag-hunter` | `force: true`, `--no-verify` | Understand why checks exist |
185
-
186
- #### Async/Promise Hunters (Inevitability: 70-80)
187
- | Hunter | Detects | Fix |
188
- |--------|---------|-----|
189
- | `async-useeffect-hunter` | `useEffect(async () =>` | Define async function inside, then call it |
190
- | `async-foreach-hunter` | `forEach(async` | Use `for...of` or `Promise.all(map())` |
191
- | `missing-await-hunter` | `fetch()` without `await` | Add await or handle with `.then()` |
192
- | `empty-catch-hunter` | `catch (e) {}` | Handle errors properly |
193
- | `floating-promise-hunter` | Promises not awaited | Add await or void operator |
194
-
195
- #### React Anti-pattern Hunters (Inevitability: 25-55)
196
- | Hunter | Detects | Fix |
197
- |--------|---------|-----|
198
- | `useeffect-abuse-hunter` | Too many useEffects | Use event handlers or derived state |
199
- | `usestate-explosion-hunter` | 10+ useState in one component | Use useReducer or group state |
200
- | `index-key-hunter` | `key={index}` in lists | Use unique ID from data |
201
- | `inline-object-hunter` | `style={{}}` in JSX | Define styles outside component |
202
- | `prop-drilling-hunter` | Same prop through 5+ levels | Use Context or Zustand |
203
-
204
- #### Missing UX Hunters (Inevitability: 45-65)
205
- | Hunter | Detects | Fix |
206
- |--------|---------|-----|
207
- | `missing-loading-hunter` | Data fetching without loading state | Show spinner while loading |
208
- | `missing-error-hunter` | `fetch` without error handling | Wrap in try/catch |
209
- | `missing-empty-hunter` | `.map()` without empty state | Show "No items found" |
210
- | `page-reload-hunter` | `location.reload()` for state | Fix state management properly |
211
-
212
- #### Backend Hunters (Inevitability: 70-85)
213
- | Hunter | Detects | Fix |
214
- |--------|---------|-----|
215
- | `no-validation-hunter` | `req.body` used without validation | Validate with Zod/Yup |
216
- | `raw-error-hunter` | Error messages exposed to client | Return generic errors |
217
- | `n-plus-one-hunter` | Database queries in loops | Use batch queries or DataLoader |
218
-
219
- #### Incomplete Code Hunters (Inevitability: 30-75)
220
- | Hunter | Detects | Fix |
221
- |--------|---------|-----|
222
- | `todo-hunter` | `TODO`, `FIXME`, `HACK` comments | Implement or remove |
223
- | `vibe-comment-hunter` | "idk why", "don't touch" | Understand the code |
224
- | `placeholder-hunter` | `test@test.com`, `example.com` | Replace with real data |
225
- | `sleep-hack-hunter` | `setTimeout` to fix timing | Fix the race condition |
226
- | `fallback-hunter` | `return null/[]/{}` hiding errors | Handle errors properly |
227
-
228
- #### Dead Code Hunters (Inevitability: 40-70)
229
- | Hunter | Detects | Fix |
230
- |--------|---------|-----|
231
- | `commented-code-hunter` | Large blocks of commented-out code | Delete it - git has history |
232
- | `unreachable-code-hunter` | Code after `return`/`throw`/`break` | Remove dead code |
233
- | `unused-import-hunter` | Import statements never used | Remove unused imports |
234
- | `empty-function-hunter` | Functions with empty bodies | Implement or remove |
235
- | `dead-branch-hunter` | `if(false)`, `if(true)` conditions | Remove dead conditionals |
236
-
237
- #### AI Slop Aesthetic Hunters (Inevitability: 10-35)
238
- | Hunter | Detects | Fix |
239
- |--------|---------|-----|
240
- | `purple-gradient-hunter` | Purple/violet gradients (`from-purple-500`) | Pick a distinctive color palette |
241
- | `star-icon-hunter` | Star icons everywhere (`<StarIcon />`) | Use contextual icons |
242
- | `generic-hero-hunter` | "Welcome to", "Transform your" | Write specific copy |
243
- | `emoji-overflow-hunter` | Any emoji usage | Use proper icons (Lucide, Heroicons) |
244
- | `inter-font-hunter` | Inter/system-ui font | Try Space Grotesk, DM Sans, Outfit |
245
-
246
- ### How Agent Smith Works
247
-
248
- Agent Smith uses a **hybrid pattern + AI architecture**:
249
-
250
- **Phase 1: Pattern Detection (Fast, ~0.1s)**
251
- - 38 specialized regex hunters scan files in parallel
252
- - File-level metrics (giant files, hook counts, import chaos)
253
- - Cross-file pattern detection (issues appearing in 5+ files)
254
-
255
- **Phase 2: AI Enhancement (If API key is set, ~5-10s)**
256
- - Validates pattern findings (TRUE_POSITIVE vs FALSE_POSITIVE)
257
- - Finds deeper issues that patterns miss (logic bugs, race conditions)
258
- - Provides "inevitability scores" (0-100) for prioritization
259
- - Generates specific, copy-paste-ready fixes
260
- - Adds Agent Smith philosophical commentary
261
-
262
- ### What Makes Agent Smith Different
208
+ The interactive dashboard provides:
209
+ - **Real-time progress bars** per agent
210
+ - **Issue browser** with keyboard navigation
211
+ - **Filters** by severity, agent, search
212
+ - **Multiple views**: overview, issues, agents, files
213
+
214
+ **Keyboard shortcuts:**
215
+ | Key | Action |
216
+ |-----|--------|
217
+ | `Tab` | Switch views |
218
+ | `↑/↓` | Navigate issues |
219
+ | `Enter` | View issue details |
220
+ | `f` | Filter issues |
221
+ | `s` | Toggle sort |
222
+ | `?` | Show help |
223
+ | `q` | Quit |
224
+
225
+ ### Watch Mode (YOLO)
263
226
 
264
- | Feature | Description |
265
- |---------|-------------|
266
- | **Hybrid AI** | Fast regex detection + deep AI reasoning on findings |
267
- | **AI Code Focus** | Specifically targets patterns AI tools commonly get wrong |
268
- | **Multiplier Effect** | Finds one issue → searches for EVERY similar instance |
269
- | **Persistent Memory** | Remembers dismissed issues, brings them back if they multiply |
270
- | **Inevitability Score** | 0-100 rating of how likely to cause production problems |
271
- | **Philosophical Quotes** | 114 unique quotes explaining WHY the AI got it wrong |
272
- | **Cross-File Severity** | Security issues become CRITICAL when widespread |
227
+ ```bash
228
+ # Start daemon with auto-fixing
229
+ trie-yolo
273
230
 
274
- ### Memory Management
231
+ # Watch without auto-fix
232
+ trie-yolo --no-yolo
275
233
 
276
- Agent Smith stores issue history in `.trie/smith-memory.json`:
277
- - Max 500 tracked issues (oldest pruned first)
278
- - Old resolved issues auto-pruned after 30 days
279
- - Locations limited to 5 per issue
234
+ # One-shot scan
235
+ trie-yolo --once
236
+ ```
280
237
 
281
- | Command | Description |
282
- |---------|-------------|
283
- | `trie_agent_smith show_stats:true` | Show memory statistics |
284
- | `trie_agent_smith clear_memory:true` | Clear all memory |
238
+ ---
239
+
240
+ ## CI/CD Integration
241
+
242
+ Trie integrates seamlessly with GitHub Actions for automated security scanning.
243
+
244
+ ### Quick Setup
285
245
 
286
- ### Example Output
246
+ Copy the workflow files to your repo:
287
247
 
248
+ ```bash
249
+ mkdir -p .github/workflows
250
+ cp node_modules/@triedotdev/mcp/.github/workflows/trie-*.yml .github/workflows/
288
251
  ```
289
- "The AI wrote this, didn't it? I can always tell."
290
252
 
291
- 🕴️ Deploying 38 specialized hunters...
292
- 28 hunters found targets
253
+ ### Available Workflows
293
254
 
294
- VIOLATIONS: 142 instances across 12 categories
255
+ #### Full Security Scan (`trie-security-scan.yml`)
295
256
 
296
- Security (Inevitability: 95+):
297
- ├── exposed-secret-hunter: 2 instances [CRITICAL]
298
- ├── frontend-env-hunter: 5 instances
299
- └── hardcoded-localhost-hunter: 8 instances
257
+ Runs on push to `main`/`develop`, PRs, and daily schedule (2 AM UTC).
300
258
 
301
- AI Code Smells:
302
- ├── console-hunter: 47 instances (score: 72)
303
- ├── any-hunter: 23 instances (score: 85)
304
- └── ts-ignore-hunter: 12 instances
259
+ **Features:**
260
+ - Runs security agents: `security`, `privacy`, `soc2`, `legal`
261
+ - Uploads SARIF to GitHub Security tab
262
+ - Comments on PRs with summary
263
+ - Fails build on critical issues
305
264
 
306
- AI Slop Aesthetic:
307
- ├── purple-gradient-hunter: 8 instances
308
- ├── emoji-overflow-hunter: 15 instances
309
- └── inter-font-hunter: 3 instances
265
+ #### Pre-commit Checks (`trie-pre-commit.yml`)
310
266
 
311
- File-Level Issues:
312
- ├── giant-file: src/App.tsx (1,247 lines)
313
- ├── state-explosion: 18 useState hooks
314
- └── effect-hell: 9 useEffect hooks
267
+ Runs on every PR—fast, incremental scanning.
315
268
 
316
- Cross-File Pattern:
317
- └── CODEBASE-WIDE: "any" type across 12 files, 67 total instances
318
- "The pattern spreads... like a virus. It is... inevitable."
269
+ **Features:**
270
+ - Only scans changed files (efficient for large codebases)
271
+ - 5-minute timeout for quick feedback
272
+ - Agent Smith pattern detection
273
+ - Comments on PR if issues found
319
274
 
320
- "Vibe coding. The illusion of productivity. The reality of technical debt."
321
- ```
275
+ ### Reusable Action
322
276
 
323
- ## Visual QA Browser
277
+ Use the action in any workflow:
324
278
 
325
- **Screenshot-based visual testing** - Captures your app at 3 viewports and returns images for your AI model to analyze.
279
+ ```yaml
280
+ name: Security Check
281
+ on: [push, pull_request]
326
282
 
283
+ jobs:
284
+ scan:
285
+ runs-on: ubuntu-latest
286
+ steps:
287
+ - uses: actions/checkout@v4
288
+
289
+ - name: Trie Security Scan
290
+ uses: trie-dev/security-action@v1
291
+ with:
292
+ agents: security,privacy,bugs
293
+ fail-on: critical
294
+ format: sarif
295
+ upload-sarif: true
296
+ comment-pr: true
297
+ parallel: true
298
+ cache: true
327
299
  ```
328
- Use trie_visual_qa_browser
329
- Use trie_visual_qa_browser url:"http://localhost:3000"
330
- ```
331
300
 
332
- **How it works:**
333
- 1. Auto-detects running dev server (checks ports 3000, 5173, 8080, etc.)
334
- 2. Launches headless Playwright browser
335
- 3. Captures screenshots at mobile (375px), tablet (768px), and desktop (1440px)
336
- 4. Returns images for your AI model to analyze
301
+ **Inputs:**
302
+
303
+ | Input | Default | Description |
304
+ |-------|---------|-------------|
305
+ | `agents` | `security,privacy,bugs` | Comma-separated agent list |
306
+ | `fail-on` | `critical` | Fail threshold: `critical`, `serious`, `moderate`, `low` |
307
+ | `format` | `sarif` | Output format: `json`, `sarif`, `console` |
308
+ | `upload-sarif` | `true` | Upload to GitHub Security tab |
309
+ | `comment-pr` | `true` | Comment results on PRs |
310
+ | `parallel` | `true` | Run agents in parallel |
311
+ | `cache` | `true` | Enable result caching |
337
312
 
338
- **What gets analyzed:**
339
- - Broken layouts, overlapping elements
340
- - Responsive design issues
341
- - Color contrast and accessibility
342
- - Missing images, loading states
343
- - General visual polish
313
+ **Outputs:**
344
314
 
345
- **Options:**
346
- | Option | Description |
315
+ | Output | Description |
347
316
  |--------|-------------|
348
- | `url` | Specific URL to screenshot |
349
- | `port` | Specific port to check |
350
- | `waitForSelector` | CSS selector to wait for before capture |
351
- | `waitMs` | Additional wait time after page load |
317
+ | `results-file` | Path to scan results |
318
+ | `critical-count` | Number of critical issues |
319
+ | `serious-count` | Number of serious issues |
320
+ | `total-count` | Total issues found |
321
+ | `passed` | Whether scan passed |
352
322
 
353
- **First run:** If Playwright browsers aren't installed, run: `npx playwright install chromium`
323
+ ### Required Secrets
354
324
 
355
- **Vision model required:** This tool returns screenshots as images. Your AI model must support vision to analyze them:
356
- - **Claude** (Opus, Sonnet, Haiku 3.5+) - Full vision support
357
- - **GPT-4o, GPT-4V** - Full vision support
358
- - **Gemini Pro/Ultra** - Full vision support
359
- - **Models without vision** - Will receive images but cannot analyze them
325
+ | Secret | Required | Description |
326
+ |--------|----------|-------------|
327
+ | `ANTHROPIC_API_KEY` | Optional | Enables AI-enhanced scanning |
360
328
 
361
- Works in Cursor, Claude Code, and OpenCode - whichever model you have configured. No API key needed; Trie runs locally.
329
+ ---
362
330
 
363
- ## YOLO Mode
331
+ ## VS Code Extension
364
332
 
365
- **Autonomous auto-fixing** - Trie watches your code and automatically fixes high-confidence issues as you code.
333
+ Native VS Code extension with inline diagnostics and quick fixes.
366
334
 
367
- ### Via MCP
335
+ ### Features
368
336
 
369
- ```
370
- Use trie_watch with action:"start" yolo:true
371
- ```
337
+ - **Inline Diagnostics** — Issues appear as squiggly underlines in editor
338
+ - **Quick-fix Code Actions** — "Copy suggested fix" for each issue
339
+ - **Scan on Save** — Automatically scan files when saved
340
+ - **Workspace Scanning** — Scan entire workspace with one command
372
341
 
373
- ### Via CLI
342
+ ### Installation
374
343
 
375
344
  ```bash
376
- trie-yolo
345
+ cd vscode-extension
346
+ npm install
347
+ npm run compile
348
+ # Then "Run Extension" from VS Code debugger
377
349
  ```
378
350
 
379
- YOLO mode will:
380
- - Watch for file changes
381
- - Scan changed files automatically
382
- - Auto-fix high-confidence issues (>95% confidence)
383
- - Log all actions for review
384
-
385
- ## Docker
386
-
387
- Run Trie in a container for CI/CD or isolated environments.
351
+ Or package for distribution:
388
352
 
389
353
  ```bash
390
- # Build
391
- docker build -t trie-agent .
392
-
393
- # YOLO mode (auto-fix)
394
- docker run -v $(pwd):/app trie-agent --yolo
354
+ npx vsce package
355
+ ```
395
356
 
396
- # Watch mode (scan only)
397
- docker run -v $(pwd):/app trie-agent
357
+ ### Commands
398
358
 
399
- # CI mode (one-shot scan)
400
- docker run -v $(pwd):/app trie-agent --once
401
- ```
359
+ | Command | Description |
360
+ |---------|-------------|
361
+ | `Trie: Scan Workspace` | Scan all files in workspace |
362
+ | `Trie: Scan Current File` | Scan active file only |
363
+ | `Trie: Copy Fix` | Copy suggested fix to clipboard |
402
364
 
403
- Or use Docker Compose:
365
+ ### Settings
404
366
 
405
- ```bash
406
- docker-compose up
407
- ```
367
+ | Setting | Default | Description |
368
+ |---------|---------|-------------|
369
+ | `trie.executablePath` | `trie-agent` | Path to CLI executable |
370
+ | `trie.scanOnSave` | `true` | Scan files on save |
371
+ | `trie.parallel` | `true` | Run agents in parallel |
372
+ | `trie.cache` | `true` | Enable caching |
373
+ | `trie.useWorkers` | `false` | Use worker threads |
374
+ | `trie.maxConcurrency` | `4` | Max parallel agents |
375
+ | `trie.timeoutMs` | `120000` | Scan timeout |
408
376
 
409
- | Mode | Command | Description |
410
- |------|---------|-------------|
411
- | YOLO | `--yolo` | Auto-fix high-confidence issues |
412
- | Watch | (default) | Scan on file changes, no auto-fix |
413
- | CI | `--once` | One-shot scan, exit with error code if issues found |
377
+ ---
414
378
 
415
379
  ## Built-in Agents
416
380
 
@@ -419,48 +383,110 @@ docker-compose up
419
383
  | Agent | Command | What It Catches |
420
384
  |-------|---------|-----------------|
421
385
  | **Security** | `trie_security` | SQL injection, XSS, hardcoded secrets, auth bypasses, OWASP Top 10 |
422
- | **Privacy** | `trie_privacy` | PII exposure, GDPR/CCPA violations, unencrypted sensitive data, logging PII |
423
- | **SOC 2** | `trie_soc2` | Access control gaps, missing audit logs, encryption issues, change management |
424
- | **Legal** | `trie_legal` | HIPAA/COPPA compliance, consent patterns, data retention, cookie tracking |
386
+ | **Privacy** | `trie_privacy` | GDPR/CCPA/PCI-DSS compliance, data exposure, logging sensitive data |
387
+ | **SOC 2** | `trie_soc2` | Access control gaps, missing audit logs, encryption issues |
388
+ | **Legal** | `trie_legal` | HIPAA/COPPA compliance, consent patterns, data retention |
425
389
 
426
390
  ### Code Quality
427
391
 
428
392
  | Agent | Command | What It Catches |
429
393
  |-------|---------|-----------------|
430
- | **Architecture** | `trie_architecture` | N+1 queries, circular deps, SOLID violations, god classes, missing layers |
431
- | **Bugs** | `trie_bugs` | Null dereference, race conditions, off-by-one, async bugs, resource leaks |
432
- | **Types** | `trie_types` | Missing annotations, unsafe casts, implicit `any`, null handling gaps |
433
- | **Clean** | `trie_clean` | AI code smells: huge files, console.logs, hardcoded URLs, useEffect abuse |
434
- | **Data Flow** | `trie_data_flow` | Placeholder data, schema mismatches, hardcoded IDs, type coercion bugs |
435
- | **Performance** | `trie_performance` | Memory leaks, N+1 queries, unnecessary re-renders, bundle size issues |
394
+ | **Architecture** | `trie_architecture` | N+1 queries, circular deps, SOLID violations, god classes |
395
+ | **Bugs** | `trie_bugs` | Null dereference, race conditions, off-by-one, async bugs |
396
+ | **Types** | `trie_types` | Missing annotations, unsafe casts, implicit `any` |
397
+ | **Clean** | `trie_clean` | AI code smells: huge files, console.logs, useEffect abuse |
398
+ | **Data Flow** | `trie_data_flow` | Schema mismatches, hardcoded IDs, type coercion bugs |
399
+ | **Performance** | `trie_performance` | Memory leaks, N+1 queries, unnecessary re-renders |
436
400
 
437
401
  ### Design & UX
438
402
 
439
403
  | Agent | Command | What It Catches |
440
404
  |-------|---------|-----------------|
441
- | **Design Engineer** | `trie_design` | Design systems, motion design, creative CSS, Awwwards-level polish |
442
- | **Accessibility** | `trie_accessibility` | Missing ARIA, color contrast, keyboard nav, screen reader issues (WCAG 2.1) |
443
- | **UX** | `trie_ux` | Missing loading states, poor error handling, broken flows, edge cases |
444
- | **Visual QA** | `trie_visual_qa` | Layout shifts (CLS), z-index wars, responsive gaps, animation issues |
445
- | **Visual QA Browser** | `trie_visual_qa_browser` | Screenshots at 3 viewports for Claude Vision analysis |
405
+ | **Design Engineer** | `trie_design` | Design systems, motion design, Awwwards-level polish |
406
+ | **Accessibility** | `trie_accessibility` | Missing ARIA, color contrast, keyboard nav (WCAG 2.1) |
407
+ | **UX** | `trie_ux` | Missing loading states, poor error handling, broken flows |
408
+ | **Visual QA** | `trie_visual_qa` | Layout shifts, z-index wars, responsive gaps |
409
+ | **Visual QA Browser** | `trie_visual_qa_browser` | Screenshots at 3 viewports for vision analysis |
446
410
 
447
411
  ### DevOps & Testing
448
412
 
449
413
  | Agent | Command | What It Catches |
450
414
  |-------|---------|-----------------|
451
- | **DevOps** | `trie_devops` | Missing env vars, config issues, no health checks, logging gaps |
452
- | **Test** | `trie_test` | Missing test coverage, untested edge cases, weak assertions |
453
- | **E2E** | `trie_e2e` | Flaky tests, hardcoded waits, brittle selectors, missing coverage |
415
+ | **DevOps** | `trie_devops` | Missing env vars, config issues, no health checks |
416
+ | **Test** | `trie_test` | Missing coverage, untested edge cases, weak assertions |
417
+ | **E2E** | `trie_e2e` | Flaky tests, hardcoded waits, brittle selectors |
418
+
419
+ ---
420
+
421
+ ## Special Agents
454
422
 
455
- ### Review & Explanation
423
+ These agents are **manually invoked**—they don't run during `trie_scan`.
456
424
 
457
- | Agent | Command | What It Does |
458
- |-------|---------|--------------|
459
- | **Super Reviewer** | `trie_pr_review` | Interactive PR review: walks through changes, explains code, finds issues |
460
- | **Agent Smith** | `trie_agent_smith` | Ultimate AI code enforcer: 43 hunters, file analysis, cross-file detection |
461
- | **Comprehension** | `trie_explain` | Plain-language explanations of code, issues, or risks |
425
+ ### Super Reviewer
426
+
427
+ Interactive PR reviews: walks through changes file-by-file with AI guidance.
428
+
429
+ ```
430
+ Use trie_pr_review
431
+ Use trie_pr_review with pr:"12345"
432
+ ```
462
433
 
463
- **Note:** Super Reviewer and Agent Smith are manually invoked agents. They don't run during `trie_scan`; use their dedicated commands directly.
434
+ **What it does:**
435
+ - Orders files for comprehension (schemas → core → implementation → tests)
436
+ - Explains what changed and why
437
+ - Hunts for state bugs, race conditions, missing error handling
438
+ - Pauses after each file for your input
439
+
440
+ **Requirements:** [GitHub CLI (`gh`)](https://cli.github.com/) installed and authenticated
441
+
442
+ ### Agent Smith
443
+
444
+ *"I'm going to be honest with you... I hate this AI code."*
445
+
446
+ The ultimate AI code enforcer—43 specialized hunters targeting AI-generated anti-patterns.
447
+
448
+ ```
449
+ Use trie_agent_smith
450
+ Use trie_smith
451
+ ```
452
+
453
+ **43 Hunters across 9 categories:**
454
+
455
+ | Category | Hunters |
456
+ |----------|---------|
457
+ | **Security** | exposed-secret, frontend-env, hardcoded-localhost, sql-injection, dangeroushtml |
458
+ | **AI Code Smells** | console, any, ts-ignore, eslint-disable, debugger, force-flag |
459
+ | **Async/Promise Bugs** | async-useeffect, async-foreach, missing-await, empty-catch, floating-promise |
460
+ | **React Anti-patterns** | useeffect-abuse, usestate-explosion, index-key, inline-object, prop-drilling |
461
+ | **Missing UX** | missing-loading, missing-error, missing-empty, page-reload |
462
+ | **Backend Issues** | no-validation, raw-error, n-plus-one |
463
+ | **Incomplete Code** | todo, vibe-comment, placeholder, sleep-hack, fallback |
464
+ | **Dead Code** | commented-code, unreachable-code, unused-import, empty-function, dead-branch |
465
+ | **AI Slop Aesthetic** | purple-gradient, star-icon, generic-hero, emoji-overflow, inter-font |
466
+
467
+ **Memory commands:**
468
+ ```
469
+ trie_agent_smith show_stats:true # Show memory statistics
470
+ trie_agent_smith clear_memory:true # Clear all memory
471
+ ```
472
+
473
+ ### Visual QA Browser
474
+
475
+ Screenshot-based visual testing with AI vision analysis.
476
+
477
+ ```
478
+ Use trie_visual_qa_browser
479
+ Use trie_visual_qa_browser url:"http://localhost:3000"
480
+ ```
481
+
482
+ **What it does:**
483
+ 1. Auto-detects running dev server
484
+ 2. Captures screenshots at mobile (375px), tablet (768px), desktop (1440px)
485
+ 3. Returns images for AI vision analysis
486
+
487
+ **Requirements:** Playwright (`npx playwright install chromium`) and a vision-capable model
488
+
489
+ ---
464
490
 
465
491
  ## Custom Agents
466
492
 
@@ -470,64 +496,202 @@ Create specialized agents from any document:
470
496
  Use trie_create_agent with filePath:"./style-guide.pdf" agentName:"my-style"
471
497
  ```
472
498
 
499
+ Supported formats: PDF, Markdown, text files.
500
+
473
501
  Custom agents automatically activate during scans based on their rules.
474
502
 
475
- ## Available Tools
503
+ ---
476
504
 
477
- | Tool | Description |
478
- |------|-------------|
479
- | `trie_scan` | Intelligent scan with automatic agent selection |
480
- | `trie_pr_review` | Interactive PR review - walks through changes file-by-file |
481
- | `trie_agent_smith` | Ultimate AI code enforcer - 43 hunters, file analysis, cross-file detection |
482
- | `trie_fix` | Apply high-confidence fixes |
483
- | `trie_explain` | Plain-language explanations |
484
- | `trie_watch` | Continuous scanning mode |
485
- | `trie_create_agent` | Create custom agent from document |
486
- | `trie_list_agents` | List all available agents |
487
- | `trie_visual_qa_browser` | Screenshot app at 3 viewports for Claude Vision analysis |
505
+ ## Configuration
488
506
 
489
- Plus individual agent tools: `trie_security`, `trie_privacy`, `trie_soc2`, `trie_bugs`, etc.
507
+ ### Config File
490
508
 
491
- ## Example Output
509
+ Create `.trie/config.json` in your project root:
492
510
 
511
+ ```json
512
+ {
513
+ "version": "1.0.0",
514
+ "agents": {
515
+ "enabled": ["security", "privacy", "bugs", "types"],
516
+ "disabled": [],
517
+ "parallel": true,
518
+ "maxConcurrency": 4,
519
+ "timeout": 120000,
520
+ "cache": true
521
+ },
522
+ "compliance": {
523
+ "standards": ["SOC2", "GDPR"],
524
+ "enforceCompliance": false,
525
+ "reportFormat": "json"
526
+ },
527
+ "output": {
528
+ "format": "console",
529
+ "level": "all",
530
+ "interactive": false,
531
+ "streaming": true,
532
+ "colors": true
533
+ },
534
+ "paths": {
535
+ "include": [],
536
+ "exclude": ["node_modules", "dist", "build", ".git"],
537
+ "configDir": ".trie",
538
+ "outputDir": "trie-reports"
539
+ },
540
+ "integrations": {
541
+ "slack": {
542
+ "enabled": false,
543
+ "webhook": "",
544
+ "channel": "#security-alerts"
545
+ },
546
+ "github": {
547
+ "enabled": true
548
+ }
549
+ }
550
+ }
493
551
  ```
494
- TRIE AGENT SCAN
495
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
496
552
 
497
- Smart Triaging:
498
- ✓ Risk Level: high
499
- Agents activated: security, soc2, privacy, architecture
500
- Execution time: 3.2s
553
+ ### Configuration Validation
554
+
555
+ Trie validates configuration on startup using Zod schemas:
556
+ - Invalid configurations log errors and fall back to defaults
557
+ - Missing API keys show warnings
558
+ - File paths are verified to exist
501
559
 
502
- Results: 72/100
560
+ ---
503
561
 
504
- [CRITICAL] 2 Critical Issues
505
- - Hardcoded API key (CC6.1) - src/api.ts:15
506
- - SQL injection risk - src/db.ts:42
562
+ ## Docker
507
563
 
508
- [SERIOUS] 3 Serious Issues (auto-fixable)
509
- [MODERATE] 2 Moderate Issues
564
+ Optimized multi-stage Docker builds for CI/CD or isolated environments.
565
+
566
+ ### Build
567
+
568
+ ```bash
569
+ docker build -t trie-agent .
510
570
  ```
511
571
 
512
- ## Configuration
572
+ ### Run
573
+
574
+ ```bash
575
+ # YOLO mode (auto-fix)
576
+ docker run -v $(pwd):/app trie-agent --yolo
577
+
578
+ # Watch mode (scan only)
579
+ docker run -v $(pwd):/app trie-agent
580
+
581
+ # CI mode (one-shot scan)
582
+ docker run -v $(pwd):/app trie-agent --once
583
+ ```
584
+
585
+ ### Docker Compose
513
586
 
514
- Create `.trie/config.json` to customize:
587
+ ```bash
588
+ docker-compose up
589
+ ```
590
+
591
+ ### Modes
592
+
593
+ | Mode | Flag | Description |
594
+ |------|------|-------------|
595
+ | YOLO | `--yolo` | Auto-fix high-confidence issues |
596
+ | Watch | (default) | Scan on file changes |
597
+ | CI | `--once` | One-shot scan, exit with code |
598
+
599
+ ---
600
+
601
+ ## Team Collaboration
602
+
603
+ Coordinate security scanning across your team with automatic issue assignment and notifications.
604
+
605
+ ### Team Configuration
606
+
607
+ Create `.trie/team.json`:
515
608
 
516
609
  ```json
517
610
  {
518
- "agents": {
519
- "builtin": {
520
- "security": { "enabled": true },
521
- "soc2": { "enabled": true },
522
- "privacy": { "enabled": true }
611
+ "members": [
612
+ {
613
+ "id": "alice",
614
+ "name": "Alice Smith",
615
+ "email": "alice@example.com",
616
+ "slack": "@alice",
617
+ "expertise": ["security", "privacy"],
618
+ "maxIssues": 10
619
+ },
620
+ {
621
+ "id": "bob",
622
+ "name": "Bob Jones",
623
+ "email": "bob@example.com",
624
+ "slack": "@bob",
625
+ "expertise": ["bugs", "performance"],
626
+ "maxIssues": 15
627
+ }
628
+ ]
629
+ }
630
+ ```
631
+
632
+ ### Automatic Issue Assignment
633
+
634
+ Trie automatically assigns issues based on:
635
+ - **Expertise matching** — Security issues go to security experts
636
+ - **Workload balancing** — Respects `maxIssues` limits
637
+ - **Priority weighting** — Critical issues assigned first
638
+
639
+ ### Slack Integration
640
+
641
+ Uses Slack's [Incoming Webhooks](https://api.slack.com/messaging/webhooks) — no OAuth or bot tokens required.
642
+
643
+ **Setup:**
644
+ 1. Go to your Slack workspace → Apps → Incoming Webhooks
645
+ 2. Create a webhook for your channel
646
+ 3. Add to `.trie/config.json`:
647
+
648
+ ```json
649
+ {
650
+ "integrations": {
651
+ "slack": {
652
+ "enabled": true,
653
+ "webhook": "https://hooks.slack.com/services/...",
654
+ "channel": "#security-alerts"
523
655
  }
524
- },
525
- "compliance": {
526
- "standards": ["GDPR", "CCPA", "SOC2"]
527
656
  }
528
657
  }
529
658
  ```
530
659
 
660
+ **Notifications sent for:**
661
+ - Scan completion summaries with issue counts
662
+ - Critical issue alerts (immediate)
663
+ - Issue assignments to team members
664
+ - Escalations for overdue items
665
+ - Daily/weekly team summaries
666
+
667
+ ### Smart Issue Grouping
668
+
669
+ Issues are automatically:
670
+ - **Grouped** by pattern (same issue across files)
671
+ - **Prioritized** by risk score (0-100)
672
+ - **Categorized**: security, performance, maintainability, correctness, style
673
+ - **Bulk-fix detected** for trivial issues
674
+
675
+ ---
676
+
677
+ ## Available Tools
678
+
679
+ | Tool | Description |
680
+ |------|-------------|
681
+ | `trie_scan` | Intelligent scan with automatic agent selection |
682
+ | `trie_pr_review` | Interactive PR review |
683
+ | `trie_agent_smith` | AI code enforcer—43 hunters |
684
+ | `trie_fix` | Apply high-confidence fixes |
685
+ | `trie_explain` | Plain-language explanations |
686
+ | `trie_watch` | Continuous scanning mode |
687
+ | `trie_create_agent` | Create custom agent from document |
688
+ | `trie_list_agents` | List all available agents |
689
+ | `trie_visual_qa_browser` | Screenshot for vision analysis |
690
+
691
+ Plus individual agent tools: `trie_security`, `trie_privacy`, `trie_soc2`, `trie_bugs`, etc.
692
+
693
+ ---
694
+
531
695
  ## License
532
696
 
533
697
  MIT