tribunal-kit 5.8.5 → 6.0.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 (315) hide show
  1. package/.agent/.manifest.json +78 -0
  2. package/.agent/ARCHITECTURE.md +32 -253
  3. package/.agent/agents/accessibility-reviewer.md +66 -151
  4. package/.agent/agents/ai-code-reviewer.md +22 -2
  5. package/.agent/agents/anti-pattern-reviewer.md +99 -0
  6. package/.agent/agents/api-architect.md +19 -2
  7. package/.agent/agents/backend-specialist.md +25 -3
  8. package/.agent/agents/cloud-engineer.md +21 -0
  9. package/.agent/agents/code-archaeologist.md +20 -3
  10. package/.agent/agents/complexity-reviewer.md +22 -2
  11. package/.agent/agents/database-architect.md +24 -3
  12. package/.agent/agents/db-latency-auditor.md +22 -2
  13. package/.agent/agents/debugger.md +19 -3
  14. package/.agent/agents/dependency-reviewer.md +19 -2
  15. package/.agent/agents/devops-engineer.md +24 -3
  16. package/.agent/agents/documentation-writer.md +21 -3
  17. package/.agent/agents/explorer-agent.md +21 -3
  18. package/.agent/agents/frontend-reviewer.md +19 -3
  19. package/.agent/agents/frontend-specialist.md +72 -224
  20. package/.agent/agents/game-developer.md +22 -3
  21. package/.agent/agents/interaction-reviewer.md +118 -0
  22. package/.agent/agents/logic-reviewer.md +18 -3
  23. package/.agent/agents/minimalist-reviewer.md +98 -0
  24. package/.agent/agents/mobile-developer.md +21 -3
  25. package/.agent/agents/mobile-reviewer.md +22 -2
  26. package/.agent/agents/orchestrator.md +19 -3
  27. package/.agent/agents/penetration-tester.md +22 -3
  28. package/.agent/agents/performance-optimizer.md +21 -3
  29. package/.agent/agents/performance-reviewer.md +2 -0
  30. package/.agent/agents/precedence-reviewer.md +19 -5
  31. package/.agent/agents/product-manager.md +20 -3
  32. package/.agent/agents/product-owner.md +22 -1
  33. package/.agent/agents/product-reviewer.md +98 -0
  34. package/.agent/agents/project-planner.md +19 -3
  35. package/.agent/agents/qa-automation-engineer.md +24 -3
  36. package/.agent/agents/resilience-reviewer.md +21 -2
  37. package/.agent/agents/schema-reviewer.md +21 -2
  38. package/.agent/agents/security-auditor.md +7 -1
  39. package/.agent/agents/seo-specialist.md +18 -3
  40. package/.agent/agents/sql-reviewer.md +22 -2
  41. package/.agent/agents/supervisor-agent.md +22 -3
  42. package/.agent/agents/swarm-worker-registry.md +7 -0
  43. package/.agent/agents/system-architect.md +19 -0
  44. package/.agent/agents/test-coverage-reviewer.md +22 -2
  45. package/.agent/agents/test-engineer.md +21 -2
  46. package/.agent/agents/throughput-optimizer.md +22 -2
  47. package/.agent/agents/type-safety-reviewer.md +21 -2
  48. package/.agent/agents/ui-ux-auditor.md +44 -242
  49. package/.agent/agents/ui-visual-auditor.md +99 -0
  50. package/.agent/agents/ux-reviewer.md +104 -0
  51. package/.agent/agents/visual-reviewer.md +98 -0
  52. package/.agent/agents/vitals-reviewer.md +23 -2
  53. package/.agent/history/README.md +53 -0
  54. package/.agent/history/case-law/cases/template-case.json +19 -0
  55. package/.agent/history/integrity_manifest.json +63 -33
  56. package/.agent/history/memory/.memory.idx +2701 -1
  57. package/.agent/history/memory/MEMORY.md +179 -1
  58. package/.agent/routing_index.json +273 -690
  59. package/.agent/rules/GEMINI.md +11 -13
  60. package/.agent/rules/GEMINI_PLANNER.md +84 -0
  61. package/.agent/scripts/case_law_manager.js +2 -0
  62. package/.agent/scripts/context_broker.js +152 -0
  63. package/.agent/scripts/guardrail_engine.js +59 -4
  64. package/.agent/scripts/impact_classifier.js +167 -0
  65. package/.agent/scripts/minimal_change_engine.js +437 -0
  66. package/.agent/scripts/pipeline_engine.js +856 -0
  67. package/.agent/scripts/socratic_gate_policy.js +60 -0
  68. package/.agent/scripts/token_budget_broker.js +52 -0
  69. package/.agent/scripts/verify_all.js +13 -0
  70. package/.agent/scripts/visual_audit.js +92 -0
  71. package/.agent/skill_topic_map.json +218 -0
  72. package/.agent/skills/12-principles-of-animation/SKILL.md +19 -10
  73. package/.agent/skills/60fps-animation/SKILL.md +19 -10
  74. package/.agent/skills/accessible-animation/SKILL.md +19 -10
  75. package/.agent/skills/adapt/SKILL.md +19 -10
  76. package/.agent/skills/advanced-rag-pipelines/SKILL.md +21 -3
  77. package/.agent/skills/agent-organizer/SKILL.md +21 -7
  78. package/.agent/skills/agentic-patterns/SKILL.md +19 -7
  79. package/.agent/skills/agentic-workflows-2026/SKILL.md +76 -0
  80. package/.agent/skills/ai-app-hardening/SKILL.md +58 -0
  81. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +21 -7
  82. package/.agent/skills/animation-on-scroll/SKILL.md +19 -10
  83. package/.agent/skills/animation-systems/SKILL.md +19 -10
  84. package/.agent/skills/antfu-conventions/SKILL.md +21 -10
  85. package/.agent/skills/api-patterns/SKILL.md +21 -7
  86. package/.agent/skills/api-security-auditor/SKILL.md +21 -7
  87. package/.agent/skills/app-builder/SKILL.md +21 -7
  88. package/.agent/skills/apple-design/SKILL.md +19 -10
  89. package/.agent/skills/architecture/SKILL.md +21 -7
  90. package/.agent/skills/audit-and-fix/SKILL.md +19 -10
  91. package/.agent/skills/authentication-best-practices/SKILL.md +21 -7
  92. package/.agent/skills/backend-security-expert/SKILL.md +21 -7
  93. package/.agent/skills/baseline-ui/SKILL.md +19 -10
  94. package/.agent/skills/bash-linux/SKILL.md +21 -7
  95. package/.agent/skills/behavioral-modes/SKILL.md +19 -7
  96. package/.agent/skills/better-colors/SKILL.md +19 -10
  97. package/.agent/skills/better-ui/SKILL.md +19 -10
  98. package/.agent/skills/bolder/SKILL.md +19 -10
  99. package/.agent/skills/brainstorming/SKILL.md +17 -7
  100. package/.agent/skills/browser-native-ai/SKILL.md +19 -3
  101. package/.agent/skills/build-primitive/SKILL.md +19 -10
  102. package/.agent/skills/building-native-ui/SKILL.md +21 -7
  103. package/.agent/skills/cicd-pro/SKILL.md +21 -10
  104. package/.agent/skills/clarify/SKILL.md +19 -10
  105. package/.agent/skills/clean-code/SKILL.md +21 -7
  106. package/.agent/skills/cloud-architect/SKILL.md +21 -10
  107. package/.agent/skills/cobejs/SKILL.md +19 -10
  108. package/.agent/skills/code-review-checklist/SKILL.md +21 -7
  109. package/.agent/skills/codebase-design/SKILL.md +21 -10
  110. package/.agent/skills/colorize/SKILL.md +19 -10
  111. package/.agent/skills/compact-landing/SKILL.md +19 -10
  112. package/.agent/skills/company-logos/SKILL.md +19 -10
  113. package/.agent/skills/config-validator/SKILL.md +21 -7
  114. package/.agent/skills/containerization-pro/SKILL.md +21 -10
  115. package/.agent/skills/context-engineering-pro/SKILL.md +69 -0
  116. package/.agent/skills/create-design-md/SKILL.md +19 -10
  117. package/.agent/skills/critique/SKILL.md +19 -10
  118. package/.agent/skills/csharp-developer/SKILL.md +21 -7
  119. package/.agent/skills/data-validation-schemas/SKILL.md +21 -7
  120. package/.agent/skills/database-design/SKILL.md +21 -7
  121. package/.agent/skills/delight/SKILL.md +19 -10
  122. package/.agent/skills/deployment-procedures/SKILL.md +21 -7
  123. package/.agent/skills/design-lab/SKILL.md +21 -10
  124. package/.agent/skills/devops-engineer/SKILL.md +21 -7
  125. package/.agent/skills/devops-incident-responder/SKILL.md +21 -7
  126. package/.agent/skills/diagnosing-bugs/SKILL.md +21 -10
  127. package/.agent/skills/distill/SKILL.md +19 -10
  128. package/.agent/skills/documentation-templates/SKILL.md +21 -7
  129. package/.agent/skills/domain-modeling/SKILL.md +21 -10
  130. package/.agent/skills/duckdb-analytical-sql/SKILL.md +55 -0
  131. package/.agent/skills/edge-ai-mobile/SKILL.md +46 -0
  132. package/.agent/skills/edge-computing/SKILL.md +21 -7
  133. package/.agent/skills/emil-design-eng/SKILL.md +19 -10
  134. package/.agent/skills/error-resilience/SKILL.md +21 -7
  135. package/.agent/skills/expo-router-v4/SKILL.md +80 -0
  136. package/.agent/skills/extract-design-system/SKILL.md +21 -7
  137. package/.agent/skills/fabel-protocol/SKILL.md +19 -2
  138. package/.agent/skills/fixing-accessibility/SKILL.md +19 -10
  139. package/.agent/skills/fixing-metadata/SKILL.md +19 -10
  140. package/.agent/skills/fixing-motion-performance/SKILL.md +19 -10
  141. package/.agent/skills/framer-motion-expert/SKILL.md +19 -6
  142. package/.agent/skills/frontend-design/SKILL.md +64 -201
  143. package/.agent/skills/frontend-security-expert/SKILL.md +21 -7
  144. package/.agent/skills/game-design-expert/SKILL.md +21 -7
  145. package/.agent/skills/game-engineering-expert/SKILL.md +21 -7
  146. package/.agent/skills/generative-ui-expert/SKILL.md +19 -3
  147. package/.agent/skills/geo-fundamentals/SKILL.md +21 -7
  148. package/.agent/skills/git-pro/SKILL.md +21 -10
  149. package/.agent/skills/github-operations/SKILL.md +21 -7
  150. package/.agent/skills/gpt-taste/SKILL.md +19 -10
  151. package/.agent/skills/gsap-core/SKILL.md +21 -4
  152. package/.agent/skills/gsap-frameworks/SKILL.md +21 -4
  153. package/.agent/skills/gsap-performance/SKILL.md +20 -5
  154. package/.agent/skills/gsap-plugins/SKILL.md +20 -5
  155. package/.agent/skills/gsap-react/SKILL.md +20 -5
  156. package/.agent/skills/gsap-scrolltrigger/SKILL.md +21 -4
  157. package/.agent/skills/gsap-timeline/SKILL.md +20 -5
  158. package/.agent/skills/gsap-utils/SKILL.md +20 -5
  159. package/.agent/skills/harden/SKILL.md +19 -10
  160. package/.agent/skills/harness-protocol/SKILL.md +20 -4
  161. package/.agent/skills/i18n-localization/SKILL.md +21 -7
  162. package/.agent/skills/impeccable/SKILL.md +19 -10
  163. package/.agent/skills/improve-codebase-architecture/SKILL.md +21 -10
  164. package/.agent/skills/improve-ui/SKILL.md +19 -10
  165. package/.agent/skills/intelligent-routing/SKILL.md +19 -7
  166. package/.agent/skills/knowledge-graph/SKILL.md +20 -4
  167. package/.agent/skills/landing-page/SKILL.md +20 -10
  168. package/.agent/skills/lint-and-validate/SKILL.md +21 -7
  169. package/.agent/skills/llm-engineering/SKILL.md +21 -7
  170. package/.agent/skills/local-first/SKILL.md +21 -7
  171. package/.agent/skills/local-first-architecture/SKILL.md +19 -10
  172. package/.agent/skills/lottie-animation/SKILL.md +19 -10
  173. package/.agent/skills/marquee-loop/SKILL.md +19 -10
  174. package/.agent/skills/masked-reveal/SKILL.md +19 -10
  175. package/.agent/skills/mcp-builder/SKILL.md +21 -7
  176. package/.agent/skills/micro-interaction/SKILL.md +19 -10
  177. package/.agent/skills/mobile-design/SKILL.md +21 -6
  178. package/.agent/skills/monorepo-management/SKILL.md +21 -7
  179. package/.agent/skills/morphing-icons/SKILL.md +19 -10
  180. package/.agent/skills/motion-engineering/SKILL.md +20 -7
  181. package/.agent/skills/nextjs-react-expert/SKILL.md +19 -7
  182. package/.agent/skills/nodejs-best-practices/SKILL.md +21 -7
  183. package/.agent/skills/observability/SKILL.md +21 -7
  184. package/.agent/skills/opentelemetry-observability/SKILL.md +58 -0
  185. package/.agent/skills/page-transition-animation/SKILL.md +19 -10
  186. package/.agent/skills/parallel-agents/SKILL.md +23 -7
  187. package/.agent/skills/performance-profiling/SKILL.md +21 -7
  188. package/.agent/skills/plan-writing/SKILL.md +21 -7
  189. package/.agent/skills/platform-engineer/SKILL.md +21 -7
  190. package/.agent/skills/platform-engineering-opentofu/SKILL.md +67 -0
  191. package/.agent/skills/playwright-ai-e2e/SKILL.md +59 -0
  192. package/.agent/skills/playwright-best-practices/SKILL.md +21 -7
  193. package/.agent/skills/polish/SKILL.md +19 -10
  194. package/.agent/skills/powershell-windows/SKILL.md +21 -7
  195. package/.agent/skills/pricing-page/SKILL.md +19 -10
  196. package/.agent/skills/product-aware-heuristics/SKILL.md +358 -0
  197. package/.agent/skills/progressive-blur/SKILL.md +19 -10
  198. package/.agent/skills/project-idioms/SKILL.md +20 -8
  199. package/.agent/skills/property-based-testing/SKILL.md +60 -0
  200. package/.agent/skills/python-patterns/SKILL.md +21 -7
  201. package/.agent/skills/python-pro/SKILL.md +21 -6
  202. package/.agent/skills/quieter/SKILL.md +19 -10
  203. package/.agent/skills/react-doctor/SKILL.md +19 -10
  204. package/.agent/skills/react-specialist/SKILL.md +19 -6
  205. package/.agent/skills/readme-builder/SKILL.md +21 -7
  206. package/.agent/skills/realtime-patterns/SKILL.md +21 -7
  207. package/.agent/skills/red-team-tactics/SKILL.md +21 -7
  208. package/.agent/skills/redesign-skill/SKILL.md +19 -10
  209. package/.agent/skills/review-animations/SKILL.md +21 -10
  210. package/.agent/skills/rust-pro/SKILL.md +21 -7
  211. package/.agent/skills/seo-fundamentals/SKILL.md +21 -7
  212. package/.agent/skills/server-management/SKILL.md +21 -7
  213. package/.agent/skills/shadcn-ui-expert/SKILL.md +21 -7
  214. package/.agent/skills/shape/SKILL.md +19 -10
  215. package/.agent/skills/skill-creator/SKILL.md +21 -7
  216. package/.agent/skills/soft-skill/SKILL.md +19 -10
  217. package/.agent/skills/sounds-on-the-web/SKILL.md +19 -10
  218. package/.agent/skills/sql-pro/SKILL.md +21 -7
  219. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +21 -7
  220. package/.agent/skills/svg-animation/SKILL.md +19 -10
  221. package/.agent/skills/swiftui-expert/SKILL.md +21 -7
  222. package/.agent/skills/swiss-design/SKILL.md +19 -10
  223. package/.agent/skills/system-design-pro/SKILL.md +21 -9
  224. package/.agent/skills/systematic-debugging/SKILL.md +21 -7
  225. package/.agent/skills/tailwind-patterns/SKILL.md +21 -7
  226. package/.agent/skills/taste-skill/SKILL.md +19 -10
  227. package/.agent/skills/tdd-workflow/SKILL.md +21 -10
  228. package/.agent/skills/test-result-analyzer/SKILL.md +18 -6
  229. package/.agent/skills/testing-patterns/SKILL.md +21 -7
  230. package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +21 -10
  231. package/.agent/skills/thinking-protocol/SKILL.md +20 -8
  232. package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +19 -10
  233. package/.agent/skills/transitions-dev/SKILL.md +19 -10
  234. package/.agent/skills/trend-researcher/SKILL.md +17 -6
  235. package/.agent/skills/typescript-advanced/SKILL.md +21 -7
  236. package/.agent/skills/typeset/SKILL.md +19 -10
  237. package/.agent/skills/ui-reasoning-engine/SKILL.md +154 -0
  238. package/.agent/skills/ui-skill-packs/SKILL.md +77 -0
  239. package/.agent/skills/ui-skills-root/SKILL.md +21 -9
  240. package/.agent/skills/ui-ux-pro-max/SKILL.md +62 -583
  241. package/.agent/skills/ui-ux-researcher/SKILL.md +17 -6
  242. package/.agent/skills/vector-search-pgvector/SKILL.md +77 -0
  243. package/.agent/skills/vue-expert/SKILL.md +19 -6
  244. package/.agent/skills/vulnerability-scanner/SKILL.md +21 -7
  245. package/.agent/skills/web-accessibility-auditor/SKILL.md +21 -7
  246. package/.agent/skills/web-design-guidelines/SKILL.md +32 -206
  247. package/.agent/skills/web-quality-audit/SKILL.md +19 -10
  248. package/.agent/skills/webapp-testing/SKILL.md +21 -7
  249. package/.agent/skills/webgpu-performance/SKILL.md +19 -3
  250. package/.agent/skills/whimsy-injector/SKILL.md +20 -10
  251. package/.agent/skills/workflow-optimizer/SKILL.md +16 -6
  252. package/.agent/skills/zero-trust-passkeys/SKILL.md +85 -0
  253. package/.agent/templates/DESIGN.md +292 -0
  254. package/.agent/templates/design-tokens.json +137 -0
  255. package/.agent/workflows/acf.md +13 -6
  256. package/.agent/workflows/api-tester.md +15 -8
  257. package/.agent/workflows/audit.md +19 -8
  258. package/.agent/workflows/brainstorm.md +14 -9
  259. package/.agent/workflows/changelog.md +14 -8
  260. package/.agent/workflows/create.md +16 -8
  261. package/.agent/workflows/debug.md +15 -10
  262. package/.agent/workflows/deploy.md +16 -8
  263. package/.agent/workflows/enhance.md +15 -10
  264. package/.agent/workflows/fix.md +15 -8
  265. package/.agent/workflows/generate.md +17 -11
  266. package/.agent/workflows/marathon.md +15 -8
  267. package/.agent/workflows/migrate.md +16 -8
  268. package/.agent/workflows/minimal.md +94 -0
  269. package/.agent/workflows/orchestrate.md +15 -8
  270. package/.agent/workflows/performance-benchmarker.md +15 -8
  271. package/.agent/workflows/pipeline.md +155 -0
  272. package/.agent/workflows/plan.md +14 -10
  273. package/.agent/workflows/preview.md +14 -7
  274. package/.agent/workflows/refactor.md +16 -8
  275. package/.agent/workflows/review-ai.md +15 -7
  276. package/.agent/workflows/review.md +15 -7
  277. package/.agent/workflows/session.md +14 -7
  278. package/.agent/workflows/status.md +13 -7
  279. package/.agent/workflows/strengthen-skills.md +15 -6
  280. package/.agent/workflows/super-prompt.md +19 -10
  281. package/.agent/workflows/swarm.md +15 -7
  282. package/.agent/workflows/test.md +15 -8
  283. package/.agent/workflows/tribunal-backend.md +16 -9
  284. package/.agent/workflows/tribunal-database.md +15 -8
  285. package/.agent/workflows/tribunal-frontend.md +26 -11
  286. package/.agent/workflows/tribunal-full.md +41 -26
  287. package/.agent/workflows/tribunal-mobile.md +15 -8
  288. package/.agent/workflows/tribunal-performance.md +15 -8
  289. package/.agent/workflows/tribunal-speed.md +16 -9
  290. package/.agent/workflows/tribunal-ui.md +82 -0
  291. package/.agent/workflows/ui-ux-pro-max.md +51 -107
  292. package/CONTRIBUTING.md +2 -2
  293. package/README.md +82 -60
  294. package/SECURITY.md +3 -3
  295. package/bin/mcp-server.js +253 -57
  296. package/bin/wrapper.js +24 -10
  297. package/dist/cli.js +29 -1
  298. package/dist/commands/compile.js +7 -0
  299. package/dist/commands/context.js +8 -3
  300. package/dist/commands/graph.js +8 -2
  301. package/dist/commands/init.js +13 -2
  302. package/dist/commands/memory.js +120 -68
  303. package/dist/commands/minimal.js +71 -0
  304. package/dist/commands/native.js +36 -0
  305. package/dist/commands/optimize.js +15 -5
  306. package/dist/esm/index.mjs +58 -32
  307. package/dist/index.d.ts +50 -2
  308. package/dist/utils/fs.js +10 -4
  309. package/dist/utils/helpers.js +10 -1
  310. package/dist/utils/version.js +9 -2
  311. package/mcp_config.json +10 -1
  312. package/package.json +16 -10
  313. package/scripts/benchmark.js +16 -0
  314. package/scripts/sync-version.js +1 -1
  315. package/scripts/visual_audit.js +126 -0
package/bin/mcp-server.js CHANGED
@@ -93,6 +93,10 @@ function searchCaseLaw(query) {
93
93
  timeout: SPAWN_TIMEOUT_MS,
94
94
  },
95
95
  );
96
+ if (result.error) {
97
+ if (result.error.code === "ETIMEDOUT") return "Error: Case law search timed out (exceeded 30s limit)";
98
+ return `Error executing case law search: ${result.error.message}`;
99
+ }
96
100
  return result.stdout || result.stderr || "No results";
97
101
  }
98
102
 
@@ -106,13 +110,30 @@ function stripBoilerplate(text) {
106
110
  return minified.trim();
107
111
  }
108
112
 
113
+ function getAgentDir() {
114
+ const fs = require("fs");
115
+ const local = path.join(process.cwd(), ".agent");
116
+ if (fs.existsSync(local)) return local;
117
+ return path.resolve(__dirname, "../.agent");
118
+ }
119
+
109
120
  function handleRequest(req) {
121
+ const fs = require("fs");
122
+ if (req.method === "notifications/initialized" || req.method === "notifications/cancelled") {
123
+ return null;
124
+ }
125
+ if (req.method === "ping") {
126
+ return {};
127
+ }
128
+
110
129
  // MCP spec: method names follow path-style convention
111
130
  if (req.method === "initialize") {
112
131
  return {
113
- protocolVersion: "2024-11-05",
132
+ protocolVersion: "2025-03-26",
114
133
  capabilities: {
115
134
  tools: {},
135
+ resources: { subscribe: false, listChanged: false },
136
+ prompts: { listChanged: false },
116
137
  },
117
138
  serverInfo: {
118
139
  name: "tribunal-kit-mcp",
@@ -121,6 +142,148 @@ function handleRequest(req) {
121
142
  };
122
143
  }
123
144
 
145
+ if (req.method === "resources/list") {
146
+ const agentDir = getAgentDir();
147
+ const resources = [];
148
+
149
+ // Agents
150
+ const agentsDir = path.join(agentDir, "agents");
151
+ if (fs.existsSync(agentsDir)) {
152
+ const files = fs.readdirSync(agentsDir).filter((f) => f.endsWith(".md"));
153
+ for (const f of files) {
154
+ const name = path.basename(f, ".md");
155
+ resources.push({
156
+ uri: `tribunal://agent/${name}`,
157
+ name: `Agent: ${name}`,
158
+ description: `Tribunal Specialist Agent rule file for ${name}`,
159
+ mimeType: "text/markdown",
160
+ });
161
+ }
162
+ }
163
+
164
+ // Skills
165
+ const skillsDir = path.join(agentDir, "skills");
166
+ if (fs.existsSync(skillsDir)) {
167
+ const dirs = fs.readdirSync(skillsDir, { withFileTypes: true });
168
+ for (const d of dirs) {
169
+ if (d.isDirectory()) {
170
+ const skillFile = path.join(skillsDir, d.name, "SKILL.md");
171
+ if (fs.existsSync(skillFile)) {
172
+ resources.push({
173
+ uri: `tribunal://skill/${d.name}`,
174
+ name: `Skill: ${d.name}`,
175
+ description: `Tribunal Skill instruction file for ${d.name}`,
176
+ mimeType: "text/markdown",
177
+ });
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ // Workflows
184
+ const workflowsDir = path.join(agentDir, "workflows");
185
+ if (fs.existsSync(workflowsDir)) {
186
+ const files = fs.readdirSync(workflowsDir).filter((f) => f.endsWith(".md"));
187
+ for (const f of files) {
188
+ const name = path.basename(f, ".md");
189
+ resources.push({
190
+ uri: `tribunal://workflow/${name}`,
191
+ name: `Workflow: ${name}`,
192
+ description: `Tribunal Workflow guide for ${name}`,
193
+ mimeType: "text/markdown",
194
+ });
195
+ }
196
+ }
197
+
198
+ return { resources };
199
+ }
200
+
201
+ if (req.method === "resources/read") {
202
+ const uri = req.params && req.params.uri;
203
+ if (!uri) throw new Error("Missing uri parameter");
204
+ const agentDir = getAgentDir();
205
+ let filePath = null;
206
+
207
+ if (uri.startsWith("tribunal://agent/")) {
208
+ const name = uri.replace("tribunal://agent/", "");
209
+ filePath = path.join(agentDir, "agents", `${name}.md`);
210
+ } else if (uri.startsWith("tribunal://skill/")) {
211
+ const name = uri.replace("tribunal://skill/", "");
212
+ filePath = path.join(agentDir, "skills", name, "SKILL.md");
213
+ } else if (uri.startsWith("tribunal://workflow/")) {
214
+ const name = uri.replace("tribunal://workflow/", "");
215
+ filePath = path.join(agentDir, "workflows", `${name}.md`);
216
+ }
217
+
218
+ if (!filePath || !fs.existsSync(filePath)) {
219
+ throw new Error(`Resource not found: ${uri}`);
220
+ }
221
+
222
+ const text = fs.readFileSync(filePath, "utf8");
223
+ return {
224
+ contents: [
225
+ {
226
+ uri,
227
+ mimeType: "text/markdown",
228
+ text,
229
+ },
230
+ ],
231
+ };
232
+ }
233
+
234
+ if (req.method === "prompts/list") {
235
+ const agentDir = getAgentDir();
236
+ const prompts = [];
237
+ const workflowsDir = path.join(agentDir, "workflows");
238
+
239
+ if (fs.existsSync(workflowsDir)) {
240
+ const files = fs.readdirSync(workflowsDir).filter((f) => f.endsWith(".md"));
241
+ for (const f of files) {
242
+ const name = path.basename(f, ".md");
243
+ prompts.push({
244
+ name,
245
+ description: `Execute tribunal workflow /${name}`,
246
+ arguments: [
247
+ {
248
+ name: "task",
249
+ description: "The task or target file to execute the workflow against",
250
+ required: false,
251
+ },
252
+ ],
253
+ });
254
+ }
255
+ }
256
+
257
+ return { prompts };
258
+ }
259
+
260
+ if (req.method === "prompts/get") {
261
+ const name = req.params && req.params.name;
262
+ const task = (req.params && req.params.arguments && req.params.arguments.task) || "";
263
+ if (!name) throw new Error("Missing prompt name parameter");
264
+
265
+ const agentDir = getAgentDir();
266
+ const workflowPath = path.join(agentDir, "workflows", `${name}.md`);
267
+ if (!fs.existsSync(workflowPath)) {
268
+ throw new Error(`Prompt workflow not found: ${name}`);
269
+ }
270
+
271
+ const content = fs.readFileSync(workflowPath, "utf8");
272
+ const promptText = task ? `${content}\n\nTarget Task/File: ${task}` : content;
273
+
274
+ return {
275
+ messages: [
276
+ {
277
+ role: "user",
278
+ content: {
279
+ type: "text",
280
+ text: promptText,
281
+ },
282
+ },
283
+ ],
284
+ };
285
+ }
286
+
124
287
  if (req.method === "tools/list") {
125
288
  return {
126
289
  tools: [
@@ -318,26 +481,28 @@ function handleRequest(req) {
318
481
  ],
319
482
  };
320
483
  }
321
- // Run synchronously by spawning a minimal script
322
- const result = spawnSync(
323
- process.execPath,
324
- [
325
- "-e",
326
- `
327
- const { generateIDEBridges } = require('${path.resolve(__dirname, "../dist/commands/init.js").replace(/\\/g, "\\\\")}');
328
- generateIDEBridges('${cwd.replace(/\\/g, "\\\\")}', '${agentDest.replace(/\\/g, "\\\\")}', false).then(() => console.log('Sync complete'));
329
- `,
330
- ],
331
- { encoding: "utf8", timeout: SPAWN_TIMEOUT_MS },
332
- );
333
- return {
334
- content: [
335
- {
336
- type: "text",
337
- text: result.stdout || result.stderr || "Sync complete",
338
- },
339
- ],
340
- };
484
+ try {
485
+ const { generateIDEBridges } = require(path.resolve(__dirname, "../dist/commands/init.js"));
486
+ // generateIDEBridges is async — execute synchronously in MCP context
487
+ generateIDEBridges(cwd, agentDest, true).then(() => {}).catch(() => {});
488
+ return {
489
+ content: [
490
+ {
491
+ type: "text",
492
+ text: "Sync complete",
493
+ },
494
+ ],
495
+ };
496
+ } catch (e) {
497
+ return {
498
+ content: [
499
+ {
500
+ type: "text",
501
+ text: `Sync failed: ${e.message}`,
502
+ },
503
+ ],
504
+ };
505
+ }
341
506
  }
342
507
 
343
508
  if (toolName === "search_case_law") {
@@ -355,7 +520,7 @@ function handleRequest(req) {
355
520
 
356
521
  if (toolName === "list_tribunal_agents") {
357
522
  const fs = require("fs");
358
- const agentDir = path.join(process.cwd(), ".agent", "agents");
523
+ const agentDir = path.join(getAgentDir(), "agents");
359
524
  if (!fs.existsSync(agentDir)) return { content: [{ type: "text", text: "No agents found or .agent directory missing." }] };
360
525
  const agents = fs.readdirSync(agentDir).filter(f => f.endsWith('.md')).map(f => f.replace('.md', ''));
361
526
  return { content: [{ type: "text", text: "Available Agents:\n- " + agents.join("\n- ") }] };
@@ -364,10 +529,12 @@ function handleRequest(req) {
364
529
  if (toolName === "get_tribunal_agent") {
365
530
  const fs = require("fs");
366
531
  const name = req.params?.arguments?.name;
367
- if (!name) throw { code: -32602, message: "Missing argument: name" };
368
- const path = require("path");
532
+ if (!name || typeof name !== "string") throw { code: -32602, message: "Missing or invalid argument: name (string)" };
369
533
  const sanitizedName = path.basename(name);
370
- const agentPath = path.join(process.cwd(), ".agent", "agents", `${sanitizedName}.md`);
534
+ const agentsDir = path.resolve(getAgentDir(), "agents");
535
+ const agentPath = path.resolve(agentsDir, `${sanitizedName}.md`);
536
+ // Path containment: ensure resolved path stays within agents directory
537
+ if (!agentPath.startsWith(agentsDir)) throw { code: -32602, message: "Invalid agent name: path traversal detected" };
371
538
  if (!fs.existsSync(agentPath)) return { content: [{ type: "text", text: `Agent '${sanitizedName}' not found.` }] };
372
539
  const text = fs.readFileSync(agentPath, "utf8");
373
540
  return { content: [{ type: "text", text: stripBoilerplate(text) }] };
@@ -375,7 +542,7 @@ function handleRequest(req) {
375
542
 
376
543
  if (toolName === "list_tribunal_skills") {
377
544
  const fs = require("fs");
378
- const skillsDir = path.join(process.cwd(), ".agent", "skills");
545
+ const skillsDir = path.join(getAgentDir(), "skills");
379
546
  if (!fs.existsSync(skillsDir)) return { content: [{ type: "text", text: "No skills found or .agent directory missing." }] };
380
547
  const skills = fs.readdirSync(skillsDir, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => d.name);
381
548
  return { content: [{ type: "text", text: "Available Skills:\n- " + skills.join("\n- ") }] };
@@ -384,10 +551,12 @@ function handleRequest(req) {
384
551
  if (toolName === "get_tribunal_skill") {
385
552
  const fs = require("fs");
386
553
  const name = req.params?.arguments?.name;
387
- if (!name) throw { code: -32602, message: "Missing argument: name" };
388
- const path = require("path");
554
+ if (!name || typeof name !== "string") throw { code: -32602, message: "Missing or invalid argument: name (string)" };
389
555
  const sanitizedName = path.basename(name);
390
- const skillPath = path.join(process.cwd(), ".agent", "skills", sanitizedName, "SKILL.md");
556
+ const skillsDir = path.resolve(getAgentDir(), "skills");
557
+ const skillPath = path.resolve(skillsDir, sanitizedName, "SKILL.md");
558
+ // Path containment: ensure resolved path stays within skills directory
559
+ if (!skillPath.startsWith(skillsDir)) throw { code: -32602, message: "Invalid skill name: path traversal detected" };
391
560
  if (!fs.existsSync(skillPath)) return { content: [{ type: "text", text: `Skill '${sanitizedName}' not found.` }] };
392
561
  const text = fs.readFileSync(skillPath, "utf8");
393
562
  return { content: [{ type: "text", text: stripBoilerplate(text) }] };
@@ -400,14 +569,15 @@ function handleRequest(req) {
400
569
 
401
570
  if (!task) throw { code: -32602, message: "Missing required argument: task" };
402
571
 
403
- const agentDest = path.join(process.cwd(), ".agent");
572
+ const agentDest = getAgentDir();
404
573
  const fs = require("fs");
405
574
  if (!fs.existsSync(agentDest)) {
406
575
  return { content: [{ type: "text", text: "Error: .agent/ directory not found. Run `tk init` first." }] };
407
576
  }
408
577
 
409
578
  try {
410
- const { broker } = require("../.agent/scripts/context_broker.js");
579
+ const brokerScript = path.join(agentDest, "scripts", "context_broker.js");
580
+ const { broker } = require(brokerScript);
411
581
  const brokerResult = broker(task, files, model, agentDest);
412
582
  return { content: [{ type: "text", text: stripBoilerplate(brokerResult.promptText) }] };
413
583
  } catch (e) {
@@ -421,7 +591,7 @@ function handleRequest(req) {
421
591
  throw { code: -32602, message: "Missing or invalid required argument: query (string)" };
422
592
  }
423
593
  const budget = req.params?.arguments?.budget || 2000;
424
- const agentDest = path.join(process.cwd(), ".agent");
594
+ const agentDest = getAgentDir();
425
595
  const fs = require("fs");
426
596
  if (!fs.existsSync(agentDest)) {
427
597
  return { content: [{ type: "text", text: "Error: .agent/ directory not found. Run `tk init` first." }] };
@@ -455,7 +625,7 @@ function handleRequest(req) {
455
625
  if (!validTypes.includes(memType)) {
456
626
  throw { code: -32602, message: `Invalid memory type: "${memType}". Must be one of: ${validTypes.join(", ")}` };
457
627
  }
458
- const agentDest = path.join(process.cwd(), ".agent");
628
+ const agentDest = getAgentDir();
459
629
  const fs = require("fs");
460
630
  if (!fs.existsSync(agentDest)) {
461
631
  return { content: [{ type: "text", text: "Error: .agent/ directory not found. Run `tk init` first." }] };
@@ -498,7 +668,42 @@ function handleRequest(req) {
498
668
  throw { code: -32601, message: `Unknown method: ${req.method}` };
499
669
  }
500
670
 
671
+ function processSingleRequest(req) {
672
+ try {
673
+ const result = handleRequest(req);
674
+ // If it's a notification, do not send a response
675
+ if (req.id === undefined || req.id === null) {
676
+ return null;
677
+ }
678
+ return { jsonrpc: "2.0", id: req.id, result };
679
+ } catch (e) {
680
+ const code = e && typeof e.code === "number" ? e.code : -32603;
681
+ const message = e && e.message ? e.message : "Internal server error";
682
+ if (req.id === undefined || req.id === null) {
683
+ return {
684
+ jsonrpc: "2.0",
685
+ id: null,
686
+ error: { code, message },
687
+ };
688
+ }
689
+ return {
690
+ jsonrpc: "2.0",
691
+ id: req.id,
692
+ error: { code, message },
693
+ };
694
+ }
695
+ }
696
+
501
697
  rl.on("line", (line) => {
698
+ if (line.length > 1048576) { // 1MB limit
699
+ const errorRes = {
700
+ jsonrpc: "2.0",
701
+ id: null,
702
+ error: { code: -32700, message: "Parse error: input line too long (exceeds 1MB limit)" },
703
+ };
704
+ console.log(JSON.stringify(errorRes));
705
+ return;
706
+ }
502
707
  if (!line.trim()) return;
503
708
 
504
709
  let req;
@@ -515,31 +720,22 @@ rl.on("line", (line) => {
515
720
  return;
516
721
  }
517
722
 
518
- try {
519
- const result = handleRequest(req);
520
- const res = { jsonrpc: "2.0", id: req.id, result };
521
- console.log(JSON.stringify(res));
522
-
523
- // After initialize, send the initialized notification per MCP spec
524
- if (req.method === "initialize") {
525
- console.log(
526
- JSON.stringify({
527
- jsonrpc: "2.0",
528
- method: "notifications/initialized",
529
- params: {},
530
- }),
531
- );
723
+ if (Array.isArray(req)) {
724
+ const responses = [];
725
+ for (const singleReq of req) {
726
+ const response = processSingleRequest(singleReq);
727
+ if (response) {
728
+ responses.push(response);
729
+ }
730
+ }
731
+ if (responses.length > 0) {
732
+ console.log(JSON.stringify(responses));
733
+ }
734
+ } else {
735
+ const response = processSingleRequest(req);
736
+ if (response) {
737
+ console.log(JSON.stringify(response));
532
738
  }
533
- } catch (e) {
534
- // Send proper JSON-RPC error response
535
- const code = e && typeof e.code === "number" ? e.code : -32603;
536
- const message = e && e.message ? e.message : "Internal server error";
537
- const errorRes = {
538
- jsonrpc: "2.0",
539
- id: req.id || null,
540
- error: { code, message },
541
- };
542
- console.log(JSON.stringify(errorRes));
543
739
  }
544
740
  });
545
741
 
package/bin/wrapper.js CHANGED
@@ -24,7 +24,9 @@ const RUST_COMMANDS = new Set([
24
24
  "min-context",
25
25
  "dag-schedule",
26
26
  "context-compress",
27
+ "context-broker",
27
28
  "optimize-step",
29
+ "impact-tier",
28
30
  ]);
29
31
 
30
32
 
@@ -87,6 +89,7 @@ function getBinaryPath() {
87
89
  const buildResult = spawnSync("cargo", ["build", "--release"], {
88
90
  cwd: path.resolve(__dirname, ".."),
89
91
  stdio: "ignore",
92
+ timeout: 60000,
90
93
  });
91
94
  if (buildResult.status === 0) {
92
95
  const releasePath = candidatePaths[0];
@@ -115,10 +118,13 @@ function runRustBinary(binPath, args) {
115
118
  });
116
119
 
117
120
  if (result.error) {
118
- console.error(
119
- `\x1b[91m✖ Failed to execute Rust engine:\x1b[0m ${result.error.message}`,
121
+ // Graceful degradation: fall back to JS engine instead of hard-crashing.
122
+ // Spawn errors include missing binaries, permission denied, corrupted
123
+ // executables, missing shared libraries, and OS-level exec failures.
124
+ console.warn(
125
+ `\x1b[93m⚠ Rust engine failed (${result.error.code || result.error.message}). Falling back to JS engine.\x1b[0m`,
120
126
  );
121
- process.exit(1);
127
+ return false; // Signal caller to fall back
122
128
  }
123
129
 
124
130
  process.exit(result.status || 0);
@@ -128,7 +134,10 @@ function runLegacyFallback() {
128
134
  // Use the modular dist/ CLI with lazy-loaded commands for faster cold-start.
129
135
  // Each command module is require()'d only when invoked (~70% fewer files loaded).
130
136
  const { main } = require("../dist/cli.js");
131
- main();
137
+ main().catch((err) => {
138
+ console.error(`\x1b[91m✖ Fatal Error:\x1b[0m ${err.message || err}`);
139
+ process.exit(1);
140
+ });
132
141
  }
133
142
 
134
143
  function main() {
@@ -150,13 +159,18 @@ function main() {
150
159
 
151
160
  // Route to Rust engine
152
161
  // console.log('\x1b[90m⚡ Executing via Rust Core Engine\x1b[0m');
153
- runRustBinary(binPath, args);
154
- return;
162
+ const rustResult = runRustBinary(binPath, args);
163
+ if (rustResult !== false) {
164
+ return; // Rust engine handled it (process.exit was called)
165
+ }
166
+ // rustResult === false means spawn error; fall through to JS fallback
155
167
  } else {
156
- // Warn if Rust command was requested but binary is missing
157
- console.warn(
158
- "\x1b[93m⚠ Rust binary not found in target/. Falling back to JS engine.\x1b[0m",
159
- );
168
+ // Warn if Rust command was requested but binary is missing (in verbose mode)
169
+ if (process.env.TK_VERBOSE || process.env.VERBOSE) {
170
+ console.warn(
171
+ "\x1b[93m⚠ Rust binary not found in target/. Falling back to JS engine.\x1b[0m",
172
+ );
173
+ }
160
174
  }
161
175
  }
162
176
 
package/dist/cli.js CHANGED
@@ -42,6 +42,15 @@ function parseArgs(argv) {
42
42
  args.flags.minimal = true;
43
43
  continue;
44
44
  }
45
+ if (arg.startsWith('--profile=')) {
46
+ args.flags.profile = arg.split('=').slice(1).join('=');
47
+ continue;
48
+ }
49
+ if (arg === '--profile') {
50
+ const idx = raw.indexOf('--profile');
51
+ args.flags.profile = raw[idx + 1] || 'full';
52
+ continue;
53
+ }
45
54
  if (arg === '--skip-update-check') {
46
55
  args.flags.skipUpdateCheck = true;
47
56
  continue;
@@ -112,6 +121,7 @@ function cmdHelp(quiet = false) {
112
121
  (0, logger_1.log)(cmd('context-compress', 'Compress a context file while retaining VERIFY comments'));
113
122
  (0, logger_1.log)(cmd('optimize-step', 'Apply bounded SkillOpt edits from a JSON payload'));
114
123
  (0, logger_1.log)(cmd('guardrail', 'Validate .agent/ integrity (phantom refs, count mismatches, drift)'));
124
+ (0, logger_1.log)(cmd('impact-tier', 'Classify task governance impact tier (0-3)'));
115
125
  (0, logger_1.log)(cmd('uninstall', 'Remove .agent/ folder from project'));
116
126
  console.log();
117
127
  (0, logger_1.log)((0, logger_1.bold)(' Options'));
@@ -126,6 +136,7 @@ function cmdHelp(quiet = false) {
126
136
  (0, logger_1.log)(opt('--skip-update-check', 'Skip auto-update version check'));
127
137
  (0, logger_1.log)(opt('--head', '(learn) Diff against last commit instead of staged'));
128
138
  (0, logger_1.log)(opt('--write', '(align) Write aligned output in-place to the target file'));
139
+ (0, logger_1.log)(opt('--version, -v', 'Print installed version'));
129
140
  console.log();
130
141
  (0, logger_1.log)((0, logger_1.bold)(' Aliases'));
131
142
  (0, logger_1.log)(` ${(0, logger_1.c)('gray', '─'.repeat(40))}`);
@@ -247,6 +258,11 @@ async function runWithUpdateCheck(command, flags) {
247
258
  await cmdMarathon(flags, process.argv, quiet);
248
259
  break;
249
260
  }
261
+ case 'minimal': {
262
+ const cmdMinimal = loadCmd('./commands/minimal', 'cmdMinimal');
263
+ cmdMinimal(flags, quiet);
264
+ break;
265
+ }
250
266
  case 'compile': {
251
267
  const cmdCompile = loadCmd('./commands/compile', 'cmdCompile');
252
268
  await cmdCompile(flags, quiet);
@@ -297,12 +313,21 @@ async function runWithUpdateCheck(command, flags) {
297
313
  cmdOptimizeStep(process.argv, quiet);
298
314
  break;
299
315
  }
316
+ case 'impact-tier': {
317
+ const cmdImpactTier = loadCmd('./commands/native', 'cmdImpactTier');
318
+ cmdImpactTier(process.argv, quiet);
319
+ break;
320
+ }
300
321
  case 'help':
301
322
  case '--help':
302
323
  case '-h':
303
324
  case null:
304
325
  cmdHelp(quiet);
305
326
  break;
327
+ case '--version':
328
+ case '-v':
329
+ (0, logger_1.log)(CURRENT_VERSION);
330
+ break;
306
331
  default:
307
332
  (0, logger_1.err)(`Unknown command: "${command}"`);
308
333
  console.log();
@@ -317,5 +342,8 @@ async function main() {
317
342
  await runWithUpdateCheck(command, flags);
318
343
  }
319
344
  if (require.main === module) {
320
- main();
345
+ main().catch(err => {
346
+ console.error(`\x1b[91m✖ Fatal Error:\x1b[0m ${err.message || err}`);
347
+ process.exit(1);
348
+ });
321
349
  }
@@ -74,6 +74,13 @@ async function cmdCompile(flags, quiet) {
74
74
  if (flags.target === "claude") targetFile = ".claude.json";
75
75
  }
76
76
 
77
+ const byteLength = Buffer.byteLength(compiledContext, "utf-8");
78
+ const mbSize = byteLength / (1024 * 1024);
79
+ if (mbSize > 5.0 && !quiet) {
80
+ const { warn } = require("../utils/logger");
81
+ warn(`Compiled context is very large (~${mbSize.toFixed(2)} MB). This might overload some LLM context windows.`);
82
+ }
83
+
77
84
  const outputPath = path.join(cwd, targetFile);
78
85
  fs.writeFileSync(outputPath, compiledContext, "utf-8");
79
86
 
@@ -19,11 +19,16 @@ function cmdContext(flags, processArgs) {
19
19
  console.error('Usage: npx tribunal-kit context <target_file>');
20
20
  process.exit(1);
21
21
  }
22
- const targetFile = args[0].replace(/\\/g, '/');
23
- const snapshotName = targetFile.replace(/[\\\/]/g, '__') + '.json';
22
+ const resolvedTarget = path_1.default.resolve(targetDir, args[0]);
23
+ const relativePath = path_1.default.relative(targetDir, resolvedTarget).replace(/\\/g, '/');
24
+ if (relativePath.startsWith('../') || relativePath === '..' || path_1.default.isAbsolute(relativePath)) {
25
+ console.error(' \x1b[91m✖\x1b[0m File must be within the project directory: ' + args[0]);
26
+ process.exit(1);
27
+ }
28
+ const snapshotName = relativePath.replace(/[\\\/]/g, '__') + '.json';
24
29
  const snapshotPath = path_1.default.join(agentDest, 'history', 'snapshots', snapshotName);
25
30
  if (!fs_1.default.existsSync(snapshotPath)) {
26
- console.error(' \x1b[91m✖\x1b[0m Context Snapshot not found for: ' + targetFile);
31
+ console.error(' \x1b[91m✖\x1b[0m Context Snapshot not found for: ' + args[0]);
27
32
  console.log(' Run: npx tribunal-kit graph (to generate snapshots)');
28
33
  process.exit(1);
29
34
  }
@@ -23,8 +23,14 @@ async function cmdGraph(flags, quiet = false) {
23
23
  await (0, helpers_1.runShellAsync)(`node "${builderScript}"`, { stdio: 'inherit', cwd: targetDir });
24
24
  await (0, helpers_1.runShellAsync)(`node "${visualizerScript}"`, { stdio: 'inherit', cwd: targetDir });
25
25
  (0, logger_1.log)(` ${(0, logger_1.c)('cyan', '▸')} Opening visualizer in browser...`);
26
- const opener = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
27
- await (0, helpers_1.runShellAsync)(`${opener} "${htmlFile}"`, { stdio: 'ignore' });
26
+ const child_process = require('child_process');
27
+ if (process.platform === 'win32') {
28
+ child_process.spawn('cmd.exe', ['/c', 'start', '', htmlFile], { stdio: 'ignore', detached: true }).unref();
29
+ } else if (process.platform === 'darwin') {
30
+ child_process.spawn('open', [htmlFile], { stdio: 'ignore', detached: true }).unref();
31
+ } else {
32
+ child_process.spawn('xdg-open', [htmlFile], { stdio: 'ignore', detached: true }).unref();
33
+ }
28
34
  }
29
35
  catch (e) {
30
36
  if (e instanceof Error) {
@@ -26,13 +26,22 @@ const CORE_AGENTS = new Set([
26
26
  'explorer-agent.md',
27
27
  'project-planner.md',
28
28
  'test-engineer.md',
29
+ 'ui-ux-auditor.md',
30
+ 'ui-visual-auditor.md',
31
+ 'accessibility-reviewer.md',
32
+ 'ux-reviewer.md',
33
+ 'visual-reviewer.md',
34
+ 'interaction-reviewer.md',
35
+ 'anti-pattern-reviewer.md',
36
+ 'product-reviewer.md',
29
37
  ]);
30
38
  // Core skills to install in --minimal mode
31
39
  const CORE_SKILLS = new Set([
32
40
  'clean-code', 'architecture', 'testing-patterns', 'systematic-debugging',
33
41
  'frontend-design', 'database-design', 'api-patterns', 'nodejs-best-practices',
34
42
  'vulnerability-scanner', 'typescript-advanced', 'python-pro', 'nextjs-react-expert',
35
- 'react-specialist', 'performance-profiling', 'lint-and-validate',
43
+ 'react-specialist', 'performance-profiling', 'lint-and-validate', 'ui-ux-pro-max',
44
+ 'ui-reasoning-engine', 'product-aware-heuristics', 'web-design-guidelines',
36
45
  ]);
37
46
  async function cmdInit(flags, quiet = false) {
38
47
  const agentSrc = (0, helpers_1.getKitAgent)();
@@ -267,7 +276,7 @@ async function cmdInit(flags, quiet = false) {
267
276
  console.log(drawRow(' Next Steps:', (0, logger_1.c)('gray', ' Next Steps:')));
268
277
  console.log(stepRow('/generate', 'Generate code with reviews'));
269
278
  console.log(stepRow('/review', 'Audit existing code for issues'));
270
- console.log(stepRow('/tribunal-full', 'Run all 19 reviewers in parallel'));
279
+ console.log(stepRow('/tribunal-full', 'Run all 21 reviewers in parallel'));
271
280
  console.log(drawRow('', ''));
272
281
  console.log(` ${(0, logger_1.c)(borderCol, '└' + '─'.repeat(W) + '┘')}`);
273
282
  console.log();
@@ -399,4 +408,6 @@ async function scaffoldDesignSystem(targetDir, agentSrc, dryRun = false) {
399
408
  await copyIfMissing(designMdSrc, designMdDest, 'DESIGN.md System');
400
409
  await copyIfMissing(designTokensSrc, designTokensDest, 'Design Tokens');
401
410
  }
411
+ exports.CORE_AGENTS = CORE_AGENTS;
412
+ exports.CORE_SKILLS = CORE_SKILLS;
402
413