@triedotdev/mcp 1.0.44 → 1.0.46

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
@@ -14,13 +14,19 @@ The last mile of shipping is where things break—not because your code doesn't
14
14
 
15
15
  ## What's New (latest updates)
16
16
 
17
- - **External Skills**: Install reusable capabilities from Vercel, Anthropic, Expo, Stripe, Supabase, or any GitHub repository. Skills are applied by the skill-review agent during scans and tracked in your project context. Browse available skills at [skills.sh](https://skills.sh).
17
+ - **Bootstrap System**: Run `trie init` to auto-detect your stack (framework, language, database). Optionally customize `.trie/RULES.md` for coding standards. Works out of the box - no config required.
18
+
19
+ - **Issue Memory & Cross-Project Learning**: Issues are now stored in `.trie/memory/` with BM25 search (same algorithm as Elasticsearch). Intelligent compaction summarizes old issues instead of deleting them, tracking trends and recurring patterns over time.
20
+
21
+ - **Extended Skill Gating**: Skills can now declare requirements for npm dependencies, environment variables, binaries in PATH, and config files. Only skills whose requirements match your project environment are loaded.
22
+
23
+ - **External Skills**: Install reusable capabilities from Vercel, Anthropic, Expo, Stripe, Supabase, or any GitHub repository. Skills are applied by the skill-review agent during scans and tracked in your project context.
18
24
 
19
25
  - **Project Info Registry**: Store important project context in `.trie/PROJECT.md` that travels with you across Claude Code, Cursor, GitHub Actions, and CLI. Define your project description, tech stack, conventions, architecture, and custom AI instructions—all in one place.
20
26
 
21
27
  - **Accessibility Agent (v2.0)**: Comprehensive WCAG 2.1 AA compliance. Detects icon-only buttons, touch targets, skipped headings, positive tabIndex, ARIA validation, color-only indicators, and 20+ more checks with WCAG criterion references.
22
28
 
23
- - **Health Score Triaging**: Your health score (0-100) now actively controls what agents run. Below 50%? All agents run automatically. Agents that found issues before get boosted priority in future scans.
29
+ - **Memory-Influenced Triaging**: The triager now uses issue memory to boost agent priority. Agents that found issues before, have recurring patterns, or have cross-project patterns get boosted confidence. If your codebase trend is "declining", all agents get a slight boost.
24
30
 
25
31
  - **Moneybags Agent**: Estimates dollar cost of bugs using IBM/NIST research. Costs scale with your user count—use `--users 10000` to match your scale (default: 250 users).
26
32
 
@@ -41,8 +47,10 @@ The last mile of shipping is where things break—not because your code doesn't
41
47
  - [Legal Agent (v2.0)](#legal-agent-v20)
42
48
  - [Design Engineer (v2.0)](#design-engineer-v20)
43
49
  - [Special Agents](#special-agents)
44
- - [Custom Agents](#custom-agents)
50
+ - [Custom Skills](#custom-skills)
45
51
  - [External Skills](#external-skills)
52
+ - [Bootstrap System](#bootstrap-system)
53
+ - [Issue Memory](#issue-memory)
46
54
  - [Project Info Registry](#project-info-registry)
47
55
  - [AI-Enhanced Mode](#ai-enhanced-mode)
48
56
  - [CI/CD Integration](#cicd-integration)
@@ -63,7 +71,7 @@ The last mile of shipping is where things break—not because your code doesn't
63
71
  | **22 Built-in Agents** | Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Moneybags, Production Ready, and more |
64
72
  | **Parallel Execution** | True parallel execution with worker threads—3-5x faster scans |
65
73
  | **Result Caching** | File-based caching with SHA256 hashing—70% faster repeated scans |
66
- | **Smart Triaging** | Only activates relevant agents based on code context |
74
+ | **Smart Triaging** | Activates agents based on code context, issue history, and memory patterns |
67
75
  | **Streaming Progress** | Real-time progress updates as agents complete |
68
76
 
69
77
  ### Developer Experience
@@ -71,7 +79,7 @@ The last mile of shipping is where things break—not because your code doesn't
71
79
  | Feature | Description |
72
80
  |---------|-------------|
73
81
  | **Watch Mode** | Automatically scan files as you code |
74
- | **Custom Agents** | Create agents from PDFs, docs, or style guides |
82
+ | **Custom Skills** | Create skills from PDFs, docs, or style guides |
75
83
  | **External Skills** | Install capabilities from Vercel, Anthropic, Expo, Stripe, or any GitHub repo |
76
84
  | **Works Everywhere** | Auto-detects Cursor, Claude Code, OpenCode, VS Code—adapts output automatically |
77
85
  | **AI-Enhanced Mode** | Optional deeper analysis with `ANTHROPIC_API_KEY` |
@@ -232,13 +240,30 @@ Once set up, here's how to use Trie day-to-day.
232
240
  | What type of code you have | Runs the right checks (payments, auth, etc.) automatically |
233
241
  | Scan history | See if issues are getting better or worse |
234
242
 
235
- **This works everywhere automatically:**
236
- - ✅ Cursor remembers between sessions
237
- - Claude Code picks up where you left off
238
- - ✅ CLI shows the same status
239
- - ✅ GitHub Actions uses the same context
243
+ **How context sharing works:**
244
+
245
+ Think of `trie scan` and `trie checkpoint` as saving your game. Context is captured when you run them:
246
+
247
+ ```
248
+ trie scan (full analysis) or trie checkpoint (quick save)
249
+
250
+ Saves to .trie/AGENTS.md, .trie/memory/
251
+
252
+ Open same project in Claude Code
253
+
254
+ Claude Code reads trie://context → sees your history
255
+ ```
256
+
257
+ | Command | What It Does |
258
+ |---------|--------------|
259
+ | `trie scan` | Full analysis - runs agents, finds issues, updates health score |
260
+ | `trie checkpoint "message"` | Quick save - saves your current context without running agents |
261
+
262
+ - Context persists in `.trie/` files in your project directory
263
+ - Any MCP client (Cursor, Claude Code) can read `trie://context`
264
+ - CLI and GitHub Actions read the same `.trie/` files
240
265
 
241
- **Where it's stored:** A file called `.trie/AGENTS.md` in your project. You can look at it anytime to see your project's health status.
266
+ **Where it's stored:** `.trie/AGENTS.md` contains your health score and checkpoints. `.trie/memory/` contains searchable issue logs.
242
267
 
243
268
  ### Health Score: The Priority System
244
269
 
@@ -253,24 +278,26 @@ Your **health score** isn't just a number—it actively controls how Trie works
253
278
  **How it works across tools:**
254
279
 
255
280
  ```
256
- Cursor: Scan finds 14 issues → Health drops to 56%
281
+ Cursor: Run trie scan → finds 14 issues → Health drops to 56%
257
282
 
258
- Claude Code: Opens same project → Sees 56% health
283
+ Saved to .trie/AGENTS.md
259
284
 
260
- Trie automatically runs more thorough checks
285
+ Claude Code: Open same project → read trie://context → sees 56% health
261
286
 
262
- GitHub Actions: Same health score Stricter CI gates
287
+ Run trie scan more thorough checks (low health = all agents)
288
+
289
+ GitHub Actions: Reads .trie/ → same health score → stricter CI gates
263
290
  ```
264
291
 
265
292
  **Why this matters:**
266
293
 
267
- | Scenario | Without Health Score | With Health Score |
268
- |----------|---------------------|-------------------|
269
- | Quick fix in Cursor | Might skip security check | Knows security found issues → runs it |
270
- | Switch to Claude Code | Starts fresh, no context | Picks up your 56% health, stays vigilant |
271
- | Push to GitHub | Generic checks | Focused on your known problem areas |
294
+ | Scenario | Without Trie | With Trie |
295
+ |----------|--------------|-----------|
296
+ | Quick fix in Cursor | No history | Run `trie scan` → knows security found issues → runs it |
297
+ | Switch to Claude Code | Starts fresh | Reads `.trie/` picks up your 56% health |
298
+ | Push to GitHub | Generic checks | Reads `.trie/` → focused on known problem areas |
272
299
 
273
- The health score ensures your project's context **travels with you** across every tool.
300
+ The `.trie/` directory ensures your project's context **travels with you** across every tool. Just run `trie scan` to capture it.
274
301
 
275
302
  ---
276
303
 
@@ -396,14 +423,17 @@ These tools are available when using Trie via MCP (Cursor, Claude Code, etc.).
396
423
  | `trie_fix` | Generate fix recommendations for detected issues |
397
424
  | `trie_explain` | Explain code, issues, or changes in plain language |
398
425
  | `trie_project` | View and manage project info (.trie/PROJECT.md) |
426
+ | `trie_init` | Initialize bootstrap files, detect stack, suggest skills |
427
+ | `trie_memory` | Search and manage issue memory across projects |
428
+ | `trie_checkpoint` | Quick save context without running a full scan |
399
429
 
400
- ### Custom Agent Tools
430
+ ### Custom Skill Tools
401
431
 
402
432
  | Tool | Description |
403
433
  |------|-------------|
404
- | `trie_create_agent` | Create a custom agent from a PDF, TXT, or MD document |
405
- | `trie_save_agent` | Save a custom agent configuration |
406
- | `trie_list_agents` | List all registered agents (built-in and custom) |
434
+ | `trie_create_skill` | Create a custom skill from a PDF, TXT, or MD document |
435
+ | `trie_save_skill` | Save a custom skill configuration |
436
+ | `trie_list_skills` | List all skills (external and custom) |
407
437
 
408
438
  ### Individual Agent Tools
409
439
 
@@ -464,6 +494,24 @@ trie-agent skills add vercel-labs/agent-skills react-best-practices
464
494
 
465
495
  # List installed skills
466
496
  trie-agent skills list
497
+
498
+ # Initialize bootstrap files
499
+ trie-agent init
500
+
501
+ # Search issue memory
502
+ trie-agent memory search "SQL injection"
503
+
504
+ # View cross-project patterns
505
+ trie-agent memory global patterns
506
+
507
+ # Quick save (checkpoint without full scan)
508
+ trie-agent checkpoint "finished auth flow"
509
+
510
+ # List checkpoints
511
+ trie-agent checkpoint list
512
+
513
+ # View skills
514
+ trie-agent skills list
467
515
  ```
468
516
 
469
517
  ### CLI vs MCP Tools
@@ -927,35 +975,35 @@ Run trie_agent_smith on this codebase
927
975
 
928
976
  ---
929
977
 
930
- ## Custom Agents
978
+ ## Custom Skills
931
979
 
932
- Create your own agents from PDFs, style guides, or documentation.
980
+ 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.
933
981
 
934
- ### Create a Custom Agent
982
+ ### Create a Custom Skill
935
983
 
936
984
  ```
937
- Create a custom agent from my-style-guide.pdf called "brand_guidelines"
985
+ Create a custom skill from my-style-guide.pdf called "brand_guidelines"
938
986
  ```
939
987
 
940
988
  Or use the MCP tool directly:
941
989
 
942
990
  ```
943
- trie_create_agent with filePath: "./docs/style-guide.pdf", agentName: "brand_guidelines"
991
+ trie_create_skill with filePath: "./docs/style-guide.pdf", skillName: "brand_guidelines"
944
992
  ```
945
993
 
946
994
  ### How It Works
947
995
 
948
996
  1. **Parse** — Trie extracts text from your document (PDF, TXT, MD)
949
997
  2. **Compress** — AI distills the document into actionable rules
950
- 3. **Register** — The agent is saved to `.trie/agents/` and loaded automatically
998
+ 3. **Register** — The skill is saved to `.trie/skills/custom/` and runs automatically during scans
951
999
 
952
- ### List Custom Agents
1000
+ ### List Custom Skills
953
1001
 
954
1002
  ```
955
- trie_list_agents
1003
+ trie_list_skills
956
1004
  ```
957
1005
 
958
- Custom agents are stored in `.trie/agents/` in your project directory.
1006
+ Custom skills are stored in `.trie/skills/custom/` in your project directory.
959
1007
 
960
1008
  ---
961
1009
 
@@ -965,14 +1013,18 @@ Install reusable capabilities from Vercel, Anthropic, Expo, Stripe, Supabase, or
965
1013
 
966
1014
  ### Key Concept: Agents vs Skills
967
1015
 
968
- | | Agent (Brain) | Skill (Hands) |
969
- |---|---------------|---------------|
1016
+ | | Agent (Brain) | Skill (Knowledge) |
1017
+ |---|---------------|-------------------|
970
1018
  | **Decides when to run** | Yes | No - invoked by agent |
971
- | **Has its own logic** | Yes | No - just instructions |
972
- | **Makes decisions** | Yes | No - follows instructions |
973
- | **Examples** | SecurityAgent, CustomAgent | react-best-practices SKILL.md |
1019
+ | **Has its own logic** | Yes | No - detection patterns |
1020
+ | **Makes decisions** | Yes | No - follows rules |
1021
+ | **Examples** | SecurityAgent, TriagerAgent | react-best-practices, brand_guidelines |
1022
+
1023
+ **Two types of skills:**
1024
+ - **External Skills** — Installed from GitHub repos (e.g., `vercel-labs/agent-skills`)
1025
+ - **Custom Skills** — Created from your documents (PDFs, style guides, books)
974
1026
 
975
- Skills are applied by the **skill-review agent** during scans.
1027
+ Both skill types are applied by the **skill-review agent** during scans and travel with your project.
976
1028
 
977
1029
  ### Install a Skill
978
1030
 
@@ -1081,6 +1133,198 @@ Skills can come from any GitHub repository with a SKILL.md file:
1081
1133
 
1082
1134
  Browse all available skills at [skills.sh](https://skills.sh)
1083
1135
 
1136
+ ### Skill Gating
1137
+
1138
+ Skills can declare requirements in their frontmatter. Only skills whose requirements are met are loaded.
1139
+
1140
+ **Simple (backwards compatible):**
1141
+
1142
+ ```yaml
1143
+ ---
1144
+ name: react-best-practices
1145
+ description: React and Next.js optimization
1146
+ requires: [react, next]
1147
+ ---
1148
+ ```
1149
+
1150
+ **Extended requirements:**
1151
+
1152
+ ```yaml
1153
+ ---
1154
+ name: docker-deploy-skill
1155
+ description: Docker deployment best practices
1156
+ requirements:
1157
+ deps: [docker-compose] # npm deps (all required)
1158
+ anyDeps: [react, vue, svelte] # At least one required
1159
+ env: [DOCKER_HOST, CI] # Environment variables
1160
+ bins: [docker, kubectl] # Binaries in PATH
1161
+ configFiles: [Dockerfile] # Files that must exist
1162
+ ---
1163
+ ```
1164
+
1165
+ | Check | What It Does |
1166
+ |-------|--------------|
1167
+ | `deps` | All listed npm packages must be in package.json |
1168
+ | `anyDeps` | At least one must be present (OR condition) |
1169
+ | `env` | Environment variables must be set |
1170
+ | `bins` | Binaries must be available in PATH |
1171
+ | `configFiles` | Files must exist in project root |
1172
+
1173
+ When you install skills, they're automatically filtered based on your project:
1174
+ - A React skill with `requires: [react]` only loads in React projects
1175
+ - A Docker skill with `requirements.bins: [docker]` only loads when Docker is installed
1176
+ - Skills without requirements always load
1177
+
1178
+ This prevents irrelevant skills from cluttering your scans.
1179
+
1180
+ ---
1181
+
1182
+ ## Bootstrap System
1183
+
1184
+ Trie works out of the box - no setup required. Run `trie init` to optionally create context files for customization.
1185
+
1186
+ ### Files (all optional)
1187
+
1188
+ | File | Purpose |
1189
+ |------|---------|
1190
+ | `.trie/RULES.md` | Your coding standards (edit to customize) |
1191
+ | `.trie/TEAM.md` | Team ownership and escalation paths |
1192
+ | `.trie/PROJECT.md` | Project overview and conventions |
1193
+ | `.trie/BOOTSTRAP.md` | First-run checklist (auto-deleted when complete) |
1194
+
1195
+ ### Initialize
1196
+
1197
+ **CLI:**
1198
+ ```bash
1199
+ trie init
1200
+ ```
1201
+
1202
+ **MCP:**
1203
+ ```
1204
+ trie_init
1205
+ ```
1206
+
1207
+ This auto-detects your stack and creates optional templates:
1208
+
1209
+ ```
1210
+ Detected Stack:
1211
+ Framework: Next.js 14.0.0
1212
+ Language: TypeScript
1213
+ Database: Prisma ORM
1214
+ Auth: NextAuth.js
1215
+
1216
+ Suggested Skills:
1217
+ trie skills add vercel-labs/agent-skills react-best-practices
1218
+ ```
1219
+
1220
+ ### Commands
1221
+
1222
+ ```bash
1223
+ # Initialize bootstrap files
1224
+ trie init
1225
+
1226
+ # Check bootstrap status
1227
+ trie init status
1228
+
1229
+ # Mark bootstrap complete (deletes BOOTSTRAP.md)
1230
+ trie init complete
1231
+ ```
1232
+
1233
+ ### MCP Resources
1234
+
1235
+ ```
1236
+ trie://bootstrap # Bootstrap status
1237
+ trie://rules # User-defined coding standards
1238
+ trie://team # Team ownership info
1239
+ ```
1240
+
1241
+ ---
1242
+
1243
+ ## Issue Memory
1244
+
1245
+ Trie stores all detected issues for search and cross-project learning. Uses BM25 ranking (same algorithm as Elasticsearch) for intelligent search.
1246
+
1247
+ ### Local Memory (`.trie/memory/`)
1248
+
1249
+ Issues from each scan are stored locally:
1250
+ - `issues.json` - Searchable issue index with BM25 ranking
1251
+ - `YYYY-MM-DD.md` - Daily issue logs
1252
+ - `compacted-summaries.json` - Historical summaries (auto-generated)
1253
+
1254
+ ### Search Issues
1255
+
1256
+ **CLI:**
1257
+ ```bash
1258
+ # Search by keyword
1259
+ trie memory search "SQL injection"
1260
+
1261
+ # View recent issues
1262
+ trie memory recent
1263
+
1264
+ # Show statistics
1265
+ trie memory stats
1266
+
1267
+ # Mark issue resolved
1268
+ trie memory resolve <issue-id>
1269
+ ```
1270
+
1271
+ **MCP:**
1272
+ ```
1273
+ trie_memory action="search" query="SQL injection"
1274
+ trie_memory action="stats"
1275
+ trie_memory action="recent" limit=10
1276
+ ```
1277
+
1278
+ ### Cross-Project Memory (`~/.trie/memory/`)
1279
+
1280
+ Patterns are tracked across all your projects:
1281
+
1282
+ ```bash
1283
+ # View patterns across projects
1284
+ trie memory global patterns
1285
+
1286
+ # List tracked projects
1287
+ trie memory global projects
1288
+
1289
+ # Search global patterns
1290
+ trie memory global search "authentication"
1291
+ ```
1292
+
1293
+ ### MCP Resources
1294
+
1295
+ ```
1296
+ trie://memory # Local issue stats and recent issues
1297
+ trie://memory/global # Cross-project patterns and stats
1298
+ ```
1299
+
1300
+ ### How It Works
1301
+
1302
+ 1. **BM25 Search**: Uses term frequency, inverse document frequency, and document length normalization for ranking
1303
+ 2. **Pattern Detection**: Issues are normalized and hashed to detect patterns
1304
+ 3. **Cross-Project Tracking**: Same pattern in multiple projects is tracked
1305
+ 4. **Fix Propagation**: When you fix a pattern, it's recorded for other projects
1306
+ 5. **Smart Suggestions**: Global patterns inform local scans
1307
+
1308
+ ### Intelligent Compaction
1309
+
1310
+ Instead of deleting old issues, Trie summarizes them:
1311
+
1312
+ - **Automatic**: When issues exceed 500, old ones (>30 days) are compacted
1313
+ - **Summaries**: Top patterns, hot files, severity breakdown preserved
1314
+ - **Trends**: Tracks if codebase is improving, stable, or declining
1315
+ - **Recurring Patterns**: Identifies issues that keep appearing across periods
1316
+ - **12 Month History**: Keeps up to 12 compacted summaries
1317
+
1318
+ ```bash
1319
+ # View stats including historical data
1320
+ trie memory stats
1321
+
1322
+ # Output includes:
1323
+ # Total Issues: 150
1324
+ # Historical: 1,200 (from compacted summaries)
1325
+ # Trend: improving
1326
+ ```
1327
+
1084
1328
  ---
1085
1329
 
1086
1330
  ## Project Info Registry