tribunal-kit 4.3.0 → 4.3.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 (98) hide show
  1. package/.agent/scripts/case_law_manager.js +684 -684
  2. package/.agent/scripts/graph_builder.js +199 -0
  3. package/.agent/scripts/graph_zoom.js +154 -0
  4. package/.agent/skills/agent-organizer/SKILL.md +9 -1
  5. package/.agent/skills/agentic-patterns/SKILL.md +9 -1
  6. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +9 -1
  7. package/.agent/skills/api-patterns/SKILL.md +206 -198
  8. package/.agent/skills/api-security-auditor/SKILL.md +9 -1
  9. package/.agent/skills/app-builder/SKILL.md +9 -1
  10. package/.agent/skills/app-builder/templates/SKILL.md +77 -69
  11. package/.agent/skills/appflow-wireframe/SKILL.md +9 -1
  12. package/.agent/skills/architecture/SKILL.md +9 -1
  13. package/.agent/skills/authentication-best-practices/SKILL.md +9 -1
  14. package/.agent/skills/bash-linux/SKILL.md +9 -1
  15. package/.agent/skills/behavioral-modes/SKILL.md +9 -1
  16. package/.agent/skills/brainstorming/SKILL.md +9 -1
  17. package/.agent/skills/building-native-ui/SKILL.md +9 -1
  18. package/.agent/skills/clean-code/SKILL.md +9 -1
  19. package/.agent/skills/code-review-checklist/SKILL.md +9 -1
  20. package/.agent/skills/config-validator/SKILL.md +9 -1
  21. package/.agent/skills/csharp-developer/SKILL.md +9 -1
  22. package/.agent/skills/data-validation-schemas/SKILL.md +287 -279
  23. package/.agent/skills/database-design/SKILL.md +199 -191
  24. package/.agent/skills/deployment-procedures/SKILL.md +9 -1
  25. package/.agent/skills/devops-engineer/SKILL.md +9 -1
  26. package/.agent/skills/devops-incident-responder/SKILL.md +9 -1
  27. package/.agent/skills/documentation-templates/SKILL.md +9 -1
  28. package/.agent/skills/edge-computing/SKILL.md +9 -1
  29. package/.agent/skills/error-resilience/SKILL.md +387 -379
  30. package/.agent/skills/extract-design-system/SKILL.md +9 -1
  31. package/.agent/skills/framer-motion-expert/SKILL.md +203 -195
  32. package/.agent/skills/frontend-design/SKILL.md +160 -152
  33. package/.agent/skills/game-design-expert/SKILL.md +9 -1
  34. package/.agent/skills/game-engineering-expert/SKILL.md +9 -1
  35. package/.agent/skills/geo-fundamentals/SKILL.md +9 -1
  36. package/.agent/skills/github-operations/SKILL.md +9 -1
  37. package/.agent/skills/gsap-core/SKILL.md +54 -46
  38. package/.agent/skills/gsap-frameworks/SKILL.md +54 -46
  39. package/.agent/skills/gsap-performance/SKILL.md +54 -46
  40. package/.agent/skills/gsap-plugins/SKILL.md +54 -46
  41. package/.agent/skills/gsap-react/SKILL.md +54 -46
  42. package/.agent/skills/gsap-scrolltrigger/SKILL.md +54 -46
  43. package/.agent/skills/gsap-timeline/SKILL.md +54 -46
  44. package/.agent/skills/gsap-utils/SKILL.md +54 -46
  45. package/.agent/skills/i18n-localization/SKILL.md +9 -1
  46. package/.agent/skills/intelligent-routing/SKILL.md +38 -30
  47. package/.agent/skills/knowledge-graph/SKILL.md +36 -0
  48. package/.agent/skills/lint-and-validate/SKILL.md +9 -1
  49. package/.agent/skills/llm-engineering/SKILL.md +9 -1
  50. package/.agent/skills/local-first/SKILL.md +9 -1
  51. package/.agent/skills/mcp-builder/SKILL.md +9 -1
  52. package/.agent/skills/mobile-design/SKILL.md +222 -214
  53. package/.agent/skills/monorepo-management/SKILL.md +293 -285
  54. package/.agent/skills/motion-engineering/SKILL.md +193 -185
  55. package/.agent/skills/nextjs-react-expert/SKILL.md +193 -185
  56. package/.agent/skills/nodejs-best-practices/SKILL.md +9 -1
  57. package/.agent/skills/observability/SKILL.md +9 -1
  58. package/.agent/skills/parallel-agents/SKILL.md +9 -1
  59. package/.agent/skills/performance-profiling/SKILL.md +9 -1
  60. package/.agent/skills/plan-writing/SKILL.md +9 -1
  61. package/.agent/skills/platform-engineer/SKILL.md +9 -1
  62. package/.agent/skills/playwright-best-practices/SKILL.md +9 -1
  63. package/.agent/skills/powershell-windows/SKILL.md +9 -1
  64. package/.agent/skills/project-idioms/SKILL.md +9 -1
  65. package/.agent/skills/python-patterns/SKILL.md +9 -1
  66. package/.agent/skills/python-pro/SKILL.md +282 -274
  67. package/.agent/skills/react-specialist/SKILL.md +236 -228
  68. package/.agent/skills/readme-builder/SKILL.md +9 -1
  69. package/.agent/skills/realtime-patterns/SKILL.md +9 -1
  70. package/.agent/skills/red-team-tactics/SKILL.md +9 -1
  71. package/.agent/skills/rust-pro/SKILL.md +9 -1
  72. package/.agent/skills/seo-fundamentals/SKILL.md +9 -1
  73. package/.agent/skills/server-management/SKILL.md +9 -1
  74. package/.agent/skills/shadcn-ui-expert/SKILL.md +9 -1
  75. package/.agent/skills/skill-creator/SKILL.md +9 -1
  76. package/.agent/skills/sql-pro/SKILL.md +9 -1
  77. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +9 -1
  78. package/.agent/skills/swiftui-expert/SKILL.md +9 -1
  79. package/.agent/skills/systematic-debugging/SKILL.md +9 -1
  80. package/.agent/skills/tailwind-patterns/SKILL.md +9 -1
  81. package/.agent/skills/tdd-workflow/SKILL.md +9 -1
  82. package/.agent/skills/test-result-analyzer/SKILL.md +9 -1
  83. package/.agent/skills/testing-patterns/SKILL.md +9 -1
  84. package/.agent/skills/trend-researcher/SKILL.md +9 -1
  85. package/.agent/skills/typescript-advanced/SKILL.md +294 -286
  86. package/.agent/skills/ui-ux-pro-max/SKILL.md +9 -1
  87. package/.agent/skills/ui-ux-researcher/SKILL.md +9 -1
  88. package/.agent/skills/vue-expert/SKILL.md +234 -226
  89. package/.agent/skills/vulnerability-scanner/SKILL.md +9 -1
  90. package/.agent/skills/web-accessibility-auditor/SKILL.md +9 -1
  91. package/.agent/skills/web-design-guidelines/SKILL.md +9 -1
  92. package/.agent/skills/webapp-testing/SKILL.md +9 -1
  93. package/.agent/skills/whimsy-injector/SKILL.md +9 -1
  94. package/.agent/skills/workflow-optimizer/SKILL.md +9 -1
  95. package/README.md +242 -242
  96. package/bin/tribunal-kit.js +30 -22
  97. package/package.json +81 -80
  98. package/scripts/validate-payload.js +73 -0
package/README.md CHANGED
@@ -1,242 +1,242 @@
1
- <div align="center">
2
- <picture>
3
- <img src="./docs/tribunalkit_no_bg.png" alt="TribunalKit — Code Without Hallucinations" width="480">
4
- </picture>
5
-
6
- <br><br>
7
-
8
- [![NPM](https://img.shields.io/npm/v/tribunal-kit?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/tribunal-kit)
9
- [![License](https://img.shields.io/badge/License-MIT-8b5cf6?style=for-the-badge)](LICENSE)
10
- [![Version](https://img.shields.io/badge/Version-4.2.0_Supreme_Court-black?style=for-the-badge)](CHANGELOG.md)
11
- </div>
12
-
13
-
14
- <br><br>
15
-
16
- > 🚨 **AI GENERATES CODE. TRIBUNAL ENSURES IT WORKS.**
17
- > A plug-in `.agent/` intelligence payload that upgrades your IDE with **41 specialist agents**, **31 slash commands**, **16 parallel Tribunal reviewers**, and a core **Swarm/Supervisor** engine.
18
-
19
- ---
20
-
21
- <br>
22
-
23
- ## ▓▒░ INITIATION SEQUENCE
24
-
25
- Drop Tribunal into any project. Global or local.
26
-
27
- ```bash
28
- # Pull the intelligence payload into your project
29
- npx tribunal-kit init
30
- ```
31
- *(Installs the `.agent/` architecture directly. No bloat. Pure capability.)*
32
-
33
- <details>
34
- <summary><b>📺 Quick Demo — What happens when you run it</b></summary>
35
- <br>
36
-
37
- ```
38
- $ npx tribunal-kit init
39
-
40
- ████████╗██████╗ ██╗██████╗ ██╗ ██╗███╗ ██╗ █████╗ ██╗
41
- ╚══██╔══╝██╔══██╗██║██╔══██╗██║ ██║████╗ ██║██╔══██╗██║
42
- ██║ ██████╔╝██║██████╔╝██║ ██║██╔██╗ ██║███████║██║
43
- ██║ ██╔══██╗██║██╔══██╗██║ ██║██║╚██╗██║██╔══██║██║
44
- ██║ ██║ ██║██║██████╔╝╚██████╔╝██║ ╚████║██║ ██║███████╗
45
- ╚═╝ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝
46
-
47
- ╔══════════════════════════════════════════════════════════════╗
48
- ║ Anti-Hallucination Agent System ║
49
- ╚══════════════════════════════════════════════════════════════╝
50
-
51
- ✔ Installed → .agent/
52
-
53
- ╔══════════════════════════════════════════════════════════════╗
54
- ║ 🤖 Agents 40 installed ║
55
- ║ ⚡ Workflows 31 installed ║
56
- ║ 🧠 Skills 90 installed ║
57
- ║ 🔧 Scripts 27 installed ║
58
- ╚══════════════════════════════════════════════════════════════╝
59
-
60
- ✔ 700+ files installed. 16 parallel Tribunal reviewers armed.
61
-
62
- $ npx tribunal-kit status
63
-
64
- ✔ Installed at .agent/
65
- 🤖 agents 40 files
66
- ⚡ workflows 31 files
67
- 🧠 skills 90 files
68
- 🔧 scripts 27 files
69
- ```
70
-
71
- > 💡 **Lighter install?** Use `npx tribunal-kit init --minimal` for just 13 core agents + 15 essential skills.
72
-
73
- </details>
74
-
75
- > ✅ **IDE Auto-Detection:** `init` automatically generates bridge files for every major AI coding IDE:
76
- >
77
- > | IDE | Bridge File Generated |
78
- > | :--- | :--- |
79
- > | **Cursor** | `.cursorrules` |
80
- > | **Windsurf** | `.windsurfrules` |
81
- > | **Gemini / Antigravity** | `.gemini/settings.json` + `.gemini/GEMINI.md` |
82
- > | **GitHub Copilot** | `.github/copilot-instructions.md` |
83
- > | **Claude** | `.claude/CLAUDE.md` |
84
- >
85
- > Bridge files are never overwritten on re-init — your customizations are safe.
86
-
87
- **Prerequisites:** Node.js ≥ 18 • Python ≥ 3.10 *(optional — required for utility scripts like `checklist.py`, `security_scan.py`)*
88
-
89
- > 💡 **Shorthand alias:** You can use `tk` instead of `tribunal-kit` for all commands (e.g., `tk init`, `tk status`).
90
-
91
- <br>
92
-
93
- ## ▓▒░ THE PIPELINE // HOW IT WORKS
94
-
95
- **Code generation is solved. Code correctness is the frontier.** We enforce a strict **Evidence-Based Closeout**.
96
-
97
- ```diff
98
- - AI Generates -> Commits to Disk -> You Find Bugs Later
99
- + AI Generates -> Parallel Tribunal Review -> Human Gate -> Commits to Disk
100
- ```
101
-
102
- ### 🎯 Auto-Routing Intelligence
103
- No manual tagging required. The system self-organizes.
104
-
105
- <p>
106
- <kbd>User</kbd> "Add JWT authentication" <br>
107
- <kbd>System</kbd> <code>🤖 Applying @security-auditor + @backend-specialist...</code> <br><br>
108
-
109
- <kbd>User</kbd> "Fix the dark mode button" <br>
110
- <kbd>System</kbd> <code>🤖 Applying @ui-ux-pro-max + @frontend-specialist...</code> <br><br>
111
-
112
- <kbd>User</kbd> "/swarm build a API" <br>
113
- <kbd>System</kbd> <code>🤖 supervisor-agent → Dispatching 3 Workers...</code>
114
- </p>
115
-
116
- <br>
117
-
118
- ## ▓▒░ THE SUPREME COURT (v4.0)
119
-
120
- *(New in v4)* The Tribunal Kit now features persistent memory so the AI **never makes the same mistake twice** and automatically learns your team's coding style.
121
-
122
- **1. The Case Law Engine (Never repeat mistakes)**
123
- If an agent makes a mistake, you can record it as a legal precedent. Before writing any future code, the `precedence-reviewer` checks this database locally to forcefully block the AI from repeating that mistake.
124
- - `npx tribunal-kit case add` *(Record an AI hallucination)*
125
- - `npx tribunal-kit case search "query"` *(Search your precedents)*
126
-
127
- **2. Skill Evolution Forge (Auto-learns your style)**
128
- You no longer need to write manual rules. The system reads your Git commits, strips out the noise to save tokens, and automatically extracts your project's unique architectural patterns to teach the AI.
129
- - `npx tribunal-kit learn` *(Run a learning digest on staged files)*
130
- - `npx tribunal-kit hook` *(Automate learning every time you `git push`)*
131
-
132
- <br>
133
-
134
- ## ▓▒░ CAPABILITY MATRIX
135
-
136
- | System Asset | Count | Operational Scope |
137
- | :--- | :---: | :--- |
138
- | 🤖 **Agents** | `40` | Specialist personas — 16 reviewers + 24 domain specialists |
139
- | 🧠 **Skills** | `90` | Domain modules (Edge Computing, Red Team Tactics, GSAP, Framer Motion, TypeScript Advanced) |
140
- | ⚡ **Workflows** | `31` | Slash command procedures including `/swarm`, `/tribunal-full`, `/ui-ux-pro-max` |
141
- | 🛠️ **Scripts** | `25` | CI/CD, linting, payload dispatching, security scanning, case law, skill evolution |
142
-
143
-
144
- <br>
145
-
146
- ## ▓▒░ COMMAND TERMINAL
147
-
148
- Expand the accordions to view the operational commands at your disposal.
149
-
150
- <details open>
151
- <summary><b>🔥 CORE EXECUTION</b></summary>
152
- <br>
153
-
154
- | Command | Action |
155
- | :--- | :--- |
156
- | <code>/generate</code> | Trigger full Tribunal: Generate → Audit → Approve. |
157
- | <code>/create</code> | Scaffold major features or apps, routed by App Builder. |
158
- | <code>/enhance</code> | Safely extend existing structures without regression. |
159
- | <code>/deploy</code> | Force the 3-gate production release sequence. |
160
-
161
- </details>
162
-
163
- <details>
164
- <summary><b>⚖️ THE TRIBUNAL GAUNTLET (REVIEWERS)</b></summary>
165
- <br>
166
- Unleash parallel reviewers on existing code.
167
-
168
- | Command | Action |
169
- | :--- | :--- |
170
- | <code>/review</code> | Audit code for silent degradation and logic holes. |
171
- | <code>/tribunal-full</code> | Unleash **ALL 16** reviewers simultaneously. Maximum scrutiny. |
172
- | <code>/tribunal-backend</code> | Summons <code>[ Logic + Security + Dependency + Types ]</code> |
173
- | <code>/tribunal-frontend</code> | Summons <code>[ Logic + Security + Frontend + Types ]</code> |
174
- | <code>/tribunal-database</code> | Summons <code>[ Logic + Security + SQL ]</code> |
175
- | <code>/tribunal-mobile</code> | Summons <code>[ Logic + Security + Mobile ]</code> |
176
-
177
- </details>
178
-
179
- <details>
180
- <summary><b>🧠 SWARM & ORCHESTRATION</b></summary>
181
- <br>
182
-
183
- | Command | Action |
184
- | :--- | :--- |
185
- | <code>/swarm</code> | Supervisor breaks goal → sends to isolated workers → synthesizes. |
186
- | <code>/orchestrate</code> | Manual multi-agent sync for complex integrations. |
187
- | <code>/plan</code> | Architectural mapping before a single line is written. |
188
- | <code>/ui-ux-pro-max</code>| Triggers peak aesthetic frontend design. |
189
-
190
- </details>
191
-
192
- <details>
193
- <summary><b>⚖️ SUPREME COURT / MEMORY</b></summary>
194
- <br>
195
-
196
- | Command | Action |
197
- | :--- | :--- |
198
- | <code>npx tribunal-kit case add</code> | Record an AI hallucination to ban it forever. |
199
- | <code>npx tribunal-kit case search</code> | Search your local database of banned code. |
200
- | <code>npx tribunal-kit learn</code> | Auto-extract project idioms from your git diffs. |
201
- | <code>npx tribunal-kit hook</code> | Install a git hook to auto-learn the moment you push. |
202
-
203
- </details>
204
-
205
- <details>
206
- <summary><b>🔧 TROUBLESHOOTING & OPS</b></summary>
207
- <br>
208
-
209
- | Command | Action |
210
- | :--- | :--- |
211
- | <code>/debug</code> | Systematic root-cause investigation. |
212
- | <code>/preview</code> | Local development server control. |
213
- | <code>/status</code> | View Tribunal session status. |
214
-
215
- </details>
216
-
217
- <br>
218
-
219
- ## ▓▒░ POST-INSTALL TELEMETRY
220
-
221
- After initialization, utility scripts unlock local ops:
222
-
223
- ```bash
224
- # 01. Pre-commit audit
225
- python .agent/scripts/checklist.py .
226
-
227
- # 02. Pre-deploy full suite verification
228
- python .agent/scripts/verify_all.py
229
-
230
- # 03. Start local development environment
231
- python .agent/scripts/auto_preview.py start
232
- ```
233
-
234
- <br>
235
-
236
- <div align="center">
237
- <br>
238
- <img src="https://img.shields.io/badge/Status-Active_&_Secured-00e5ff?style=for-the-badge" alt="Status" />
239
- <br><br>
240
- <i>"Never guess database column names. Error handling on every async function. Evidence-based closeouts. Welcome to the Tribunal."</i><br>
241
- <sub><b>MIT Licensed</b> • Hand-forged for high-performance agentic engineering.</sub>
242
- </div>
1
+ <div align="center">
2
+ <picture>
3
+ <img src="./docs/tribunalkit_no_bg.png" alt="TribunalKit — Code Without Hallucinations" width="480">
4
+ </picture>
5
+
6
+ <br><br>
7
+
8
+ [![NPM](https://img.shields.io/npm/v/tribunal-kit?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/tribunal-kit)
9
+ [![License](https://img.shields.io/badge/License-MIT-8b5cf6?style=for-the-badge)](LICENSE)
10
+ [![Version](https://img.shields.io/badge/Version-4.3.1_Supreme_Court-black?style=for-the-badge)](CHANGELOG.md)
11
+ </div>
12
+
13
+
14
+ <br><br>
15
+
16
+ > 🚨 **AI GENERATES CODE. TRIBUNAL ENSURES IT WORKS.**
17
+ > A plug-in `.agent/` intelligence payload that upgrades your IDE with **41 specialist agents**, **32 slash commands**, **16 parallel Tribunal reviewers**, and a core **Swarm/Supervisor** engine.
18
+
19
+ ---
20
+
21
+ <br>
22
+
23
+ ## ▓▒░ INITIATION SEQUENCE
24
+
25
+ Drop Tribunal into any project. Global or local.
26
+
27
+ ```bash
28
+ # Pull the intelligence payload into your project
29
+ npx tribunal-kit init
30
+ ```
31
+ *(Installs the `.agent/` architecture directly. No bloat. Pure capability.)*
32
+
33
+ <details>
34
+ <summary><b>📺 Quick Demo — What happens when you run it</b></summary>
35
+ <br>
36
+
37
+ ```
38
+ $ npx tribunal-kit init
39
+
40
+ ████████╗██████╗ ██╗██████╗ ██╗ ██╗███╗ ██╗ █████╗ ██╗
41
+ ╚══██╔══╝██╔══██╗██║██╔══██╗██║ ██║████╗ ██║██╔══██╗██║
42
+ ██║ ██████╔╝██║██████╔╝██║ ██║██╔██╗ ██║███████║██║
43
+ ██║ ██╔══██╗██║██╔══██╗██║ ██║██║╚██╗██║██╔══██║██║
44
+ ██║ ██║ ██║██║██████╔╝╚██████╔╝██║ ╚████║██║ ██║███████╗
45
+ ╚═╝ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝
46
+
47
+ ╔══════════════════════════════════════════════════════════════╗
48
+ ║ Anti-Hallucination Agent System ║
49
+ ╚══════════════════════════════════════════════════════════════╝
50
+
51
+ ✔ Installed → .agent/
52
+
53
+ ╔══════════════════════════════════════════════════════════════╗
54
+ ║ 🤖 Agents 41 installed ║
55
+ ║ ⚡ Workflows 32 installed ║
56
+ ║ 🧠 Skills 91 installed ║
57
+ ║ 🔧 Scripts 27 installed ║
58
+ ╚══════════════════════════════════════════════════════════════╝
59
+
60
+ ✔ 700+ files installed. 16 parallel Tribunal reviewers armed.
61
+
62
+ $ npx tribunal-kit status
63
+
64
+ ✔ Installed at .agent/
65
+ 🤖 agents 40 files
66
+ ⚡ workflows 31 files
67
+ 🧠 skills 90 files
68
+ 🔧 scripts 27 files
69
+ ```
70
+
71
+ > 💡 **Lighter install?** Use `npx tribunal-kit init --minimal` for just 13 core agents + 15 essential skills.
72
+
73
+ </details>
74
+
75
+ > ✅ **IDE Auto-Detection:** `init` automatically generates bridge files for every major AI coding IDE:
76
+ >
77
+ > | IDE | Bridge File Generated |
78
+ > | :--- | :--- |
79
+ > | **Cursor** | `.cursorrules` |
80
+ > | **Windsurf** | `.windsurfrules` |
81
+ > | **Gemini / Antigravity** | `.gemini/settings.json` + `.gemini/GEMINI.md` |
82
+ > | **GitHub Copilot** | `.github/copilot-instructions.md` |
83
+ > | **Claude** | `.claude/CLAUDE.md` |
84
+ >
85
+ > Bridge files are never overwritten on re-init — your customizations are safe.
86
+
87
+ **Prerequisites:** Node.js ≥ 18
88
+
89
+ > 💡 **Shorthand alias:** You can use `tk` instead of `tribunal-kit` for all commands (e.g., `tk init`, `tk status`).
90
+
91
+ <br>
92
+
93
+ ## ▓▒░ THE PIPELINE // HOW IT WORKS
94
+
95
+ **Code generation is solved. Code correctness is the frontier.** We enforce a strict **Evidence-Based Closeout**.
96
+
97
+ ```diff
98
+ - AI Generates -> Commits to Disk -> You Find Bugs Later
99
+ + AI Generates -> Parallel Tribunal Review -> Human Gate -> Commits to Disk
100
+ ```
101
+
102
+ ### 🎯 Auto-Routing Intelligence
103
+ No manual tagging required. The system self-organizes.
104
+
105
+ <p>
106
+ <kbd>User</kbd> "Add JWT authentication" <br>
107
+ <kbd>System</kbd> <code>🤖 Applying @security-auditor + @backend-specialist...</code> <br><br>
108
+
109
+ <kbd>User</kbd> "Fix the dark mode button" <br>
110
+ <kbd>System</kbd> <code>🤖 Applying @ui-ux-pro-max + @frontend-specialist...</code> <br><br>
111
+
112
+ <kbd>User</kbd> "/swarm build a API" <br>
113
+ <kbd>System</kbd> <code>🤖 supervisor-agent → Dispatching 3 Workers...</code>
114
+ </p>
115
+
116
+ <br>
117
+
118
+ ## ▓▒░ THE SUPREME COURT (v4.0)
119
+
120
+ *(New in v4)* The Tribunal Kit now features persistent memory so the AI **never makes the same mistake twice** and automatically learns your team's coding style.
121
+
122
+ **1. The Case Law Engine (Never repeat mistakes)**
123
+ If an agent makes a mistake, you can record it as a legal precedent. Before writing any future code, the `precedence-reviewer` checks this database locally to forcefully block the AI from repeating that mistake.
124
+ - `npx tribunal-kit case add` *(Record an AI hallucination)*
125
+ - `npx tribunal-kit case search "query"` *(Search your precedents)*
126
+
127
+ **2. Skill Evolution Forge (Auto-learns your style)**
128
+ You no longer need to write manual rules. The system reads your Git commits, strips out the noise to save tokens, and automatically extracts your project's unique architectural patterns to teach the AI.
129
+ - `npx tribunal-kit learn` *(Run a learning digest on staged files)*
130
+ - `npx tribunal-kit hook` *(Automate learning every time you `git push`)*
131
+
132
+ <br>
133
+
134
+ ## ▓▒░ CAPABILITY MATRIX
135
+
136
+ | System Asset | Count | Operational Scope |
137
+ | :--- | :---: | :--- |
138
+ | 🤖 **Agents** | `40` | Specialist personas — 16 reviewers + 24 domain specialists |
139
+ | 🧠 **Skills** | `90` | Domain modules (Edge Computing, Red Team Tactics, GSAP, Framer Motion, TypeScript Advanced) |
140
+ | ⚡ **Workflows** | `31` | Slash command procedures including `/swarm`, `/tribunal-full`, `/ui-ux-pro-max` |
141
+ | 🛠️ **Scripts** | `25` | CI/CD, linting, payload dispatching, security scanning, case law, skill evolution |
142
+
143
+
144
+ <br>
145
+
146
+ ## ▓▒░ COMMAND TERMINAL
147
+
148
+ Expand the accordions to view the operational commands at your disposal.
149
+
150
+ <details open>
151
+ <summary><b>🔥 CORE EXECUTION</b></summary>
152
+ <br>
153
+
154
+ | Command | Action |
155
+ | :--- | :--- |
156
+ | <code>/generate</code> | Trigger full Tribunal: Generate → Audit → Approve. |
157
+ | <code>/create</code> | Scaffold major features or apps, routed by App Builder. |
158
+ | <code>/enhance</code> | Safely extend existing structures without regression. |
159
+ | <code>/deploy</code> | Force the 3-gate production release sequence. |
160
+
161
+ </details>
162
+
163
+ <details>
164
+ <summary><b>⚖️ THE TRIBUNAL GAUNTLET (REVIEWERS)</b></summary>
165
+ <br>
166
+ Unleash parallel reviewers on existing code.
167
+
168
+ | Command | Action |
169
+ | :--- | :--- |
170
+ | <code>/review</code> | Audit code for silent degradation and logic holes. |
171
+ | <code>/tribunal-full</code> | Unleash **ALL 16** reviewers simultaneously. Maximum scrutiny. |
172
+ | <code>/tribunal-backend</code> | Summons <code>[ Logic + Security + Dependency + Types ]</code> |
173
+ | <code>/tribunal-frontend</code> | Summons <code>[ Logic + Security + Frontend + Types ]</code> |
174
+ | <code>/tribunal-database</code> | Summons <code>[ Logic + Security + SQL ]</code> |
175
+ | <code>/tribunal-mobile</code> | Summons <code>[ Logic + Security + Mobile ]</code> |
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary><b>🧠 SWARM & ORCHESTRATION</b></summary>
181
+ <br>
182
+
183
+ | Command | Action |
184
+ | :--- | :--- |
185
+ | <code>/swarm</code> | Supervisor breaks goal → sends to isolated workers → synthesizes. |
186
+ | <code>/orchestrate</code> | Manual multi-agent sync for complex integrations. |
187
+ | <code>/plan</code> | Architectural mapping before a single line is written. |
188
+ | <code>/ui-ux-pro-max</code>| Triggers peak aesthetic frontend design. |
189
+
190
+ </details>
191
+
192
+ <details>
193
+ <summary><b>⚖️ SUPREME COURT / MEMORY</b></summary>
194
+ <br>
195
+
196
+ | Command | Action |
197
+ | :--- | :--- |
198
+ | <code>npx tribunal-kit case add</code> | Record an AI hallucination to ban it forever. |
199
+ | <code>npx tribunal-kit case search</code> | Search your local database of banned code. |
200
+ | <code>npx tribunal-kit learn</code> | Auto-extract project idioms from your git diffs. |
201
+ | <code>npx tribunal-kit hook</code> | Install a git hook to auto-learn the moment you push. |
202
+
203
+ </details>
204
+
205
+ <details>
206
+ <summary><b>🔧 TROUBLESHOOTING & OPS</b></summary>
207
+ <br>
208
+
209
+ | Command | Action |
210
+ | :--- | :--- |
211
+ | <code>/debug</code> | Systematic root-cause investigation. |
212
+ | <code>/preview</code> | Local development server control. |
213
+ | <code>/status</code> | View Tribunal session status. |
214
+
215
+ </details>
216
+
217
+ <br>
218
+
219
+ ## ▓▒░ POST-INSTALL TELEMETRY
220
+
221
+ After initialization, utility scripts unlock local ops:
222
+
223
+ ```bash
224
+ # 01. Pre-commit audit
225
+ node .agent/scripts/checklist.js .
226
+
227
+ # 02. Pre-deploy full suite verification
228
+ node .agent/scripts/verify_all.js
229
+
230
+ # 03. Start local development environment
231
+ node .agent/scripts/auto_preview.js start
232
+ ```
233
+
234
+ <br>
235
+
236
+ <div align="center">
237
+ <br>
238
+ <img src="https://img.shields.io/badge/Status-Active_&_Secured-00e5ff?style=for-the-badge" alt="Status" />
239
+ <br><br>
240
+ <i>"Never guess database column names. Error handling on every async function. Evidence-based closeouts. Welcome to the Tribunal."</i><br>
241
+ <sub><b>MIT Licensed</b> • Hand-forged for high-performance agentic engineering.</sub>
242
+ </div>
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  /**
3
3
  * tribunal-kit CLI (alias: tk)
4
4
  *
@@ -373,6 +373,35 @@ function cmdInit(flags) {
373
373
  }
374
374
  // ────────────────────────────────────────────────────────
375
375
 
376
+ // ── Backup / Cleanup ────────────────────────────────────
377
+ if (!dryRun && fs.existsSync(agentDest) && flags.force) {
378
+ // Backup the existing subdirectories before overwriting
379
+ const backupDir = path.join(agentDest, '.backups', `backup-${Date.now()}`);
380
+ fs.mkdirSync(backupDir, { recursive: true });
381
+
382
+ // PRESERVE_DIRS: user-generated content that must survive updates
383
+ const PRESERVE_DIRS = ['history', 'patterns', 'mcp_config.json'];
384
+ const subdirs = ['agents', 'workflows', 'skills', 'scripts', '.shared', 'rules'];
385
+ for (const sub of subdirs) {
386
+ const subPath = path.join(agentDest, sub);
387
+ if (fs.existsSync(subPath)) {
388
+ // Copy to backup dir
389
+ copyDir(subPath, path.join(backupDir, sub), false);
390
+ fs.rmSync(subPath, { recursive: true, force: true });
391
+ }
392
+ }
393
+ log(` ${c('gray', '✦ Backed up existing configurations to .agent/.backups/')}`);
394
+
395
+ // Verify preserved dirs still exist after cleanup
396
+ for (const kept of PRESERVE_DIRS) {
397
+ const keptPath = path.join(agentDest, kept);
398
+ if (kept.includes('.') ? false : !fs.existsSync(keptPath)) {
399
+ // It's okay if it doesn't exist yet — it'll be created below
400
+ }
401
+ }
402
+ }
403
+ // ────────────────────────────────────────────────────────
404
+
376
405
  banner();
377
406
 
378
407
  if (dryRun) {
@@ -395,25 +424,6 @@ function cmdInit(flags) {
395
424
  process.exit(0);
396
425
  }
397
426
 
398
- if (!dryRun && fs.existsSync(agentDest) && flags.force) {
399
- // PRESERVE_DIRS: user-generated content that must survive updates
400
- const PRESERVE_DIRS = ['history', 'patterns', 'mcp_config.json'];
401
- const subdirs = ['agents', 'workflows', 'skills', 'scripts', '.shared', 'rules'];
402
- for (const sub of subdirs) {
403
- const subPath = path.join(agentDest, sub);
404
- if (fs.existsSync(subPath)) {
405
- fs.rmSync(subPath, { recursive: true, force: true });
406
- }
407
- }
408
- // Verify preserved dirs still exist after cleanup
409
- for (const kept of PRESERVE_DIRS) {
410
- const keptPath = path.join(agentDest, kept);
411
- if (kept.includes('.') ? false : !fs.existsSync(keptPath)) {
412
- // It's okay if it doesn't exist yet — it'll be created below
413
- }
414
- }
415
- }
416
-
417
427
  // Ensure history dirs exist (Case Law + Skill Evolution)
418
428
  if (!dryRun) {
419
429
  const caseDir = path.join(agentDest, 'history', 'case-law', 'cases');
@@ -671,7 +681,6 @@ function cmdLearn(flags) {
671
681
 
672
682
  const dryRun = flags.dryRun ? '--dry-run' : '';
673
683
  const useHead = flags.head ? '--head' : '';
674
- const python = process.platform === 'win32' ? 'python' : 'python3';
675
684
  const { execSync } = require('child_process');
676
685
 
677
686
  // Phase 1: Skill Evolution
@@ -780,7 +789,6 @@ function cmdCase(flags) {
780
789
  process.exit(1);
781
790
  }
782
791
 
783
- const python = process.platform === 'win32' ? 'python' : 'python3';
784
792
  const caseLawScript = path.join(agentDest, 'scripts', 'case_law_manager.js');
785
793
 
786
794
  // Make shorthand aliases