tribunal-kit 4.4.1 → 4.4.3

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 (141) hide show
  1. package/.agent/history/architecture-graph.yaml +140 -0
  2. package/.agent/history/graph-cache.json +262 -0
  3. package/.agent/history/snapshots/bin__tribunal-kit.js.json +19 -0
  4. package/.agent/history/snapshots/eslint.config.js.json +9 -0
  5. package/.agent/history/snapshots/migrate_refs.js.json +11 -0
  6. package/.agent/history/snapshots/scripts__changelog.js.json +13 -0
  7. package/.agent/history/snapshots/scripts__sync-version.js.json +12 -0
  8. package/.agent/history/snapshots/scripts__validate-payload.js.json +12 -0
  9. package/.agent/history/snapshots/test__integration__bridges.test.js.json +14 -0
  10. package/.agent/history/snapshots/test__integration__init.test.js.json +14 -0
  11. package/.agent/history/snapshots/test__integration__routing.test.js.json +12 -0
  12. package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +14 -0
  13. package/.agent/history/snapshots/test__integration__wave2.test.js.json +14 -0
  14. package/.agent/history/snapshots/test__unit__args.test.js.json +20 -0
  15. package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +11 -0
  16. package/.agent/history/snapshots/test__unit__context_broker.test.js.json +11 -0
  17. package/.agent/history/snapshots/test__unit__copyDir.test.js.json +23 -0
  18. package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +12 -0
  19. package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +11 -0
  20. package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +23 -0
  21. package/.agent/history/snapshots/test__unit__semver.test.js.json +20 -0
  22. package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +12 -0
  23. package/.agent/scripts/_colors.js +170 -18
  24. package/.agent/scripts/_utils.js +244 -42
  25. package/.agent/scripts/bundle_analyzer.js +261 -290
  26. package/.agent/scripts/case_law_manager.js +1 -7
  27. package/.agent/scripts/checklist.js +278 -266
  28. package/.agent/scripts/colors.js +11 -17
  29. package/.agent/scripts/context_broker.js +1 -7
  30. package/.agent/scripts/dependency_analyzer.js +234 -272
  31. package/.agent/scripts/graph_builder.js +46 -18
  32. package/.agent/scripts/graph_visualizer.js +10 -4
  33. package/.agent/scripts/graph_zoom.js +6 -4
  34. package/.agent/scripts/inner_loop_validator.js +2 -8
  35. package/.agent/scripts/lint_runner.js +186 -187
  36. package/.agent/scripts/marathon_harness.js +799 -0
  37. package/.agent/scripts/prompt_compiler.js +56 -0
  38. package/.agent/scripts/schema_validator.js +8 -25
  39. package/.agent/scripts/security_scan.js +276 -303
  40. package/.agent/scripts/session_manager.js +1 -7
  41. package/.agent/scripts/skill_evolution.js +1 -8
  42. package/.agent/scripts/skill_integrator.js +1 -7
  43. package/.agent/scripts/test_runner.js +186 -193
  44. package/.agent/scripts/utils.js +17 -32
  45. package/.agent/scripts/verify_all.js +248 -257
  46. package/.agent/skills/agent-organizer/SKILL.md +42 -0
  47. package/.agent/skills/agentic-patterns/SKILL.md +42 -0
  48. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +42 -0
  49. package/.agent/skills/api-patterns/SKILL.md +42 -0
  50. package/.agent/skills/api-security-auditor/SKILL.md +42 -0
  51. package/.agent/skills/app-builder/SKILL.md +42 -0
  52. package/.agent/skills/appflow-wireframe/SKILL.md +42 -0
  53. package/.agent/skills/architecture/SKILL.md +42 -0
  54. package/.agent/skills/authentication-best-practices/SKILL.md +42 -0
  55. package/.agent/skills/backend-security-expert/SKILL.md +122 -0
  56. package/.agent/skills/bash-linux/SKILL.md +42 -0
  57. package/.agent/skills/behavioral-modes/SKILL.md +42 -0
  58. package/.agent/skills/brainstorming/SKILL.md +42 -0
  59. package/.agent/skills/building-native-ui/SKILL.md +42 -0
  60. package/.agent/skills/clean-code/SKILL.md +42 -0
  61. package/.agent/skills/code-review-checklist/SKILL.md +42 -0
  62. package/.agent/skills/config-validator/SKILL.md +42 -0
  63. package/.agent/skills/csharp-developer/SKILL.md +42 -0
  64. package/.agent/skills/data-validation-schemas/SKILL.md +42 -0
  65. package/.agent/skills/database-design/SKILL.md +42 -0
  66. package/.agent/skills/deployment-procedures/SKILL.md +42 -0
  67. package/.agent/skills/devops-engineer/SKILL.md +42 -0
  68. package/.agent/skills/devops-incident-responder/SKILL.md +42 -0
  69. package/.agent/skills/documentation-templates/SKILL.md +42 -0
  70. package/.agent/skills/edge-computing/SKILL.md +42 -0
  71. package/.agent/skills/error-resilience/SKILL.md +42 -0
  72. package/.agent/skills/extract-design-system/SKILL.md +42 -0
  73. package/.agent/skills/framer-motion-expert/SKILL.md +42 -0
  74. package/.agent/skills/frontend-design/SKILL.md +42 -0
  75. package/.agent/skills/frontend-security-expert/SKILL.md +123 -0
  76. package/.agent/skills/game-design-expert/SKILL.md +42 -0
  77. package/.agent/skills/game-engineering-expert/SKILL.md +42 -0
  78. package/.agent/skills/geo-fundamentals/SKILL.md +42 -0
  79. package/.agent/skills/github-operations/SKILL.md +42 -0
  80. package/.agent/skills/gsap-core/SKILL.md +42 -0
  81. package/.agent/skills/gsap-frameworks/SKILL.md +42 -0
  82. package/.agent/skills/gsap-performance/SKILL.md +42 -0
  83. package/.agent/skills/gsap-plugins/SKILL.md +42 -0
  84. package/.agent/skills/gsap-react/SKILL.md +42 -0
  85. package/.agent/skills/gsap-scrolltrigger/SKILL.md +42 -0
  86. package/.agent/skills/gsap-timeline/SKILL.md +42 -0
  87. package/.agent/skills/gsap-utils/SKILL.md +42 -0
  88. package/.agent/skills/i18n-localization/SKILL.md +42 -0
  89. package/.agent/skills/intelligent-routing/SKILL.md +42 -0
  90. package/.agent/skills/knowledge-graph/SKILL.md +42 -0
  91. package/.agent/skills/lint-and-validate/SKILL.md +42 -0
  92. package/.agent/skills/llm-engineering/SKILL.md +42 -0
  93. package/.agent/skills/local-first/SKILL.md +42 -0
  94. package/.agent/skills/mcp-builder/SKILL.md +42 -0
  95. package/.agent/skills/mobile-design/SKILL.md +42 -0
  96. package/.agent/skills/monorepo-management/SKILL.md +42 -0
  97. package/.agent/skills/motion-engineering/SKILL.md +42 -0
  98. package/.agent/skills/nextjs-react-expert/SKILL.md +42 -0
  99. package/.agent/skills/nodejs-best-practices/SKILL.md +42 -0
  100. package/.agent/skills/observability/SKILL.md +42 -0
  101. package/.agent/skills/parallel-agents/SKILL.md +42 -0
  102. package/.agent/skills/performance-profiling/SKILL.md +42 -0
  103. package/.agent/skills/plan-writing/SKILL.md +42 -0
  104. package/.agent/skills/platform-engineer/SKILL.md +42 -0
  105. package/.agent/skills/playwright-best-practices/SKILL.md +42 -0
  106. package/.agent/skills/powershell-windows/SKILL.md +42 -0
  107. package/.agent/skills/project-idioms/SKILL.md +42 -0
  108. package/.agent/skills/python-patterns/SKILL.md +42 -0
  109. package/.agent/skills/python-pro/SKILL.md +42 -0
  110. package/.agent/skills/react-specialist/SKILL.md +42 -0
  111. package/.agent/skills/readme-builder/SKILL.md +42 -0
  112. package/.agent/skills/realtime-patterns/SKILL.md +42 -0
  113. package/.agent/skills/red-team-tactics/SKILL.md +42 -0
  114. package/.agent/skills/rust-pro/SKILL.md +42 -0
  115. package/.agent/skills/seo-fundamentals/SKILL.md +42 -0
  116. package/.agent/skills/server-management/SKILL.md +42 -0
  117. package/.agent/skills/shadcn-ui-expert/SKILL.md +42 -0
  118. package/.agent/skills/skill-creator/SKILL.md +42 -0
  119. package/.agent/skills/sql-pro/SKILL.md +42 -0
  120. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +42 -0
  121. package/.agent/skills/swiftui-expert/SKILL.md +42 -0
  122. package/.agent/skills/systematic-debugging/SKILL.md +42 -0
  123. package/.agent/skills/tailwind-patterns/SKILL.md +42 -0
  124. package/.agent/skills/tdd-workflow/SKILL.md +42 -0
  125. package/.agent/skills/test-result-analyzer/SKILL.md +42 -0
  126. package/.agent/skills/testing-patterns/SKILL.md +42 -0
  127. package/.agent/skills/trend-researcher/SKILL.md +42 -0
  128. package/.agent/skills/typescript-advanced/SKILL.md +42 -0
  129. package/.agent/skills/ui-ux-pro-max/SKILL.md +42 -0
  130. package/.agent/skills/ui-ux-researcher/SKILL.md +42 -0
  131. package/.agent/skills/vue-expert/SKILL.md +42 -0
  132. package/.agent/skills/vulnerability-scanner/SKILL.md +42 -0
  133. package/.agent/skills/web-accessibility-auditor/SKILL.md +42 -0
  134. package/.agent/skills/web-design-guidelines/SKILL.md +42 -0
  135. package/.agent/skills/webapp-testing/SKILL.md +42 -0
  136. package/.agent/skills/whimsy-injector/SKILL.md +42 -0
  137. package/.agent/skills/workflow-optimizer/SKILL.md +42 -0
  138. package/.agent/workflows/marathon.md +247 -0
  139. package/.agent/workflows/super-prompt.md +27 -0
  140. package/bin/tribunal-kit.js +47 -1
  141. package/package.json +3 -2
@@ -245,3 +245,45 @@ Review these questions before confirming output:
245
245
 
246
246
  ## VBC Protocol (Verification-Before-Completion)
247
247
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
248
+
249
+
250
+ ---
251
+
252
+ ## 🤖 LLM-Specific Traps
253
+
254
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
255
+
256
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
257
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
258
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
259
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
260
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
261
+
262
+ ---
263
+
264
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
265
+
266
+ **Slash command: `/review` or `/tribunal-full`**
267
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
268
+
269
+ ### ❌ Forbidden AI Tropes
270
+
271
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
272
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
273
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
274
+
275
+ ### ✅ Pre-Flight Self-Audit
276
+
277
+ Review these questions before confirming output:
278
+ ```
279
+ ✅ Did I rely ONLY on real, verified tools and methods?
280
+ ✅ Is this solution appropriately scoped to the user's constraints?
281
+ ✅ Did I handle potential failure modes and edge cases?
282
+ ✅ Have I avoided generic boilerplate that doesn't add value?
283
+ ```
284
+
285
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
286
+
287
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
288
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
289
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -191,3 +191,45 @@ Review these questions before confirming output:
191
191
 
192
192
  ## VBC Protocol (Verification-Before-Completion)
193
193
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
194
+
195
+
196
+ ---
197
+
198
+ ## 🤖 LLM-Specific Traps
199
+
200
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
201
+
202
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
203
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
204
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
205
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
206
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
207
+
208
+ ---
209
+
210
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
211
+
212
+ **Slash command: `/review` or `/tribunal-full`**
213
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
214
+
215
+ ### ❌ Forbidden AI Tropes
216
+
217
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
218
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
219
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
220
+
221
+ ### ✅ Pre-Flight Self-Audit
222
+
223
+ Review these questions before confirming output:
224
+ ```
225
+ ✅ Did I rely ONLY on real, verified tools and methods?
226
+ ✅ Is this solution appropriately scoped to the user's constraints?
227
+ ✅ Did I handle potential failure modes and edge cases?
228
+ ✅ Have I avoided generic boilerplate that doesn't add value?
229
+ ```
230
+
231
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
232
+
233
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
234
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
235
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -570,3 +570,45 @@ Review these questions before confirming output:
570
570
 
571
571
  ## VBC Protocol (Verification-Before-Completion)
572
572
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
573
+
574
+
575
+ ---
576
+
577
+ ## 🤖 LLM-Specific Traps
578
+
579
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
580
+
581
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
582
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
583
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
584
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
585
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
586
+
587
+ ---
588
+
589
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
590
+
591
+ **Slash command: `/review` or `/tribunal-full`**
592
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
593
+
594
+ ### ❌ Forbidden AI Tropes
595
+
596
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
597
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
598
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
599
+
600
+ ### ✅ Pre-Flight Self-Audit
601
+
602
+ Review these questions before confirming output:
603
+ ```
604
+ ✅ Did I rely ONLY on real, verified tools and methods?
605
+ ✅ Is this solution appropriately scoped to the user's constraints?
606
+ ✅ Did I handle potential failure modes and edge cases?
607
+ ✅ Have I avoided generic boilerplate that doesn't add value?
608
+ ```
609
+
610
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
611
+
612
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
613
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
614
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -143,3 +143,45 @@ Review these questions before confirming output:
143
143
 
144
144
  ## VBC Protocol (Verification-Before-Completion)
145
145
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
146
+
147
+
148
+ ---
149
+
150
+ ## 🤖 LLM-Specific Traps
151
+
152
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
153
+
154
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
155
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
156
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
157
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
158
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
159
+
160
+ ---
161
+
162
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
163
+
164
+ **Slash command: `/review` or `/tribunal-full`**
165
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
166
+
167
+ ### ❌ Forbidden AI Tropes
168
+
169
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
170
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
171
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
172
+
173
+ ### ✅ Pre-Flight Self-Audit
174
+
175
+ Review these questions before confirming output:
176
+ ```
177
+ ✅ Did I rely ONLY on real, verified tools and methods?
178
+ ✅ Is this solution appropriately scoped to the user's constraints?
179
+ ✅ Did I handle potential failure modes and edge cases?
180
+ ✅ Have I avoided generic boilerplate that doesn't add value?
181
+ ```
182
+
183
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
184
+
185
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
186
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
187
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -217,3 +217,45 @@ Review these questions before confirming output:
217
217
 
218
218
  ## VBC Protocol (Verification-Before-Completion)
219
219
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
220
+
221
+
222
+ ---
223
+
224
+ ## 🤖 LLM-Specific Traps
225
+
226
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
227
+
228
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
229
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
230
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
231
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
232
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
233
+
234
+ ---
235
+
236
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
237
+
238
+ **Slash command: `/review` or `/tribunal-full`**
239
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
240
+
241
+ ### ❌ Forbidden AI Tropes
242
+
243
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
244
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
245
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
246
+
247
+ ### ✅ Pre-Flight Self-Audit
248
+
249
+ Review these questions before confirming output:
250
+ ```
251
+ ✅ Did I rely ONLY on real, verified tools and methods?
252
+ ✅ Is this solution appropriately scoped to the user's constraints?
253
+ ✅ Did I handle potential failure modes and edge cases?
254
+ ✅ Have I avoided generic boilerplate that doesn't add value?
255
+ ```
256
+
257
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
258
+
259
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
260
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
261
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -187,3 +187,45 @@ Review these questions before confirming output:
187
187
 
188
188
  ## VBC Protocol (Verification-Before-Completion)
189
189
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
190
+
191
+
192
+ ---
193
+
194
+ ## 🤖 LLM-Specific Traps
195
+
196
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
197
+
198
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
199
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
200
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
201
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
202
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
203
+
204
+ ---
205
+
206
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
207
+
208
+ **Slash command: `/review` or `/tribunal-full`**
209
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
210
+
211
+ ### ❌ Forbidden AI Tropes
212
+
213
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
214
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
215
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
216
+
217
+ ### ✅ Pre-Flight Self-Audit
218
+
219
+ Review these questions before confirming output:
220
+ ```
221
+ ✅ Did I rely ONLY on real, verified tools and methods?
222
+ ✅ Is this solution appropriately scoped to the user's constraints?
223
+ ✅ Did I handle potential failure modes and edge cases?
224
+ ✅ Have I avoided generic boilerplate that doesn't add value?
225
+ ```
226
+
227
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
228
+
229
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
230
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
231
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: backend-security-expert
3
+ description: Backend security auditing for modern server-side architectures. Focuses on Next.js Server Actions, Node.js/Edge APIs, JWT & Session architectures, ORM injection (Prisma/Drizzle), and RBAC implementation.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ version: 1.0.0
6
+ last-updated: 2026-05-22
7
+ applies-to-model: gemini-3-1-pro, claude-3-7-sonnet
8
+ ---
9
+
10
+ # Backend Security Expert — Modern Server Architectures
11
+
12
+ ## Hallucination Traps (Read First)
13
+ - ❌ Recommending session tokens without algorithm enforcement → ✅ Always verify JWT algorithms (`alg: "HS256"`) to prevent "None" attacks.
14
+ - ❌ Treating ORMs as automatically secure → ✅ Prisma and Drizzle can still be vulnerable if raw SQL/queries are dynamically interpolated.
15
+ - ❌ Assuming Next.js Server Actions are private APIs → ✅ Server Actions are public endpoints and must be authenticated and rate-limited.
16
+ - ❌ Leaving input validation to the controller logic → ✅ Always enforce strict schema boundaries (Zod/Pydantic) before business logic.
17
+
18
+ ---
19
+
20
+ ## 1. Next.js Server Actions & Edge APIs
21
+ Server Actions create implicit API endpoints. They must be treated like raw REST routes.
22
+ - **Authentication**: Validate the session ID/token at the very top of *every* Server Action.
23
+ - **Input Validation**: Parse all inputs using Zod. Do not trust TypeScript types, as they do not exist at runtime.
24
+ - **Rate Limiting**: Apply `@upstash/ratelimit` or similar to prevent brute force and abuse on public-facing actions.
25
+
26
+ ## 2. Authentication & Authorization (RBAC)
27
+ - **Role-Based Access**: Check if the authenticated user has permission to perform the specific action, not just if they are logged in.
28
+ - **IDOR Prevention**: Always verify that the resource being modified belongs to the user requesting the modification (e.g., `WHERE userId = session.userId`).
29
+ - **Secrets Management**: Never hardcode API keys. Ensure they are loaded from `.env` and fail loudly if missing.
30
+
31
+ ## 3. Database & ORM Security
32
+ - **NoSQL/ORM Injection**: Avoid passing raw JSON or objects directly into query constraints (e.g., MongoDB `$where` or Prisma raw queries).
33
+ - **Mass Assignment**: Never destructure user input directly into a database create/update call. Explicitly pick the fields allowed to be updated.
34
+ - **Query Depth**: For GraphQL backends, always implement depth limiting and cost analysis to prevent query-based DDoS.
35
+
36
+ ## 4. Headers & Server Hardening
37
+ - **CORS**: Never use wildcard `Access-Control-Allow-Origin: *` for authenticated routes.
38
+ - **Security Headers**: Ensure Helmet (or equivalent Next.js headers config) is active for HSTS, X-Frame-Options, and Content-Type-Options.
39
+
40
+ ---
41
+
42
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
43
+
44
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
45
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
46
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
47
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
48
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
49
+
50
+ ---
51
+
52
+ **Slash command: `/review` or `/tribunal-full`**
53
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
54
+
55
+ ### ❌ Forbidden AI Tropes
56
+
57
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
58
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
59
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
60
+
61
+ Review these questions before confirming output:
62
+ ```
63
+ ✅ Did I rely ONLY on real, verified tools and methods?
64
+ ✅ Is this solution appropriately scoped to the user's constraints?
65
+ ✅ Did I handle potential failure modes and edge cases?
66
+ ✅ Have I avoided generic boilerplate that doesn't add value?
67
+ ```
68
+
69
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
70
+
71
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
72
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
73
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
74
+
75
+ ## Pre-Flight Checklist
76
+ - [ ] Have I reviewed the user's specific constraints and requests?
77
+ - [ ] Have I checked the environment for relevant existing implementations?
78
+
79
+ ## VBC Protocol (Verification-Before-Completion)
80
+ You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
81
+
82
+
83
+ ---
84
+
85
+ ## 🤖 LLM-Specific Traps
86
+
87
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
88
+
89
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
90
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
91
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
92
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
93
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
94
+
95
+ ---
96
+
97
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
98
+
99
+ **Slash command: `/review` or `/tribunal-full`**
100
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
101
+
102
+ ### ❌ Forbidden AI Tropes
103
+
104
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
105
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
106
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
107
+
108
+ ### ✅ Pre-Flight Self-Audit
109
+
110
+ Review these questions before confirming output:
111
+ ```
112
+ ✅ Did I rely ONLY on real, verified tools and methods?
113
+ ✅ Is this solution appropriately scoped to the user's constraints?
114
+ ✅ Did I handle potential failure modes and edge cases?
115
+ ✅ Have I avoided generic boilerplate that doesn't add value?
116
+ ```
117
+
118
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
119
+
120
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
121
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
122
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -177,3 +177,45 @@ Review these questions before confirming output:
177
177
 
178
178
  ## VBC Protocol (Verification-Before-Completion)
179
179
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
180
+
181
+
182
+ ---
183
+
184
+ ## 🤖 LLM-Specific Traps
185
+
186
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
187
+
188
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
189
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
190
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
191
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
192
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
193
+
194
+ ---
195
+
196
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
197
+
198
+ **Slash command: `/review` or `/tribunal-full`**
199
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
200
+
201
+ ### ❌ Forbidden AI Tropes
202
+
203
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
204
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
205
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
206
+
207
+ ### ✅ Pre-Flight Self-Audit
208
+
209
+ Review these questions before confirming output:
210
+ ```
211
+ ✅ Did I rely ONLY on real, verified tools and methods?
212
+ ✅ Is this solution appropriately scoped to the user's constraints?
213
+ ✅ Did I handle potential failure modes and edge cases?
214
+ ✅ Have I avoided generic boilerplate that doesn't add value?
215
+ ```
216
+
217
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
218
+
219
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
220
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
221
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -221,3 +221,45 @@ Review these questions before confirming output:
221
221
 
222
222
  ## VBC Protocol (Verification-Before-Completion)
223
223
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
224
+
225
+
226
+ ---
227
+
228
+ ## 🤖 LLM-Specific Traps
229
+
230
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
231
+
232
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
233
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
234
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
235
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
236
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
237
+
238
+ ---
239
+
240
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
241
+
242
+ **Slash command: `/review` or `/tribunal-full`**
243
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
244
+
245
+ ### ❌ Forbidden AI Tropes
246
+
247
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
248
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
249
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
250
+
251
+ ### ✅ Pre-Flight Self-Audit
252
+
253
+ Review these questions before confirming output:
254
+ ```
255
+ ✅ Did I rely ONLY on real, verified tools and methods?
256
+ ✅ Is this solution appropriately scoped to the user's constraints?
257
+ ✅ Did I handle potential failure modes and edge cases?
258
+ ✅ Have I avoided generic boilerplate that doesn't add value?
259
+ ```
260
+
261
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
262
+
263
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
264
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
265
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -484,3 +484,45 @@ Review these questions before confirming output:
484
484
 
485
485
  ## VBC Protocol (Verification-Before-Completion)
486
486
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
487
+
488
+
489
+ ---
490
+
491
+ ## 🤖 LLM-Specific Traps
492
+
493
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
494
+
495
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
496
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
497
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
498
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
499
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
500
+
501
+ ---
502
+
503
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
504
+
505
+ **Slash command: `/review` or `/tribunal-full`**
506
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
507
+
508
+ ### ❌ Forbidden AI Tropes
509
+
510
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
511
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
512
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
513
+
514
+ ### ✅ Pre-Flight Self-Audit
515
+
516
+ Review these questions before confirming output:
517
+ ```
518
+ ✅ Did I rely ONLY on real, verified tools and methods?
519
+ ✅ Is this solution appropriately scoped to the user's constraints?
520
+ ✅ Did I handle potential failure modes and edge cases?
521
+ ✅ Have I avoided generic boilerplate that doesn't add value?
522
+ ```
523
+
524
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
525
+
526
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
527
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
528
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -200,3 +200,45 @@ Review these questions before confirming output:
200
200
 
201
201
  ## VBC Protocol (Verification-Before-Completion)
202
202
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
203
+
204
+
205
+ ---
206
+
207
+ ## 🤖 LLM-Specific Traps
208
+
209
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
210
+
211
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
212
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
213
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
214
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
215
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
216
+
217
+ ---
218
+
219
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
220
+
221
+ **Slash command: `/review` or `/tribunal-full`**
222
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
223
+
224
+ ### ❌ Forbidden AI Tropes
225
+
226
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
227
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
228
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
229
+
230
+ ### ✅ Pre-Flight Self-Audit
231
+
232
+ Review these questions before confirming output:
233
+ ```
234
+ ✅ Did I rely ONLY on real, verified tools and methods?
235
+ ✅ Is this solution appropriately scoped to the user's constraints?
236
+ ✅ Did I handle potential failure modes and edge cases?
237
+ ✅ Have I avoided generic boilerplate that doesn't add value?
238
+ ```
239
+
240
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
241
+
242
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
243
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
244
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -379,3 +379,45 @@ Review these questions before confirming output:
379
379
 
380
380
  ## VBC Protocol (Verification-Before-Completion)
381
381
  You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
382
+
383
+
384
+ ---
385
+
386
+ ## 🤖 LLM-Specific Traps
387
+
388
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
389
+
390
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
391
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
392
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
393
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
394
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
395
+
396
+ ---
397
+
398
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
399
+
400
+ **Slash command: `/review` or `/tribunal-full`**
401
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
402
+
403
+ ### ❌ Forbidden AI Tropes
404
+
405
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
406
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
407
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
408
+
409
+ ### ✅ Pre-Flight Self-Audit
410
+
411
+ Review these questions before confirming output:
412
+ ```
413
+ ✅ Did I rely ONLY on real, verified tools and methods?
414
+ ✅ Is this solution appropriately scoped to the user's constraints?
415
+ ✅ Did I handle potential failure modes and edge cases?
416
+ ✅ Have I avoided generic boilerplate that doesn't add value?
417
+ ```
418
+
419
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
420
+
421
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
422
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
423
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.