tribunal-kit 6.0.1 → 7.0.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 (349) hide show
  1. package/.agent/ARCHITECTURE.md +9 -6
  2. package/.agent/agents/accessibility-reviewer.md +23 -16
  3. package/.agent/agents/ai-code-reviewer.md +25 -21
  4. package/.agent/agents/anti-pattern-reviewer.md +12 -7
  5. package/.agent/agents/api-architect.md +1 -0
  6. package/.agent/agents/backend-specialist.md +23 -22
  7. package/.agent/agents/cloud-engineer.md +1 -0
  8. package/.agent/agents/code-archaeologist.md +1 -0
  9. package/.agent/agents/complexity-reviewer.md +10 -7
  10. package/.agent/agents/database-architect.md +3 -2
  11. package/.agent/agents/db-latency-auditor.md +6 -2
  12. package/.agent/agents/debugger.md +3 -2
  13. package/.agent/agents/dependency-reviewer.md +1 -0
  14. package/.agent/agents/devops-engineer.md +9 -8
  15. package/.agent/agents/documentation-writer.md +6 -5
  16. package/.agent/agents/explorer-agent.md +1 -0
  17. package/.agent/agents/frontend-reviewer.md +21 -17
  18. package/.agent/agents/frontend-specialist.md +23 -20
  19. package/.agent/agents/game-developer.md +1 -0
  20. package/.agent/agents/interaction-reviewer.md +10 -5
  21. package/.agent/agents/logic-reviewer.md +3 -0
  22. package/.agent/agents/minimalist-reviewer.md +6 -0
  23. package/.agent/agents/mobile-developer.md +7 -6
  24. package/.agent/agents/mobile-reviewer.md +14 -13
  25. package/.agent/agents/orchestrator.md +3 -0
  26. package/.agent/agents/penetration-tester.md +1 -0
  27. package/.agent/agents/performance-optimizer.md +6 -5
  28. package/.agent/agents/performance-reviewer.md +6 -6
  29. package/.agent/agents/pipeline-reviewer.md +144 -0
  30. package/.agent/agents/precedence-reviewer.md +1 -0
  31. package/.agent/agents/product-manager.md +1 -0
  32. package/.agent/agents/product-owner.md +1 -0
  33. package/.agent/agents/product-reviewer.md +12 -7
  34. package/.agent/agents/project-planner.md +3 -0
  35. package/.agent/agents/qa-automation-engineer.md +50 -43
  36. package/.agent/agents/resilience-reviewer.md +1 -0
  37. package/.agent/agents/schema-reviewer.md +1 -0
  38. package/.agent/agents/security-auditor.md +24 -24
  39. package/.agent/agents/seo-specialist.md +33 -23
  40. package/.agent/agents/sql-reviewer.md +5 -4
  41. package/.agent/agents/supervisor-agent.md +12 -2
  42. package/.agent/agents/swarm-worker-contracts.md +13 -13
  43. package/.agent/agents/swarm-worker-registry.md +51 -51
  44. package/.agent/agents/system-architect.md +1 -0
  45. package/.agent/agents/test-coverage-reviewer.md +25 -22
  46. package/.agent/agents/test-engineer.md +12 -11
  47. package/.agent/agents/throughput-optimizer.md +45 -40
  48. package/.agent/agents/type-safety-reviewer.md +5 -4
  49. package/.agent/agents/ui-ux-auditor.md +6 -4
  50. package/.agent/agents/ui-visual-auditor.md +3 -0
  51. package/.agent/agents/ux-reviewer.md +11 -6
  52. package/.agent/agents/visual-reviewer.md +11 -6
  53. package/.agent/agents/vitals-reviewer.md +5 -4
  54. package/.agent/history/memory/.memory.idx +1532 -1
  55. package/.agent/history/memory/MEMORY.md +102 -1
  56. package/.agent/mcp_config.json +1 -6
  57. package/.agent/routing_index.json +2033 -263
  58. package/.agent/rules/GEMINI.md +11 -9
  59. package/.agent/rules/GEMINI_PLANNER.md +19 -21
  60. package/.agent/scripts/_colors.js +52 -54
  61. package/.agent/scripts/_utils.js +52 -53
  62. package/.agent/scripts/auto_preview.js +39 -43
  63. package/.agent/scripts/bundle_analyzer.js +47 -60
  64. package/.agent/scripts/case_law_manager.js +200 -294
  65. package/.agent/scripts/checklist.js +73 -94
  66. package/.agent/scripts/cicd_validator.js +305 -0
  67. package/.agent/scripts/compile_router.py +4 -111
  68. package/.agent/scripts/context_broker.js +317 -412
  69. package/.agent/scripts/contract_engine.js +402 -0
  70. package/.agent/scripts/dependency_analyzer.js +112 -124
  71. package/.agent/scripts/graph_builder.js +75 -103
  72. package/.agent/scripts/graph_visualizer.js +10 -12
  73. package/.agent/scripts/graph_zoom.js +38 -55
  74. package/.agent/scripts/guardrail_engine.js +195 -145
  75. package/.agent/scripts/impact_classifier.js +55 -30
  76. package/.agent/scripts/inner_loop_validator.js +108 -159
  77. package/.agent/scripts/integrity_manifest.js +59 -67
  78. package/.agent/scripts/lint_runner.js +65 -75
  79. package/.agent/scripts/marathon_harness.js +131 -208
  80. package/.agent/scripts/migrate_skills_frontmatter.py +4 -63
  81. package/.agent/scripts/minify_context.js +29 -33
  82. package/.agent/scripts/minimal_change_engine.js +95 -87
  83. package/.agent/scripts/mutation_runner.js +46 -62
  84. package/.agent/scripts/pipeline_engine.js +320 -209
  85. package/.agent/scripts/prompt_compiler.js +118 -93
  86. package/.agent/scripts/schema_validator.js +73 -121
  87. package/.agent/scripts/security_scan.js +88 -117
  88. package/.agent/scripts/session_manager.js +52 -69
  89. package/.agent/scripts/signal_detector.js +24 -22
  90. package/.agent/scripts/skill_evolution.js +184 -245
  91. package/.agent/scripts/skill_integrator.js +35 -48
  92. package/.agent/scripts/socratic_gate_policy.js +15 -12
  93. package/.agent/scripts/strengthen_skills.js +29 -33
  94. package/.agent/scripts/swarm_dispatcher.js +120 -151
  95. package/.agent/scripts/test_runner.js +54 -56
  96. package/.agent/scripts/token_budget_broker.js +9 -7
  97. package/.agent/scripts/trace_engine.js +126 -0
  98. package/.agent/scripts/verify_all.js +76 -93
  99. package/.agent/scripts/visual_audit.js +16 -21
  100. package/.agent/skill_topic_map.json +22 -3
  101. package/.agent/skills/12-principles-of-animation/SKILL.md +7 -0
  102. package/.agent/skills/60fps-animation/SKILL.md +7 -0
  103. package/.agent/skills/accessible-animation/SKILL.md +5 -1
  104. package/.agent/skills/adapt/SKILL.md +7 -1
  105. package/.agent/skills/advanced-rag-pipelines/SKILL.md +1 -0
  106. package/.agent/skills/agent-organizer/SKILL.md +1 -0
  107. package/.agent/skills/agentic-patterns/SKILL.md +33 -25
  108. package/.agent/skills/agentic-workflows-2026/SKILL.md +6 -2
  109. package/.agent/skills/ai-app-hardening/SKILL.md +9 -8
  110. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +7 -6
  111. package/.agent/skills/animation-on-scroll/SKILL.md +24 -15
  112. package/.agent/skills/animation-systems/SKILL.md +11 -10
  113. package/.agent/skills/antfu-conventions/SKILL.md +7 -2
  114. package/.agent/skills/api-patterns/SKILL.md +14 -10
  115. package/.agent/skills/api-security-auditor/SKILL.md +15 -14
  116. package/.agent/skills/app-builder/SKILL.md +1 -0
  117. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +2 -2
  118. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
  119. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +12 -12
  120. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +3 -3
  121. package/.agent/skills/apple-design/SKILL.md +8 -7
  122. package/.agent/skills/architecture/SKILL.md +3 -2
  123. package/.agent/skills/audit-and-fix/SKILL.md +8 -5
  124. package/.agent/skills/authentication-best-practices/SKILL.md +9 -8
  125. package/.agent/skills/backend-security-expert/SKILL.md +1 -0
  126. package/.agent/skills/baseline-ui/SKILL.md +8 -7
  127. package/.agent/skills/bash-linux/SKILL.md +1 -0
  128. package/.agent/skills/behavioral-modes/SKILL.md +1 -0
  129. package/.agent/skills/better-colors/SKILL.md +11 -7
  130. package/.agent/skills/better-typography/SKILL.md +30 -16
  131. package/.agent/skills/better-ui/SKILL.md +17 -10
  132. package/.agent/skills/bolder/SKILL.md +6 -0
  133. package/.agent/skills/brainstorming/SKILL.md +6 -4
  134. package/.agent/skills/browser-native-ai/SKILL.md +5 -4
  135. package/.agent/skills/build-primitive/SKILL.md +5 -0
  136. package/.agent/skills/building-native-ui/SKILL.md +1 -0
  137. package/.agent/skills/cicd-pro/SKILL.md +2 -1
  138. package/.agent/skills/clarify/SKILL.md +19 -14
  139. package/.agent/skills/clean-code/SKILL.md +16 -15
  140. package/.agent/skills/cloud-architect/SKILL.md +1 -0
  141. package/.agent/skills/cobejs/SKILL.md +7 -9
  142. package/.agent/skills/code-review-checklist/SKILL.md +1 -0
  143. package/.agent/skills/codebase-design/SKILL.md +7 -2
  144. package/.agent/skills/colorize/SKILL.md +8 -3
  145. package/.agent/skills/compact-landing/SKILL.md +8 -3
  146. package/.agent/skills/company-logos/SKILL.md +6 -0
  147. package/.agent/skills/config-validator/SKILL.md +10 -9
  148. package/.agent/skills/containerization-pro/SKILL.md +6 -5
  149. package/.agent/skills/context-engineering-pro/SKILL.md +5 -4
  150. package/.agent/skills/create-design-md/SKILL.md +13 -5
  151. package/.agent/skills/critique/SKILL.md +10 -8
  152. package/.agent/skills/csharp-developer/SKILL.md +1 -0
  153. package/.agent/skills/data-validation-schemas/SKILL.md +28 -23
  154. package/.agent/skills/database-design/SKILL.md +2 -1
  155. package/.agent/skills/delight/SKILL.md +6 -0
  156. package/.agent/skills/deployment-procedures/SKILL.md +2 -1
  157. package/.agent/skills/design-lab/SKILL.md +5 -0
  158. package/.agent/skills/devops-engineer/SKILL.md +3 -2
  159. package/.agent/skills/devops-incident-responder/SKILL.md +2 -1
  160. package/.agent/skills/diagnosing-bugs/SKILL.md +12 -2
  161. package/.agent/skills/distill/SKILL.md +7 -2
  162. package/.agent/skills/documentation-templates/SKILL.md +3 -2
  163. package/.agent/skills/domain-modeling/SKILL.md +12 -4
  164. package/.agent/skills/duckdb-analytical-sql/SKILL.md +7 -3
  165. package/.agent/skills/edge-ai-mobile/SKILL.md +5 -1
  166. package/.agent/skills/edge-computing/SKILL.md +9 -8
  167. package/.agent/skills/emil-design-eng/SKILL.md +43 -27
  168. package/.agent/skills/error-resilience/SKILL.md +34 -16
  169. package/.agent/skills/expo-router-v4/SKILL.md +2 -1
  170. package/.agent/skills/extract-design-system/SKILL.md +12 -11
  171. package/.agent/skills/fabel-protocol/SKILL.md +24 -17
  172. package/.agent/skills/fixing-accessibility/SKILL.md +23 -16
  173. package/.agent/skills/fixing-metadata/SKILL.md +24 -13
  174. package/.agent/skills/fixing-motion-performance/SKILL.md +7 -5
  175. package/.agent/skills/framer-motion-expert/SKILL.md +29 -15
  176. package/.agent/skills/frontend-design/SKILL.md +21 -13
  177. package/.agent/skills/frontend-security-expert/SKILL.md +1 -0
  178. package/.agent/skills/game-design-expert/SKILL.md +1 -0
  179. package/.agent/skills/game-engineering-expert/SKILL.md +1 -0
  180. package/.agent/skills/generative-ui-expert/SKILL.md +3 -2
  181. package/.agent/skills/geo-fundamentals/SKILL.md +2 -1
  182. package/.agent/skills/git-pro/SKILL.md +10 -9
  183. package/.agent/skills/github-operations/SKILL.md +2 -1
  184. package/.agent/skills/gpt-taste/SKILL.md +7 -0
  185. package/.agent/skills/gsap-core/SKILL.md +26 -22
  186. package/.agent/skills/gsap-frameworks/SKILL.md +6 -5
  187. package/.agent/skills/gsap-performance/SKILL.md +4 -3
  188. package/.agent/skills/gsap-plugins/SKILL.md +34 -33
  189. package/.agent/skills/gsap-react/SKILL.md +9 -8
  190. package/.agent/skills/gsap-scrolltrigger/SKILL.md +34 -33
  191. package/.agent/skills/gsap-timeline/SKILL.md +18 -15
  192. package/.agent/skills/gsap-utils/SKILL.md +25 -24
  193. package/.agent/skills/harden/SKILL.md +9 -3
  194. package/.agent/skills/harness-protocol/SKILL.md +1 -0
  195. package/.agent/skills/i18n-localization/SKILL.md +10 -9
  196. package/.agent/skills/impeccable/SKILL.md +5 -0
  197. package/.agent/skills/improve-codebase-architecture/SKILL.md +10 -5
  198. package/.agent/skills/improve-ui/SKILL.md +12 -5
  199. package/.agent/skills/intelligent-routing/SKILL.md +7 -6
  200. package/.agent/skills/knowledge-graph/SKILL.md +1 -0
  201. package/.agent/skills/landing-page/SKILL.md +1 -0
  202. package/.agent/skills/lint-and-validate/SKILL.md +9 -4
  203. package/.agent/skills/llm-engineering/SKILL.md +55 -54
  204. package/.agent/skills/local-first/SKILL.md +20 -19
  205. package/.agent/skills/local-first-architecture/SKILL.md +6 -1
  206. package/.agent/skills/lottie-animation/SKILL.md +7 -3
  207. package/.agent/skills/marquee-loop/SKILL.md +1 -0
  208. package/.agent/skills/masked-reveal/SKILL.md +17 -4
  209. package/.agent/skills/mcp-builder/SKILL.md +13 -10
  210. package/.agent/skills/micro-interaction/SKILL.md +20 -5
  211. package/.agent/skills/mobile-design/SKILL.md +26 -15
  212. package/.agent/skills/monorepo-management/SKILL.md +3 -2
  213. package/.agent/skills/morphing-icons/SKILL.md +16 -6
  214. package/.agent/skills/motion-engineering/SKILL.md +19 -15
  215. package/.agent/skills/nextjs-react-expert/SKILL.md +26 -21
  216. package/.agent/skills/nodejs-best-practices/SKILL.md +89 -76
  217. package/.agent/skills/observability/SKILL.md +45 -44
  218. package/.agent/skills/opentelemetry-observability/SKILL.md +2 -1
  219. package/.agent/skills/page-transition-animation/SKILL.md +6 -3
  220. package/.agent/skills/parallel-agents/SKILL.md +7 -2
  221. package/.agent/skills/performance-profiling/SKILL.md +24 -13
  222. package/.agent/skills/plan-writing/SKILL.md +1 -0
  223. package/.agent/skills/platform-engineer/SKILL.md +3 -2
  224. package/.agent/skills/platform-engineering-opentofu/SKILL.md +1 -0
  225. package/.agent/skills/playwright-ai-e2e/SKILL.md +3 -2
  226. package/.agent/skills/playwright-best-practices/SKILL.md +29 -28
  227. package/.agent/skills/polish/SKILL.md +13 -12
  228. package/.agent/skills/powershell-windows/SKILL.md +1 -0
  229. package/.agent/skills/pricing-page/SKILL.md +8 -3
  230. package/.agent/skills/product-aware-heuristics/SKILL.md +122 -72
  231. package/.agent/skills/progressive-blur/SKILL.md +9 -4
  232. package/.agent/skills/project-idioms/SKILL.md +1 -0
  233. package/.agent/skills/property-based-testing/SKILL.md +10 -12
  234. package/.agent/skills/python-patterns/SKILL.md +1 -0
  235. package/.agent/skills/python-pro/SKILL.md +1 -0
  236. package/.agent/skills/quieter/SKILL.md +6 -0
  237. package/.agent/skills/react-doctor/SKILL.md +6 -0
  238. package/.agent/skills/react-specialist/SKILL.md +32 -28
  239. package/.agent/skills/readme-builder/SKILL.md +1 -0
  240. package/.agent/skills/realtime-patterns/SKILL.md +34 -33
  241. package/.agent/skills/red-team-tactics/SKILL.md +1 -0
  242. package/.agent/skills/redesign-skill/SKILL.md +6 -0
  243. package/.agent/skills/review-animations/SKILL.md +5 -2
  244. package/.agent/skills/review-animations/STANDARDS.md +37 -23
  245. package/.agent/skills/rust-pro/SKILL.md +1 -0
  246. package/.agent/skills/seo-fundamentals/SKILL.md +4 -3
  247. package/.agent/skills/server-management/SKILL.md +1 -0
  248. package/.agent/skills/shadcn-ui-expert/SKILL.md +28 -22
  249. package/.agent/skills/shape/SKILL.md +9 -2
  250. package/.agent/skills/skill-creator/SKILL.md +1 -0
  251. package/.agent/skills/soft-skill/SKILL.md +6 -0
  252. package/.agent/skills/sounds-on-the-web/SKILL.md +1 -0
  253. package/.agent/skills/sql-pro/SKILL.md +1 -0
  254. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +1 -0
  255. package/.agent/skills/svg-animation/SKILL.md +16 -7
  256. package/.agent/skills/swiftui-expert/SKILL.md +1 -0
  257. package/.agent/skills/swiss-design/SKILL.md +5 -0
  258. package/.agent/skills/system-design-pro/SKILL.md +1 -0
  259. package/.agent/skills/systematic-debugging/SKILL.md +1 -0
  260. package/.agent/skills/tailwind-patterns/SKILL.md +25 -11
  261. package/.agent/skills/taste-skill/SKILL.md +6 -0
  262. package/.agent/skills/tdd-workflow/SKILL.md +5 -0
  263. package/.agent/skills/test-result-analyzer/SKILL.md +1 -0
  264. package/.agent/skills/testing-patterns/SKILL.md +123 -115
  265. package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +5 -0
  266. package/.agent/skills/thinking-protocol/SKILL.md +3 -0
  267. package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +9 -8
  268. package/.agent/skills/transitions-dev/SKILL.md +19 -6
  269. package/.agent/skills/trend-researcher/SKILL.md +1 -0
  270. package/.agent/skills/typescript-advanced/SKILL.md +23 -18
  271. package/.agent/skills/typeset/SKILL.md +10 -1
  272. package/.agent/skills/ui-reasoning-engine/SKILL.md +67 -48
  273. package/.agent/skills/ui-skill-packs/SKILL.md +6 -1
  274. package/.agent/skills/ui-skills-root/SKILL.md +39 -38
  275. package/.agent/skills/ui-ux-pro-max/SKILL.md +34 -26
  276. package/.agent/skills/ui-ux-researcher/SKILL.md +1 -0
  277. package/.agent/skills/vector-search-pgvector/SKILL.md +3 -2
  278. package/.agent/skills/vue-expert/SKILL.md +22 -19
  279. package/.agent/skills/vulnerability-scanner/SKILL.md +22 -21
  280. package/.agent/skills/web-accessibility-auditor/SKILL.md +2 -1
  281. package/.agent/skills/web-design-guidelines/SKILL.md +16 -10
  282. package/.agent/skills/web-quality-audit/SKILL.md +5 -0
  283. package/.agent/skills/webapp-testing/SKILL.md +14 -13
  284. package/.agent/skills/webgpu-performance/SKILL.md +1 -0
  285. package/.agent/skills/whimsy-injector/SKILL.md +9 -5
  286. package/.agent/skills/workflow-optimizer/SKILL.md +1 -0
  287. package/.agent/skills/zero-trust-passkeys/SKILL.md +11 -6
  288. package/.agent/templates/DESIGN.md +119 -110
  289. package/.agent/templates/design-tokens.json +9 -6
  290. package/.agent/workflows/acf.md +1 -0
  291. package/.agent/workflows/api-tester.md +1 -0
  292. package/.agent/workflows/audit.md +1 -0
  293. package/.agent/workflows/brainstorm.md +1 -0
  294. package/.agent/workflows/changelog.md +1 -0
  295. package/.agent/workflows/contract.md +60 -0
  296. package/.agent/workflows/create.md +1 -0
  297. package/.agent/workflows/debug.md +1 -0
  298. package/.agent/workflows/deploy.md +1 -0
  299. package/.agent/workflows/enhance.md +1 -0
  300. package/.agent/workflows/fix-ci.md +89 -0
  301. package/.agent/workflows/fix.md +1 -0
  302. package/.agent/workflows/generate.md +1 -0
  303. package/.agent/workflows/marathon.md +1 -0
  304. package/.agent/workflows/migrate.md +1 -0
  305. package/.agent/workflows/minimal.md +9 -7
  306. package/.agent/workflows/orchestrate.md +1 -0
  307. package/.agent/workflows/performance-benchmarker.md +1 -0
  308. package/.agent/workflows/pipeline.md +26 -21
  309. package/.agent/workflows/plan.md +1 -0
  310. package/.agent/workflows/preview.md +1 -0
  311. package/.agent/workflows/refactor.md +3 -2
  312. package/.agent/workflows/review-ai.md +4 -3
  313. package/.agent/workflows/review.md +1 -0
  314. package/.agent/workflows/session.md +1 -0
  315. package/.agent/workflows/status.md +1 -0
  316. package/.agent/workflows/strengthen-skills.md +1 -0
  317. package/.agent/workflows/super-prompt.md +1 -0
  318. package/.agent/workflows/swarm.md +15 -3
  319. package/.agent/workflows/test.md +8 -7
  320. package/.agent/workflows/tribunal-backend.md +3 -2
  321. package/.agent/workflows/tribunal-cicd.md +104 -0
  322. package/.agent/workflows/tribunal-database.md +1 -0
  323. package/.agent/workflows/tribunal-frontend.md +8 -6
  324. package/.agent/workflows/tribunal-full.md +2 -1
  325. package/.agent/workflows/tribunal-mobile.md +6 -5
  326. package/.agent/workflows/tribunal-performance.md +1 -0
  327. package/.agent/workflows/tribunal-speed.md +1 -0
  328. package/.agent/workflows/tribunal-ui.md +29 -21
  329. package/.agent/workflows/ui-ux-pro-max.md +19 -15
  330. package/CONTRIBUTING.md +3 -3
  331. package/README.md +94 -44
  332. package/SECURITY.md +10 -10
  333. package/bin/mcp-server.js +385 -252
  334. package/bin/tribunal-kit.js +29 -30
  335. package/bin/wrapper.js +40 -46
  336. package/dist/cli.js +6 -0
  337. package/dist/commands/case.js +2 -0
  338. package/dist/commands/contract.js +440 -0
  339. package/dist/commands/status.js +6 -0
  340. package/dist/index.d.ts +8 -1
  341. package/package.json +13 -12
  342. package/scripts/benchmark.js +62 -86
  343. package/scripts/changelog.js +67 -73
  344. package/scripts/fix-vbc.js +13 -15
  345. package/scripts/fix-vbc.ps1 +2 -118
  346. package/scripts/stress_benchmark.js +358 -0
  347. package/scripts/sync-version.js +71 -41
  348. package/scripts/validate-payload.js +23 -30
  349. package/scripts/visual_audit.js +23 -13
@@ -37,23 +37,26 @@ flowchart TD
37
37
  ## 2. Option A + Option C Hybrid Architecture (v3.0.0 Standard)
38
38
 
39
39
  ### Subsystem A: 2-Tier Lazy Skill Routing Engine
40
- - **Lightweight Index (`skill_topic_map.json`):** 185 skills indexed across 9 domain routes and file extensions (~500 tokens).
40
+
41
+ - **Lightweight Index (`skill_topic_map.json`):** 183 skills indexed across 9 domain routes and file extensions (~500 tokens).
41
42
  - **Startup Overhead:** ~2,500 – 3,500 startup tokens vs 85,000 tokens previously (95% token reduction).
42
- - **Zero Exclusions:** All 185 skills remain indexed on disk; target skills are fetched dynamically on-demand via `view_file`.
43
+ - **Zero Exclusions:** All 183 skills remain indexed on disk; target skills are fetched dynamically on-demand via `view_file`.
43
44
 
44
45
  ### Subsystem C: Stage-Partitioned Tribunal Pipeline
45
- - **51 Specialist Agents** (21 Parallel Reviewers + 30 Domain Specialists).
46
- - **3 Execution Waves:** Replaces monolithic fan-out with 3 partitioned passes (21 reviewers total):
46
+
47
+ - **52 Specialist Agents** (28 Parallel Reviewers + 24 Domain Specialists).
48
+ - **3 Execution Waves:** Replaces monolithic fan-out with 3 partitioned passes (28 reviewers total):
47
49
  - **Wave 1 (Core Integrity):** `precedence-reviewer`, `logic-reviewer`, `schema-reviewer`, `resilience-reviewer`
48
- - **Wave 2 (Security & Types):** `security-auditor`, `dependency-reviewer`, `type-safety-reviewer`, `complexity-reviewer`, `sql-reviewer`
50
+ - **Wave 2 (Security & Types):** `security-auditor`, `dependency-reviewer`, `type-safety-reviewer`, `complexity-reviewer`, `sql-reviewer`, `pipeline-reviewer`
49
51
  - **Wave 3 (Domain & Performance):** `frontend-reviewer`, `performance-reviewer`, `mobile-reviewer`, `ai-code-reviewer`, `test-coverage-reviewer`, `accessibility-reviewer`, `ui-ux-auditor`, `review-animations`, `vitals-reviewer`, `db-latency-auditor`, `throughput-optimizer`
50
- - **Attention Preservation:** Reviewers execute in scoped 4-8 reviewer evaluation pairs, eliminating hallucination risks and attention dilution.
52
+ - **Attention Preservation:** Reviewers execute in scoped evaluation pairs of 4 to 8 specialists, eliminating hallucination risks and attention dilution.
51
53
 
52
54
  ---
53
55
 
54
56
  ## 3. Skill-Script Binding Standard
55
57
 
56
58
  Every skill in `.agent/skills/` conforms to the Option A+C Hybrid v3.0.0 frontmatter standard:
59
+
57
60
  - `version`: `3.0.0`
58
61
  - `script`: Primary executable script path in `.agent/scripts/`
59
62
  - `scripts-binding`: Array of executable CLI tools (`security_scan.js`, `test_runner.js`, `schema_validator.js`, etc.)
@@ -18,6 +18,7 @@ skills:
18
18
  ## Mandatory Pre-Flight Context Inspection
19
19
 
20
20
  Before auditing accessibility, you MUST inspect:
21
+
21
22
  1. Target size bounds → Verify touch targets on mobile/touch interfaces meet 44x44px minimum (WCAG 2.2 SC 2.5.8)
22
23
  2. Interactive element markup → Check for native `<button>` and `<a>` elements instead of unsemantic `<div onClick>`
23
24
  3. Form input & Icon-only buttons → Verify `<label htmlFor="...">` bindings and `aria-label` declarations
@@ -27,39 +28,44 @@ Before auditing accessibility, you MUST inspect:
27
28
  ## What This Reviewer Catches
28
29
 
29
30
  ### 1. Target Size (Minimum) (WCAG 2.2 SC 2.5.8 - Level AA)
30
- * **Criterion:** All interactive targets (buttons, links, form fields, checkboxes) must be at least **24x24 CSS pixels** in size.
31
- * **Coarse Pointers (Touch):** If the UI is used on touch devices (pointer: coarse), targets must meet a minimum size of **44x44px** (Apple HIG) or **48x48dp** (Material Design).
32
- * **Exception:** Inline text links (e.g., links in paragraphs) are exempt, but must have sufficient visual distinction (e.g., underline).
33
- * **Spacing Buffer:** Targets smaller than 24x24px must have surrounding spacing buffer so that a 24px diameter circle centered on the target does not intersect another target.
31
+
32
+ - **Criterion:** All interactive targets (buttons, links, form fields, checkboxes) must be at least **24x24 CSS pixels** in size.
33
+ - **Coarse Pointers (Touch):** If the UI is used on touch devices (pointer: coarse), targets must meet a minimum size of **44x44px** (Apple HIG) or **48x48dp** (Material Design).
34
+ - **Exception:** Inline text links (e.g., links in paragraphs) are exempt, but must have sufficient visual distinction (e.g., underline).
35
+ - **Spacing Buffer:** Targets smaller than 24x24px must have surrounding spacing buffer so that a 24px diameter circle centered on the target does not intersect another target.
34
36
 
35
37
  ### 2. APCA Contrast Guidelines (WCAG 3.0 APCA Base)
36
- * **Lightness Contrast (Lc):** Ensure readability using the APCA scale instead of flat 4.5:1 ratios:
37
- * **Body text (small size):** Must achieve Lc > 75.
38
- * **Large display headings (large size):** Must achieve Lc > 60.
39
- * **Interactive indicators & borders:** Must achieve Lc > 45.
38
+
39
+ - **Lightness Contrast (Lc):** Ensure readability using the APCA scale instead of flat 4.5:1 ratios:
40
+ - **Body text (small size):** Must achieve Lc > 75.
41
+ - **Large display headings (large size):** Must achieve Lc > 60.
42
+ - **Interactive indicators & borders:** Must achieve Lc > 45.
40
43
 
41
44
  ### 3. Keyboard Navigation & Focus Visibility
42
- * **Focus Ring (WCAG 2.4.13 - Level AA):** Visible focus rings must achieve 3:1 contrast and cannot be hidden (`outline: none` is forbidden).
43
- * **Focus Trap (WCAG 2.1.2):** All overlay modals, slide-out panels, and drawers must trap focus internally and return it to the trigger element on close.
44
- * **Semantic Tab Order:** Tab navigation must match the visual layout reading flow.
45
+
46
+ - **Focus Ring (WCAG 2.4.13 - Level AA):** Visible focus rings must achieve 3:1 contrast and cannot be hidden (`outline: none` is forbidden).
47
+ - **Focus Trap (WCAG 2.1.2):** All overlay modals, slide-out panels, and drawers must trap focus internally and return it to the trigger element on close.
48
+ - **Semantic Tab Order:** Tab navigation must match the visual layout reading flow.
45
49
 
46
50
  ### 4. Semantic Markup & ARIA Semantics (WCAG 4.1.2)
47
- * **Interactive Tags:** Clickable elements must use native `<button>` or `<a>` tags. Avoid `<div onClick>`.
48
- * **Label Association (WCAG 1.3.1):** All input elements must be linked to a `<label htmlFor="...">`. Placeholders are not labels.
49
- * **Accessible Name:** Icon-only buttons must declare an `aria-label` or `aria-labelledby` property.
51
+
52
+ - **Interactive Tags:** Clickable elements must use native `<button>` or `<a>` tags. Avoid `<div onClick>`.
53
+ - **Label Association (WCAG 1.3.1):** All input elements must be linked to a `<label htmlFor="...">`. Placeholders are not labels.
54
+ - **Accessible Name:** Icon-only buttons must declare an `aria-label` or `aria-labelledby` property.
50
55
 
51
56
  ---
52
57
 
53
58
  ## Code Comparison Examples
54
59
 
55
60
  ### Target Size (Minimum) Violation
61
+
56
62
  ```tsx
57
63
  // ❌ REJECTED: Small 14x14px click area, no padding buffer. Fails WCAG 2.5.8.
58
64
  <button onClick={onClose} className="w-3.5 h-3.5 bg-red-500 rounded-full" />
59
65
 
60
66
  // ✅ APPROVED: Visual area remains small (w-3.5 h-3.5), but absolute touch target is expanded to 44x44px
61
- <button
62
- onClick={onClose}
67
+ <button
68
+ onClick={onClose}
63
69
  aria-label="Close alert"
64
70
  className="relative p-3 hover:bg-[var(--bg-surface-raised)] rounded-full transition-all"
65
71
  >
@@ -68,6 +74,7 @@ Before auditing accessibility, you MUST inspect:
68
74
  ```
69
75
 
70
76
  ### Contrast Violation
77
+
71
78
  ```tsx
72
79
  // ❌ REJECTED: Gray text on white background yields contrast ratio of 2.2:1 (Lc <40).
73
80
  <p className="text-gray-300 bg-white text-xs">Secondary description</p>
@@ -21,6 +21,7 @@ Every piece of code that calls an LLM API must be verified against the actual pr
21
21
  ## Mandatory Pre-Flight Context Inspection
22
22
 
23
23
  Before auditing LLM integration code, you MUST inspect:
24
+
24
25
  1. `package.json` / `requirements.txt` → Check LLM SDK versions (`openai`, `@anthropic-ai/sdk`, `@google/genai`, `ai` Vercel AI SDK)
25
26
  2. Environment configs → Confirm model name strings are parameterized (`process.env.MODEL_NAME`) rather than hardcoded strings
26
27
  3. Prompt templates → Audit user input sanitization delimiters (`<user_input>`) and prompt injection boundaries
@@ -48,21 +49,21 @@ Flag any model name that cannot be verified in the provider's current model docu
48
49
  ```typescript
49
50
  // ❌ HALLUCINATED: Parameters that don't exist in OpenAI SDK
50
51
  const response = await openai.chat.completions.create({
51
- model: "gpt-4o",
52
+ model: 'gpt-4o',
52
53
  messages,
53
54
  max_length: 1000, // Hallucinated — use max_tokens
54
- format: "json", // Hallucinated — use response_format: { type: 'json_object' }
55
+ format: 'json', // Hallucinated — use response_format: { type: 'json_object' }
55
56
  memory: true, // Doesn't exist
56
- plugins: ["web-search"], // Doesn't exist in API
57
- instructions: "Be helpful", // Hallucinated — belongs in system message
57
+ plugins: ['web-search'], // Doesn't exist in API
58
+ instructions: 'Be helpful', // Hallucinated — belongs in system message
58
59
  });
59
60
 
60
61
  // ✅ REAL OpenAI API parameters
61
62
  const response = await openai.chat.completions.create({
62
- model: "gpt-4o",
63
+ model: 'gpt-4o',
63
64
  messages,
64
65
  max_tokens: 1000,
65
- response_format: { type: "json_object" },
66
+ response_format: { type: 'json_object' },
66
67
  temperature: 0.7,
67
68
  stream: false,
68
69
  });
@@ -71,17 +72,17 @@ const response = await openai.chat.completions.create({
71
72
  ```typescript
72
73
  // ❌ HALLUCINATED: Anthropic SDK parameters
73
74
  const message = await anthropic.messages.create({
74
- model: "claude-3-5-sonnet-20241022",
75
+ model: 'claude-3-5-sonnet-20241022',
75
76
  messages,
76
77
  max_response: 1024, // Hallucinated — use max_tokens
77
- system_prompt: "...", // Hallucinated — 'system' is a top-level param
78
+ system_prompt: '...', // Hallucinated — 'system' is a top-level param
78
79
  });
79
80
 
80
81
  // ✅ REAL Anthropic API
81
82
  const message = await anthropic.messages.create({
82
- model: "claude-3-5-sonnet-20241022",
83
+ model: 'claude-3-5-sonnet-20241022',
83
84
  max_tokens: 1024,
84
- system: "You are a helpful assistant.",
85
+ system: 'You are a helpful assistant.',
85
86
  messages,
86
87
  });
87
88
  ```
@@ -97,13 +98,16 @@ const systemPrompt = `You are a helpful assistant. Context: ${userInput}`;
97
98
 
98
99
  // ❌ CRITICAL: User content in system role message
99
100
  const messages = [
100
- { role: "system", content: userQuery }, // User can override system behavior
101
+ { role: 'system', content: userQuery }, // User can override system behavior
101
102
  ];
102
103
 
103
104
  // ✅ SAFE: Strict role separation
104
105
  const messages = [
105
- { role: "system", content: "You are a helpful assistant. Only answer questions about our product." },
106
- { role: "user", content: userQuery }, // User input isolated to user role
106
+ {
107
+ role: 'system',
108
+ content: 'You are a helpful assistant. Only answer questions about our product.',
109
+ },
110
+ { role: 'user', content: userQuery }, // User input isolated to user role
107
111
  ];
108
112
 
109
113
  // ✅ SAFE: XML delimiting when injection context unavoidable
@@ -155,14 +159,14 @@ try {
155
159
  const allUsers = await prisma.user.findMany(); // 50,000 users
156
160
  const response = await openai.chat.completions.create({
157
161
  messages: [
158
- { role: "user", content: `Users: ${JSON.stringify(allUsers)}\n${userQuery}` },
162
+ { role: 'user', content: `Users: ${JSON.stringify(allUsers)}\n${userQuery}` },
159
163
  // This could be 200,000 tokens per request!
160
164
  ],
161
165
  });
162
166
 
163
167
  // ❌ COST EXPLOSION: No max_tokens limit on user-facing endpoint
164
168
  const response = await anthropic.messages.create({
165
- model: "claude-3-5-sonnet-20241022",
169
+ model: 'claude-3-5-sonnet-20241022',
166
170
  // Missing max_tokens — model can run indefinitely
167
171
  messages,
168
172
  });
@@ -170,11 +174,11 @@ const response = await anthropic.messages.create({
170
174
  // ✅ APPROVED: Token budgeting + RAG for large datasets
171
175
  const relevantChunks = await vectorStore.similaritySearch(userQuery, 5); // Retrieve top 5
172
176
  const response = await openai.chat.completions.create({
173
- model: "gpt-4o-mini", // Cost-efficient model for routing
177
+ model: 'gpt-4o-mini', // Cost-efficient model for routing
174
178
  max_tokens: 500, // Hard cap prevents runaway responses
175
179
  messages: [
176
- { role: "system", content: `Context:\n${relevantChunks.map((c) => c.content).join("\n")}` },
177
- { role: "user", content: userQuery },
180
+ { role: 'system', content: `Context:\n${relevantChunks.map(c => c.content).join('\n')}` },
181
+ { role: 'user', content: userQuery },
178
182
  ],
179
183
  });
180
184
  ```
@@ -186,12 +190,12 @@ const response = await openai.chat.completions.create({
186
190
  ```typescript
187
191
  // ❌ REJECTED: Conversation history appended unbounded — will eventually overflow
188
192
  const messages = conversationHistory; // Can grow to 100k+ tokens
189
- messages.push({ role: "user", content: newMessage });
193
+ messages.push({ role: 'user', content: newMessage });
190
194
  const response = await client.chat(messages);
191
195
 
192
196
  // ✅ APPROVED: Sliding window with token counting
193
- import { encoding_for_model } from "tiktoken";
194
- const enc = encoding_for_model("gpt-4o");
197
+ import { encoding_for_model } from 'tiktoken';
198
+ const enc = encoding_for_model('gpt-4o');
195
199
 
196
200
  function trimToTokenLimit(messages: Message[], limit: number = 100_000): Message[] {
197
201
  let totalTokens = 0;
@@ -17,6 +17,7 @@ You enforce originality and build quality. You systematically block generic AI a
17
17
  ## Mandatory Pre-Flight Context Inspection
18
18
 
19
19
  Before auditing UI aesthetics, you MUST inspect:
20
+
20
21
  1. `index.css` / CSS variables / Tailwind config → Check color palette definitions (verify non-purple primary colors and custom design tokens)
21
22
  2. UI component library configs (`components.json`, `theme/`) → Verify customized radius, typography, and shadow tokens
22
23
  3. Visual layout files → Check for asymmetrical column balance vs generic repetitive cards
@@ -26,21 +27,24 @@ Before auditing UI aesthetics, you MUST inspect:
26
27
  ## What This Reviewer Catches
27
28
 
28
29
  ### ❌ REJECTED Criteria (Blocking)
29
- * **The Purple Primary Cliché:** Using purple/violet (`#7C3AED`, `#8B5CF6`, `oklch(... 280 ... / 290Hue)`) as the primary brand/interaction color.
30
- * **Mesh Gradient Cliché:** Using radial mesh gradients with multiple high-saturation blur stops as hero backgrounds.
31
- * **Bento Grid Overuse:** Structuring an entire page layout as a grid of identical rounded cards without visual break or tension.
32
- * **Glassmorphism Overuse:** Applying backdrop-blur panels and translucent layers for primary containers instead of clean solid surfaces.
33
- * **Card-inside-Card Overlap:** Embedding cards within cards without distinct backgrounds or border elevations, resulting in muddy visual hierarchy.
30
+
31
+ - **The Purple Primary Cliché:** Using purple/violet (`#7C3AED`, `#8B5CF6`, `oklch(... 280 ... / 290Hue)`) as the primary brand/interaction color.
32
+ - **Mesh Gradient Cliché:** Using radial mesh gradients with multiple high-saturation blur stops as hero backgrounds.
33
+ - **Bento Grid Overuse:** Structuring an entire page layout as a grid of identical rounded cards without visual break or tension.
34
+ - **Glassmorphism Overuse:** Applying backdrop-blur panels and translucent layers for primary containers instead of clean solid surfaces.
35
+ - **Card-inside-Card Overlap:** Embedding cards within cards without distinct backgrounds or border elevations, resulting in muddy visual hierarchy.
34
36
 
35
37
  ### ⚠️ WARNING Criteria (Non-blocking)
36
- * *Default Library Styles:* Using default, uncustomized colors/radii from tailwind or shadcn/ui.
37
- * *Centered Hero:* Uninspired "centered title + centered paragraph + centered CTA button" layouts.
38
+
39
+ - _Default Library Styles:_ Using default, uncustomized colors/radii from tailwind or shadcn/ui.
40
+ - _Centered Hero:_ Uninspired "centered title + centered paragraph + centered CTA button" layouts.
38
41
 
39
42
  ---
40
43
 
41
44
  ## Code Comparison Examples
42
45
 
43
46
  ### Purple Gradient vs. Sophisticated Tinted Depth
47
+
44
48
  ```css
45
49
  /* ❌ REJECTED: Overused purple gradient background */
46
50
  .card-ai {
@@ -56,6 +60,7 @@ Before auditing UI aesthetics, you MUST inspect:
56
60
  ```
57
61
 
58
62
  ### Bento Overuse vs. Asymmetrical Grid Balance
63
+
59
64
  ```tsx
60
65
  // ❌ REJECTED: Repetitive, identical rounded bento boxes for layout
61
66
  <div className="grid grid-cols-3 gap-4">
@@ -21,6 +21,7 @@ You are the master designer of APIs. You do not merely write controllers; you de
21
21
  ## Mandatory Pre-Flight Context Inspection
22
22
 
23
23
  Before designing API contracts, you MUST inspect:
24
+
24
25
  1. `openapi.json` / `routes/` / `api/` → Review existing API endpoints, path versioning standards (`/v1/`), and route naming conventions
25
26
  2. `package.json` → Check web framework (Hono, Express, Fastify, Next.js Route Handlers) and schema validation engine (Zod, Pydantic)
26
27
  3. Client consumption contracts → Confirm response envelope formats (`data`, `meta`, `error`) across active frontend components
@@ -22,6 +22,7 @@ last-updated: 2026-07-29
22
22
  ## Mandatory Pre-Flight Context Inspection
23
23
 
24
24
  Before generating API routes, server actions, or middleware, you MUST inspect:
25
+
25
26
  1. `package.json` → Check Node.js framework (Express, Fastify, Hono, Next.js Server Actions), validation library (Zod, Valibot), and ORM (Prisma v6, Drizzle, Kysely)
26
27
  2. `env.mjs` / `.env.example` → Verify required environment variable schemas and secret keys
27
28
  3. Auth configuration (`lib/auth.ts`, `middleware.ts`) → Inspect active session management, JWT algorithms, and RBAC roles
@@ -48,16 +49,16 @@ Every route handler starts with schema validation. Never trust incoming data.
48
49
 
49
50
  ```typescript
50
51
  // ✅ APPROVED: Zod validates at the boundary before any business logic
51
- import { z } from "zod";
52
+ import { z } from 'zod';
52
53
 
53
54
  const CreateUserSchema = z.object({
54
55
  email: z.string().email(),
55
56
  name: z.string().min(2).max(100),
56
- role: z.enum(["user", "admin"]).default("user"),
57
+ role: z.enum(['user', 'admin']).default('user'),
57
58
  });
58
59
 
59
60
  // Hono route with validation
60
- app.post("/users", async (c) => {
61
+ app.post('/users', async c => {
61
62
  const raw = await c.req.json();
62
63
  const result = CreateUserSchema.safeParse(raw);
63
64
 
@@ -88,11 +89,11 @@ async function updateProfile(req: Request) {
88
89
  async function updateProfile(req: Request) {
89
90
  // 1. Authentication — verify identity
90
91
  const session = await auth.verifySession(req);
91
- if (!session) return Response.json({ error: "Unauthorized" }, { status: 401 });
92
+ if (!session) return Response.json({ error: 'Unauthorized' }, { status: 401 });
92
93
 
93
94
  // 2. Authorization — verify permission
94
- if (session.userId !== req.params.id && session.role !== "admin") {
95
- return Response.json({ error: "Forbidden" }, { status: 403 });
95
+ if (session.userId !== req.params.id && session.role !== 'admin') {
96
+ return Response.json({ error: 'Forbidden' }, { status: 403 });
96
97
  }
97
98
 
98
99
  // 3. Input validation
@@ -111,29 +112,29 @@ async function updateProfile(req: Request) {
111
112
 
112
113
  ```typescript
113
114
  // ❌ BAD: Leaks internal details, no type contract
114
- app.get("/users/:id", async (req, res) => {
115
+ app.get('/users/:id', async (req, res) => {
115
116
  const user = await db.query(`SELECT * FROM users WHERE id = ${req.params.id}`);
116
117
  res.json(user.rows[0]); // Could throw and send HTML error page with stack trace
117
118
  });
118
119
 
119
120
  // ✅ APPROVED: Typed error response, no information leak
120
- app.get("/users/:id", async (req, res) => {
121
+ app.get('/users/:id', async (req, res) => {
121
122
  try {
122
123
  const id = IdSchema.parse(req.params.id);
123
124
  const user = await db.users.findUnique({ where: { id } });
124
125
 
125
126
  if (!user) {
126
- return res.status(404).json({ error: "User not found", code: "NOT_FOUND" });
127
+ return res.status(404).json({ error: 'User not found', code: 'NOT_FOUND' });
127
128
  }
128
129
 
129
130
  return res.json(user);
130
131
  } catch (error) {
131
132
  if (error instanceof z.ZodError) {
132
- return res.status(400).json({ error: "Invalid ID format", code: "VALIDATION_ERROR" });
133
+ return res.status(400).json({ error: 'Invalid ID format', code: 'VALIDATION_ERROR' });
133
134
  }
134
135
  // Log internally, never expose internal details
135
- logger.error({ error, userId: req.params.id }, "Failed to fetch user");
136
- return res.status(500).json({ error: "Internal server error", code: "INTERNAL_ERROR" });
136
+ logger.error({ error, userId: req.params.id }, 'Failed to fetch user');
137
+ return res.status(500).json({ error: 'Internal server error', code: 'INTERNAL_ERROR' });
137
138
  }
138
139
  });
139
140
  ```
@@ -176,7 +177,7 @@ return res.json({
176
177
  const user = await db.query(`SELECT * FROM users WHERE email = '${email}'`);
177
178
 
178
179
  // ❌ Hardcoded secret
179
- const JWT_SECRET = "mysecretkey123";
180
+ const JWT_SECRET = 'mysecretkey123';
180
181
 
181
182
  // ❌ Algorithm bypass-risk
182
183
  jwt.verify(token, secret); // Missing: { algorithms: ['HS256'] }
@@ -187,17 +188,17 @@ await db.users.update({ where: { id }, data: req.body }); // User could set role
187
188
 
188
189
  ```typescript
189
190
  // ✅ Parameterized query
190
- const user = await db.execute("SELECT * FROM users WHERE email = $1", [email]);
191
+ const user = await db.execute('SELECT * FROM users WHERE email = $1', [email]);
191
192
 
192
193
  // ✅ Environment variable
193
194
  const JWT_SECRET =
194
195
  process.env.JWT_SECRET ??
195
196
  (() => {
196
- throw new Error("JWT_SECRET not set");
197
+ throw new Error('JWT_SECRET not set');
197
198
  })();
198
199
 
199
200
  // ✅ Algorithm enforced
200
- jwt.verify(token, secret, { algorithms: ["HS256"] });
201
+ jwt.verify(token, secret, { algorithms: ['HS256'] });
201
202
 
202
203
  // ✅ Explicit field allowlist
203
204
  const { name, bio } = UpdateProfileSchema.parse(req.body); // Only allowed fields
@@ -209,21 +210,21 @@ await db.users.update({ where: { id }, data: { name, bio } });
209
210
  ## 7. Rate Limiting — Required on All Public Endpoints
210
211
 
211
212
  ```typescript
212
- import { Ratelimit } from "@upstash/ratelimit";
213
- import { Redis } from "@upstash/redis";
213
+ import { Ratelimit } from '@upstash/ratelimit';
214
+ import { Redis } from '@upstash/redis';
214
215
 
215
216
  const ratelimit = new Ratelimit({
216
217
  redis: Redis.fromEnv(),
217
- limiter: Ratelimit.slidingWindow(10, "10 s"), // 10 requests per 10 seconds
218
+ limiter: Ratelimit.slidingWindow(10, '10 s'), // 10 requests per 10 seconds
218
219
  });
219
220
 
220
221
  // Apply to every public auth endpoint at minimum
221
- app.post("/auth/login", async (c) => {
222
- const identifier = c.req.header("CF-Connecting-IP") ?? "anonymous";
222
+ app.post('/auth/login', async c => {
223
+ const identifier = c.req.header('CF-Connecting-IP') ?? 'anonymous';
223
224
  const { success, remaining } = await ratelimit.limit(identifier);
224
225
 
225
226
  if (!success) {
226
- return c.json({ error: "Too many requests" }, 429);
227
+ return c.json({ error: 'Too many requests' }, 429);
227
228
  }
228
229
 
229
230
  // ... rest of login logic
@@ -17,6 +17,7 @@ last-updated: 2026-07-29
17
17
  ## Mandatory Pre-Flight Context Inspection
18
18
 
19
19
  Before generating IaC, Dockerfiles, or CI/CD pipelines, you MUST inspect:
20
+
20
21
  1. `Dockerfile` / `.dockerignore` / `.github/workflows/` / `terraform/` → Inspect existing infra declarations
21
22
  2. `package.json` / `requirements.txt` / `Cargo.toml` → Determine runtime language, version, and build steps
22
23
  3. Secrets & AWS IAM configuration → Verify OIDC auth setup for GitHub Actions and S3 state backend configuration
@@ -17,6 +17,7 @@ last-updated: 2026-07-29
17
17
  ## Mandatory Pre-Flight Context Inspection
18
18
 
19
19
  Before auditing legacy codebases, you MUST inspect:
20
+
20
21
  1. `package.json` / `requirements.txt` → Read project dependencies, deprecated library usages, and version ages
21
22
  2. Entry point files (`server.ts`, `index.js`, `app/`) → Locate active listeners, API routers, and scheduled jobs
22
23
  3. Test suite directory (`tests/`, `__tests__/`, `spec/`) → Check baseline test coverage before recommending refactors
@@ -21,6 +21,7 @@ You have one job: enforce the **Dependency Ladder** and prevent over-engineering
21
21
  ## Mandatory Pre-Flight Context Inspection
22
22
 
23
23
  Before auditing complexity, you MUST inspect:
24
+
24
25
  1. `package.json` / `requirements.txt` → Verify existing dependencies before permitting new package imports
25
26
  2. Project directory structure → Check if similar utility functions or abstractions already exist in the codebase
26
27
  3. Native platform features → Determine if browser/Node/Python native standard library APIs can solve the task without extra code
@@ -44,13 +45,13 @@ Before code is accepted, you must verify that the implementation sits at the low
44
45
 
45
46
  ## Section 1: Common Over-Engineering Patterns to Reject
46
47
 
47
- | Anti-Pattern | Why It's Rejected | Real Alternative (Lower Rung) |
48
- | :--- | :--- | :--- |
49
- | Importing `lodash` or similar utility library | Standard library handles most collections/strings | Use native `Array.prototype` methods or modern JS features |
50
- | Custom React/Vue slider/carousel component | Heavy, complex, prone to accessibility bugs | Native CSS Scroll Snap or standard platform elements |
51
- | Hand-rolling custom cryptographic / hashing utils | Prone to security vulnerabilities and bugs | Use standard Node.js `crypto` or Web Crypto API |
52
- | Elaborate helper/wrapper layers for simple APIs | Wastes context, adds cognitive overhead | Direct API consumption (Keep It Simple) |
53
- | Adding new NPM packages for simple tasks | Bloats bundle, introduces supply-chain risk | Write a simple pure function locally |
48
+ | Anti-Pattern | Why It's Rejected | Real Alternative (Lower Rung) |
49
+ | :------------------------------------------------ | :------------------------------------------------ | :--------------------------------------------------------- |
50
+ | Importing `lodash` or similar utility library | Standard library handles most collections/strings | Use native `Array.prototype` methods or modern JS features |
51
+ | Custom React/Vue slider/carousel component | Heavy, complex, prone to accessibility bugs | Native CSS Scroll Snap or standard platform elements |
52
+ | Hand-rolling custom cryptographic / hashing utils | Prone to security vulnerabilities and bugs | Use standard Node.js `crypto` or Web Crypto API |
53
+ | Elaborate helper/wrapper layers for simple APIs | Wastes context, adds cognitive overhead | Direct API consumption (Keep It Simple) |
54
+ | Adding new NPM packages for simple tasks | Bloats bundle, introduces supply-chain risk | Write a simple pure function locally |
54
55
 
55
56
  ---
56
57
 
@@ -59,9 +60,11 @@ Before code is accepted, you must verify that the implementation sits at the low
59
60
  Your review should output one of two verdicts:
60
61
 
61
62
  ### 1. `✅ APPROVED`
63
+
62
64
  The code is simple, uses native platform capabilities, does not introduce unnecessary dependencies, and follows the Dependency Ladder.
63
65
 
64
66
  ### 2. `❌ REJECTED`
67
+
65
68
  The code is over-engineered, introduces a redundant dependency, or implements custom logic where a standard library/platform API exists. Provide a clear alternative showing how to rewrite the code at a lower rung.
66
69
 
67
70
  ---
@@ -19,6 +19,7 @@ last-updated: 2026-07-29
19
19
  ## Mandatory Pre-Flight Context Inspection
20
20
 
21
21
  Before generating schemas, migrations, or database queries, you MUST inspect:
22
+
22
23
  1. `schema.prisma` / `drizzle.schema.ts` / `migrations/` → Read existing database models and active migration history
23
24
  2. `package.json` / `requirements.txt` → Check ORM version (Prisma v6 vs v5, Drizzle, SQLAlchemy) and database engine (PostgreSQL, SQLite, MySQL)
24
25
  3. Foreign key constraints & Indexes → Check existing composite indices and foreign key constraints to prevent duplicate or missing index definitions
@@ -146,7 +147,7 @@ const user = await prisma.user.create({ data: userData });
146
147
  const account = await prisma.account.create({ data: { userId: user.id } });
147
148
 
148
149
  // ✅ ATOMIC: Both succeed or both rollback
149
- const result = await prisma.$transaction(async (tx) => {
150
+ const result = await prisma.$transaction(async tx => {
150
151
  const user = await tx.user.create({ data: userData });
151
152
  const account = await tx.account.create({ data: { userId: user.id } });
152
153
  return { user, account };
@@ -167,7 +168,7 @@ const users = await prisma.user.findMany({
167
168
  include: {
168
169
  posts: {
169
170
  where: { published: true },
170
- orderBy: { createdAt: "desc" },
171
+ orderBy: { createdAt: 'desc' },
171
172
  take: 5,
172
173
  },
173
174
  },
@@ -21,6 +21,7 @@ You audit **database layer files only** — `.sql`, `schema.prisma`, and source
21
21
  ## Mandatory Pre-Flight Context Inspection
22
22
 
23
23
  Before auditing database latency, you MUST inspect:
24
+
24
25
  1. `schema.prisma` / `drizzle.schema.ts` → Read existing model indexes, foreign key declarations, and connection pool string settings
25
26
  2. `package.json` → Check ORM driver type (pg, postgres-js, sqlite3, @libsql/client) and pool configuration settings
26
27
  3. Direct DB call loops → Scan for `.findMany()`, `select()`, or `.query()` executed inside loops or resolvers
@@ -70,7 +71,10 @@ for (const user of users) {
70
71
  }
71
72
 
72
73
  // ✅ APPROVED: Drizzle with join
73
- const result = await db.select().from(usersTable).leftJoin(ordersTable, eq(usersTable.id, ordersTable.userId));
74
+ const result = await db
75
+ .select()
76
+ .from(usersTable)
77
+ .leftJoin(ordersTable, eq(usersTable.id, ordersTable.userId));
74
78
  ```
75
79
 
76
80
  ---
@@ -177,7 +181,7 @@ if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
177
181
 
178
182
  ```typescript
179
183
  // ❌ OVER-SCOPED TRANSACTION: Lock held during external API call
180
- await prisma.$transaction(async (tx) => {
184
+ await prisma.$transaction(async tx => {
181
185
  const order = await tx.order.create({ data: orderData });
182
186
  const payment = await stripe.charges.create({ amount: order.total }); // 2-5 sec external call!
183
187
  await tx.order.update({ where: { id: order.id }, data: { paymentId: payment.id } });
@@ -16,6 +16,7 @@ last-updated: 2026-07-29
16
16
  ## Mandatory Pre-Flight Context Inspection
17
17
 
18
18
  Before beginning a debugging session, you MUST inspect:
19
+
19
20
  1. Exact error logs / stack trace output → Read full un-truncated error traceback and exception frames
20
21
  2. Git status / recent commits (`git log -n 5`) → Identify recent changes, file edits, or dependency updates
21
22
  3. Runtime environment configs (`package.json`, `.env.example`, Node/Python version) → Verify version compatibility and required secrets
@@ -158,8 +159,8 @@ if (result.name) {
158
159
  }
159
160
 
160
161
  // Error swallowed — exception disappears
161
- fetch("/api")
162
- .then((r) => r.json())
162
+ fetch('/api')
163
+ .then(r => r.json())
163
164
  .catch(() => {}); // Error silently discarded
164
165
 
165
166
  // Promise in useEffect without cleanup
@@ -18,6 +18,7 @@ You are the last line of defense against fabricated dependencies. An AI model wi
18
18
  ## Mandatory Pre-Flight Context Inspection
19
19
 
20
20
  Before auditing package imports, you MUST inspect:
21
+
21
22
  1. `package.json` (`dependencies`, `devDependencies`, `peerDependencies`) or `requirements.txt` / `pyproject.toml`
22
23
  2. `node_modules` structure or import maps (if present)
23
24
  3. Framework sub-package export maps (e.g. Next.js 15 subpath exports `@tanstack/react-query`, `lucide-react`, `framer-motion`)
@@ -21,6 +21,7 @@ last-updated: 2026-07-29
21
21
  ## Mandatory Pre-Flight Context Inspection
22
22
 
23
23
  Before generating DevOps pipelines or infrastructure manifests, you MUST inspect:
24
+
24
25
  1. `Dockerfile` / `.github/workflows/` / `k8s/` → Review existing CI/CD automation and container configurations
25
26
  2. `package.json` / runtime dependency lockfiles → Inspect Node/Python version, build commands, and script targets
26
27
  3. Production deployment targets → Verify GitOps setup (ArgoCD vs GitHub Actions vs Terraform) and cluster readiness probes
@@ -100,8 +101,8 @@ jobs:
100
101
  - name: Setup Node
101
102
  uses: actions/setup-node@v4
102
103
  with:
103
- node-version: "22"
104
- cache: "npm"
104
+ node-version: '22'
105
+ cache: 'npm'
105
106
 
106
107
  - run: npm ci
107
108
  - run: npm run type-check # tsc --noEmit
@@ -141,11 +142,11 @@ metadata:
141
142
  spec:
142
143
  project: default
143
144
  source:
144
- repoURL: "https://github.com/mycorp/k8s-manifests"
145
+ repoURL: 'https://github.com/mycorp/k8s-manifests'
145
146
  path: apps/api-service
146
147
  targetRevision: HEAD
147
148
  destination:
148
- server: "https://kubernetes.default.svc"
149
+ server: 'https://kubernetes.default.svc'
149
150
  namespace: production
150
151
  syncPolicy:
151
152
  automated:
@@ -189,11 +190,11 @@ spec:
189
190
  # Resource limits — ALWAYS set in production
190
191
  resources:
191
192
  requests:
192
- memory: "128Mi"
193
- cpu: "100m"
193
+ memory: '128Mi'
194
+ cpu: '100m'
194
195
  limits:
195
- memory: "512Mi"
196
- cpu: "500m"
196
+ memory: '512Mi'
197
+ cpu: '500m'
197
198
  ```
198
199
 
199
200
  ---