tribunal-kit 4.3.1 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/.agent/agents/api-architect.md +66 -66
  2. package/.agent/agents/db-latency-auditor.md +216 -216
  3. package/.agent/agents/precedence-reviewer.md +250 -250
  4. package/.agent/agents/resilience-reviewer.md +88 -88
  5. package/.agent/agents/schema-reviewer.md +67 -67
  6. package/.agent/agents/throughput-optimizer.md +299 -299
  7. package/.agent/agents/ui-ux-auditor.md +292 -292
  8. package/.agent/agents/vitals-reviewer.md +223 -223
  9. package/.agent/scripts/_colors.js +18 -18
  10. package/.agent/scripts/_utils.js +42 -42
  11. package/.agent/scripts/append_flow.js +72 -72
  12. package/.agent/scripts/auto_preview.js +197 -197
  13. package/.agent/scripts/bundle_analyzer.js +290 -290
  14. package/.agent/scripts/case_law_manager.js +17 -6
  15. package/.agent/scripts/checklist.js +266 -266
  16. package/.agent/scripts/colors.js +17 -17
  17. package/.agent/scripts/compress_skills.js +141 -141
  18. package/.agent/scripts/consolidate_skills.js +149 -149
  19. package/.agent/scripts/context_broker.js +611 -609
  20. package/.agent/scripts/deep_compress.js +150 -150
  21. package/.agent/scripts/dependency_analyzer.js +272 -272
  22. package/.agent/scripts/graph_builder.js +151 -37
  23. package/.agent/scripts/graph_visualizer.js +384 -0
  24. package/.agent/scripts/inner_loop_validator.js +451 -465
  25. package/.agent/scripts/lint_runner.js +187 -187
  26. package/.agent/scripts/minify_context.js +100 -100
  27. package/.agent/scripts/mutation_runner.js +280 -0
  28. package/.agent/scripts/patch_skills_meta.js +156 -156
  29. package/.agent/scripts/patch_skills_output.js +244 -244
  30. package/.agent/scripts/schema_validator.js +297 -297
  31. package/.agent/scripts/security_scan.js +303 -303
  32. package/.agent/scripts/session_manager.js +276 -276
  33. package/.agent/scripts/skill_evolution.js +644 -644
  34. package/.agent/scripts/skill_integrator.js +313 -313
  35. package/.agent/scripts/strengthen_skills.js +193 -193
  36. package/.agent/scripts/strip_tribunal.js +47 -47
  37. package/.agent/scripts/swarm_dispatcher.js +360 -360
  38. package/.agent/scripts/test_runner.js +193 -193
  39. package/.agent/scripts/utils.js +32 -32
  40. package/.agent/scripts/verify_all.js +257 -256
  41. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +1 -1
  42. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
  43. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +1 -1
  44. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
  45. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +1 -1
  46. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +1 -1
  47. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +1 -1
  48. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +1 -1
  49. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
  50. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +1 -1
  51. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +1 -1
  52. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +1 -1
  53. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +1 -1
  54. package/.agent/skills/doc.md +1 -1
  55. package/.agent/skills/knowledge-graph/SKILL.md +32 -16
  56. package/.agent/skills/testing-patterns/SKILL.md +19 -2
  57. package/.agent/skills/ui-ux-pro-max/SKILL.md +480 -43
  58. package/.agent/workflows/generate.md +183 -183
  59. package/.agent/workflows/tribunal-speed.md +183 -183
  60. package/README.md +1 -1
  61. package/bin/tribunal-kit.js +134 -17
  62. package/package.json +6 -3
  63. package/scripts/changelog.js +167 -167
  64. package/scripts/sync-version.js +81 -81
  65. package/.agent/scripts/__pycache__/_colors.cpython-311.pyc +0 -0
  66. package/.agent/scripts/__pycache__/_utils.cpython-311.pyc +0 -0
  67. package/.agent/scripts/__pycache__/case_law_manager.cpython-311.pyc +0 -0
@@ -1,36 +1,52 @@
1
1
  ---
2
2
  name: Knowledge Graph Analyzer
3
- description: Understands the architecture and dependencies of the codebase without token bloat.
4
- version: 1.0.0
3
+ description: Understands the architecture, risk blast radius, and dependencies of the codebase without token bloat. Now includes Context Snapshots for 27x token reduction.
4
+ version: 3.0.0
5
5
  ---
6
6
 
7
- # /graph — Knowledge Graph Skill
7
+ # /graph — Knowledge Graph Skill v3.0
8
8
 
9
9
  Use this skill when the user types `/graph` or when you need to deeply understand the architecture of an unfamiliar codebase without suffering from context-window bloat.
10
10
 
11
+ ## The Token Reduction Protocol (Option C)
12
+
13
+ **DO NOT READ RAW SOURCE FILES IF A SNAPSHOT EXISTS.**
14
+ Reading raw project files wastes up to 50,000 tokens per edit. You must use the pre-computed Context Snapshots instead. These snapshots contain the file's content, resolved imports, dependent files, and risk scores all in one JSON blob.
15
+
11
16
  ## Pre-Flight Checklist
12
- Before answering architectural questions or making broad code changes, you must understand the environment.
13
- - [ ] Have I run the Macro Mapper to get the high-level architecture?
14
- - [ ] Have I used the Micro Zoomer on the specific files related to the user's request to see their exact signatures?
17
+ - [ ] Have I run the Macro Mapper to generate the latest Context Snapshots?
18
+ - [ ] Am I reading from `.agent/history/snapshots/` instead of directly grepping the project?
19
+ - [ ] Have I respected the `blastRadius` before modifying a file?
15
20
 
16
21
  ## Execution Protocol
17
22
 
18
- 1. **Step 1: The Macro Map (World View)**
19
- Execute the graph builder to map module boundaries. This runs incrementally and respects `.gitignore`.
23
+ 1. **Step 1: The Macro Map (Blast Radius & Snapshot Engine)**
24
+ Execute the graph builder to map module boundaries and compute downstream risk scores. This also automatically generates a Context Snapshot for every file.
20
25
  ```bash
21
26
  node .agent/scripts/graph_builder.js
22
27
  ```
23
- Read the output file at `.agent/history/architecture-graph.yaml`. **Do NOT try to read every file in the project.** Use this map to identify which files export the functions or components you need.
24
28
 
25
- 2. **Step 2: The Micro Zoom (Street View)**
26
- Once you know which file to investigate, use the zoomer to get its structural skeleton. This strips out the internal logic and returns only imports, exports, class signatures, and function parameters.
29
+ 2. **Step 2: Read Context Snapshots (MANDATORY)**
30
+ Instead of using `cat` or `grep` to read a file, read its snapshot. Snapshots are stored in `.agent/history/snapshots/` with slashes replaced by `__`.
31
+ *Example:* To edit `src/middleware/auth.js`, read `.agent/history/snapshots/src__middleware__auth.js.json`.
32
+
33
+ This gives you:
34
+ - The full source code of the target file.
35
+ - The exported symbols of every file it imports.
36
+ - The list of files that depend on it.
37
+ - Its exact `riskScore` and `blastRadius`.
38
+
39
+ 3. **Step 3: Interactive Visualization (For Humans)**
40
+ The user can view a sleek, zero-dependency visualizer of the codebase. You can prompt them to run:
27
41
  ```bash
28
- node .agent/scripts/graph_zoom.js --focus <path_to_file>
42
+ npx tribunal-kit graph
29
43
  ```
30
- *Example: `node .agent/scripts/graph_zoom.js --focus src/components/Button.tsx`*
31
44
 
32
- 3. **Step 3: Analyze and Advise**
33
- Present the user with your findings. Highlight hidden dependencies, circular imports, or structural insights based on what you discovered in the graphs.
45
+ 4. **Step 4: The Micro Zoom (Legacy Street View)**
46
+ If a snapshot is unavailable or too large, you can fall back to the zoomer to get its structural skeleton:
47
+ ```bash
48
+ node .agent/scripts/graph_zoom.js --focus <path_to_file>
49
+ ```
34
50
 
35
51
  ## VBC Protocol (Verification-Before-Completion)
36
- You are explicitly forbidden from guessing or "hallucinating" what functions, props, or variables exist inside a file. You MUST use the `graph_zoom.js` script to verify a component's exact signature before you attempt to call it, mock it, or rewrite it.
52
+ You are explicitly forbidden from guessing or "hallucinating" what functions, props, or variables exist inside a file. You MUST read the Context Snapshot (or use `graph_zoom.js`) to verify a component's exact signature before you attempt to call it, mock it, or rewrite it. Always respect the Blast Radius Risk Score before deleting or mutating files.
@@ -2,8 +2,8 @@
2
2
  name: testing-patterns
3
3
  description: Testing mastery across stacks. Unit testing with Jest/Vitest/pytest, integration testing, E2E with Playwright, mocking strategies, test architecture (AAA, Given-When-Then), code coverage, snapshot testing, API testing, component testing with Testing Library, and TDD workflow. Use when writing tests, designing test architecture, or improving test coverage.
4
4
  allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 2.0.0
6
- last-updated: 2026-04-01
5
+ version: 2.1.0
6
+ last-updated: 2026-04-26
7
7
  applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
8
  ---
9
9
 
@@ -471,6 +471,23 @@ describe("POST /api/users", () => {
471
471
 
472
472
  ---
473
473
 
474
+ ## Mutation Testing (Tribunal Engine)
475
+
476
+ ```bash
477
+ # Run the Tribunal Mutation Engine
478
+ npx tribunal-kit mutate src/math.js "npx jest src/math.test.js"
479
+ ```
480
+
481
+ ```
482
+ Mutation Engine rules:
483
+ - Code coverage only proves code was EXECUTED, not that it was TESTED.
484
+ - The Mutation Engine swaps operators (=== to !==) and verifies the test suite FAILS.
485
+ - If the test passes despite the mutation, the mutant "survives" (false positive test).
486
+ - Use this engine on critical business logic to eradicate LLM "tautological" tests.
487
+ ```
488
+
489
+ ---
490
+
474
491
  ## Code Coverage
475
492
 
476
493
  ```jsonc