@triedotdev/mcp 1.0.38 → 1.0.40

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
@@ -4,6 +4,8 @@
4
4
 
5
5
  Specialized agents scan your code for security, privacy, compliance, and bugs—all running in parallel with intelligent caching and real-time streaming.
6
6
 
7
+ Also try the agentic workspace for shipping AI-generated code: https://www.trie.dev
8
+
7
9
  ## Why Trie
8
10
 
9
11
  Trie is purpose-built for the last mile of shipping AI-generated code.
@@ -12,6 +14,10 @@ The last mile of shipping is where things break—not because your code doesn't
12
14
 
13
15
  ## What's New (latest updates)
14
16
 
17
+ - **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.
18
+
19
+ - **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.
20
+
15
21
  - **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.
16
22
 
17
23
  - **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).
@@ -28,16 +34,18 @@ The last mile of shipping is where things break—not because your code doesn't
28
34
  - [MCP Tools](#mcp-tools)
29
35
  - [CLI](#cli)
30
36
  - [Built-in Agents](#built-in-agents)
37
+ - [Accessibility Agent (v2.0)](#accessibility-agent-v20)
31
38
  - [Moneybags Agent (v1.1)](#moneybags-agent-v11)
32
39
  - [Legal Agent (v2.0)](#legal-agent-v20)
33
40
  - [Design Engineer (v2.0)](#design-engineer-v20)
34
41
  - [Special Agents](#special-agents)
35
42
  - [Custom Agents](#custom-agents)
43
+ - [Project Info Registry](#project-info-registry)
36
44
  - [AI-Enhanced Mode](#ai-enhanced-mode)
37
45
  - [CI/CD Integration](#cicd-integration)
38
46
  - [VS Code Extension](#vs-code-extension)
39
47
  - [Agent Context System](#agent-context-system)
40
- - [Production Shipping](#production-shipping)
48
+ - [Production Shipping](#production-shipping) (Production Ready Agent)
41
49
  - [Configuration](#configuration)
42
50
  - [License](#license)
43
51
 
@@ -383,6 +391,7 @@ These tools are available when using Trie via MCP (Cursor, Claude Code, etc.).
383
391
  | `trie_watch` | Watch mode—automatically scan files as you code |
384
392
  | `trie_fix` | Generate fix recommendations for detected issues |
385
393
  | `trie_explain` | Explain code, issues, or changes in plain language |
394
+ | `trie_project` | View and manage project info (.trie/PROJECT.md) |
386
395
 
387
396
  ### Custom Agent Tools
388
397
 
@@ -402,7 +411,7 @@ Run a specific agent directly:
402
411
  | `trie_privacy` | GDPR/CCPA/PCI-DSS compliance, PII exposure, logging sensitive data |
403
412
  | `trie_soc2` | Access control gaps, missing audit logs, encryption issues |
404
413
  | `trie_legal` | Licensing, ToS, accessibility, IP, GDPR/CCPA, e-commerce, marketing, COPPA |
405
- | `trie_accessibility` | WCAG 2.1 compliance, keyboard nav, screen readers, color contrast |
414
+ | `trie_accessibility` | WCAG 2.1 AA: icon-only buttons, touch targets, heading levels, ARIA validation, focus management, 20+ checks |
406
415
  | `trie_architecture` | Code organization, SOLID principles, N+1 queries, scalability |
407
416
  | `trie_bugs` | Null safety, edge cases, async issues, common bugs |
408
417
  | `trie_types` | Type errors, missing annotations, null checks |
@@ -483,7 +492,7 @@ trie-agent agents
483
492
 
484
493
  | Agent | Description |
485
494
  |-------|-------------|
486
- | **Accessibility** | WCAG 2.1 compliance, keyboard nav, screen readers, color contrast |
495
+ | **Accessibility** | WCAG 2.1 AA compliance: icon-only buttons, touch targets, heading levels, ARIA validation, color-only indicators, keyboard nav, focus management, 20+ checks |
487
496
  | **Design Engineer** | AI slop detection, verified token systems, contrast validation, design health scoring, domain-aware recommendations |
488
497
  | **User Testing** | Simulate happy path, security tester, confused user, impatient user |
489
498
  | **Visual QA** | Visual regression, responsive design, cross-browser issues |
@@ -501,6 +510,128 @@ trie-agent agents
501
510
 
502
511
  ---
503
512
 
513
+ ## Accessibility Agent (v2.0)
514
+
515
+ The Accessibility Agent has been completely rebuilt to provide comprehensive WCAG 2.1 AA compliance checking—matching and exceeding tools like rams.ai, axe-core, and Lighthouse.
516
+
517
+ ### Severity Levels
518
+
519
+ | Level | Description | Examples |
520
+ |-------|-------------|----------|
521
+ | **Critical** | Blocks access entirely | Images without alt, icon-only buttons without labels, empty links |
522
+ | **Serious** | Significantly impairs access | Focus outline removed, positive tabIndex, missing ARIA attributes |
523
+ | **Moderate** | Creates barriers | Skipped headings, color-only indicators, small touch targets |
524
+ | **Low** | Best practices | Missing semantic elements, external link warnings |
525
+
526
+ ### What It Detects
527
+
528
+ #### Critical Issues
529
+
530
+ | Issue | WCAG | Description |
531
+ |-------|------|-------------|
532
+ | Images without alt text | 1.1.1 | Screen readers cannot describe the image |
533
+ | Icon-only buttons missing aria-label | 4.1.2 | Screen readers announce "button" with no purpose |
534
+ | Non-semantic click handlers | 2.1.1 | `div onClick` without keyboard support blocks keyboard users |
535
+ | Empty links | 2.4.4 | Links with no text content are unusable |
536
+ | Links without href | 2.4.4 | Anchor elements must have destinations |
537
+
538
+ #### Serious Issues
539
+
540
+ | Issue | WCAG | Description |
541
+ |-------|------|-------------|
542
+ | Focus outline removed | 2.4.7 | `outline: none` without replacement hides keyboard focus |
543
+ | Positive tabIndex values | 2.4.3 | `tabIndex={5}` disrupts natural tab order |
544
+ | Role without required ARIA | 4.1.2 | `role="slider"` needs `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
545
+ | Form inputs without labels | 1.3.1 | Inputs must have associated labels or aria-label |
546
+ | Color-only status indicators | 1.4.1 | Red/green for error/success excludes colorblind users |
547
+ | Placeholder as only label | 3.3.2 | Placeholder disappears when user types |
548
+ | Modal without Escape key | 2.1.2 | Keyboard users may be trapped in modal |
549
+
550
+ #### Moderate Issues
551
+
552
+ | Issue | WCAG | Description |
553
+ |-------|------|-------------|
554
+ | Skipped heading levels | 2.4.6 | h1 → h3 confuses screen reader navigation |
555
+ | First heading not h1 | 2.4.6 | Pages should start with h1 |
556
+ | Touch targets under 24px | 2.5.8 | Minimum 24×24px for WCAG AA |
557
+ | Missing autocomplete | 1.3.5 | Helps users fill forms faster |
558
+ | Generic link text | 2.4.4 | "Click here" is meaningless out of context |
559
+ | Missing prefers-reduced-motion | 2.3.3 | Animations can trigger vestibular disorders |
560
+ | Status messages without aria-live | 4.1.3 | Toasts/alerts not announced to screen readers |
561
+
562
+ #### Low Issues
563
+
564
+ | Issue | WCAG | Description |
565
+ |-------|------|-------------|
566
+ | Touch targets under 44px | 2.5.5 | Recommended 44×44px for AAA |
567
+ | Missing semantic elements | 1.3.1 | `<div class="nav">` should be `<nav>` |
568
+ | External links without warning | 3.2.5 | `target="_blank"` should indicate new window |
569
+ | Disabled elements without explanation | — | Users need to know why action is unavailable |
570
+
571
+ ### ARIA Validation
572
+
573
+ The agent validates that ARIA roles have their required attributes:
574
+
575
+ | Role | Required Attributes |
576
+ |------|---------------------|
577
+ | `checkbox` | `aria-checked` |
578
+ | `slider` | `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
579
+ | `combobox` | `aria-expanded`, `aria-controls` |
580
+ | `progressbar` | `aria-valuenow`, `aria-valuemin`, `aria-valuemax` |
581
+ | `tab` | `aria-selected` |
582
+ | `switch` | `aria-checked` |
583
+
584
+ ### Accessibility Score
585
+
586
+ Each scan produces an **Accessibility Score** (0-100) based on issue severity:
587
+
588
+ ```
589
+ ═══════════════════════════════════════════════════
590
+ ACCESSIBILITY REVIEW: src/components/
591
+ ═══════════════════════════════════════════════════
592
+
593
+ CRITICAL (2 issues)
594
+ ───────────────────
595
+ [A11Y] Line 24: Icon-only button missing accessible name
596
+ <button><CloseIcon /></button>
597
+ Fix: Add aria-label="Close"
598
+ WCAG: 4.1.2 Name, Role, Value
599
+
600
+ SERIOUS (1 issue)
601
+ ─────────────────
602
+ [A11Y] Line 48: Focus outline removed without replacement
603
+ className="outline-none"
604
+ Fix: Add focus-visible:ring-2 focus-visible:ring-offset-2
605
+ WCAG: 2.4.7 Focus Visible
606
+
607
+ MODERATE (2 issues)
608
+ ───────────────────
609
+ [A11Y] Line 67: Skipped heading level: h1 to h3
610
+ <h3>Features</h3>
611
+ Fix: Use h2 after h1
612
+ WCAG: 2.4.6 Headings and Labels
613
+
614
+ ═══════════════════════════════════════════════════
615
+ SUMMARY: 2 critical, 1 serious, 2 moderate
616
+ Score: 55/100
617
+ ═══════════════════════════════════════════════════
618
+ ```
619
+
620
+ ### Usage
621
+
622
+ ```bash
623
+ # Run accessibility scan
624
+ trie scan --agents accessibility
625
+
626
+ # Full UI scan (accessibility + design)
627
+ trie scan --agents accessibility,design-engineer
628
+
629
+ # MCP usage
630
+ trie_accessibility
631
+ ```
632
+
633
+ ---
634
+
504
635
  ## Moneybags Agent
505
636
 
506
637
  The Moneybags agent answers the question every CFO asks: **"How much will this bug cost us?"**
@@ -818,6 +949,141 @@ Custom agents are stored in `.trie/agents/` in your project directory.
818
949
 
819
950
  ---
820
951
 
952
+ ## Project Info Registry
953
+
954
+ Store important project-specific information in `.trie/PROJECT.md` that's automatically available to all AI tools.
955
+
956
+ ### Why Project Info?
957
+
958
+ 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:
959
+
960
+ - Project description and purpose
961
+ - Technology stack and frameworks
962
+ - Architecture decisions and patterns
963
+ - Coding conventions and style guidelines
964
+ - Environment info (URLs, API endpoints)
965
+ - Team ownership and contacts
966
+ - Compliance requirements
967
+ - Custom instructions for AI assistants
968
+
969
+ ### Create PROJECT.md
970
+
971
+ **Using CLI:**
972
+ ```bash
973
+ trie-agent project init
974
+ ```
975
+
976
+ **Using MCP (Cursor/Claude Code):**
977
+ ```
978
+ trie_project action="init"
979
+ ```
980
+
981
+ This creates a template at `.trie/PROJECT.md` with sections ready to fill in.
982
+
983
+ ### View Project Info
984
+
985
+ **CLI:**
986
+ ```bash
987
+ trie-agent project
988
+ ```
989
+
990
+ **MCP:**
991
+ ```
992
+ trie_project action="view"
993
+ ```
994
+
995
+ **MCP Resource:**
996
+ ```
997
+ Read trie://project
998
+ ```
999
+
1000
+ ### Update Sections
1001
+
1002
+ **MCP:**
1003
+ ```
1004
+ trie_project action="update" section="Technology Stack" content="- **Language:** TypeScript\n- **Framework:** Next.js 14\n- **Database:** PostgreSQL"
1005
+ ```
1006
+
1007
+ ### How It Works
1008
+
1009
+ ```
1010
+ your-project/
1011
+ ├── .trie/
1012
+ │ └── PROJECT.md ← Your project context
1013
+ ├── src/
1014
+ └── package.json
1015
+ ```
1016
+
1017
+ The PROJECT.md file is:
1018
+ - **Committed to git** — context travels with your code
1019
+ - **Available via `trie://project`** — AI tools can read it directly
1020
+ - **Integrated into `trie://context`** — included in overall project context
1021
+ - **Per-project** — each project has its own file
1022
+
1023
+ ### Template Sections
1024
+
1025
+ | Section | What to Include |
1026
+ |---------|-----------------|
1027
+ | **Project Overview** | What does this project do? Who is it for? |
1028
+ | **Technology Stack** | Languages, frameworks, databases, cloud services |
1029
+ | **Architecture** | Key patterns, system design, important decisions |
1030
+ | **Coding Conventions** | Style rules, naming conventions, patterns to follow |
1031
+ | **Environment** | Dev/staging/prod URLs, API endpoints |
1032
+ | **Team** | Who owns what, contact info |
1033
+ | **Compliance** | GDPR, SOC2, HIPAA requirements |
1034
+ | **AI Instructions** | Special instructions for AI assistants |
1035
+
1036
+ ### Example PROJECT.md
1037
+
1038
+ ```markdown
1039
+ ## Project Overview
1040
+
1041
+ E-commerce platform for sustainable products.
1042
+ Focus on fast checkout and mobile-first UX.
1043
+
1044
+ ## Technology Stack
1045
+
1046
+ - **Language:** TypeScript
1047
+ - **Framework:** Next.js 14 (App Router)
1048
+ - **Database:** PostgreSQL with Prisma ORM
1049
+ - **Hosting:** Vercel + Supabase
1050
+
1051
+ ## Architecture
1052
+
1053
+ - Server Components by default, Client Components only when needed
1054
+ - tRPC for type-safe API calls
1055
+ - Zustand for client state
1056
+
1057
+ ## Coding Conventions
1058
+
1059
+ - Use `pnpm` for package management
1060
+ - Prefer named exports over default exports
1061
+ - Use Tailwind CSS, no inline styles
1062
+ - Tests required for payment-related code
1063
+
1064
+ ## AI Instructions
1065
+
1066
+ When working on this project:
1067
+ 1. Always use Server Components unless client interactivity is needed
1068
+ 2. Check for accessibility issues (we target WCAG AA)
1069
+ 3. Payment code must be reviewed by security agent before commit
1070
+ ```
1071
+
1072
+ ### Multi-Project Support
1073
+
1074
+ Each project has its own `.trie/PROJECT.md`:
1075
+
1076
+ ```
1077
+ ~/projects/
1078
+ ├── project-a/.trie/PROJECT.md ← Project A's context
1079
+ ├── project-b/.trie/PROJECT.md ← Project B's context
1080
+ └── project-c/.trie/PROJECT.md ← Project C's context
1081
+ ```
1082
+
1083
+ 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.
1084
+
1085
+ ---
1086
+
821
1087
  ## AI-Enhanced Mode
822
1088
 
823
1089
  Trie works in two modes:
@@ -933,20 +1199,49 @@ Every time you scan, Trie updates a file in your project (`.trie/AGENTS.md`) wit
933
1199
  | Push to GitHub | CI/CD knows what to focus on |
934
1200
  | Ask Trie "what should I fix?" | Gives prioritized answer based on your history |
935
1201
 
1202
+ ### File Size Management
1203
+
1204
+ The context system uses automatic limits to prevent unbounded growth:
1205
+
1206
+ | Limit | Value | What Happens |
1207
+ |-------|-------|--------------|
1208
+ | Max tracked issues | 500 | Oldest issues pruned when exceeded |
1209
+ | Locations per issue | 5 | Only most recent locations kept |
1210
+ | Scan history | 20 scans | Older scan records removed |
1211
+ | Hot files | 10 files | Only top 10 shown |
1212
+ | Issue age | 30 days | Stale resolved issues pruned |
1213
+
1214
+ You don't need to manage this - Trie automatically prunes old data on each scan.
1215
+
1216
+ ### Multiple Projects
1217
+
1218
+ Each project has its own isolated context:
1219
+
1220
+ | Scenario | How It Works |
1221
+ |----------|--------------|
1222
+ | Switch between projects | Each project has its own `.trie/` folder |
1223
+ | Clone on new machine | Context restored from committed `.trie/` files |
1224
+ | Monorepo with workspaces | Each workspace can have its own `.trie/` |
1225
+ | Team collaboration | Same context when pulling changes |
1226
+
1227
+ Trie auto-detects your project root by looking for `package.json`, `.git`, `Cargo.toml`, `go.mod`, or similar project indicators.
1228
+
936
1229
  ### For Developers: Technical Details
937
1230
 
938
1231
  <details>
939
1232
  <summary>MCP Resources (click to expand)</summary>
940
1233
 
941
1234
  ```
942
- trie://context # AGENTS.md content (read this first)
1235
+ trie://context # Combined context (PROJECT.md + scan results)
1236
+ trie://project # User-defined project info (PROJECT.md)
943
1237
  trie://context/state # Detailed JSON state
944
1238
  trie://agents # Available agents
945
1239
  trie://config # Current configuration
946
1240
  ```
947
1241
 
948
1242
  Files stored:
949
- - `.trie/AGENTS.md` - Human-readable context
1243
+ - `.trie/PROJECT.md` - User-defined project context (description, stack, conventions, AI instructions)
1244
+ - `.trie/AGENTS.md` - Auto-generated scan context
950
1245
  - `.trie/state.json` - Machine-readable state for programmatic access
951
1246
 
952
1247
  </details>
@@ -955,27 +1250,31 @@ Files stored:
955
1250
 
956
1251
  ## Production Shipping
957
1252
 
958
- Trie solves the "last mile" of shipping to production. See [PRODUCTION_SHIPPING.md](./PRODUCTION_SHIPPING.md) for the complete guide.
1253
+ Trie solves the "last mile" of shipping to production with the **Production Ready** agent.
959
1254
 
960
1255
  ### Quick Production Check
961
1256
 
962
1257
  ```bash
963
- # Full production readiness scan
964
- trie scan --agents security,privacy,bugs,performance --fail-on serious
1258
+ # Run production readiness scan
1259
+ trie scan --agents production-ready
965
1260
 
966
- # Or via MCP
967
- trie_scan with agents: ["security", "privacy", "bugs", "performance"]
1261
+ # Full production scan with cost analysis
1262
+ trie scan --agents production-ready,moneybags,security --users 10000
968
1263
  ```
969
1264
 
970
- ### What It Covers
1265
+ ### What Production Ready Checks
971
1266
 
972
1267
  | Area | What's Checked |
973
1268
  |------|----------------|
974
- | **Security Hardening** | SQL injection, XSS, auth bypass, secrets, dependencies |
975
- | **Scalability** | Connection pooling, stateless design, N+1 queries |
976
- | **Architecture** | Circular dependencies, god classes, coupling |
977
- | **Reliability** | Error handling, health checks, timeouts |
978
- | **Revenue Protection** | Payment security, data compliance, business logic |
1269
+ | **Health Endpoints** | `/health`, `/ready`, `/live` endpoints for orchestrators |
1270
+ | **Graceful Shutdown** | SIGTERM handling, connection draining |
1271
+ | **Connection Pooling** | Database pool configuration |
1272
+ | **Security Headers** | CSP, HSTS, X-Frame-Options, etc. |
1273
+ | **Rate Limiting** | API rate limiting configuration |
1274
+ | **Monitoring** | Error tracking, APM integration |
1275
+ | **Session Storage** | External session store (not in-memory) |
1276
+ | **Error Handling** | Global error handlers, no empty catch blocks |
1277
+ | **Anti-patterns** | console.log, localhost URLs, TODO comments |
979
1278
 
980
1279
  ### CI/CD Gate
981
1280
 
@@ -984,7 +1283,7 @@ Add to your workflow:
984
1283
  ```yaml
985
1284
  - uses: triedotdev/trie-action@v1
986
1285
  with:
987
- agents: security,privacy,bugs,performance,architecture
1286
+ agents: production-ready,security,privacy,moneybags
988
1287
  fail-on: serious
989
1288
  upload-sarif: true
990
1289
  ```