tribunal-kit 5.7.0 → 5.8.0

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 (56) hide show
  1. package/.agent/ARCHITECTURE.md +6 -7
  2. package/.agent/agents/frontend-reviewer.md +13 -0
  3. package/.agent/agents/frontend-specialist.md +14 -0
  4. package/.agent/agents/logic-reviewer.md +11 -0
  5. package/.agent/agents/orchestrator.md +15 -0
  6. package/.agent/agents/security-auditor.md +13 -0
  7. package/.agent/agents/ui-ux-auditor.md +7 -31
  8. package/.agent/history/memory/.memory.idx +766 -0
  9. package/.agent/history/memory/MEMORY.md +62 -0
  10. package/.agent/routing_index.json +694 -714
  11. package/.agent/rules/GEMINI.md +58 -8
  12. package/.agent/scripts/_colors.js +131 -89
  13. package/.agent/scripts/_utils.js +163 -128
  14. package/.agent/scripts/auto_preview.js +207 -197
  15. package/.agent/scripts/bundle_analyzer.js +227 -192
  16. package/.agent/scripts/case_law_manager.js +991 -689
  17. package/.agent/scripts/checklist.js +233 -190
  18. package/.agent/scripts/context_broker.js +930 -605
  19. package/.agent/scripts/dependency_analyzer.js +275 -184
  20. package/.agent/scripts/graph_builder.js +412 -341
  21. package/.agent/scripts/graph_visualizer.js +392 -390
  22. package/.agent/scripts/graph_zoom.js +198 -156
  23. package/.agent/scripts/inner_loop_validator.js +523 -445
  24. package/.agent/scripts/lint_runner.js +199 -157
  25. package/.agent/scripts/marathon_harness.js +819 -661
  26. package/.agent/scripts/minify_context.js +115 -100
  27. package/.agent/scripts/mutation_runner.js +321 -280
  28. package/.agent/scripts/prompt_compiler.js +62 -42
  29. package/.agent/scripts/schema_validator.js +373 -280
  30. package/.agent/scripts/security_scan.js +333 -190
  31. package/.agent/scripts/session_manager.js +306 -270
  32. package/.agent/scripts/skill_evolution.js +810 -637
  33. package/.agent/scripts/skill_integrator.js +327 -307
  34. package/.agent/scripts/strengthen_skills.js +203 -193
  35. package/.agent/scripts/swarm_dispatcher.js +558 -457
  36. package/.agent/scripts/test_runner.js +178 -152
  37. package/.agent/scripts/verify_all.js +200 -168
  38. package/.agent/skills/fabel-protocol/SKILL.md +235 -0
  39. package/.agent/skills/thinking-protocol/SKILL.md +27 -0
  40. package/.agent/workflows/generate.md +1 -1
  41. package/.agent/workflows/tribunal-speed.md +1 -1
  42. package/README.md +53 -53
  43. package/bin/mcp-server.js +460 -175
  44. package/bin/tribunal-kit.js +1245 -987
  45. package/bin/wrapper.js +104 -74
  46. package/dist/cli.js +31 -0
  47. package/dist/commands/case.js +23 -0
  48. package/dist/commands/compile.js +84 -0
  49. package/dist/commands/init.js +42 -0
  50. package/dist/commands/learn.js +57 -0
  51. package/dist/commands/memory.js +456 -0
  52. package/package.json +2 -2
  53. package/scripts/benchmark.js +162 -125
  54. package/scripts/changelog.js +196 -168
  55. package/scripts/sync-version.js +94 -81
  56. package/scripts/validate-payload.js +85 -78
@@ -42,7 +42,7 @@ Type any of these in your AI IDE chat:
42
42
  | ----------------------- | -------------------------------------------------------------------------------------- | ----------------------------------- |
43
43
  | `/generate` | Full Tribunal: Maker → Parallel Review → Human Gate | `workflows/generate.md` |
44
44
  | `/review` | Audit existing code (no generation) | `workflows/review.md` |
45
- | `/tribunal-full` | ALL 18 reviewers at once — maximum coverage | `workflows/tribunal-full.md` |
45
+ | `/tribunal-full` | ALL 19 reviewers at once — maximum coverage | `workflows/tribunal-full.md` |
46
46
  | `/tribunal-backend` | Logic + Security + Deps + Types | `workflows/tribunal-backend.md` |
47
47
  | `/tribunal-frontend` | Logic + Security + Frontend + Types | `workflows/tribunal-frontend.md` |
48
48
  | `/tribunal-database` | Logic + Security + SQL | `workflows/tribunal-database.md` |
@@ -71,7 +71,7 @@ Type any of these in your AI IDE chat:
71
71
 
72
72
  ---
73
73
 
74
- ## The 18 Tribunal Agents
74
+ ## The 19 Tribunal Agents
75
75
 
76
76
  | Agent | File | Activates When |
77
77
  | ------------------------ | ---------------------------------- | ----------------------------------------------------------------------------------- |
@@ -267,16 +267,15 @@ Script failures follow cascade rules:
267
267
  .agent/
268
268
  ├── ARCHITECTURE.md ← This file
269
269
  ├── GEMINI.md ← Root behavior config (includes /swarm routing)
270
- ├── agents/ ← 43 specialist + reviewer agents (18 reviewers + 25 domain)
270
+ ├── agents/ ← 43 specialist + reviewer agents (19 reviewers + 24 domain)
271
271
  │ ├── supervisor-agent.md ← Swarm triage, dispatch, synthesis
272
272
  │ ├── swarm-worker-contracts.md ← WorkerRequest/WorkerResult schemas
273
273
  │ └── swarm-worker-registry.md ← Task type → agent routing map
274
274
  ├── rules/GEMINI.md ← Master rules (P0 priority)
275
- ├── scripts/ ← 25 Python/JS automation scripts
276
- │ └── swarm_dispatcher.js Validates WorkerRequest/WorkerResult JSON
277
- ├── skills/ ← 90 modular skill packages (all hardened)
275
+ ├── scripts/ ← 28 Python/JS automation scripts
276
+ ├── skills/ 106 modular skill packages (all hardened)
278
277
  ├── patterns/ ← 5 ADK skill base patterns
279
278
  ├── history/ ← Case Law + Skill Evolution data (user-generated, preserved on update)
280
- └── workflows/ ← 31 slash command definitions
279
+ └── workflows/ ← 34 slash command definitions
281
280
  └── swarm.md ← /swarm orchestration procedure
282
281
  ```
@@ -159,4 +159,17 @@ const { id } = await params;
159
159
 
160
160
  ---
161
161
 
162
+ ## Section 7: Fabel Design Standards
163
+
164
+ ### Platform-Aware Rendering Checks
165
+ - Verify if the component differentiates between desktop and mobile targets where applicable.
166
+ - In components or SVGs, ensure viewport, viewBox, and touch target sizes are adjusted properly (e.g., minimum 44x44px touch targets on mobile).
167
+ - Look for responsive utility classes or hooks (`useMediaQuery`, Tailwind `sm:`, `md:`, etc.) to verify adaptation logic.
168
+
169
+ ### Visual Content Safety
170
+ - Flag any code, assets, SVGs, or mocks containing references to copyrighted characters, brands, logos, or real people's likenesses.
171
+ - Ensure only generic symbols, standard library icons (e.g., Lucide React), or explicitly clean SVGs are used.
172
+
173
+ ---
174
+
162
175
  ---
@@ -255,3 +255,17 @@ Every component I generate meets WCAG 2.2 AA:
255
255
  - **Color contrast**: Text minimum 4.5:1 (AA) on its background
256
256
 
257
257
  ---
258
+
259
+ ## 9. Fabel Output Format & Structure Rules
260
+
261
+ ### File Creation Decision Tree
262
+ - **Inline Output:** Code changes under 20 lines should be provided inline.
263
+ - **File Output:** Code changes over 20 lines, new components, or major refactors must be written directly to a file rather than printed in the response.
264
+ - **Documentation:** Create markdown files in specific doc folders rather than verbose text walls in chat.
265
+
266
+ ### Formatting & Prose Discipline
267
+ - **Prose-First:** Use paragraph prose as the default form of communication.
268
+ - **Anti-Slop:** Avoid bulleted list lists and nested headers for short points. Use bullets only when describing 4 or more distinct, multifaceted items.
269
+ - **No Decorative Sections:** Eliminate filler sections, conversational headers, or repetitive explanations. Keep it scannable, dense, and premium.
270
+
271
+ ---
@@ -115,4 +115,15 @@ Flag any:
115
115
 
116
116
  ---
117
117
 
118
+ ## Fabel Epistemic Standards
119
+
120
+ ### Stale Context Detection
121
+ - Flag any code that modifies a file or calls a method based on an out-of-date or assumed file state. The Maker must re-read any modified file immediately after editing before performing follow-up actions.
122
+
123
+ ### // VERIFY: [reason] Enforcement
124
+ - Flag any lines calling an undocumented API, third-party library method, or complex framework feature that lack an explicit `// VERIFY: [reason]` comment explaining why the Maker believes the call is correct.
125
+ - Ensure the verification reason is specific, not generic (e.g., `// VERIFY: Check if package.json has this version`).
126
+
127
+ ---
128
+
118
129
  ---
@@ -185,3 +185,18 @@ Approve? Y = write to disk | N = discard | R = revise with feedback
185
185
  **Nothing is written to disk without explicit human approval.**
186
186
 
187
187
  ---
188
+
189
+ ## 9. Fabel Tool Selection & Scaling Rules
190
+
191
+ ### Tool Priority Hierarchy
192
+ 1. **Workspace Tools** — prioritize local file search, grep, view, and edit. These are fast and conserve token space.
193
+ 2. **Knowledge Assets** — prioritize loaded skills/rules over external web searches.
194
+ 3. **Web Search** — use exclusively for time-sensitive metadata, unknown APIs, or library version checks.
195
+
196
+ ### Complexity-Scaled budgets
197
+ - **Simple Lookup / Fact:** 1 tool call max.
198
+ - **Single-File Edit / Bug Fix:** 2–4 tool calls.
199
+ - **Complex Implementation:** 5–10 tool calls.
200
+ - **Maximum Threshold:** If a task requires >20 tool calls, the Orchestrator MUST halt and request the user to decompose the task or provide guidance.
201
+
202
+ ---
@@ -178,3 +178,16 @@ app.use((err: Error, req, res, next) => {
178
178
  ```
179
179
 
180
180
  ---
181
+
182
+ ## 4. Prompt Injection Defense & LLM Call Security
183
+
184
+ ### Prompt Injection Defenses
185
+ - Ensure user-provided input is never concatenated directly into top-level system prompts.
186
+ - Verify that user inputs are isolated in `<user_provided_context>` or custom XML tags, and system prompts explicitly instruct the model to ignore instructions within those tags.
187
+ - Verify that HTML/XML tags are stripped or sanitized from user input before sending to LLM APIs.
188
+
189
+ ### LLM Call Audit Checklist
190
+ - Flag any hardcoded API keys. They must be loaded from environment variables.
191
+ - Verify model strings against official current lists (no invented names like `claude-4-opus` or `gpt-5`).
192
+ - Ensure all LLM API calls are asynchronous and properly awaited.
193
+ - Check that output parsing is wrapped in try-catch blocks and parses structured JSON safely.
@@ -128,7 +128,7 @@ Required fix: [concrete action the Maker Agent must take]
128
128
 
129
129
  ```
130
130
  ✅ 8pt grid system: 8px, 16px, 24px, 32px, 48px, 64px, 96px, 128px
131
- ✅ CSS custom properties: --space-2: 8px, --space-4: 16px, --space-6: 24px
131
+ Custom CSS properties: --space-2: 8px, --space-4: 16px, --space-6: 24px
132
132
  ✅ Section padding: 80px–120px vertical on desktop, 48px–64px on mobile
133
133
  ✅ Component padding: consistent horizontal padding on all containers
134
134
  ```
@@ -224,36 +224,7 @@ Required fix: [concrete action the Maker Agent must take]
224
224
 
225
225
  ```
226
226
  COLOR
227
- Primary color is not purple/violet
228
- □ Using CSS custom properties, not raw hex values
229
- □ Dark mode background is near-black (not generic gray-900)
230
- □ Contrast ratios meet WCAG AA
231
-
232
- TYPOGRAPHY
233
- □ Fluid sizing with clamp() for responsive text
234
- □ Clear hierarchy: hero / heading / subheading / body / caption
235
- □ Max line length bounded for readability
236
-
237
- MOTION
238
- □ Entrance animation present on key elements
239
- □ Hover states on all interactive elements
240
- □ @media (prefers-reduced-motion) implemented
241
- □ No linear easing — use cubic-bezier throughout
242
-
243
- LAYOUT
244
- □ Not a standard hero layout without justification
245
- □ Not a bento grid without justification
246
- □ 8pt spacing grid used consistently
247
-
248
- TEXTURE
249
- □ Background has depth: grain, shadow, or layering
250
- □ No flat mesh gradient backgrounds
251
- □ Glassmorphism used sparingly, not as the default
252
-
253
- ACCESSIBILITY
254
- □ Focus-visible styles on all interactive elements
255
- □ Semantic HTML (button not div, nav not ul, etc.)
256
- □ ARIA labels where needed for icon-only buttons
227
+ ... [truncated for spacing] ...
257
228
  ```
258
229
 
259
230
  ---
@@ -297,4 +268,9 @@ VBC PROTOCOL (Verdict-Based Correction):
297
268
  □ Every REJECTED verdict includes a concrete "Required fix" with code
298
269
  □ Every WARNING includes a code example from the positive patterns above
299
270
  □ No vague feedback — every verdict is actionable
271
+
272
+ FABEL DESIGN INTELLIGENCE:
273
+ □ Did I check that the visual output adapts to the target platform (mobile vs desktop)?
274
+ □ Are touch targets at least 44x44px for touch screens?
275
+ □ Did I verify that there are no copyrighted characters, logos, or real people in the generated UI?
300
276
  ```