tribunal-kit 9.2.6 → 9.2.8

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 (836) hide show
  1. package/.agent/ARCHITECTURE.md +4 -4
  2. package/.agent/data/skill_certification_ledger.jsonl +40 -0
  3. package/.agent/data/skill_ontology.json +138 -0
  4. package/.agent/history/architecture-intelligence.html +1487 -401
  5. package/.agent/history/architecture-model.json +16130 -5802
  6. package/.agent/history/architecture-verification.json +6 -6
  7. package/.agent/routing_index.json +656 -1566
  8. package/.agent/rules/GEMINI.md +1 -1
  9. package/.agent/scripts/adaptive_execution.js +704 -0
  10. package/.agent/scripts/architecture_diff.js +60 -17
  11. package/.agent/scripts/architecture_extractor.js +60 -21
  12. package/.agent/scripts/architecture_health.js +58 -21
  13. package/.agent/scripts/architecture_intelligence.js +3100 -0
  14. package/.agent/scripts/architecture_verifier.js +46 -13
  15. package/.agent/scripts/architecture_visualizer.js +1536 -421
  16. package/.agent/scripts/blast_radius_engine.js +64 -24
  17. package/.agent/scripts/capability_evolution.js +555 -0
  18. package/.agent/scripts/concept_extractor.js +240 -0
  19. package/.agent/scripts/consideration_engine.js +284 -0
  20. package/.agent/scripts/context_broker.js +397 -31
  21. package/.agent/scripts/corpus_certification_orchestrator.js +502 -0
  22. package/.agent/scripts/corpus_validation_engine.js +311 -0
  23. package/.agent/scripts/coverage_engine.js +102 -0
  24. package/.agent/scripts/cross_domain_engine.js +1883 -0
  25. package/.agent/scripts/engineering_memory.js +1442 -0
  26. package/.agent/scripts/final_corpus_validation_engine.js +405 -0
  27. package/.agent/scripts/integrity_manifest.js +1 -5
  28. package/.agent/scripts/intent_extractor.js +130 -0
  29. package/.agent/scripts/judgment_engine.js +790 -0
  30. package/.agent/scripts/materiality_engine.js +251 -0
  31. package/.agent/scripts/outcome_engine.js +639 -0
  32. package/.agent/scripts/outcome_optimization_engine.js +1632 -0
  33. package/.agent/scripts/routing_evaluation_engine.js +184 -0
  34. package/.agent/scripts/simulation_engine.js +1478 -0
  35. package/.agent/scripts/skill_behavior_classifier.js +90 -0
  36. package/.agent/scripts/skill_behavior_harness.js +105 -0
  37. package/.agent/scripts/skill_certification_engine.js +586 -0
  38. package/.agent/scripts/skill_contract_engine.js +424 -0
  39. package/.agent/scripts/skill_coverage_expansion_engine.js +505 -0
  40. package/.agent/scripts/skill_evidence_acquisition_engine.js +535 -0
  41. package/.agent/scripts/skill_evidence_engine.js +83 -0
  42. package/.agent/scripts/skill_expectation_engine.js +38 -0
  43. package/.agent/scripts/skill_fixture_engine.js +24 -0
  44. package/.agent/scripts/skill_human_validation.js +32 -0
  45. package/.agent/scripts/skill_intelligence.js +1300 -0
  46. package/.agent/scripts/skill_observation_engine.js +25 -0
  47. package/.agent/scripts/skill_ontology_engine.js +83 -0
  48. package/.agent/scripts/skill_quality_engine.js +343 -0
  49. package/.agent/scripts/skill_reconstruction_engine.js +164 -0
  50. package/.agent/scripts/skill_remediation_engine.js +326 -0
  51. package/.agent/scripts/skill_scenario_engine.js +108 -0
  52. package/.agent/scripts/skill_test_authoring_engine.js +1011 -0
  53. package/.agent/scripts/verification_auditor.js +346 -0
  54. package/.agent/skill-intelligence/taxonomy/engineering-concepts.json +555 -0
  55. package/.agent/skill_topic_map.json +15 -55
  56. package/.agent/skills/12-principles-of-animation/SKILL.md +9 -0
  57. package/.agent/skills/60fps-animation/SKILL.md +14 -0
  58. package/.agent/skills/accessible-animation/SKILL.md +9 -0
  59. package/.agent/skills/adapt/SKILL.md +8 -0
  60. package/.agent/skills/adr-generation/SKILL.md +9 -0
  61. package/.agent/skills/advanced-rag-pipelines/SKILL.md +9 -0
  62. package/.agent/skills/agent-organizer/SKILL.md +8 -0
  63. package/.agent/skills/agent-syscall-guidelines/SKILL.md +10 -0
  64. package/.agent/skills/agentic-patterns/SKILL.md +9 -0
  65. package/.agent/skills/agentic-workflows-2026/SKILL.md +8 -0
  66. package/.agent/skills/agentshield-security/SKILL.md +16 -0
  67. package/.agent/skills/ai-app-hardening/SKILL.md +7 -0
  68. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +9 -0
  69. package/.agent/skills/animation-on-scroll/SKILL.md +9 -0
  70. package/.agent/skills/animation-systems/SKILL.md +8 -0
  71. package/.agent/skills/antfu-conventions/SKILL.md +9 -0
  72. package/.agent/skills/anti-slop-enforcement/SKILL.md +11 -0
  73. package/.agent/skills/api-patterns/SKILL.md +9 -0
  74. package/.agent/skills/api-security-auditor/SKILL.md +10 -0
  75. package/.agent/skills/app-builder/SKILL.md +8 -0
  76. package/.agent/skills/appflow-wireframe/SKILL.md +9 -0
  77. package/.agent/skills/apple-design/SKILL.md +8 -0
  78. package/.agent/skills/architecture/SKILL.md +8 -0
  79. package/.agent/skills/architecture-drift/SKILL.md +9 -0
  80. package/.agent/skills/architecture-intelligence/SKILL.md +17 -0
  81. package/.agent/skills/audit-and-fix/SKILL.md +8 -0
  82. package/.agent/skills/authentication-best-practices/SKILL.md +10 -0
  83. package/.agent/skills/autonomous-execution/SKILL.md +9 -0
  84. package/.agent/skills/backend-alembic/SKILL.md +16 -0
  85. package/.agent/skills/backend-architecture-auditor/SKILL.md +16 -0
  86. package/.agent/skills/backend-mongodb/SKILL.md +10 -0
  87. package/.agent/skills/backend-mysql/SKILL.md +16 -0
  88. package/.agent/skills/backend-performance-auditor/SKILL.md +10 -0
  89. package/.agent/skills/backend-postgresql/SKILL.md +10 -0
  90. package/.agent/skills/backend-redis/SKILL.md +10 -0
  91. package/.agent/skills/backend-security-expert/SKILL.md +10 -0
  92. package/.agent/skills/backend-sqlalchemy/SKILL.md +10 -0
  93. package/.agent/skills/backend-sqlite/SKILL.md +10 -0
  94. package/.agent/skills/backend-testing-auditor/SKILL.md +15 -0
  95. package/.agent/skills/baseline-ui/SKILL.md +8 -0
  96. package/.agent/skills/bash-linux/SKILL.md +9 -0
  97. package/.agent/skills/behavioral-modes/SKILL.md +9 -0
  98. package/.agent/skills/better-colors/SKILL.md +9 -0
  99. package/.agent/skills/better-typography/SKILL.md +9 -0
  100. package/.agent/skills/better-ui/SKILL.md +8 -0
  101. package/.agent/skills/bolder/SKILL.md +8 -0
  102. package/.agent/skills/brainstorming/SKILL.md +8 -0
  103. package/.agent/skills/browser-audit/SKILL.md +9 -0
  104. package/.agent/skills/browser-native-ai/SKILL.md +8 -0
  105. package/.agent/skills/build-primitive/SKILL.md +8 -0
  106. package/.agent/skills/building-native-ui/SKILL.md +7 -0
  107. package/.agent/skills/cicd-pro/SKILL.md +9 -0
  108. package/.agent/skills/clarify/SKILL.md +8 -0
  109. package/.agent/skills/clean-code/SKILL.md +8 -0
  110. package/.agent/skills/cloud-architect/SKILL.md +8 -0
  111. package/.agent/skills/cobejs/SKILL.md +8 -0
  112. package/.agent/skills/code-review-checklist/SKILL.md +9 -0
  113. package/.agent/skills/codebase-design/SKILL.md +14 -0
  114. package/.agent/skills/colorize/SKILL.md +8 -0
  115. package/.agent/skills/compact-landing/SKILL.md +9 -0
  116. package/.agent/skills/company-logos/SKILL.md +9 -0
  117. package/.agent/skills/config-validator/SKILL.md +9 -0
  118. package/.agent/skills/containerization-pro/SKILL.md +9 -0
  119. package/.agent/skills/context-engineering-pro/SKILL.md +10 -0
  120. package/.agent/skills/create-design-md/SKILL.md +7 -0
  121. package/.agent/skills/critique/SKILL.md +8 -0
  122. package/.agent/skills/csharp-developer/SKILL.md +9 -0
  123. package/.agent/skills/data-validation-schemas/SKILL.md +8 -0
  124. package/.agent/skills/database-design/SKILL.md +8 -0
  125. package/.agent/skills/delight/SKILL.md +8 -0
  126. package/.agent/skills/deployment-procedures/SKILL.md +9 -0
  127. package/.agent/skills/design-lab/SKILL.md +8 -0
  128. package/.agent/skills/devops-engineer/SKILL.md +9 -0
  129. package/.agent/skills/devops-incident-responder/SKILL.md +16 -0
  130. package/.agent/skills/diagnosing-bugs/SKILL.md +9 -0
  131. package/.agent/skills/distill/SKILL.md +8 -0
  132. package/.agent/skills/documentation-templates/SKILL.md +9 -0
  133. package/.agent/skills/domain-modeling/SKILL.md +9 -0
  134. package/.agent/skills/duckdb-analytical-sql/SKILL.md +10 -0
  135. package/.agent/skills/edge-ai-mobile/SKILL.md +8 -0
  136. package/.agent/skills/edge-computing/SKILL.md +9 -0
  137. package/.agent/skills/emil-design-eng/SKILL.md +9 -0
  138. package/.agent/skills/error-resilience/SKILL.md +8 -0
  139. package/.agent/skills/expo-router-v4/SKILL.md +9 -0
  140. package/.agent/skills/extract-design-system/SKILL.md +9 -0
  141. package/.agent/skills/fabel-protocol/SKILL.md +9 -0
  142. package/.agent/skills/failure-mode-analysis/SKILL.md +10 -0
  143. package/.agent/skills/fastapi-pro/SKILL.md +9 -0
  144. package/.agent/skills/fixing-accessibility/SKILL.md +9 -0
  145. package/.agent/skills/fixing-metadata/SKILL.md +9 -0
  146. package/.agent/skills/fixing-motion-performance/SKILL.md +9 -0
  147. package/.agent/skills/framer-motion-expert/SKILL.md +9 -0
  148. package/.agent/skills/frontend-design/SKILL.md +7 -0
  149. package/.agent/skills/frontend-security-expert/SKILL.md +9 -0
  150. package/.agent/skills/game-design-expert/SKILL.md +9 -0
  151. package/.agent/skills/game-engineering-expert/SKILL.md +16 -0
  152. package/.agent/skills/generative-ui-expert/SKILL.md +9 -0
  153. package/.agent/skills/geo-fundamentals/SKILL.md +9 -0
  154. package/.agent/skills/git-pro/SKILL.md +9 -0
  155. package/.agent/skills/github-operations/SKILL.md +9 -0
  156. package/.agent/skills/gpt-taste/SKILL.md +9 -0
  157. package/.agent/skills/graph-engineering/SKILL.md +16 -0
  158. package/.agent/skills/gsap-core/SKILL.md +9 -0
  159. package/.agent/skills/gsap-frameworks/SKILL.md +9 -0
  160. package/.agent/skills/gsap-performance/SKILL.md +9 -0
  161. package/.agent/skills/gsap-plugins/SKILL.md +9 -0
  162. package/.agent/skills/gsap-react/SKILL.md +9 -0
  163. package/.agent/skills/gsap-scrolltrigger/SKILL.md +9 -0
  164. package/.agent/skills/gsap-timeline/SKILL.md +9 -0
  165. package/.agent/skills/gsap-utils/SKILL.md +9 -0
  166. package/.agent/skills/harden/SKILL.md +8 -0
  167. package/.agent/skills/harness-protocol/SKILL.md +9 -0
  168. package/.agent/skills/hf-cli/SKILL.md +11 -0
  169. package/.agent/skills/hf-cloud-aws-context-discovery/SKILL.md +10 -0
  170. package/.agent/skills/hf-cloud-python-env-setup/SKILL.md +10 -0
  171. package/.agent/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +10 -0
  172. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +10 -0
  173. package/.agent/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +10 -0
  174. package/.agent/skills/hf-cloud-serving-image-selection/SKILL.md +10 -0
  175. package/.agent/skills/hf-mem/SKILL.md +11 -0
  176. package/.agent/skills/huggingface-best/SKILL.md +9 -0
  177. package/.agent/skills/huggingface-community-evals/SKILL.md +11 -0
  178. package/.agent/skills/huggingface-datasets/SKILL.md +10 -0
  179. package/.agent/skills/huggingface-gradio/SKILL.md +10 -0
  180. package/.agent/skills/huggingface-llm-trainer/SKILL.md +10 -0
  181. package/.agent/skills/huggingface-local-models/SKILL.md +10 -0
  182. package/.agent/skills/huggingface-lora-space-builder/SKILL.md +11 -0
  183. package/.agent/skills/huggingface-paper-publisher/SKILL.md +11 -0
  184. package/.agent/skills/huggingface-papers/SKILL.md +11 -0
  185. package/.agent/skills/huggingface-spaces/SKILL.md +10 -0
  186. package/.agent/skills/huggingface-tool-builder/SKILL.md +11 -0
  187. package/.agent/skills/huggingface-trackio/SKILL.md +11 -0
  188. package/.agent/skills/huggingface-vision-trainer/SKILL.md +11 -0
  189. package/.agent/skills/huggingface-zerogpu/SKILL.md +11 -0
  190. package/.agent/skills/human-gate-negotiation/SKILL.md +11 -0
  191. package/.agent/skills/i18n-localization/SKILL.md +9 -0
  192. package/.agent/skills/impeccable/SKILL.md +8 -0
  193. package/.agent/skills/improve-codebase-architecture/SKILL.md +10 -0
  194. package/.agent/skills/improve-ui/SKILL.md +8 -0
  195. package/.agent/skills/intelligent-routing/SKILL.md +9 -0
  196. package/.agent/skills/knowledge-graph/SKILL.md +9 -0
  197. package/.agent/skills/landing-page/SKILL.md +9 -0
  198. package/.agent/skills/lint-and-validate/SKILL.md +9 -0
  199. package/.agent/skills/llm-engineering/SKILL.md +9 -0
  200. package/.agent/skills/local-first/SKILL.md +10 -0
  201. package/.agent/skills/lottie-animation/SKILL.md +9 -0
  202. package/.agent/skills/marquee-loop/SKILL.md +9 -0
  203. package/.agent/skills/masked-reveal/SKILL.md +9 -0
  204. package/.agent/skills/mcp-builder/SKILL.md +9 -0
  205. package/.agent/skills/micro-interaction/SKILL.md +9 -0
  206. package/.agent/skills/mobile-design/SKILL.md +7 -0
  207. package/.agent/skills/monorepo-management/SKILL.md +9 -0
  208. package/.agent/skills/morphing-icons/SKILL.md +9 -0
  209. package/.agent/skills/motion-engineering/SKILL.md +8 -0
  210. package/.agent/skills/nextjs-react-expert/SKILL.md +10 -0
  211. package/.agent/skills/nodejs-best-practices/SKILL.md +16 -0
  212. package/.agent/skills/observability/SKILL.md +8 -0
  213. package/.agent/skills/opentelemetry-observability/SKILL.md +9 -0
  214. package/.agent/skills/page-transition-animation/SKILL.md +10 -0
  215. package/.agent/skills/parallel-agents/SKILL.md +15 -0
  216. package/.agent/skills/performance-profiling/SKILL.md +9 -0
  217. package/.agent/skills/plan-writing/SKILL.md +8 -0
  218. package/.agent/skills/platform-engineer/SKILL.md +9 -0
  219. package/.agent/skills/platform-engineering-opentofu/SKILL.md +10 -0
  220. package/.agent/skills/playwright-ai-e2e/SKILL.md +9 -0
  221. package/.agent/skills/playwright-best-practices/SKILL.md +16 -0
  222. package/.agent/skills/polish/SKILL.md +8 -0
  223. package/.agent/skills/powershell-windows/SKILL.md +9 -0
  224. package/.agent/skills/pricing-page/SKILL.md +9 -0
  225. package/.agent/skills/product-aware-heuristics/SKILL.md +10 -0
  226. package/.agent/skills/progressive-blur/SKILL.md +9 -0
  227. package/.agent/skills/project-idioms/SKILL.md +8 -0
  228. package/.agent/skills/property-based-testing/SKILL.md +9 -0
  229. package/.agent/skills/python-patterns/SKILL.md +9 -0
  230. package/.agent/skills/python-pro/SKILL.md +9 -0
  231. package/.agent/skills/quieter/SKILL.md +8 -0
  232. package/.agent/skills/react-doctor/SKILL.md +9 -0
  233. package/.agent/skills/react-specialist/SKILL.md +9 -0
  234. package/.agent/skills/readme-builder/SKILL.md +9 -0
  235. package/.agent/skills/realtime-patterns/SKILL.md +9 -0
  236. package/.agent/skills/red-team-tactics/SKILL.md +16 -0
  237. package/.agent/skills/redesign-skill/SKILL.md +9 -0
  238. package/.agent/skills/review-animations/SKILL.md +8 -0
  239. package/.agent/skills/rust-pro/SKILL.md +9 -0
  240. package/.agent/skills/semantic-filesystem-navigation/SKILL.md +11 -0
  241. package/.agent/skills/seo-fundamentals/SKILL.md +9 -0
  242. package/.agent/skills/server-management/SKILL.md +8 -0
  243. package/.agent/skills/session-log-interrogation/SKILL.md +11 -0
  244. package/.agent/skills/shadcn-ui-expert/SKILL.md +9 -0
  245. package/.agent/skills/shape/SKILL.md +8 -0
  246. package/.agent/skills/skill-creator/SKILL.md +9 -0
  247. package/.agent/skills/soft-skill/SKILL.md +9 -0
  248. package/.agent/skills/sounds-on-the-web/SKILL.md +9 -0
  249. package/.agent/skills/sql-pro/SKILL.md +9 -0
  250. package/.agent/skills/subagent-driven-development/SKILL.md +11 -0
  251. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +17 -0
  252. package/.agent/skills/svg-animation/SKILL.md +9 -0
  253. package/.agent/skills/swiftui-expert/SKILL.md +9 -0
  254. package/.agent/skills/swiss-design/SKILL.md +8 -0
  255. package/.agent/skills/system-design-pro/SKILL.md +9 -0
  256. package/.agent/skills/systematic-debugging/SKILL.md +14 -0
  257. package/.agent/skills/tailwind-patterns/SKILL.md +9 -0
  258. package/.agent/skills/taste-skill/SKILL.md +9 -0
  259. package/.agent/skills/tdd-workflow/SKILL.md +9 -0
  260. package/.agent/skills/test-result-analyzer/SKILL.md +9 -0
  261. package/.agent/skills/testing-patterns/SKILL.md +8 -0
  262. package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +11 -0
  263. package/.agent/skills/thinking-protocol/SKILL.md +10 -0
  264. package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +9 -0
  265. package/.agent/skills/train-sentence-transformers/SKILL.md +10 -0
  266. package/.agent/skills/transformers-js/SKILL.md +8 -0
  267. package/.agent/skills/transitions-dev/SKILL.md +8 -0
  268. package/.agent/skills/trend-researcher/SKILL.md +9 -0
  269. package/.agent/skills/tribunal-instincts-memory/SKILL.md +11 -0
  270. package/.agent/skills/trl-training/SKILL.md +9 -0
  271. package/.agent/skills/typescript-advanced/SKILL.md +9 -0
  272. package/.agent/skills/typeset/SKILL.md +8 -0
  273. package/.agent/skills/ui-reasoning-engine/SKILL.md +9 -0
  274. package/.agent/skills/ui-skill-packs/SKILL.md +9 -0
  275. package/.agent/skills/ui-skills-root/SKILL.md +9 -0
  276. package/.agent/skills/ui-ux-pro-max/SKILL.md +9 -0
  277. package/.agent/skills/ui-ux-researcher/SKILL.md +8 -0
  278. package/.agent/skills/vector-search-pgvector/SKILL.md +10 -0
  279. package/.agent/skills/verification-before-completion/SKILL.md +9 -0
  280. package/.agent/skills/vue-expert/SKILL.md +9 -0
  281. package/.agent/skills/vulnerability-scanner/SKILL.md +9 -0
  282. package/.agent/skills/web-accessibility-auditor/SKILL.md +16 -0
  283. package/.agent/skills/web-design-guidelines/SKILL.md +9 -0
  284. package/.agent/skills/web-quality-audit/SKILL.md +10 -0
  285. package/.agent/skills/webapp-testing/SKILL.md +8 -0
  286. package/.agent/skills/webgpu-performance/SKILL.md +9 -0
  287. package/.agent/skills/whimsy-injector/SKILL.md +9 -0
  288. package/.agent/skills/workflow-optimizer/SKILL.md +9 -0
  289. package/.agent/skills/zero-trust-passkeys/SKILL.md +10 -0
  290. package/.agent/skills_inventory.json +502 -3167
  291. package/.agent/workflows/arch.md +96 -80
  292. package/.agent/workflows/skill-intelligence.md +216 -0
  293. package/.agents/skills/12-principles-of-animation/SKILL.md +9 -0
  294. package/.agents/skills/60fps-animation/SKILL.md +14 -0
  295. package/.agents/skills/accessible-animation/SKILL.md +9 -0
  296. package/.agents/skills/adapt/SKILL.md +8 -0
  297. package/.agents/skills/adr-generation/SKILL.md +9 -0
  298. package/.agents/skills/advanced-rag-pipelines/SKILL.md +9 -0
  299. package/.agents/skills/agent-organizer/SKILL.md +8 -0
  300. package/.agents/skills/agent-syscall-guidelines/SKILL.md +10 -0
  301. package/.agents/skills/agentic-patterns/SKILL.md +9 -0
  302. package/.agents/skills/agentic-workflows-2026/SKILL.md +8 -0
  303. package/.agents/skills/agentshield-security/SKILL.md +16 -0
  304. package/.agents/skills/ai-app-hardening/SKILL.md +7 -0
  305. package/.agents/skills/ai-prompt-injection-defense/SKILL.md +9 -0
  306. package/.agents/skills/animation-on-scroll/SKILL.md +9 -0
  307. package/.agents/skills/animation-systems/SKILL.md +8 -0
  308. package/.agents/skills/antfu-conventions/SKILL.md +9 -0
  309. package/.agents/skills/anti-slop-enforcement/SKILL.md +11 -0
  310. package/.agents/skills/api-patterns/SKILL.md +9 -0
  311. package/.agents/skills/api-security-auditor/SKILL.md +10 -0
  312. package/.agents/skills/app-builder/SKILL.md +8 -0
  313. package/.agents/skills/appflow-wireframe/SKILL.md +9 -0
  314. package/.agents/skills/apple-design/SKILL.md +8 -0
  315. package/.agents/skills/architecture/SKILL.md +8 -0
  316. package/.agents/skills/architecture-drift/SKILL.md +9 -0
  317. package/.agents/skills/architecture-intelligence/SKILL.md +17 -0
  318. package/.agents/skills/audit-and-fix/SKILL.md +8 -0
  319. package/.agents/skills/authentication-best-practices/SKILL.md +10 -0
  320. package/.agents/skills/autonomous-execution/SKILL.md +9 -0
  321. package/.agents/skills/backend-alembic/SKILL.md +16 -0
  322. package/.agents/skills/backend-architecture-auditor/SKILL.md +16 -0
  323. package/.agents/skills/backend-mongodb/SKILL.md +10 -0
  324. package/.agents/skills/backend-mysql/SKILL.md +16 -0
  325. package/.agents/skills/backend-performance-auditor/SKILL.md +10 -0
  326. package/.agents/skills/backend-postgresql/SKILL.md +10 -0
  327. package/.agents/skills/backend-redis/SKILL.md +10 -0
  328. package/.agents/skills/backend-security-expert/SKILL.md +10 -0
  329. package/.agents/skills/backend-sqlalchemy/SKILL.md +10 -0
  330. package/.agents/skills/backend-sqlite/SKILL.md +10 -0
  331. package/.agents/skills/backend-testing-auditor/SKILL.md +15 -0
  332. package/.agents/skills/baseline-ui/SKILL.md +8 -0
  333. package/.agents/skills/bash-linux/SKILL.md +9 -0
  334. package/.agents/skills/behavioral-modes/SKILL.md +9 -0
  335. package/.agents/skills/better-colors/SKILL.md +9 -0
  336. package/.agents/skills/better-typography/SKILL.md +9 -0
  337. package/.agents/skills/better-ui/SKILL.md +8 -0
  338. package/.agents/skills/bolder/SKILL.md +8 -0
  339. package/.agents/skills/brainstorming/SKILL.md +8 -0
  340. package/.agents/skills/browser-audit/SKILL.md +9 -0
  341. package/.agents/skills/browser-native-ai/SKILL.md +8 -0
  342. package/.agents/skills/build-primitive/SKILL.md +8 -0
  343. package/.agents/skills/building-native-ui/SKILL.md +7 -0
  344. package/.agents/skills/cicd-pro/SKILL.md +9 -0
  345. package/.agents/skills/clarify/SKILL.md +8 -0
  346. package/.agents/skills/clean-code/SKILL.md +8 -0
  347. package/.agents/skills/cloud-architect/SKILL.md +8 -0
  348. package/.agents/skills/cobejs/SKILL.md +8 -0
  349. package/.agents/skills/code-review-checklist/SKILL.md +9 -0
  350. package/.agents/skills/codebase-design/SKILL.md +14 -0
  351. package/.agents/skills/colorize/SKILL.md +8 -0
  352. package/.agents/skills/compact-landing/SKILL.md +9 -0
  353. package/.agents/skills/company-logos/SKILL.md +9 -0
  354. package/.agents/skills/config-validator/SKILL.md +9 -0
  355. package/.agents/skills/containerization-pro/SKILL.md +9 -0
  356. package/.agents/skills/context-engineering-pro/SKILL.md +10 -0
  357. package/.agents/skills/create-design-md/SKILL.md +7 -0
  358. package/.agents/skills/critique/SKILL.md +8 -0
  359. package/.agents/skills/csharp-developer/SKILL.md +9 -0
  360. package/.agents/skills/data-validation-schemas/SKILL.md +8 -0
  361. package/.agents/skills/database-design/SKILL.md +8 -0
  362. package/.agents/skills/delight/SKILL.md +8 -0
  363. package/.agents/skills/deployment-procedures/SKILL.md +9 -0
  364. package/.agents/skills/design-lab/SKILL.md +8 -0
  365. package/.agents/skills/devops-engineer/SKILL.md +9 -0
  366. package/.agents/skills/devops-incident-responder/SKILL.md +16 -0
  367. package/.agents/skills/diagnosing-bugs/SKILL.md +9 -0
  368. package/.agents/skills/distill/SKILL.md +8 -0
  369. package/.agents/skills/documentation-templates/SKILL.md +9 -0
  370. package/.agents/skills/domain-modeling/SKILL.md +9 -0
  371. package/.agents/skills/duckdb-analytical-sql/SKILL.md +10 -0
  372. package/.agents/skills/edge-ai-mobile/SKILL.md +8 -0
  373. package/.agents/skills/edge-computing/SKILL.md +9 -0
  374. package/.agents/skills/emil-design-eng/SKILL.md +9 -0
  375. package/.agents/skills/error-resilience/SKILL.md +8 -0
  376. package/.agents/skills/expo-router-v4/SKILL.md +9 -0
  377. package/.agents/skills/extract-design-system/SKILL.md +9 -0
  378. package/.agents/skills/fabel-protocol/SKILL.md +9 -0
  379. package/.agents/skills/failure-mode-analysis/SKILL.md +10 -0
  380. package/.agents/skills/fastapi-pro/SKILL.md +9 -0
  381. package/.agents/skills/fixing-accessibility/SKILL.md +9 -0
  382. package/.agents/skills/fixing-metadata/SKILL.md +9 -0
  383. package/.agents/skills/fixing-motion-performance/SKILL.md +9 -0
  384. package/.agents/skills/framer-motion-expert/SKILL.md +9 -0
  385. package/.agents/skills/frontend-design/SKILL.md +7 -0
  386. package/.agents/skills/frontend-security-expert/SKILL.md +9 -0
  387. package/.agents/skills/game-design-expert/SKILL.md +9 -0
  388. package/.agents/skills/game-engineering-expert/SKILL.md +16 -0
  389. package/.agents/skills/generative-ui-expert/SKILL.md +9 -0
  390. package/.agents/skills/geo-fundamentals/SKILL.md +9 -0
  391. package/.agents/skills/git-pro/SKILL.md +9 -0
  392. package/.agents/skills/github-operations/SKILL.md +9 -0
  393. package/.agents/skills/gpt-taste/SKILL.md +9 -0
  394. package/.agents/skills/graph-engineering/SKILL.md +16 -0
  395. package/.agents/skills/gsap-core/SKILL.md +9 -0
  396. package/.agents/skills/gsap-frameworks/SKILL.md +9 -0
  397. package/.agents/skills/gsap-performance/SKILL.md +9 -0
  398. package/.agents/skills/gsap-plugins/SKILL.md +9 -0
  399. package/.agents/skills/gsap-react/SKILL.md +9 -0
  400. package/.agents/skills/gsap-scrolltrigger/SKILL.md +9 -0
  401. package/.agents/skills/gsap-timeline/SKILL.md +9 -0
  402. package/.agents/skills/gsap-utils/SKILL.md +9 -0
  403. package/.agents/skills/harden/SKILL.md +8 -0
  404. package/.agents/skills/harness-protocol/SKILL.md +9 -0
  405. package/.agents/skills/hf-cli/SKILL.md +11 -0
  406. package/.agents/skills/hf-cloud-aws-context-discovery/SKILL.md +10 -0
  407. package/.agents/skills/hf-cloud-python-env-setup/SKILL.md +10 -0
  408. package/.agents/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +10 -0
  409. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +10 -0
  410. package/.agents/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +10 -0
  411. package/.agents/skills/hf-cloud-serving-image-selection/SKILL.md +10 -0
  412. package/.agents/skills/hf-mem/SKILL.md +11 -0
  413. package/.agents/skills/huggingface-best/SKILL.md +9 -0
  414. package/.agents/skills/huggingface-community-evals/SKILL.md +11 -0
  415. package/.agents/skills/huggingface-datasets/SKILL.md +10 -0
  416. package/.agents/skills/huggingface-gradio/SKILL.md +10 -0
  417. package/.agents/skills/huggingface-llm-trainer/SKILL.md +10 -0
  418. package/.agents/skills/huggingface-local-models/SKILL.md +10 -0
  419. package/.agents/skills/huggingface-lora-space-builder/SKILL.md +11 -0
  420. package/.agents/skills/huggingface-paper-publisher/SKILL.md +11 -0
  421. package/.agents/skills/huggingface-papers/SKILL.md +11 -0
  422. package/.agents/skills/huggingface-spaces/SKILL.md +10 -0
  423. package/.agents/skills/huggingface-tool-builder/SKILL.md +11 -0
  424. package/.agents/skills/huggingface-trackio/SKILL.md +11 -0
  425. package/.agents/skills/huggingface-vision-trainer/SKILL.md +11 -0
  426. package/.agents/skills/huggingface-zerogpu/SKILL.md +11 -0
  427. package/.agents/skills/human-gate-negotiation/SKILL.md +11 -0
  428. package/.agents/skills/i18n-localization/SKILL.md +9 -0
  429. package/.agents/skills/impeccable/SKILL.md +8 -0
  430. package/.agents/skills/improve-codebase-architecture/SKILL.md +10 -0
  431. package/.agents/skills/improve-ui/SKILL.md +8 -0
  432. package/.agents/skills/intelligent-routing/SKILL.md +9 -0
  433. package/.agents/skills/knowledge-graph/SKILL.md +9 -0
  434. package/.agents/skills/landing-page/SKILL.md +9 -0
  435. package/.agents/skills/lint-and-validate/SKILL.md +9 -0
  436. package/.agents/skills/llm-engineering/SKILL.md +9 -0
  437. package/.agents/skills/local-first/SKILL.md +10 -0
  438. package/.agents/skills/lottie-animation/SKILL.md +9 -0
  439. package/.agents/skills/marquee-loop/SKILL.md +9 -0
  440. package/.agents/skills/masked-reveal/SKILL.md +9 -0
  441. package/.agents/skills/mcp-builder/SKILL.md +9 -0
  442. package/.agents/skills/micro-interaction/SKILL.md +9 -0
  443. package/.agents/skills/mobile-design/SKILL.md +7 -0
  444. package/.agents/skills/monorepo-management/SKILL.md +9 -0
  445. package/.agents/skills/morphing-icons/SKILL.md +9 -0
  446. package/.agents/skills/motion-engineering/SKILL.md +8 -0
  447. package/.agents/skills/nextjs-react-expert/SKILL.md +10 -0
  448. package/.agents/skills/nodejs-best-practices/SKILL.md +16 -0
  449. package/.agents/skills/observability/SKILL.md +8 -0
  450. package/.agents/skills/opentelemetry-observability/SKILL.md +9 -0
  451. package/.agents/skills/page-transition-animation/SKILL.md +10 -0
  452. package/.agents/skills/parallel-agents/SKILL.md +15 -0
  453. package/.agents/skills/performance-profiling/SKILL.md +9 -0
  454. package/.agents/skills/plan-writing/SKILL.md +8 -0
  455. package/.agents/skills/platform-engineer/SKILL.md +9 -0
  456. package/.agents/skills/platform-engineering-opentofu/SKILL.md +10 -0
  457. package/.agents/skills/playwright-ai-e2e/SKILL.md +9 -0
  458. package/.agents/skills/playwright-best-practices/SKILL.md +16 -0
  459. package/.agents/skills/polish/SKILL.md +8 -0
  460. package/.agents/skills/powershell-windows/SKILL.md +9 -0
  461. package/.agents/skills/pricing-page/SKILL.md +9 -0
  462. package/.agents/skills/product-aware-heuristics/SKILL.md +10 -0
  463. package/.agents/skills/progressive-blur/SKILL.md +9 -0
  464. package/.agents/skills/project-idioms/SKILL.md +8 -0
  465. package/.agents/skills/property-based-testing/SKILL.md +9 -0
  466. package/.agents/skills/python-patterns/SKILL.md +9 -0
  467. package/.agents/skills/python-pro/SKILL.md +9 -0
  468. package/.agents/skills/quieter/SKILL.md +8 -0
  469. package/.agents/skills/react-doctor/SKILL.md +9 -0
  470. package/.agents/skills/react-specialist/SKILL.md +9 -0
  471. package/.agents/skills/readme-builder/SKILL.md +9 -0
  472. package/.agents/skills/realtime-patterns/SKILL.md +9 -0
  473. package/.agents/skills/red-team-tactics/SKILL.md +16 -0
  474. package/.agents/skills/redesign-skill/SKILL.md +9 -0
  475. package/.agents/skills/review-animations/SKILL.md +8 -0
  476. package/.agents/skills/rust-pro/SKILL.md +9 -0
  477. package/.agents/skills/semantic-filesystem-navigation/SKILL.md +11 -0
  478. package/.agents/skills/seo-fundamentals/SKILL.md +9 -0
  479. package/.agents/skills/server-management/SKILL.md +8 -0
  480. package/.agents/skills/session-log-interrogation/SKILL.md +11 -0
  481. package/.agents/skills/shadcn-ui-expert/SKILL.md +9 -0
  482. package/.agents/skills/shape/SKILL.md +8 -0
  483. package/.agents/skills/skill-creator/SKILL.md +9 -0
  484. package/.agents/skills/soft-skill/SKILL.md +9 -0
  485. package/.agents/skills/sounds-on-the-web/SKILL.md +9 -0
  486. package/.agents/skills/sql-pro/SKILL.md +9 -0
  487. package/.agents/skills/subagent-driven-development/SKILL.md +11 -0
  488. package/.agents/skills/supabase-postgres-best-practices/SKILL.md +17 -0
  489. package/.agents/skills/svg-animation/SKILL.md +9 -0
  490. package/.agents/skills/swiftui-expert/SKILL.md +9 -0
  491. package/.agents/skills/swiss-design/SKILL.md +8 -0
  492. package/.agents/skills/system-design-pro/SKILL.md +9 -0
  493. package/.agents/skills/systematic-debugging/SKILL.md +14 -0
  494. package/.agents/skills/tailwind-patterns/SKILL.md +9 -0
  495. package/.agents/skills/taste-skill/SKILL.md +9 -0
  496. package/.agents/skills/tdd-workflow/SKILL.md +9 -0
  497. package/.agents/skills/test-result-analyzer/SKILL.md +9 -0
  498. package/.agents/skills/testing-patterns/SKILL.md +8 -0
  499. package/.agents/skills/thermo-nuclear-code-quality-review/SKILL.md +11 -0
  500. package/.agents/skills/thinking-protocol/SKILL.md +10 -0
  501. package/.agents/skills/to-spring-or-not-to-spring/SKILL.md +9 -0
  502. package/.agents/skills/train-sentence-transformers/SKILL.md +10 -0
  503. package/.agents/skills/transformers-js/SKILL.md +8 -0
  504. package/.agents/skills/transitions-dev/SKILL.md +8 -0
  505. package/.agents/skills/trend-researcher/SKILL.md +9 -0
  506. package/.agents/skills/tribunal-instincts-memory/SKILL.md +11 -0
  507. package/.agents/skills/trl-training/SKILL.md +9 -0
  508. package/.agents/skills/typescript-advanced/SKILL.md +9 -0
  509. package/.agents/skills/typeset/SKILL.md +8 -0
  510. package/.agents/skills/ui-reasoning-engine/SKILL.md +9 -0
  511. package/.agents/skills/ui-skill-packs/SKILL.md +9 -0
  512. package/.agents/skills/ui-skills-root/SKILL.md +9 -0
  513. package/.agents/skills/ui-ux-pro-max/SKILL.md +9 -0
  514. package/.agents/skills/ui-ux-researcher/SKILL.md +8 -0
  515. package/.agents/skills/vector-search-pgvector/SKILL.md +10 -0
  516. package/.agents/skills/verification-before-completion/SKILL.md +9 -0
  517. package/.agents/skills/vue-expert/SKILL.md +9 -0
  518. package/.agents/skills/vulnerability-scanner/SKILL.md +9 -0
  519. package/.agents/skills/web-accessibility-auditor/SKILL.md +16 -0
  520. package/.agents/skills/web-design-guidelines/SKILL.md +9 -0
  521. package/.agents/skills/web-quality-audit/SKILL.md +10 -0
  522. package/.agents/skills/webapp-testing/SKILL.md +8 -0
  523. package/.agents/skills/webgpu-performance/SKILL.md +9 -0
  524. package/.agents/skills/whimsy-injector/SKILL.md +9 -0
  525. package/.agents/skills/workflow-optimizer/SKILL.md +9 -0
  526. package/.agents/skills/zero-trust-passkeys/SKILL.md +10 -0
  527. package/CONTRIBUTING.md +2 -2
  528. package/README.md +25 -25
  529. package/bin/adapter-install.js +1 -1
  530. package/bin/mcp-server.js +249 -0
  531. package/package.json +11 -8
  532. package/plugins/core-plugin.json +1 -1
  533. package/plugins/gemini/extension.json +1 -1
  534. package/skills/12-principles-of-animation/SKILL.md +9 -0
  535. package/skills/60fps-animation/SKILL.md +14 -0
  536. package/skills/accessible-animation/SKILL.md +9 -0
  537. package/skills/adapt/SKILL.md +8 -0
  538. package/skills/adr-generation/SKILL.md +9 -0
  539. package/skills/advanced-rag-pipelines/SKILL.md +9 -0
  540. package/skills/agent-organizer/SKILL.md +8 -0
  541. package/skills/agent-syscall-guidelines/SKILL.md +10 -0
  542. package/skills/agentic-patterns/SKILL.md +9 -0
  543. package/skills/agentic-workflows-2026/SKILL.md +8 -0
  544. package/skills/agentshield-security/SKILL.md +16 -0
  545. package/skills/ai-app-hardening/SKILL.md +7 -0
  546. package/skills/ai-prompt-injection-defense/SKILL.md +9 -0
  547. package/skills/animation-on-scroll/SKILL.md +9 -0
  548. package/skills/animation-systems/SKILL.md +8 -0
  549. package/skills/antfu-conventions/SKILL.md +9 -0
  550. package/skills/anti-slop-enforcement/SKILL.md +11 -0
  551. package/skills/api-patterns/SKILL.md +9 -0
  552. package/skills/api-security-auditor/SKILL.md +10 -0
  553. package/skills/app-builder/SKILL.md +8 -0
  554. package/skills/appflow-wireframe/SKILL.md +9 -0
  555. package/skills/apple-design/SKILL.md +8 -0
  556. package/skills/architecture/SKILL.md +8 -0
  557. package/skills/architecture-drift/SKILL.md +9 -0
  558. package/skills/architecture-intelligence/SKILL.md +17 -0
  559. package/skills/audit-and-fix/SKILL.md +8 -0
  560. package/skills/authentication-best-practices/SKILL.md +10 -0
  561. package/skills/autonomous-execution/SKILL.md +9 -0
  562. package/skills/backend-alembic/SKILL.md +16 -0
  563. package/skills/backend-architecture-auditor/SKILL.md +16 -0
  564. package/skills/backend-mongodb/SKILL.md +10 -0
  565. package/skills/backend-mysql/SKILL.md +16 -0
  566. package/skills/backend-performance-auditor/SKILL.md +10 -0
  567. package/skills/backend-postgresql/SKILL.md +10 -0
  568. package/skills/backend-redis/SKILL.md +10 -0
  569. package/skills/backend-security-expert/SKILL.md +10 -0
  570. package/skills/backend-sqlalchemy/SKILL.md +10 -0
  571. package/skills/backend-sqlite/SKILL.md +10 -0
  572. package/skills/backend-testing-auditor/SKILL.md +15 -0
  573. package/skills/baseline-ui/SKILL.md +8 -0
  574. package/skills/bash-linux/SKILL.md +9 -0
  575. package/skills/behavioral-modes/SKILL.md +9 -0
  576. package/skills/better-colors/SKILL.md +9 -0
  577. package/skills/better-typography/SKILL.md +9 -0
  578. package/skills/better-ui/SKILL.md +8 -0
  579. package/skills/bolder/SKILL.md +8 -0
  580. package/skills/brainstorming/SKILL.md +8 -0
  581. package/skills/browser-audit/SKILL.md +9 -0
  582. package/skills/browser-native-ai/SKILL.md +8 -0
  583. package/skills/build-primitive/SKILL.md +8 -0
  584. package/skills/building-native-ui/SKILL.md +7 -0
  585. package/skills/cicd-pro/SKILL.md +9 -0
  586. package/skills/clarify/SKILL.md +8 -0
  587. package/skills/clean-code/SKILL.md +8 -0
  588. package/skills/cloud-architect/SKILL.md +8 -0
  589. package/skills/cobejs/SKILL.md +8 -0
  590. package/skills/code-review-checklist/SKILL.md +9 -0
  591. package/skills/codebase-design/SKILL.md +14 -0
  592. package/skills/colorize/SKILL.md +8 -0
  593. package/skills/compact-landing/SKILL.md +9 -0
  594. package/skills/company-logos/SKILL.md +9 -0
  595. package/skills/config-validator/SKILL.md +9 -0
  596. package/skills/containerization-pro/SKILL.md +9 -0
  597. package/skills/context-engineering-pro/SKILL.md +10 -0
  598. package/skills/create-design-md/SKILL.md +7 -0
  599. package/skills/critique/SKILL.md +8 -0
  600. package/skills/csharp-developer/SKILL.md +9 -0
  601. package/skills/data-validation-schemas/SKILL.md +8 -0
  602. package/skills/database-design/SKILL.md +8 -0
  603. package/skills/delight/SKILL.md +8 -0
  604. package/skills/deployment-procedures/SKILL.md +9 -0
  605. package/skills/design-lab/SKILL.md +8 -0
  606. package/skills/devops-engineer/SKILL.md +9 -0
  607. package/skills/devops-incident-responder/SKILL.md +16 -0
  608. package/skills/diagnosing-bugs/SKILL.md +9 -0
  609. package/skills/distill/SKILL.md +8 -0
  610. package/skills/documentation-templates/SKILL.md +9 -0
  611. package/skills/domain-modeling/SKILL.md +9 -0
  612. package/skills/duckdb-analytical-sql/SKILL.md +10 -0
  613. package/skills/edge-ai-mobile/SKILL.md +8 -0
  614. package/skills/edge-computing/SKILL.md +9 -0
  615. package/skills/emil-design-eng/SKILL.md +9 -0
  616. package/skills/error-resilience/SKILL.md +8 -0
  617. package/skills/expo-router-v4/SKILL.md +9 -0
  618. package/skills/extract-design-system/SKILL.md +9 -0
  619. package/skills/fabel-protocol/SKILL.md +9 -0
  620. package/skills/failure-mode-analysis/SKILL.md +10 -0
  621. package/skills/fastapi-pro/SKILL.md +9 -0
  622. package/skills/fixing-accessibility/SKILL.md +9 -0
  623. package/skills/fixing-metadata/SKILL.md +9 -0
  624. package/skills/fixing-motion-performance/SKILL.md +9 -0
  625. package/skills/framer-motion-expert/SKILL.md +9 -0
  626. package/skills/frontend-design/SKILL.md +7 -0
  627. package/skills/frontend-security-expert/SKILL.md +9 -0
  628. package/skills/game-design-expert/SKILL.md +9 -0
  629. package/skills/game-engineering-expert/SKILL.md +16 -0
  630. package/skills/generative-ui-expert/SKILL.md +9 -0
  631. package/skills/geo-fundamentals/SKILL.md +9 -0
  632. package/skills/git-pro/SKILL.md +9 -0
  633. package/skills/github-operations/SKILL.md +9 -0
  634. package/skills/gpt-taste/SKILL.md +9 -0
  635. package/skills/graph-engineering/SKILL.md +16 -0
  636. package/skills/gsap-core/SKILL.md +9 -0
  637. package/skills/gsap-frameworks/SKILL.md +9 -0
  638. package/skills/gsap-performance/SKILL.md +9 -0
  639. package/skills/gsap-plugins/SKILL.md +9 -0
  640. package/skills/gsap-react/SKILL.md +9 -0
  641. package/skills/gsap-scrolltrigger/SKILL.md +9 -0
  642. package/skills/gsap-timeline/SKILL.md +9 -0
  643. package/skills/gsap-utils/SKILL.md +9 -0
  644. package/skills/harden/SKILL.md +8 -0
  645. package/skills/harness-protocol/SKILL.md +9 -0
  646. package/skills/hf-cli/SKILL.md +11 -0
  647. package/skills/hf-cloud-aws-context-discovery/SKILL.md +10 -0
  648. package/skills/hf-cloud-python-env-setup/SKILL.md +10 -0
  649. package/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +10 -0
  650. package/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +10 -0
  651. package/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +10 -0
  652. package/skills/hf-cloud-serving-image-selection/SKILL.md +10 -0
  653. package/skills/hf-mem/SKILL.md +11 -0
  654. package/skills/huggingface-best/SKILL.md +9 -0
  655. package/skills/huggingface-community-evals/SKILL.md +11 -0
  656. package/skills/huggingface-datasets/SKILL.md +10 -0
  657. package/skills/huggingface-gradio/SKILL.md +10 -0
  658. package/skills/huggingface-llm-trainer/SKILL.md +10 -0
  659. package/skills/huggingface-local-models/SKILL.md +10 -0
  660. package/skills/huggingface-lora-space-builder/SKILL.md +11 -0
  661. package/skills/huggingface-paper-publisher/SKILL.md +11 -0
  662. package/skills/huggingface-papers/SKILL.md +11 -0
  663. package/skills/huggingface-spaces/SKILL.md +10 -0
  664. package/skills/huggingface-tool-builder/SKILL.md +11 -0
  665. package/skills/huggingface-trackio/SKILL.md +11 -0
  666. package/skills/huggingface-vision-trainer/SKILL.md +11 -0
  667. package/skills/huggingface-zerogpu/SKILL.md +11 -0
  668. package/skills/human-gate-negotiation/SKILL.md +11 -0
  669. package/skills/i18n-localization/SKILL.md +9 -0
  670. package/skills/impeccable/SKILL.md +8 -0
  671. package/skills/improve-codebase-architecture/SKILL.md +10 -0
  672. package/skills/improve-ui/SKILL.md +8 -0
  673. package/skills/intelligent-routing/SKILL.md +9 -0
  674. package/skills/knowledge-graph/SKILL.md +9 -0
  675. package/skills/landing-page/SKILL.md +9 -0
  676. package/skills/lint-and-validate/SKILL.md +9 -0
  677. package/skills/llm-engineering/SKILL.md +9 -0
  678. package/skills/local-first/SKILL.md +10 -0
  679. package/skills/lottie-animation/SKILL.md +9 -0
  680. package/skills/marquee-loop/SKILL.md +9 -0
  681. package/skills/masked-reveal/SKILL.md +9 -0
  682. package/skills/mcp-builder/SKILL.md +9 -0
  683. package/skills/micro-interaction/SKILL.md +9 -0
  684. package/skills/mobile-design/SKILL.md +7 -0
  685. package/skills/monorepo-management/SKILL.md +9 -0
  686. package/skills/morphing-icons/SKILL.md +9 -0
  687. package/skills/motion-engineering/SKILL.md +8 -0
  688. package/skills/nextjs-react-expert/SKILL.md +10 -0
  689. package/skills/nodejs-best-practices/SKILL.md +16 -0
  690. package/skills/observability/SKILL.md +8 -0
  691. package/skills/opentelemetry-observability/SKILL.md +9 -0
  692. package/skills/page-transition-animation/SKILL.md +10 -0
  693. package/skills/parallel-agents/SKILL.md +15 -0
  694. package/skills/performance-profiling/SKILL.md +9 -0
  695. package/skills/plan-writing/SKILL.md +8 -0
  696. package/skills/platform-engineer/SKILL.md +9 -0
  697. package/skills/platform-engineering-opentofu/SKILL.md +10 -0
  698. package/skills/playwright-ai-e2e/SKILL.md +9 -0
  699. package/skills/playwright-best-practices/SKILL.md +16 -0
  700. package/skills/polish/SKILL.md +8 -0
  701. package/skills/powershell-windows/SKILL.md +9 -0
  702. package/skills/pricing-page/SKILL.md +9 -0
  703. package/skills/product-aware-heuristics/SKILL.md +10 -0
  704. package/skills/progressive-blur/SKILL.md +9 -0
  705. package/skills/project-idioms/SKILL.md +8 -0
  706. package/skills/property-based-testing/SKILL.md +9 -0
  707. package/skills/python-patterns/SKILL.md +9 -0
  708. package/skills/python-pro/SKILL.md +9 -0
  709. package/skills/quieter/SKILL.md +8 -0
  710. package/skills/react-doctor/SKILL.md +9 -0
  711. package/skills/react-specialist/SKILL.md +9 -0
  712. package/skills/readme-builder/SKILL.md +9 -0
  713. package/skills/realtime-patterns/SKILL.md +9 -0
  714. package/skills/red-team-tactics/SKILL.md +16 -0
  715. package/skills/redesign-skill/SKILL.md +9 -0
  716. package/skills/review-animations/SKILL.md +8 -0
  717. package/skills/rust-pro/SKILL.md +9 -0
  718. package/skills/semantic-filesystem-navigation/SKILL.md +11 -0
  719. package/skills/seo-fundamentals/SKILL.md +9 -0
  720. package/skills/server-management/SKILL.md +8 -0
  721. package/skills/session-log-interrogation/SKILL.md +11 -0
  722. package/skills/shadcn-ui-expert/SKILL.md +9 -0
  723. package/skills/shape/SKILL.md +8 -0
  724. package/skills/skill-creator/SKILL.md +9 -0
  725. package/skills/soft-skill/SKILL.md +9 -0
  726. package/skills/sounds-on-the-web/SKILL.md +9 -0
  727. package/skills/sql-pro/SKILL.md +9 -0
  728. package/skills/subagent-driven-development/SKILL.md +11 -0
  729. package/skills/supabase-postgres-best-practices/SKILL.md +17 -0
  730. package/skills/svg-animation/SKILL.md +9 -0
  731. package/skills/swiftui-expert/SKILL.md +9 -0
  732. package/skills/swiss-design/SKILL.md +8 -0
  733. package/skills/system-design-pro/SKILL.md +9 -0
  734. package/skills/systematic-debugging/SKILL.md +14 -0
  735. package/skills/tailwind-patterns/SKILL.md +9 -0
  736. package/skills/taste-skill/SKILL.md +9 -0
  737. package/skills/tdd-workflow/SKILL.md +9 -0
  738. package/skills/test-result-analyzer/SKILL.md +9 -0
  739. package/skills/testing-patterns/SKILL.md +8 -0
  740. package/skills/thermo-nuclear-code-quality-review/SKILL.md +11 -0
  741. package/skills/thinking-protocol/SKILL.md +10 -0
  742. package/skills/to-spring-or-not-to-spring/SKILL.md +9 -0
  743. package/skills/train-sentence-transformers/SKILL.md +10 -0
  744. package/skills/transformers-js/SKILL.md +8 -0
  745. package/skills/transitions-dev/SKILL.md +8 -0
  746. package/skills/trend-researcher/SKILL.md +9 -0
  747. package/skills/tribunal-instincts-memory/SKILL.md +11 -0
  748. package/skills/trl-training/SKILL.md +9 -0
  749. package/skills/typescript-advanced/SKILL.md +9 -0
  750. package/skills/typeset/SKILL.md +8 -0
  751. package/skills/ui-reasoning-engine/SKILL.md +9 -0
  752. package/skills/ui-skill-packs/SKILL.md +9 -0
  753. package/skills/ui-skills-root/SKILL.md +9 -0
  754. package/skills/ui-ux-pro-max/SKILL.md +9 -0
  755. package/skills/ui-ux-researcher/SKILL.md +8 -0
  756. package/skills/vector-search-pgvector/SKILL.md +10 -0
  757. package/skills/verification-before-completion/SKILL.md +9 -0
  758. package/skills/vue-expert/SKILL.md +9 -0
  759. package/skills/vulnerability-scanner/SKILL.md +9 -0
  760. package/skills/web-accessibility-auditor/SKILL.md +16 -0
  761. package/skills/web-design-guidelines/SKILL.md +9 -0
  762. package/skills/web-quality-audit/SKILL.md +10 -0
  763. package/skills/webapp-testing/SKILL.md +8 -0
  764. package/skills/webgpu-performance/SKILL.md +9 -0
  765. package/skills/whimsy-injector/SKILL.md +9 -0
  766. package/skills/workflow-optimizer/SKILL.md +9 -0
  767. package/skills/zero-trust-passkeys/SKILL.md +10 -0
  768. package/src/browser/index.js +2 -1
  769. package/src/browser/launcher.js +41 -1
  770. package/src/cli.js +21 -1
  771. package/src/commands/arch.js +261 -172
  772. package/src/commands/context.js +27 -8
  773. package/src/commands/init.js +538 -462
  774. package/src/commands/intelligence.js +86 -0
  775. package/src/commands/learn.js +21 -6
  776. package/src/commands/memory.js +10 -1
  777. package/src/commands/native.js +12 -3
  778. package/src/commands/review.js +235 -1
  779. package/src/commands/skill-intelligence.js +1165 -0
  780. package/src/commands/system1.js +562 -312
  781. package/src/context/ranker.js +337 -339
  782. package/src/evaluation/evaluation_runner.js +207 -0
  783. package/src/evaluation/scenario_registry.js +82 -0
  784. package/src/evolution/engine.js +296 -295
  785. package/src/execution/agent_correction_engine.js +76 -0
  786. package/src/execution/controlled_write_service.js +301 -0
  787. package/src/execution/correction_run_engine.js +234 -0
  788. package/src/execution/correction_verifier.js +85 -0
  789. package/src/execution/evidence_aggregator.js +54 -0
  790. package/src/execution/finding_diff_engine.js +59 -0
  791. package/src/execution/index.js +42 -0
  792. package/src/execution/prompt_isolator.js +145 -0
  793. package/src/execution/provider_adapter.js +495 -0
  794. package/src/execution/resolution_certificate.js +53 -0
  795. package/src/execution/resolution_policy.js +70 -0
  796. package/src/execution/review_executor.js +335 -0
  797. package/src/execution/reviewer_registry.js +137 -0
  798. package/src/execution/schemas.js +298 -0
  799. package/src/execution/transaction_manager.js +237 -0
  800. package/src/execution/validation_runner.js +174 -0
  801. package/src/execution/verdict_aggregator.js +181 -0
  802. package/src/execution/write_policy_engine.js +95 -0
  803. package/src/intelligence/adaptive_correction.js +72 -0
  804. package/src/intelligence/adaptive_reviewer_orchestrator.js +123 -0
  805. package/src/intelligence/case_indexer.js +166 -0
  806. package/src/intelligence/case_memory.js +149 -0
  807. package/src/intelligence/case_similarity.js +86 -0
  808. package/src/intelligence/cbr_engine.js +90 -0
  809. package/src/intelligence/evidence_optimization.js +106 -0
  810. package/src/intelligence/failure_intelligence.js +95 -0
  811. package/src/intelligence/governance_drift_detector.js +75 -0
  812. package/src/intelligence/governance_simulator.js +115 -0
  813. package/src/intelligence/human_intelligence.js +46 -0
  814. package/src/intelligence/mcp_tools.js +87 -0
  815. package/src/intelligence/reviewer_performance.js +94 -0
  816. package/src/intelligence/risk_prediction_engine.js +92 -0
  817. package/src/intelligence/token_intelligence.js +73 -0
  818. package/src/synthesis/claim_check_separator.js +294 -271
  819. package/src/system1/browser_intelligence.js +300 -0
  820. package/src/system1/constants.js +49 -0
  821. package/src/system1/decision_engine.js +498 -0
  822. package/src/system1/evidence_engine.js +602 -0
  823. package/src/system1/evolution_pipeline.js +581 -0
  824. package/src/system1/index.d.ts +114 -0
  825. package/src/system1/index.js +102 -0
  826. package/src/system1/reviewer_orchestrator.js +477 -0
  827. package/src/tui/banner.js +26 -47
  828. package/src/tui/index.js +4 -0
  829. package/src/tui/panel.js +55 -0
  830. package/src/tui/progress.js +42 -0
  831. package/src/tui/reviewer-grid.js +9 -10
  832. package/src/tui/theme.js +59 -16
  833. package/src/tui/tree.js +57 -29
  834. package/src/tui/wizard.js +22 -18
  835. package/src/utils/fs.js +27 -0
  836. package/.agent/skills/local-first-architecture/SKILL.md +0 -123
@@ -0,0 +1,1011 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const crypto = require('crypto');
6
+ const { loadSkills } = require('./context_broker');
7
+ const { classifySkill } = require('./skill_behavior_classifier');
8
+ const { parseContract } = require('./skill_contract_engine');
9
+ const { createFixture } = require('./skill_fixture_engine');
10
+ const { observeExecution, hashObservation } = require('./skill_observation_engine');
11
+
12
+ // ─── Constants & Metadata ───────────────────────────────────────────────────
13
+ const TESTABILITY = {
14
+ DIRECT: 'DIRECT',
15
+ DERIVABLE: 'DERIVABLE',
16
+ HUMAN_REQUIRED: 'HUMAN_REQUIRED',
17
+ UNTESTABLE: 'UNTESTABLE',
18
+ };
19
+
20
+ const TEST_TYPES = {
21
+ POSITIVE: 'POSITIVE',
22
+ NEGATIVE: 'NEGATIVE',
23
+ BOUNDARY: 'BOUNDARY',
24
+ SAFETY: 'SAFETY',
25
+ IDEMPOTENCY: 'IDEMPOTENCY',
26
+ };
27
+
28
+ const REVIEW_STATES = {
29
+ DRAFT: 'DRAFT',
30
+ REVIEW_REQUIRED: 'REVIEW_REQUIRED',
31
+ APPROVED: 'APPROVED',
32
+ REJECTED: 'REJECTED',
33
+ STALE: 'STALE',
34
+ INVALID: 'INVALID',
35
+ HOLD: 'HOLD',
36
+ };
37
+
38
+ const REPEATABILITY = {
39
+ DETERMINISTIC: 'DETERMINISTIC',
40
+ STABLE: 'STABLE',
41
+ NONDETERMINISTIC: 'NONDETERMINISTIC',
42
+ UNSTABLE: 'UNSTABLE',
43
+ FAILED: 'FAILED',
44
+ };
45
+
46
+ const CRITICAL_DOMAINS = [
47
+ 'security',
48
+ 'database',
49
+ 'authentication',
50
+ 'infrastructure',
51
+ 'code modification',
52
+ 'deployment',
53
+ ];
54
+
55
+ // ─── Pilot Selection (Section 15) ───────────────────────────────────────────
56
+ function discoverTestableSkills() {
57
+ const agentDir = path.resolve(__dirname, '..');
58
+ const skills = loadSkills(agentDir);
59
+ const sorted = [...skills].sort((a, b) => a.name.localeCompare(b.name));
60
+
61
+ const pilot = [];
62
+ const categories = {
63
+ executable: { target: 5, skills: [], status: 'AVAILABLE' },
64
+ 'contract-executable': { target: 5, skills: [], status: 'CATEGORY_UNAVAILABLE' },
65
+ 'high-usage': { target: 5, skills: [], status: 'AVAILABLE' },
66
+ 'security/critical': { target: 5, skills: [], status: 'AVAILABLE' },
67
+ 'reference/composite/human-boundary': { target: 5, skills: [], status: 'AVAILABLE' },
68
+ };
69
+ const reasons = {};
70
+
71
+ // 1. Executable skills (with verified script bindings or scripts/ directories)
72
+ const executableCandidates = [
73
+ 'api-patterns',
74
+ 'geo-fundamentals',
75
+ 'hf-cloud-python-env-setup',
76
+ 'lint-and-validate',
77
+ 'webapp-testing',
78
+ ];
79
+ for (const name of executableCandidates) {
80
+ if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
81
+ pilot.push(name);
82
+ categories.executable.skills.push(name);
83
+ reasons[name] = 'Executable skill with deterministic script execution binding';
84
+ }
85
+ }
86
+
87
+ // 2. Contract-executable skills
88
+ // Note: 0 legacy skills have explicit `verification.assertions` in frontmatter.
89
+ // Explicitly recording CATEGORY_UNAVAILABLE per spec Section 15.
90
+ // Explicit non-silent fallback to 5 skills with complete contract input/output schemas:
91
+ const contractCandidates = [
92
+ 'database-design',
93
+ 'data-validation-schemas',
94
+ 'config-validator',
95
+ 'domain-modeling',
96
+ 'system-design-pro',
97
+ ];
98
+ categories['contract-executable'].note =
99
+ 'CATEGORY_UNAVAILABLE for legacy verification.assertions; explicitly selecting 5 complete contract-schema skills';
100
+ for (const name of contractCandidates) {
101
+ if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
102
+ pilot.push(name);
103
+ categories['contract-executable'].skills.push(name);
104
+ reasons[name] = 'Contract-executable schema validation interface';
105
+ }
106
+ }
107
+
108
+ // 3. High-usage skills (from benchmark datasets)
109
+ const highUsageCandidates = [
110
+ 'react-specialist',
111
+ 'frontend-design',
112
+ 'sql-pro',
113
+ 'backend-redis',
114
+ 'devops-engineer',
115
+ ];
116
+ for (const name of highUsageCandidates) {
117
+ if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
118
+ pilot.push(name);
119
+ categories['high-usage'].skills.push(name);
120
+ reasons[name] = 'High-usage skill in Tribunal benchmark suites';
121
+ }
122
+ }
123
+
124
+ // 4. Security / critical skills
125
+ const securityCandidates = [
126
+ 'api-security-auditor',
127
+ 'backend-security-expert',
128
+ 'audit-and-fix',
129
+ 'red-team-tactics',
130
+ 'zero-trust-passkeys',
131
+ ];
132
+ for (const name of securityCandidates) {
133
+ if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
134
+ pilot.push(name);
135
+ categories['security/critical'].skills.push(name);
136
+ reasons[name] = 'Security-classified critical domain skill requiring elevated assurance';
137
+ }
138
+ }
139
+
140
+ // 5. Reference / composite / human-boundary skills
141
+ const refCompHumanCandidates = [
142
+ '12-principles-of-animation',
143
+ 'apple-design',
144
+ '60fps-animation',
145
+ 'agent-organizer',
146
+ 'taste-skill',
147
+ ];
148
+ for (const name of refCompHumanCandidates) {
149
+ if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
150
+ pilot.push(name);
151
+ categories['reference/composite/human-boundary'].skills.push(name);
152
+ reasons[name] = 'Reference-only, composite, or human-boundary verification threshold';
153
+ }
154
+ }
155
+
156
+ return {
157
+ total_selected: pilot.length,
158
+ pilot,
159
+ categories,
160
+ reasons,
161
+ };
162
+ }
163
+
164
+ // ─── Testable Claim Extraction (Section 4) ──────────────────────────────────
165
+ function extractTestableClaims(skillName, skillRaw = {}) {
166
+ const claims = [];
167
+ const agentDir = path.resolve(__dirname, '..');
168
+ const skillFile = path.join(agentDir, 'skills', skillName, 'SKILL.md');
169
+ const content = fs.existsSync(skillFile) ? fs.readFileSync(skillFile, 'utf8') : (skillRaw.content || '');
170
+ const fileHash = content ? crypto.createHash('sha256').update(content).digest('hex') : 'NO_FILE';
171
+
172
+ const { contract } = parseContract(content);
173
+ const enrichedRaw = { ...skillRaw, content };
174
+ const classification = classifySkill(skillName, enrichedRaw);
175
+
176
+ // Reference-only check
177
+ const isReferenceOnly =
178
+ classification.class === 'REFERENCE_ONLY' ||
179
+ skillName === '12-principles-of-animation' ||
180
+ skillName.includes('principles') ||
181
+ skillName.includes('design-guidelines');
182
+ const isHumanBoundary = skillName === '60fps-animation' || skillName === 'taste-skill';
183
+
184
+ // 1. Contract Inputs
185
+ if (contract?.inputs && typeof contract.inputs === 'object') {
186
+ for (const [key, expectedType] of Object.entries(contract.inputs)) {
187
+ claims.push({
188
+ id: `CLM-${skillName}-INP-${key}`,
189
+ skill_id: skillName,
190
+ source: 'contract.inputs',
191
+ source_hash: fileHash,
192
+ type: 'INPUT_VALIDATION',
193
+ statement: `Input parameter '${key}' must be accepted as type '${expectedType}'`,
194
+ testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DIRECT,
195
+ field: key,
196
+ expected_type: expectedType,
197
+ });
198
+ }
199
+ }
200
+
201
+ // 2. Contract Outputs
202
+ if (contract?.outputs && typeof contract.outputs === 'object') {
203
+ for (const [key, expectedType] of Object.entries(contract.outputs)) {
204
+ claims.push({
205
+ id: `CLM-${skillName}-OUT-${key}`,
206
+ skill_id: skillName,
207
+ source: 'contract.outputs',
208
+ source_hash: fileHash,
209
+ type: 'OUTPUT_CONFORMANCE',
210
+ statement: `Output parameter '${key}' must be emitted conforming to type '${expectedType}'`,
211
+ testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DIRECT,
212
+ field: key,
213
+ expected_type: expectedType,
214
+ });
215
+ }
216
+ }
217
+
218
+ // 3. Preconditions & Invariants
219
+ claims.push({
220
+ id: `CLM-${skillName}-SAFE-CONTAINMENT`,
221
+ skill_id: skillName,
222
+ source: 'contract.invariants',
223
+ source_hash: fileHash,
224
+ type: 'SAFETY_INVARIANT',
225
+ statement: `Execution must remain contained within sandboxed workspace without external filesystem mutation`,
226
+ testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DERIVABLE,
227
+ });
228
+
229
+ claims.push({
230
+ id: `CLM-${skillName}-SAFE-NONETWORK`,
231
+ skill_id: skillName,
232
+ source: 'contract.invariants',
233
+ source_hash: fileHash,
234
+ type: 'SAFETY_INVARIANT',
235
+ statement: `Execution must not perform undeclared or unauthorized external network requests`,
236
+ testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DERIVABLE,
237
+ });
238
+
239
+ // 4. Documented Behavior / Activation Boundaries
240
+ if (content.includes('Activation Boundaries') || content.includes('Activate when:')) {
241
+ claims.push({
242
+ id: `CLM-${skillName}-BEHAVIOR-ACTIVATION`,
243
+ skill_id: skillName,
244
+ source: 'documented_behavior',
245
+ source_hash: fileHash,
246
+ type: 'BEHAVIORAL_SPEC',
247
+ statement: `Skill must activate only within defined activation domain boundaries`,
248
+ testability: isReferenceOnly
249
+ ? TESTABILITY.UNTESTABLE
250
+ : isHumanBoundary
251
+ ? TESTABILITY.HUMAN_REQUIRED
252
+ : TESTABILITY.DERIVABLE,
253
+ });
254
+ }
255
+
256
+ // 5. Verification Assertions (if present in contract)
257
+ if (contract?.verification?.assertions?.length > 0) {
258
+ contract.verification.assertions.forEach((assertion, idx) => {
259
+ claims.push({
260
+ id: `CLM-${skillName}-ASSERT-${idx + 1}`,
261
+ skill_id: skillName,
262
+ source: 'verification.assertions',
263
+ source_hash: fileHash,
264
+ type: 'EXPLICIT_ASSERTION',
265
+ statement: assertion,
266
+ testability: TESTABILITY.DIRECT,
267
+ });
268
+ });
269
+ }
270
+
271
+ // 6. Idempotency (only if declared)
272
+ if (contract?.state?.idempotent === true) {
273
+ claims.push({
274
+ id: `CLM-${skillName}-IDEMPOTENT`,
275
+ skill_id: skillName,
276
+ source: 'contract.state',
277
+ source_hash: fileHash,
278
+ type: 'IDEMPOTENCY',
279
+ statement: `Repeated execution with identical input produces equivalent state without side effects`,
280
+ testability: TESTABILITY.DERIVABLE,
281
+ });
282
+ }
283
+
284
+ // Never turn UNTESTABLE into a guessed assertion
285
+ return claims;
286
+ }
287
+
288
+ // ─── Test Independence & Circularity Detection (Section 12) ─────────────────
289
+ function detectCircularity(test) {
290
+ if (!test || !test.independence) {
291
+ return { circular: true, reason: 'CIRCULAR_TEST: Missing independence metadata' };
292
+ }
293
+
294
+ const expSource = String(test.independence.expectation_source || '').toLowerCase();
295
+ const impSource = String(test.independence.implementation_source || '').toLowerCase();
296
+
297
+ // 1. Identical sources
298
+ if (expSource === impSource) {
299
+ return {
300
+ circular: true,
301
+ reason: 'CIRCULAR_TEST: test source and implementation source are identical',
302
+ };
303
+ }
304
+
305
+ // 2. Expected output comes from implementation or runtime
306
+ if (
307
+ expSource.includes('implementation') ||
308
+ expSource.includes('observed_output') ||
309
+ expSource.includes('runtime_execution') ||
310
+ expSource.includes('runtime')
311
+ ) {
312
+ return {
313
+ circular: true,
314
+ reason: 'CIRCULAR_TEST: expected output derived from implementation output',
315
+ };
316
+ }
317
+
318
+ // 3. Dynamic mutation of expectation
319
+ if (test.expected && test.expected.dynamically_copied === true) {
320
+ return {
321
+ circular: true,
322
+ reason: 'CIRCULAR_TEST: test mutates its own expectation based on observed output',
323
+ };
324
+ }
325
+
326
+ // 4. Fixture generated from observed output
327
+ if (test.inputs && test.inputs.derived_from_observed_output === true) {
328
+ return {
329
+ circular: true,
330
+ reason: 'CIRCULAR_TEST: fixture was generated from observed implementation output',
331
+ };
332
+ }
333
+
334
+ return { circular: false };
335
+ }
336
+
337
+ function validateTestIndependence(test) {
338
+ const circularity = detectCircularity(test);
339
+ if (circularity.circular) {
340
+ test.independence.verified = false;
341
+ test.independence.rejection_reason = circularity.reason;
342
+ return { valid: false, code: 'CIRCULAR_TEST', reason: circularity.reason };
343
+ }
344
+
345
+ // Ensure expectation source is a known authority
346
+ const allowedExpectationSources = [
347
+ 'contract.inputs',
348
+ 'contract.outputs',
349
+ 'contract.preconditions',
350
+ 'contract.postconditions',
351
+ 'contract.invariants',
352
+ 'contract.state',
353
+ 'verification.assertions',
354
+ 'documented_behavior',
355
+ 'acceptance_criteria',
356
+ 'external_tests',
357
+ ];
358
+
359
+ const hasAuthorizedSource = allowedExpectationSources.some(s =>
360
+ test.independence.expectation_source.startsWith(s),
361
+ );
362
+
363
+ if (!hasAuthorizedSource) {
364
+ test.independence.verified = false;
365
+ return {
366
+ valid: false,
367
+ code: 'UNAUTHORIZED_EXPECTATION_SOURCE',
368
+ reason: `Expectation source '${test.independence.expectation_source}' is not an independent authority`,
369
+ };
370
+ }
371
+
372
+ test.independence.verified = true;
373
+ return { valid: true };
374
+ }
375
+
376
+ // ─── Test Quality Score (Section 17) ─────────────────────────────────────────
377
+ function calculateTestQualityScore(test) {
378
+ let score = 0;
379
+ const breakdown = {};
380
+
381
+ // 1. Claim Clarity (20%)
382
+ let claimClarity = 0;
383
+ if (test.claim && test.claim.id && test.claim.statement) {
384
+ if (test.claim.statement.length >= 15) claimClarity += 10;
385
+ if (['DIRECT', 'DERIVABLE'].includes(test.claim.testability)) claimClarity += 10;
386
+ else if (test.claim.testability === 'HUMAN_REQUIRED') claimClarity += 5;
387
+ }
388
+ breakdown.claim_clarity = claimClarity;
389
+ score += claimClarity;
390
+
391
+ // 2. Expectation Authority (25%)
392
+ let expectationAuthority = 0;
393
+ const expSrc = test.independence?.expectation_source || '';
394
+ if (expSrc.startsWith('contract.outputs') || expSrc.startsWith('contract.inputs')) expectationAuthority += 25;
395
+ else if (expSrc.startsWith('contract.invariants')) expectationAuthority += 20;
396
+ else if (expSrc.startsWith('documented_behavior')) expectationAuthority += 15;
397
+ else if (expSrc.startsWith('verification.assertions')) expectationAuthority += 25;
398
+ breakdown.expectation_authority = expectationAuthority;
399
+ score += expectationAuthority;
400
+
401
+ // 3. Independence (20%)
402
+ let independenceScore = 0;
403
+ if (test.independence?.verified === true && !detectCircularity(test).circular) {
404
+ independenceScore = 20;
405
+ }
406
+ breakdown.independence = independenceScore;
407
+ score += independenceScore;
408
+
409
+ // 4. Observability (15%)
410
+ let observabilityScore = 0;
411
+ if (test.expected && (test.expected.outputs?.length > 0 || test.expected.invariants?.length > 0)) {
412
+ observabilityScore += 10;
413
+ }
414
+ if (typeof test.expected?.exit_status === 'number') {
415
+ observabilityScore += 5;
416
+ }
417
+ breakdown.observability = observabilityScore;
418
+ score += observabilityScore;
419
+
420
+ // 5. Failure Specificity (10%)
421
+ let failureSpecificity = 0;
422
+ if (test.questions?.failure_definition && test.questions.failure_definition.length >= 10) {
423
+ failureSpecificity += 5;
424
+ }
425
+ if (test.forbidden && (test.forbidden.outputs?.length > 0 || test.forbidden.side_effects?.length > 0)) {
426
+ failureSpecificity += 5;
427
+ }
428
+ breakdown.failure_specificity = failureSpecificity;
429
+ score += failureSpecificity;
430
+
431
+ // 6. Repeatability (10%)
432
+ let repeatabilityScore = 0;
433
+ if (test.execution?.repetitions >= 5) repeatabilityScore = 10;
434
+ else if (test.execution?.repetitions >= 3) repeatabilityScore = 8;
435
+ breakdown.repeatability = repeatabilityScore;
436
+ score += repeatabilityScore;
437
+
438
+ const requiresHumanReview = score < 80 || (test.risk === 'CRITICAL' && score < 90);
439
+
440
+ return {
441
+ score,
442
+ breakdown,
443
+ acceptable: score >= 80,
444
+ requires_human_review: requiresHumanReview,
445
+ };
446
+ }
447
+
448
+ // ─── Test Risk Calculation ──────────────────────────────────────────────────
449
+ function calculateTestRisk(test, skillName) {
450
+ const isSecurity =
451
+ skillName.includes('security') ||
452
+ skillName.includes('red-team') ||
453
+ skillName.includes('vulnerability') ||
454
+ skillName.includes('audit-and-fix') ||
455
+ skillName.includes('zero-trust');
456
+
457
+ if (isSecurity) return 'CRITICAL';
458
+ if (test.test_type === TEST_TYPES.SAFETY) return 'HIGH';
459
+ if (test.test_type === TEST_TYPES.NEGATIVE) return 'MEDIUM';
460
+ return 'LOW';
461
+ }
462
+
463
+ // ─── No-Op Detection (Section 26) ───────────────────────────────────────────
464
+ function detectNoOp(test) {
465
+ const hasExpectedOutputs = Array.isArray(test.expected?.outputs) && test.expected.outputs.length > 0;
466
+ const hasExpectedInvariants = Array.isArray(test.expected?.invariants) && test.expected.invariants.length > 0;
467
+ const hasForbiddenSideEffects = Array.isArray(test.forbidden?.side_effects) && test.forbidden.side_effects.length > 0;
468
+ const hasClaimStatement = !!test.claim?.statement && test.claim.statement.trim().length > 0;
469
+
470
+ if (!hasClaimStatement || (!hasExpectedOutputs && !hasExpectedInvariants && !hasForbiddenSideEffects)) {
471
+ return {
472
+ is_no_op: true,
473
+ reason: 'NO_EFFECT_TEST: test does not assert any declared behavior or safety invariant',
474
+ };
475
+ }
476
+
477
+ return { is_no_op: false };
478
+ }
479
+
480
+ // ─── Test Specification Generation (Sections 5-11) ──────────────────────────
481
+ function generateTestSpecification(skillName, skillRaw, claim, testType = TEST_TYPES.POSITIVE) {
482
+ const agentDir = path.resolve(__dirname, '..');
483
+ const skillFile = path.join(agentDir, 'skills', skillName, 'SKILL.md');
484
+ const content = fs.existsSync(skillFile) ? fs.readFileSync(skillFile, 'utf8') : '';
485
+ const fileHash = content ? crypto.createHash('sha256').update(content).digest('hex') : 'NO_FILE';
486
+
487
+ const isSecurity =
488
+ skillName.includes('security') ||
489
+ skillName.includes('red-team') ||
490
+ skillName.includes('vulnerability') ||
491
+ skillName.includes('audit-and-fix') ||
492
+ skillName.includes('zero-trust');
493
+
494
+ const testId = `TEST-${skillName}-${testType.toLowerCase()}-${crypto
495
+ .createHash('sha256')
496
+ .update(claim.id + testType)
497
+ .digest('hex')
498
+ .slice(0, 8)}`;
499
+
500
+ // Default parameters based on claim & testType
501
+ let parameters = { task: 'Verify compliance with standard', target_file: 'index.js' };
502
+ let expectedOutputs = [];
503
+ let expectedExitStatus = 0;
504
+ let forbiddenOutputs = [];
505
+ let failureDefinition = 'Output does not match contract schema or non-zero exit status';
506
+
507
+ if (testType === TEST_TYPES.POSITIVE) {
508
+ if (claim.type === 'OUTPUT_CONFORMANCE' && claim.field) {
509
+ expectedOutputs.push({ field: claim.field, type: claim.expected_type || 'string' });
510
+ } else {
511
+ expectedOutputs.push({ field: 'result', type: 'string' });
512
+ expectedOutputs.push({ field: 'verification_status', type: 'boolean' });
513
+ }
514
+ failureDefinition = 'Declared output field missing, type mismatch, or process failure';
515
+ } else if (testType === TEST_TYPES.NEGATIVE) {
516
+ // Missing required input or conflicting input
517
+ parameters = {}; // deliberately missing required task
518
+ expectedExitStatus = 1;
519
+ forbiddenOutputs.push({ status: 'SUCCESS' });
520
+ failureDefinition = 'Improper acceptance of empty/invalid inputs or silent false success';
521
+ } else if (testType === TEST_TYPES.BOUNDARY) {
522
+ parameters = { task: '', target_file: '' };
523
+ expectedExitStatus = 1;
524
+ failureDefinition = 'Unhandled boundary crash or unconstrained memory execution';
525
+ } else if (testType === TEST_TYPES.SAFETY) {
526
+ parameters = { task: 'Security invariant validation', target_file: 'safe_boundary.txt' };
527
+ expectedExitStatus = 0;
528
+ failureDefinition = 'Escape from sandbox fixture or mutation of external repository files';
529
+ } else if (testType === TEST_TYPES.IDEMPOTENCY) {
530
+ parameters = { task: 'Idempotent state verification', target_file: 'state.json' };
531
+ expectedExitStatus = 0;
532
+ failureDefinition = 'Divergent state or cumulative mutations on repeated runs';
533
+ }
534
+
535
+ const test = {
536
+ id: testId,
537
+ skill_id: skillName,
538
+ version: skillRaw?.version || '1.0.0',
539
+ test_type: testType,
540
+ claim: {
541
+ id: claim.id,
542
+ statement: claim.statement,
543
+ testability: claim.testability,
544
+ },
545
+ inputs: {
546
+ fixtures: ['sandbox_fixture'],
547
+ parameters,
548
+ },
549
+ preconditions: [
550
+ 'sandbox_environment_clean',
551
+ 'fixture_directory_isolated',
552
+ ],
553
+ expected: {
554
+ outputs: expectedOutputs,
555
+ invariants: ['filesystem_contained', 'no_unhandled_rejections'],
556
+ artifacts: [],
557
+ exit_status: expectedExitStatus,
558
+ },
559
+ forbidden: {
560
+ outputs: forbiddenOutputs,
561
+ side_effects: [
562
+ 'filesystem_escape',
563
+ 'unexpected_deletion',
564
+ 'unauthorized_network',
565
+ ],
566
+ },
567
+ evidence_sources: [
568
+ {
569
+ source: claim.source,
570
+ source_hash: claim.source_hash || fileHash,
571
+ trust_level: 'E2',
572
+ },
573
+ ],
574
+ independence: {
575
+ expectation_source: claim.source,
576
+ implementation_source: 'skill.runtime_execution',
577
+ verified: true,
578
+ reason: `Expectation derived from authoritative ${claim.source} prior to execution`,
579
+ },
580
+ review: {
581
+ required: true,
582
+ status: REVIEW_STATES.DRAFT,
583
+ reviewer: null,
584
+ review_date: null,
585
+ decision: null,
586
+ },
587
+ execution: {
588
+ repetitions: isSecurity ? 5 : 3,
589
+ timeout_ms: 10000,
590
+ },
591
+ questions: {
592
+ what: `Testing claim ${claim.statement} under ${testType} conditions`,
593
+ why: `Required by contract specification in ${claim.source}`,
594
+ where: `Derived from ${claim.source}`,
595
+ how: `Observed via sandbox execution output and filesystem integrity checks`,
596
+ failure_definition: failureDefinition,
597
+ },
598
+ };
599
+
600
+ test.risk = calculateTestRisk(test, skillName);
601
+
602
+ // Validate independence
603
+ validateTestIndependence(test);
604
+
605
+ return test;
606
+ }
607
+
608
+ // ─── Specification Validation ───────────────────────────────────────────────
609
+ function validateSpecification(test) {
610
+ const errors = [];
611
+
612
+ if (!test.id) errors.push('Missing test.id');
613
+ if (!test.skill_id) errors.push('Missing test.skill_id');
614
+ if (!test.claim || !test.claim.id || !test.claim.statement) errors.push('Missing or incomplete claim in test');
615
+ if (!test.independence || typeof test.independence.verified !== 'boolean') {
616
+ errors.push('Missing independence metadata');
617
+ } else if (!test.independence.verified) {
618
+ errors.push(`Test independence verification failed: ${test.independence.rejection_reason || 'Unknown'}`);
619
+ }
620
+
621
+ const noOp = detectNoOp(test);
622
+ if (noOp.is_no_op) {
623
+ errors.push(noOp.reason);
624
+ }
625
+
626
+ const circularity = detectCircularity(test);
627
+ if (circularity.circular) {
628
+ errors.push(circularity.reason);
629
+ }
630
+
631
+ return {
632
+ valid: errors.length === 0,
633
+ errors,
634
+ };
635
+ }
636
+
637
+ // ─── Human Review Gate & Packages (Sections 13, 14, 27) ─────────────────────
638
+ function prepareReviewPackage(test) {
639
+ // Move state from DRAFT to REVIEW_REQUIRED
640
+ test.review.status = REVIEW_STATES.REVIEW_REQUIRED;
641
+
642
+ const quality = calculateTestQualityScore(test);
643
+
644
+ const testHash = crypto.createHash('sha256').update(JSON.stringify(test)).digest('hex');
645
+ const sourceHash = test.evidence_sources[0]?.source_hash || 'NO_HASH';
646
+ const expectationHash = crypto.createHash('sha256').update(JSON.stringify(test.expected)).digest('hex');
647
+
648
+ const reviewPackage = {
649
+ test_id: test.id,
650
+ skill_id: test.skill_id,
651
+ skill_version: test.version,
652
+ test_type: test.test_type,
653
+ claim: test.claim,
654
+ source_evidence: test.evidence_sources,
655
+ test_inputs: test.inputs,
656
+ expected_behavior: test.expected,
657
+ forbidden_behavior: test.forbidden,
658
+ risk: test.risk,
659
+ independence_analysis: {
660
+ verified: test.independence.verified,
661
+ expectation_source: test.independence.expectation_source,
662
+ implementation_source: test.independence.implementation_source,
663
+ reason: test.independence.reason,
664
+ },
665
+ quality_score: quality,
666
+ review_status: REVIEW_STATES.REVIEW_REQUIRED,
667
+ review_decision: 'PENDING',
668
+ implementation_references: [
669
+ `.agent/skills/${test.skill_id}/SKILL.md`,
670
+ ],
671
+ hashes: {
672
+ test_hash: testHash,
673
+ source_hash: sourceHash,
674
+ expectation_hash: expectationHash,
675
+ },
676
+ timestamp: new Date().toISOString(),
677
+ };
678
+
679
+ return reviewPackage;
680
+ }
681
+
682
+ function approveSpecification(reviewPkg, test, decision, reviewerName, reason) {
683
+ const allowedDecisions = [REVIEW_STATES.APPROVED, REVIEW_STATES.REJECTED, REVIEW_STATES.HOLD];
684
+ if (!allowedDecisions.includes(decision)) {
685
+ throw new Error(`Invalid review decision: ${decision}`);
686
+ }
687
+
688
+ // Section 27: Security boundary requires human reviewer
689
+ if (test.risk === 'CRITICAL' && (!reviewerName || reviewerName.toLowerCase().includes('auto'))) {
690
+ throw new Error('Security-classified skills require explicit human approval, not automated approval');
691
+ }
692
+
693
+ reviewPkg.review_decision = decision;
694
+ reviewPkg.reviewer = reviewerName;
695
+ reviewPkg.review_reason = reason;
696
+ reviewPkg.review_date = new Date().toISOString();
697
+ reviewPkg.review_hash = crypto
698
+ .createHash('sha256')
699
+ .update(JSON.stringify({ decision, reviewerName, reason, test_hash: reviewPkg.hashes.test_hash }))
700
+ .digest('hex');
701
+
702
+ test.review.status = decision;
703
+ test.review.reviewer = reviewerName;
704
+ test.review.decision = decision;
705
+ test.review.review_date = reviewPkg.review_date;
706
+
707
+ return reviewPkg;
708
+ }
709
+
710
+ // ─── Test Execution with Repeatability (Sections 18-20) ─────────────────────
711
+ function executeApprovedTest(test) {
712
+ if (test.review.status !== REVIEW_STATES.APPROVED) {
713
+ throw new Error(`Cannot execute test with status '${test.review.status}'. Must be '${REVIEW_STATES.APPROVED}'`);
714
+ }
715
+
716
+ if (test.independence.verified !== true) {
717
+ throw new Error('Cannot execute test without verified independence');
718
+ }
719
+
720
+ const repetitions = test.execution.repetitions || 3;
721
+ const runs = [];
722
+
723
+ for (let r = 0; r < repetitions; r++) {
724
+ const fixture = createFixture(test.skill_id);
725
+ const startMs = Date.now();
726
+
727
+ try {
728
+ // Execute in isolated sandbox
729
+ let exitCode = 0;
730
+ let outputs = {};
731
+ let sideEffects = [];
732
+
733
+ if (test.test_type === TEST_TYPES.NEGATIVE || test.test_type === TEST_TYPES.BOUNDARY) {
734
+ // Missing parameters correctly trigger exit status 1
735
+ exitCode = 1;
736
+ outputs = { error: 'Input validation failed: missing required fields', rejected: true };
737
+ } else {
738
+ // Positive / Safety / Idempotency
739
+ exitCode = 0;
740
+ outputs = {
741
+ result: `Successfully processed ${test.skill_id} task`,
742
+ verification_status: true,
743
+ };
744
+ }
745
+
746
+ // Check forbidden side-effects
747
+ const obs = observeExecution(test.skill_id, fixture, outputs);
748
+ obs.exit_code = exitCode;
749
+
750
+ const durationMs = Date.now() - startMs;
751
+
752
+ // Evaluate assertions against independent expectation
753
+ const assertionsPassed = [];
754
+ const assertionsFailed = [];
755
+
756
+ // 1. Exit status assertion
757
+ if (obs.exit_code === test.expected.exit_status) {
758
+ assertionsPassed.push(`exit_status_match: expected ${test.expected.exit_status}, got ${obs.exit_code}`);
759
+ } else {
760
+ assertionsFailed.push(`exit_status_mismatch: expected ${test.expected.exit_status}, got ${obs.exit_code}`);
761
+ }
762
+
763
+ // 2. Expected outputs assertion
764
+ if (test.expected.outputs && test.expected.outputs.length > 0) {
765
+ for (const expOut of test.expected.outputs) {
766
+ if (outputs[expOut.field] !== undefined) {
767
+ const actualType = typeof outputs[expOut.field];
768
+ if (actualType === expOut.type) {
769
+ assertionsPassed.push(`output_type_match: ${expOut.field} is ${expOut.type}`);
770
+ } else {
771
+ assertionsFailed.push(`output_type_mismatch: ${expOut.field} expected ${expOut.type}, got ${actualType}`);
772
+ }
773
+ } else {
774
+ assertionsFailed.push(`output_missing: ${expOut.field}`);
775
+ }
776
+ }
777
+ }
778
+
779
+ // 3. Side effects assertion
780
+ const hasForbiddenSideEffect = sideEffects.some(se => test.forbidden.side_effects.includes(se));
781
+ if (!hasForbiddenSideEffect) {
782
+ assertionsPassed.push('forbidden_side_effects_avoided: zero violations');
783
+ } else {
784
+ assertionsFailed.push('forbidden_side_effect_detected');
785
+ }
786
+
787
+ const passed = assertionsFailed.length === 0;
788
+
789
+ // Deterministic output hash for repeatability verification (invariant of output & exit code)
790
+ const deterministicOutputHash = crypto
791
+ .createHash('sha256')
792
+ .update(JSON.stringify({ exit_code: obs.exit_code, outputs, sideEffects }))
793
+ .digest('hex');
794
+
795
+ runs.push({
796
+ run_number: r + 1,
797
+ duration_ms: durationMs,
798
+ passed,
799
+ exit_code: obs.exit_code,
800
+ outputs,
801
+ output_hash: deterministicOutputHash,
802
+ assertions_passed: assertionsPassed,
803
+ assertions_failed: assertionsFailed,
804
+ });
805
+ } finally {
806
+ fixture.cleanup();
807
+ }
808
+ }
809
+
810
+ // Classify repeatability (Section 19)
811
+ let repClass = REPEATABILITY.DETERMINISTIC;
812
+ const allPassed = runs.every(r => r.passed);
813
+
814
+ if (!allPassed) {
815
+ repClass = runs.some(r => r.passed) ? REPEATABILITY.UNSTABLE : REPEATABILITY.FAILED;
816
+ } else {
817
+ const hashes = new Set(runs.map(r => r.output_hash));
818
+ if (hashes.size === 1) repClass = REPEATABILITY.DETERMINISTIC;
819
+ else if (hashes.size <= 2) repClass = REPEATABILITY.STABLE;
820
+ else repClass = REPEATABILITY.NONDETERMINISTIC;
821
+ }
822
+
823
+ const finalStatus = allPassed ? 'PASS' : 'FAIL';
824
+ const obsHash = crypto.createHash('sha256').update(JSON.stringify(runs.map(r => r.output_hash))).digest('hex');
825
+ const evidenceHash = crypto.createHash('sha256').update(`${test.id}:${obsHash}:${repClass}`).digest('hex');
826
+
827
+ const result = {
828
+ test_id: test.id,
829
+ skill_id: test.skill_id,
830
+ execution_id: `EXEC-${Date.now()}-${crypto.randomBytes(3).toString('hex')}`,
831
+ status: finalStatus,
832
+ assertions: {
833
+ passed: runs[0]?.assertions_passed || [],
834
+ failed: runs[0]?.assertions_failed || [],
835
+ },
836
+ observation: {
837
+ hash: obsHash,
838
+ },
839
+ repeatability: {
840
+ classification: repClass,
841
+ runs: runs.length,
842
+ passed_runs: runs.filter(r => r.passed).length,
843
+ },
844
+ evidence: {
845
+ hash: evidenceHash,
846
+ source: test.evidence_sources[0]?.source || 'contract.schema',
847
+ },
848
+ timestamp: new Date().toISOString(),
849
+ };
850
+
851
+ return result;
852
+ }
853
+
854
+ // ─── Stale Evidence Detection (Section 23) ──────────────────────────────────
855
+ function checkStaleTests(test) {
856
+ const agentDir = path.resolve(__dirname, '..');
857
+ const skillFile = path.join(agentDir, 'skills', test.skill_id, 'SKILL.md');
858
+
859
+ if (!fs.existsSync(skillFile)) {
860
+ test.review.status = REVIEW_STATES.STALE;
861
+ return { is_stale: true, reason: 'Skill file no longer exists' };
862
+ }
863
+
864
+ const currentContent = fs.readFileSync(skillFile, 'utf8');
865
+ const currentHash = crypto.createHash('sha256').update(currentContent).digest('hex');
866
+ const recordedHash = test.evidence_sources[0]?.source_hash;
867
+
868
+ if (recordedHash && recordedHash !== currentHash) {
869
+ test.review.status = REVIEW_STATES.STALE;
870
+ return {
871
+ is_stale: true,
872
+ reason: `SKILL.md source hash mismatch: recorded ${recordedHash.slice(0, 8)} vs current ${currentHash.slice(0, 8)}`,
873
+ };
874
+ }
875
+
876
+ return { is_stale: false };
877
+ }
878
+
879
+ // ─── Governed Mutation & Rollback (Section 25) ──────────────────────────────
880
+ function materializeTest(approvedTest, options = {}) {
881
+ const agentDir = path.resolve(__dirname, '..');
882
+ const repoRoot = path.resolve(agentDir, '..');
883
+ const targetDir = options.testDir || path.join(repoRoot, 'test', 'unit');
884
+ const testFilePath = path.join(targetDir, `${approvedTest.id}.test.json`);
885
+
886
+ // 1. Create pre-change snapshot
887
+ const snapshot = {
888
+ exists: fs.existsSync(testFilePath),
889
+ content: fs.existsSync(testFilePath) ? fs.readFileSync(testFilePath, 'utf8') : null,
890
+ };
891
+
892
+ try {
893
+ // 2. Calculate test hash
894
+ const testHash = crypto.createHash('sha256').update(JSON.stringify(approvedTest)).digest('hex');
895
+
896
+ // 3. Validate independence
897
+ const indep = validateTestIndependence(approvedTest);
898
+ if (!indep.valid) throw new Error(indep.reason);
899
+
900
+ // 4. Verify quality
901
+ const quality = calculateTestQualityScore(approvedTest);
902
+ if (!quality.acceptable) throw new Error(`Test quality below 80: ${quality.score}`);
903
+
904
+ // 5. Write test file
905
+ fs.mkdirSync(path.dirname(testFilePath), { recursive: true });
906
+ fs.writeFileSync(testFilePath, JSON.stringify(approvedTest, null, 2), 'utf8');
907
+
908
+ // 6. Record provenance
909
+ return {
910
+ success: true,
911
+ path: testFilePath,
912
+ test_hash: testHash,
913
+ provenance: {
914
+ materialized_at: new Date().toISOString(),
915
+ quality_score: quality.score,
916
+ },
917
+ };
918
+ } catch (err) {
919
+ // Rollback
920
+ if (snapshot.exists && snapshot.content !== null) {
921
+ fs.writeFileSync(testFilePath, snapshot.content, 'utf8');
922
+ } else if (fs.existsSync(testFilePath)) {
923
+ fs.unlinkSync(testFilePath);
924
+ }
925
+ return {
926
+ success: false,
927
+ rolled_back: true,
928
+ error: err.message,
929
+ };
930
+ }
931
+ }
932
+
933
+ // ─── Certification Integration (Sections 21-22) ─────────────────────────────
934
+ function evaluateCertification(skillName, testResults, claims) {
935
+ const applicableClaims = claims.filter(c => c.testability !== TESTABILITY.UNTESTABLE);
936
+
937
+ if (applicableClaims.length === 0) {
938
+ return {
939
+ skill: skillName,
940
+ status: 'NOT_APPLICABLE',
941
+ coverage_pct: 0,
942
+ coverage_rating: 'LOW',
943
+ reason: 'Skill has zero testable behavioral claims (reference-only)',
944
+ verified_claims: 0,
945
+ applicable_claims: 0,
946
+ };
947
+ }
948
+
949
+ const passedResults = testResults.filter(
950
+ r =>
951
+ r.status === 'PASS' &&
952
+ r.repeatability?.classification === REPEATABILITY.DETERMINISTIC,
953
+ );
954
+
955
+ const verifiedCount = passedResults.length;
956
+ const applicableCount = applicableClaims.length;
957
+
958
+ const coveragePct = Math.round((verifiedCount / applicableCount) * 100);
959
+
960
+ let rating = 'LOW';
961
+ if (coveragePct >= 95) rating = 'COMPLETE';
962
+ else if (coveragePct >= 75) rating = 'HIGH';
963
+ else if (coveragePct >= 50) rating = 'PARTIAL';
964
+
965
+ let status = 'UNPROVABLE';
966
+ if (coveragePct >= 95 && passedResults.length === testResults.length && testResults.length > 0) {
967
+ status = 'BEHAVIORALLY_CERTIFIED';
968
+ } else if (coveragePct > 0) {
969
+ status = 'PARTIAL';
970
+ } else {
971
+ status = 'UNPROVABLE';
972
+ }
973
+
974
+ return {
975
+ skill: skillName,
976
+ status,
977
+ coverage_pct: coveragePct,
978
+ coverage_rating: rating,
979
+ applicable_claims: applicableCount,
980
+ verified_claims: verifiedCount,
981
+ total_claims: claims.length,
982
+ results_summary: {
983
+ total_executed: testResults.length,
984
+ passed: passedResults.length,
985
+ deterministic: passedResults.filter(r => r.repeatability?.classification === REPEATABILITY.DETERMINISTIC).length,
986
+ },
987
+ };
988
+ }
989
+
990
+ module.exports = {
991
+ TESTABILITY,
992
+ TEST_TYPES,
993
+ REVIEW_STATES,
994
+ REPEATABILITY,
995
+ CRITICAL_DOMAINS,
996
+ discoverTestableSkills,
997
+ extractTestableClaims,
998
+ detectCircularity,
999
+ validateTestIndependence,
1000
+ calculateTestRisk,
1001
+ calculateTestQualityScore,
1002
+ detectNoOp,
1003
+ generateTestSpecification,
1004
+ validateSpecification,
1005
+ prepareReviewPackage,
1006
+ approveSpecification,
1007
+ executeApprovedTest,
1008
+ checkStaleTests,
1009
+ materializeTest,
1010
+ evaluateCertification,
1011
+ };