@triedotdev/mcp 1.0.43 → 1.0.45

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
@@ -3,7 +3,8 @@
3
3
  **A central registry for agents and skills that follow you from Cursor to CI/CD and everything in between.**
4
4
 
5
5
  Download the Trie workspace: https://www.trie.dev
6
- Follow me on X: [@Louiskishfy] (https://x.com/louiskishfy)
6
+
7
+ Follow me on X: https://x.com/louiskishfy
7
8
 
8
9
  ## Why Trie
9
10
 
@@ -13,13 +14,19 @@ The last mile of shipping is where things break—not because your code doesn't
13
14
 
14
15
  ## What's New (latest updates)
15
16
 
16
- - **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.
17
24
 
18
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.
19
26
 
20
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.
21
28
 
22
- - **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.
23
30
 
24
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).
25
32
 
@@ -40,8 +47,10 @@ The last mile of shipping is where things break—not because your code doesn't
40
47
  - [Legal Agent (v2.0)](#legal-agent-v20)
41
48
  - [Design Engineer (v2.0)](#design-engineer-v20)
42
49
  - [Special Agents](#special-agents)
43
- - [Custom Agents](#custom-agents)
50
+ - [Custom Skills](#custom-skills)
44
51
  - [External Skills](#external-skills)
52
+ - [Bootstrap System](#bootstrap-system)
53
+ - [Issue Memory](#issue-memory)
45
54
  - [Project Info Registry](#project-info-registry)
46
55
  - [AI-Enhanced Mode](#ai-enhanced-mode)
47
56
  - [CI/CD Integration](#cicd-integration)
@@ -62,7 +71,7 @@ The last mile of shipping is where things break—not because your code doesn't
62
71
  | **22 Built-in Agents** | Security, Privacy, SOC 2, Legal, Architecture, Performance, E2E, Visual QA, Data Flow, Moneybags, Production Ready, and more |
63
72
  | **Parallel Execution** | True parallel execution with worker threads—3-5x faster scans |
64
73
  | **Result Caching** | File-based caching with SHA256 hashing—70% faster repeated scans |
65
- | **Smart Triaging** | Only activates relevant agents based on code context |
74
+ | **Smart Triaging** | Activates agents based on code context, issue history, and memory patterns |
66
75
  | **Streaming Progress** | Real-time progress updates as agents complete |
67
76
 
68
77
  ### Developer Experience
@@ -70,7 +79,7 @@ The last mile of shipping is where things break—not because your code doesn't
70
79
  | Feature | Description |
71
80
  |---------|-------------|
72
81
  | **Watch Mode** | Automatically scan files as you code |
73
- | **Custom Agents** | Create agents from PDFs, docs, or style guides |
82
+ | **Custom Skills** | Create skills from PDFs, docs, or style guides |
74
83
  | **External Skills** | Install capabilities from Vercel, Anthropic, Expo, Stripe, or any GitHub repo |
75
84
  | **Works Everywhere** | Auto-detects Cursor, Claude Code, OpenCode, VS Code—adapts output automatically |
76
85
  | **AI-Enhanced Mode** | Optional deeper analysis with `ANTHROPIC_API_KEY` |
@@ -231,13 +240,30 @@ Once set up, here's how to use Trie day-to-day.
231
240
  | What type of code you have | Runs the right checks (payments, auth, etc.) automatically |
232
241
  | Scan history | See if issues are getting better or worse |
233
242
 
234
- **This works everywhere automatically:**
235
- - ✅ Cursor remembers between sessions
236
- - Claude Code picks up where you left off
237
- - ✅ CLI shows the same status
238
- - ✅ 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 |
239
261
 
240
- **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.
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
265
+
266
+ **Where it's stored:** `.trie/AGENTS.md` contains your health score and checkpoints. `.trie/memory/` contains searchable issue logs.
241
267
 
242
268
  ### Health Score: The Priority System
243
269
 
@@ -252,24 +278,26 @@ Your **health score** isn't just a number—it actively controls how Trie works
252
278
  **How it works across tools:**
253
279
 
254
280
  ```
255
- Cursor: Scan finds 14 issues → Health drops to 56%
281
+ Cursor: Run trie scan → finds 14 issues → Health drops to 56%
282
+
283
+ Saved to .trie/AGENTS.md
256
284
 
257
- Claude Code: Opens same project → Sees 56% health
285
+ Claude Code: Open same project → read trie://context → sees 56% health
258
286
 
259
- Trie automatically runs more thorough checks
287
+ Run trie scan more thorough checks (low health = all agents)
260
288
 
261
- GitHub Actions: Same health score → Stricter CI gates
289
+ GitHub Actions: Reads .trie/ → same health score → stricter CI gates
262
290
  ```
263
291
 
264
292
  **Why this matters:**
265
293
 
266
- | Scenario | Without Health Score | With Health Score |
267
- |----------|---------------------|-------------------|
268
- | Quick fix in Cursor | Might skip security check | Knows security found issues → runs it |
269
- | Switch to Claude Code | Starts fresh, no context | Picks up your 56% health, stays vigilant |
270
- | 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 |
271
299
 
272
- 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.
273
301
 
274
302
  ---
275
303
 
@@ -395,14 +423,17 @@ These tools are available when using Trie via MCP (Cursor, Claude Code, etc.).
395
423
  | `trie_fix` | Generate fix recommendations for detected issues |
396
424
  | `trie_explain` | Explain code, issues, or changes in plain language |
397
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 |
398
429
 
399
- ### Custom Agent Tools
430
+ ### Custom Skill Tools
400
431
 
401
432
  | Tool | Description |
402
433
  |------|-------------|
403
- | `trie_create_agent` | Create a custom agent from a PDF, TXT, or MD document |
404
- | `trie_save_agent` | Save a custom agent configuration |
405
- | `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) |
406
437
 
407
438
  ### Individual Agent Tools
408
439
 
@@ -463,6 +494,24 @@ trie-agent skills add vercel-labs/agent-skills react-best-practices
463
494
 
464
495
  # List installed skills
465
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
466
515
  ```
467
516
 
468
517
  ### CLI vs MCP Tools
@@ -926,35 +975,35 @@ Run trie_agent_smith on this codebase
926
975
 
927
976
  ---
928
977
 
929
- ## Custom Agents
978
+ ## Custom Skills
930
979
 
931
- 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.
932
981
 
933
- ### Create a Custom Agent
982
+ ### Create a Custom Skill
934
983
 
935
984
  ```
936
- 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"
937
986
  ```
938
987
 
939
988
  Or use the MCP tool directly:
940
989
 
941
990
  ```
942
- 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"
943
992
  ```
944
993
 
945
994
  ### How It Works
946
995
 
947
996
  1. **Parse** — Trie extracts text from your document (PDF, TXT, MD)
948
997
  2. **Compress** — AI distills the document into actionable rules
949
- 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
950
999
 
951
- ### List Custom Agents
1000
+ ### List Custom Skills
952
1001
 
953
1002
  ```
954
- trie_list_agents
1003
+ trie_list_skills
955
1004
  ```
956
1005
 
957
- Custom agents are stored in `.trie/agents/` in your project directory.
1006
+ Custom skills are stored in `.trie/skills/custom/` in your project directory.
958
1007
 
959
1008
  ---
960
1009
 
@@ -964,14 +1013,18 @@ Install reusable capabilities from Vercel, Anthropic, Expo, Stripe, Supabase, or
964
1013
 
965
1014
  ### Key Concept: Agents vs Skills
966
1015
 
967
- | | Agent (Brain) | Skill (Hands) |
968
- |---|---------------|---------------|
1016
+ | | Agent (Brain) | Skill (Knowledge) |
1017
+ |---|---------------|-------------------|
969
1018
  | **Decides when to run** | Yes | No - invoked by agent |
970
- | **Has its own logic** | Yes | No - just instructions |
971
- | **Makes decisions** | Yes | No - follows instructions |
972
- | **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 |
973
1022
 
974
- Skills are applied by the **skill-review agent** during scans.
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)
1026
+
1027
+ Both skill types are applied by the **skill-review agent** during scans and travel with your project.
975
1028
 
976
1029
  ### Install a Skill
977
1030
 
@@ -1080,6 +1133,198 @@ Skills can come from any GitHub repository with a SKILL.md file:
1080
1133
 
1081
1134
  Browse all available skills at [skills.sh](https://skills.sh)
1082
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
+
1083
1328
  ---
1084
1329
 
1085
1330
  ## Project Info Registry