code-ai-installer 4.0.0 → 4.0.1-b

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 (471) hide show
  1. package/README.md +83 -67
  2. package/dist/index.js +2 -0
  3. package/dist/mcp/audit_ledger.d.ts +12 -0
  4. package/dist/mcp/audit_ledger.js +82 -0
  5. package/dist/mcp/cli.js +7 -1
  6. package/dist/mcp/config.d.ts +23 -0
  7. package/dist/mcp/config.js +44 -6
  8. package/dist/mcp/index.d.ts +1 -2
  9. package/dist/mcp/index.js +1 -2
  10. package/dist/mcp/paths.d.ts +20 -2
  11. package/dist/mcp/paths.js +29 -5
  12. package/dist/mcp/proposal_dedup.d.ts +32 -0
  13. package/dist/mcp/proposal_dedup.js +102 -0
  14. package/dist/mcp/proposal_store.d.ts +18 -0
  15. package/dist/mcp/proposal_store.js +74 -0
  16. package/dist/mcp/scorecard.d.ts +140 -0
  17. package/dist/mcp/scorecard.js +103 -0
  18. package/dist/mcp/skill_invocations.d.ts +15 -0
  19. package/dist/mcp/skill_invocations.js +28 -0
  20. package/dist/mcp/task_state.d.ts +77 -2
  21. package/dist/mcp/tools/_subprocess.d.ts +16 -0
  22. package/dist/mcp/tools/_subprocess.js +56 -0
  23. package/dist/mcp/tools/advance_gate.js +2 -2
  24. package/dist/mcp/tools/aggregate_run_metrics.d.ts +19 -0
  25. package/dist/mcp/tools/aggregate_run_metrics.js +139 -0
  26. package/dist/mcp/tools/apply_diff.d.ts +2 -0
  27. package/dist/mcp/tools/apply_diff.js +29 -0
  28. package/dist/mcp/tools/audit_bilocale_parity.d.ts +2 -0
  29. package/dist/mcp/tools/audit_bilocale_parity.js +146 -0
  30. package/dist/mcp/tools/audit_budget_compliance.d.ts +35 -0
  31. package/dist/mcp/tools/audit_budget_compliance.js +172 -0
  32. package/dist/mcp/tools/build.d.ts +2 -0
  33. package/dist/mcp/tools/build.js +47 -0
  34. package/dist/mcp/tools/check_lint.d.ts +2 -0
  35. package/dist/mcp/tools/check_lint.js +23 -0
  36. package/dist/mcp/tools/classify_gate.js +2 -2
  37. package/dist/mcp/tools/current_gate.js +2 -2
  38. package/dist/mcp/tools/dependency_supply_chain.d.ts +2 -0
  39. package/dist/mcp/tools/dependency_supply_chain.js +59 -0
  40. package/dist/mcp/tools/docker_compose.d.ts +2 -0
  41. package/dist/mcp/tools/docker_compose.js +24 -0
  42. package/dist/mcp/tools/e2e_playwright.d.ts +2 -0
  43. package/dist/mcp/tools/e2e_playwright.js +88 -0
  44. package/dist/mcp/tools/get_skill.js +17 -0
  45. package/dist/mcp/tools/git_commit.d.ts +2 -0
  46. package/dist/mcp/tools/git_commit.js +30 -0
  47. package/dist/mcp/tools/list_proposals.d.ts +6 -0
  48. package/dist/mcp/tools/list_proposals.js +16 -0
  49. package/dist/mcp/tools/list_skills.js +9 -1
  50. package/dist/mcp/tools/load_role.d.ts +3 -4
  51. package/dist/mcp/tools/load_role.js +11 -13
  52. package/dist/mcp/tools/propose_change.d.ts +8 -0
  53. package/dist/mcp/tools/propose_change.js +36 -0
  54. package/dist/mcp/tools/record_decision.js +25 -25
  55. package/dist/mcp/tools/review_proposal.d.ts +17 -0
  56. package/dist/mcp/tools/review_proposal.js +99 -0
  57. package/dist/mcp/tools/run_drift_audit.d.ts +11 -0
  58. package/dist/mcp/tools/run_drift_audit.js +79 -0
  59. package/dist/mcp/tools/run_tests.d.ts +2 -0
  60. package/dist/mcp/tools/run_tests.js +92 -0
  61. package/dist/mcp/tools/sign_off.js +14 -2
  62. package/dist/mcp/tools/stubs.js +30 -9
  63. package/dist/mcp/tools/verify_claim.js +33 -6
  64. package/dist/mcp_setup.d.ts +14 -3
  65. package/dist/mcp_setup.js +15 -6
  66. package/dist/shared/frontmatter.d.ts +44 -2
  67. package/dist/shared/frontmatter.js +54 -6
  68. package/dist/shared/index.d.ts +0 -5
  69. package/dist/shared/index.js +0 -5
  70. package/dist/shared/persona.d.ts +2 -2
  71. package/dist/shared/persona.js +1 -1
  72. package/dist/shared/pipeline.d.ts +46 -1
  73. package/dist/shared/tools.d.ts +1382 -16
  74. package/dist/shared/tools.js +229 -0
  75. package/dist/shared/vocabulary.d.ts +99 -4
  76. package/dist/shared/vocabulary.js +94 -5
  77. package/domains/analytics/.agents/skills/ansoff-matrix/SKILL.md +316 -300
  78. package/domains/analytics/.agents/skills/bcg-matrix/SKILL.md +345 -329
  79. package/domains/analytics/.agents/skills/blue-ocean-strategy/SKILL.md +432 -416
  80. package/domains/analytics/.agents/skills/board/SKILL.md +22 -0
  81. package/domains/analytics/.agents/skills/cohort-analysis/SKILL.md +338 -322
  82. package/domains/analytics/.agents/skills/competitive-analysis/SKILL.md +413 -395
  83. package/domains/analytics/.agents/skills/customer-journey-mapping/SKILL.md +347 -331
  84. package/domains/analytics/.agents/skills/gates/SKILL.md +388 -366
  85. package/domains/analytics/.agents/skills/handoff/SKILL.md +402 -380
  86. package/domains/analytics/.agents/skills/html-pdf-report/SKILL.md +21 -289
  87. package/domains/analytics/.agents/skills/html-pdf-report-reference/SKILL.md +325 -0
  88. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
  89. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
  90. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
  91. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
  92. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
  93. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
  94. package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/skill.yaml +23 -0
  95. package/domains/analytics/.agents/skills/icp-buyer-persona/SKILL.md +407 -390
  96. package/domains/analytics/.agents/skills/jtbd-analysis/SKILL.md +357 -341
  97. package/domains/analytics/.agents/skills/karpathy-guidelines/SKILL.md +32 -0
  98. package/domains/analytics/.agents/skills/pest-analysis/SKILL.md +324 -305
  99. package/domains/analytics/.agents/skills/porters-five-forces/SKILL.md +377 -361
  100. package/domains/analytics/.agents/skills/report-design/SKILL.md +416 -398
  101. package/domains/analytics/.agents/skills/rfm-analysis/SKILL.md +330 -314
  102. package/domains/analytics/.agents/skills/session-prompt-generator/SKILL.md +400 -378
  103. package/domains/analytics/.agents/skills/swot-analysis/SKILL.md +340 -324
  104. package/domains/analytics/.agents/skills/tam-sam-som/SKILL.md +329 -312
  105. package/domains/analytics/.agents/skills/trend-analysis/SKILL.md +347 -331
  106. package/domains/analytics/.agents/skills/unit-economics/SKILL.md +430 -413
  107. package/domains/analytics/.agents/skills/value-chain-analysis/SKILL.md +346 -330
  108. package/domains/analytics/.agents/skills/web-research/SKILL.md +323 -308
  109. package/domains/analytics/AGENTS.md +1 -0
  110. package/domains/analytics/agents/auditor.md +76 -0
  111. package/domains/analytics/agents/conductor.md +11 -0
  112. package/domains/analytics/agents/data_analyst.md +11 -0
  113. package/domains/analytics/agents/designer.md +11 -0
  114. package/domains/analytics/agents/interviewer.md +11 -0
  115. package/domains/analytics/agents/layouter.md +11 -0
  116. package/domains/analytics/agents/mediator.md +11 -0
  117. package/domains/analytics/agents/researcher.md +11 -0
  118. package/domains/analytics/agents/strategist.md +11 -0
  119. package/domains/analytics/locales/en/.agents/skills/ansoff-matrix/SKILL.md +316 -300
  120. package/domains/analytics/locales/en/.agents/skills/bcg-matrix/SKILL.md +345 -329
  121. package/domains/analytics/locales/en/.agents/skills/blue-ocean-strategy/SKILL.md +432 -416
  122. package/domains/analytics/locales/en/.agents/skills/board/SKILL.md +22 -0
  123. package/domains/analytics/locales/en/.agents/skills/cohort-analysis/SKILL.md +338 -322
  124. package/domains/analytics/locales/en/.agents/skills/competitive-analysis/SKILL.md +413 -395
  125. package/domains/analytics/locales/en/.agents/skills/customer-journey-mapping/SKILL.md +347 -331
  126. package/domains/analytics/locales/en/.agents/skills/gates/SKILL.md +388 -366
  127. package/domains/analytics/locales/en/.agents/skills/handoff/SKILL.md +402 -380
  128. package/domains/analytics/locales/en/.agents/skills/html-pdf-report/SKILL.md +21 -289
  129. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/SKILL.md +325 -0
  130. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
  131. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
  132. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
  133. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
  134. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
  135. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
  136. package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/skill.yaml +29 -0
  137. package/domains/analytics/locales/en/.agents/skills/icp-buyer-persona/SKILL.md +407 -390
  138. package/domains/analytics/locales/en/.agents/skills/jtbd-analysis/SKILL.md +357 -341
  139. package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +32 -0
  140. package/domains/analytics/locales/en/.agents/skills/pest-analysis/SKILL.md +324 -305
  141. package/domains/analytics/locales/en/.agents/skills/porters-five-forces/SKILL.md +377 -361
  142. package/domains/analytics/locales/en/.agents/skills/report-design/SKILL.md +416 -398
  143. package/domains/analytics/locales/en/.agents/skills/rfm-analysis/SKILL.md +330 -314
  144. package/domains/analytics/locales/en/.agents/skills/session-prompt-generator/SKILL.md +400 -378
  145. package/domains/analytics/locales/en/.agents/skills/swot-analysis/SKILL.md +340 -324
  146. package/domains/analytics/locales/en/.agents/skills/tam-sam-som/SKILL.md +329 -312
  147. package/domains/analytics/locales/en/.agents/skills/trend-analysis/SKILL.md +347 -331
  148. package/domains/analytics/locales/en/.agents/skills/unit-economics/SKILL.md +430 -413
  149. package/domains/analytics/locales/en/.agents/skills/value-chain-analysis/SKILL.md +366 -350
  150. package/domains/analytics/locales/en/.agents/skills/web-research/SKILL.md +324 -309
  151. package/domains/analytics/locales/en/AGENTS.md +1 -0
  152. package/domains/analytics/locales/en/agents/auditor.md +76 -0
  153. package/domains/analytics/locales/en/agents/conductor.md +27 -0
  154. package/domains/analytics/locales/en/agents/data_analyst.md +29 -0
  155. package/domains/analytics/locales/en/agents/designer.md +27 -0
  156. package/domains/analytics/locales/en/agents/interviewer.md +11 -0
  157. package/domains/analytics/locales/en/agents/layouter.md +11 -0
  158. package/domains/analytics/locales/en/agents/mediator.md +11 -0
  159. package/domains/analytics/locales/en/agents/researcher.md +11 -0
  160. package/domains/analytics/locales/en/agents/strategist.md +11 -0
  161. package/domains/analytics/persona/persona-base.md +94 -0
  162. package/domains/analytics/pipeline.yaml +102 -0
  163. package/domains/content/.agents/skills/audience-analysis/SKILL.md +15 -0
  164. package/domains/content/.agents/skills/board/SKILL.md +20 -0
  165. package/domains/content/.agents/skills/brand-compliance/SKILL.md +15 -0
  166. package/domains/content/.agents/skills/brand-guidelines/SKILL.md +17 -0
  167. package/domains/content/.agents/skills/competitor-content-analysis/SKILL.md +15 -0
  168. package/domains/content/.agents/skills/content-brief/SKILL.md +15 -0
  169. package/domains/content/.agents/skills/content-calendar/SKILL.md +15 -0
  170. package/domains/content/.agents/skills/content-release-gate/SKILL.md +15 -0
  171. package/domains/content/.agents/skills/content-review-checklist/SKILL.md +15 -0
  172. package/domains/content/.agents/skills/cta-optimization/SKILL.md +15 -0
  173. package/domains/content/.agents/skills/data-storytelling/SKILL.md +15 -0
  174. package/domains/content/.agents/skills/email-copywriting/SKILL.md +15 -0
  175. package/domains/content/.agents/skills/email-engagement-tiers/SKILL.md +15 -0
  176. package/domains/content/.agents/skills/fact-checking/SKILL.md +15 -0
  177. package/domains/content/.agents/skills/gates/SKILL.md +20 -0
  178. package/domains/content/.agents/skills/google-stitch-content/SKILL.md +15 -0
  179. package/domains/content/.agents/skills/handoff/SKILL.md +24 -0
  180. package/domains/content/.agents/skills/headline-formulas/SKILL.md +15 -0
  181. package/domains/content/.agents/skills/image-prompt-engineering/SKILL.md +15 -0
  182. package/domains/content/.agents/skills/karpathy-guidelines/SKILL.md +28 -0
  183. package/domains/content/.agents/skills/mailerlite-email-ops/SKILL.md +15 -0
  184. package/domains/content/.agents/skills/marketing-psychology/SKILL.md +15 -0
  185. package/domains/content/.agents/skills/moodboard/SKILL.md +15 -0
  186. package/domains/content/.agents/skills/platform-compliance/SKILL.md +15 -0
  187. package/domains/content/.agents/skills/platform-strategy/SKILL.md +15 -0
  188. package/domains/content/.agents/skills/platform-visual-specs/SKILL.md +15 -0
  189. package/domains/content/.agents/skills/readability-scoring/SKILL.md +15 -0
  190. package/domains/content/.agents/skills/seo-copywriting/SKILL.md +15 -0
  191. package/domains/content/.agents/skills/social-media-formats/SKILL.md +15 -0
  192. package/domains/content/.agents/skills/source-verification/SKILL.md +15 -0
  193. package/domains/content/.agents/skills/storytelling-framework/SKILL.md +15 -0
  194. package/domains/content/.agents/skills/tone-of-voice/SKILL.md +15 -0
  195. package/domains/content/.agents/skills/topic-research/SKILL.md +15 -0
  196. package/domains/content/.agents/skills/trend-research/SKILL.md +15 -0
  197. package/domains/content/.agents/skills/visual-brief/SKILL.md +15 -0
  198. package/domains/content/AGENTS.md +4 -0
  199. package/domains/content/agents/auditor.md +76 -0
  200. package/domains/content/agents/conductor.md +11 -0
  201. package/domains/content/agents/copywriter.md +11 -0
  202. package/domains/content/agents/researcher.md +11 -0
  203. package/domains/content/agents/reviewer.md +11 -0
  204. package/domains/content/agents/strategist.md +11 -0
  205. package/domains/content/agents/visual_concept.md +11 -0
  206. package/domains/content/locales/en/.agents/skills/audience-analysis/SKILL.md +15 -0
  207. package/domains/content/locales/en/.agents/skills/board/SKILL.md +20 -0
  208. package/domains/content/locales/en/.agents/skills/brand-compliance/SKILL.md +15 -0
  209. package/domains/content/locales/en/.agents/skills/brand-guidelines/SKILL.md +17 -0
  210. package/domains/content/locales/en/.agents/skills/competitor-content-analysis/SKILL.md +15 -0
  211. package/domains/content/locales/en/.agents/skills/content-brief/SKILL.md +15 -0
  212. package/domains/content/locales/en/.agents/skills/content-calendar/SKILL.md +15 -0
  213. package/domains/content/locales/en/.agents/skills/content-release-gate/SKILL.md +15 -0
  214. package/domains/content/locales/en/.agents/skills/content-review-checklist/SKILL.md +15 -0
  215. package/domains/content/locales/en/.agents/skills/cta-optimization/SKILL.md +15 -0
  216. package/domains/content/locales/en/.agents/skills/data-storytelling/SKILL.md +15 -0
  217. package/domains/content/locales/en/.agents/skills/email-copywriting/SKILL.md +15 -0
  218. package/domains/content/locales/en/.agents/skills/email-engagement-tiers/SKILL.md +15 -0
  219. package/domains/content/locales/en/.agents/skills/fact-checking/SKILL.md +15 -0
  220. package/domains/content/locales/en/.agents/skills/gates/SKILL.md +20 -0
  221. package/domains/content/locales/en/.agents/skills/google-stitch-content/SKILL.md +15 -0
  222. package/domains/content/locales/en/.agents/skills/handoff/SKILL.md +24 -0
  223. package/domains/content/locales/en/.agents/skills/headline-formulas/SKILL.md +15 -0
  224. package/domains/content/locales/en/.agents/skills/image-prompt-engineering/SKILL.md +15 -0
  225. package/domains/content/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +30 -1
  226. package/domains/content/locales/en/.agents/skills/mailerlite-email-ops/SKILL.md +15 -0
  227. package/domains/content/locales/en/.agents/skills/marketing-psychology/SKILL.md +15 -0
  228. package/domains/content/locales/en/.agents/skills/moodboard/SKILL.md +15 -0
  229. package/domains/content/locales/en/.agents/skills/platform-compliance/SKILL.md +15 -0
  230. package/domains/content/locales/en/.agents/skills/platform-strategy/SKILL.md +15 -0
  231. package/domains/content/locales/en/.agents/skills/platform-visual-specs/SKILL.md +15 -0
  232. package/domains/content/locales/en/.agents/skills/readability-scoring/SKILL.md +15 -0
  233. package/domains/content/locales/en/.agents/skills/seo-copywriting/SKILL.md +15 -0
  234. package/domains/content/locales/en/.agents/skills/social-media-formats/SKILL.md +15 -0
  235. package/domains/content/locales/en/.agents/skills/source-verification/SKILL.md +15 -0
  236. package/domains/content/locales/en/.agents/skills/storytelling-framework/SKILL.md +15 -0
  237. package/domains/content/locales/en/.agents/skills/tone-of-voice/SKILL.md +15 -0
  238. package/domains/content/locales/en/.agents/skills/topic-research/SKILL.md +15 -0
  239. package/domains/content/locales/en/.agents/skills/trend-research/SKILL.md +15 -0
  240. package/domains/content/locales/en/.agents/skills/visual-brief/SKILL.md +15 -0
  241. package/domains/content/locales/en/AGENTS.md +4 -0
  242. package/domains/content/locales/en/agents/auditor.md +76 -0
  243. package/domains/content/locales/en/agents/conductor.md +12 -0
  244. package/domains/content/locales/en/agents/copywriter.md +12 -0
  245. package/domains/content/locales/en/agents/researcher.md +12 -0
  246. package/domains/content/locales/en/agents/reviewer.md +12 -0
  247. package/domains/content/locales/en/agents/strategist.md +12 -0
  248. package/domains/content/locales/en/agents/visual_concept.md +12 -0
  249. package/domains/content/persona/persona-base.md +94 -0
  250. package/domains/content/pipeline.yaml +96 -0
  251. package/domains/development/.agents/skills/adr-log/SKILL.md +1 -0
  252. package/domains/development/.agents/skills/design-intake/SKILL.md +0 -4
  253. package/domains/development/.agents/skills/karpathy-guidelines/SKILL.md +2 -1
  254. package/domains/development/.agents/skills/lava-flow-legacy-detection/SKILL.md +15 -1
  255. package/domains/development/.agents/skills/mcp-integration/SKILL.md +211 -0
  256. package/domains/development/.agents/skills/mcp-integration/agents/claude.json +22 -0
  257. package/domains/development/.agents/skills/mcp-integration/agents/copilot.json +22 -0
  258. package/domains/development/.agents/skills/mcp-integration/agents/gemini.json +22 -0
  259. package/domains/development/.agents/skills/mcp-integration/agents/kimi.yaml +18 -0
  260. package/domains/development/.agents/skills/mcp-integration/agents/openai.yaml +8 -0
  261. package/domains/development/.agents/skills/mcp-integration/agents/qwen.json +22 -0
  262. package/domains/development/.agents/skills/mcp-integration/agents/skill.yaml +26 -0
  263. package/domains/development/.agents/skills/qa-ui-a11y-smoke/SKILL.md +1 -1
  264. package/domains/development/.agents/skills/ui-a11y-smoke-review/SKILL.md +1 -1
  265. package/domains/development/AGENTS.md +1 -0
  266. package/domains/development/AGENTS.yaml +1 -0
  267. package/domains/development/agents/architect.md +13 -1
  268. package/domains/development/agents/auditor.md +74 -0
  269. package/domains/development/agents/conductor.md +14 -3
  270. package/domains/development/agents/devops.md +8 -9
  271. package/domains/development/agents/reviewer.md +12 -0
  272. package/domains/development/agents/senior_full_stack.md +12 -0
  273. package/domains/development/agents/tester.md +10 -16
  274. package/domains/development/locales/en/.agents/skills/adr-log/SKILL.md +1 -0
  275. package/domains/development/locales/en/.agents/skills/current-state-analysis/SKILL.md +256 -172
  276. package/domains/development/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +2 -1
  277. package/domains/development/locales/en/.agents/skills/lava-flow-legacy-detection/SKILL.md +15 -1
  278. package/domains/development/locales/en/.agents/skills/mcp-integration/SKILL.md +211 -0
  279. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/claude.json +22 -0
  280. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/copilot.json +22 -0
  281. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/gemini.json +22 -0
  282. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/kimi.yaml +18 -0
  283. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/openai.yaml +8 -0
  284. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/qwen.json +22 -0
  285. package/domains/development/locales/en/.agents/skills/mcp-integration/agents/skill.yaml +26 -0
  286. package/domains/development/locales/en/.agents/skills/qa-ui-a11y-smoke/SKILL.md +1 -1
  287. package/domains/development/locales/en/.agents/skills/ui-a11y-smoke-review/SKILL.md +1 -1
  288. package/domains/development/locales/en/AGENTS.md +5 -0
  289. package/domains/development/locales/en/AGENTS.yaml +1 -0
  290. package/domains/development/locales/en/agents/architect.md +13 -1
  291. package/domains/development/locales/en/agents/auditor.md +74 -0
  292. package/domains/development/locales/en/agents/conductor.md +14 -3
  293. package/domains/development/locales/en/agents/devops.md +8 -9
  294. package/domains/development/locales/en/agents/reviewer.md +12 -0
  295. package/domains/development/locales/en/agents/senior_full_stack.md +12 -0
  296. package/domains/development/locales/en/agents/tester.md +10 -16
  297. package/domains/development/persona/persona-base.md +94 -0
  298. package/domains/product/.agents/skills/aarrr-metrics/SKILL.md +451 -433
  299. package/domains/product/.agents/skills/ab-test-design/SKILL.md +428 -412
  300. package/domains/product/.agents/skills/acceptance-criteria/SKILL.md +422 -406
  301. package/domains/product/.agents/skills/assumption-mapping/SKILL.md +323 -307
  302. package/domains/product/.agents/skills/board/SKILL.md +24 -0
  303. package/domains/product/.agents/skills/design-brief/SKILL.md +433 -418
  304. package/domains/product/.agents/skills/epic-breakdown/SKILL.md +435 -420
  305. package/domains/product/.agents/skills/gates/SKILL.md +470 -446
  306. package/domains/product/.agents/skills/gtm-brief/SKILL.md +18 -321
  307. package/domains/product/.agents/skills/gtm-brief-reference/SKILL.md +348 -0
  308. package/domains/product/.agents/skills/gtm-brief-reference/agents/claude.json +17 -0
  309. package/domains/product/.agents/skills/gtm-brief-reference/agents/copilot.json +17 -0
  310. package/domains/product/.agents/skills/gtm-brief-reference/agents/gemini.json +17 -0
  311. package/domains/product/.agents/skills/gtm-brief-reference/agents/kimi.yaml +15 -0
  312. package/domains/product/.agents/skills/gtm-brief-reference/agents/openai.yaml +10 -0
  313. package/domains/product/.agents/skills/gtm-brief-reference/agents/qwen.json +17 -0
  314. package/domains/product/.agents/skills/gtm-brief-reference/agents/skill.yaml +22 -0
  315. package/domains/product/.agents/skills/handoff/SKILL.md +463 -439
  316. package/domains/product/.agents/skills/html-pdf-report/SKILL.md +21 -663
  317. package/domains/product/.agents/skills/html-pdf-report-reference/SKILL.md +699 -0
  318. package/domains/product/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
  319. package/domains/product/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
  320. package/domains/product/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
  321. package/domains/product/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
  322. package/domains/product/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
  323. package/domains/product/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
  324. package/domains/product/.agents/skills/html-pdf-report-reference/agents/skill.yaml +22 -0
  325. package/domains/product/.agents/skills/hypothesis-template/SKILL.md +484 -469
  326. package/domains/product/.agents/skills/jtbd-canvas/SKILL.md +274 -258
  327. package/domains/product/.agents/skills/kano-model/SKILL.md +370 -355
  328. package/domains/product/.agents/skills/karpathy-guidelines/SKILL.md +36 -0
  329. package/domains/product/.agents/skills/launch-checklist/SKILL.md +434 -419
  330. package/domains/product/.agents/skills/moscow-prioritization/SKILL.md +407 -392
  331. package/domains/product/.agents/skills/north-star-metric/SKILL.md +317 -301
  332. package/domains/product/.agents/skills/okr-framework/SKILL.md +299 -284
  333. package/domains/product/.agents/skills/opportunity-solution-tree/SKILL.md +472 -456
  334. package/domains/product/.agents/skills/prd-template/SKILL.md +18 -258
  335. package/domains/product/.agents/skills/prd-template-reference/SKILL.md +285 -0
  336. package/domains/product/.agents/skills/prd-template-reference/agents/claude.json +17 -0
  337. package/domains/product/.agents/skills/prd-template-reference/agents/copilot.json +17 -0
  338. package/domains/product/.agents/skills/prd-template-reference/agents/gemini.json +17 -0
  339. package/domains/product/.agents/skills/prd-template-reference/agents/kimi.yaml +16 -0
  340. package/domains/product/.agents/skills/prd-template-reference/agents/openai.yaml +10 -0
  341. package/domains/product/.agents/skills/prd-template-reference/agents/qwen.json +17 -0
  342. package/domains/product/.agents/skills/prd-template-reference/agents/skill.yaml +23 -0
  343. package/domains/product/.agents/skills/problem-statement/SKILL.md +327 -312
  344. package/domains/product/.agents/skills/product-roadmap/SKILL.md +320 -304
  345. package/domains/product/.agents/skills/product-vision/SKILL.md +409 -394
  346. package/domains/product/.agents/skills/release-notes/SKILL.md +18 -258
  347. package/domains/product/.agents/skills/release-notes-reference/SKILL.md +285 -0
  348. package/domains/product/.agents/skills/release-notes-reference/agents/claude.json +17 -0
  349. package/domains/product/.agents/skills/release-notes-reference/agents/copilot.json +17 -0
  350. package/domains/product/.agents/skills/release-notes-reference/agents/gemini.json +17 -0
  351. package/domains/product/.agents/skills/release-notes-reference/agents/kimi.yaml +15 -0
  352. package/domains/product/.agents/skills/release-notes-reference/agents/openai.yaml +10 -0
  353. package/domains/product/.agents/skills/release-notes-reference/agents/qwen.json +17 -0
  354. package/domains/product/.agents/skills/release-notes-reference/agents/skill.yaml +22 -0
  355. package/domains/product/.agents/skills/report-design/SKILL.md +17 -307
  356. package/domains/product/.agents/skills/report-design-reference/SKILL.md +331 -0
  357. package/domains/product/.agents/skills/report-design-reference/agents/claude.json +17 -0
  358. package/domains/product/.agents/skills/report-design-reference/agents/copilot.json +17 -0
  359. package/domains/product/.agents/skills/report-design-reference/agents/gemini.json +17 -0
  360. package/domains/product/.agents/skills/report-design-reference/agents/kimi.yaml +15 -0
  361. package/domains/product/.agents/skills/report-design-reference/agents/openai.yaml +10 -0
  362. package/domains/product/.agents/skills/report-design-reference/agents/qwen.json +17 -0
  363. package/domains/product/.agents/skills/report-design-reference/agents/skill.yaml +22 -0
  364. package/domains/product/.agents/skills/rice-scoring/SKILL.md +266 -251
  365. package/domains/product/.agents/skills/saas-metrics/SKILL.md +422 -404
  366. package/domains/product/.agents/skills/session-prompt-generator/SKILL.md +474 -450
  367. package/domains/product/.agents/skills/user-flow/SKILL.md +491 -476
  368. package/domains/product/.agents/skills/user-interview-script/SKILL.md +315 -298
  369. package/domains/product/.agents/skills/user-story/SKILL.md +401 -385
  370. package/domains/product/.agents/skills/wsjf-scoring/SKILL.md +333 -315
  371. package/domains/product/AGENTS.md +5 -0
  372. package/domains/product/AGENTS.yaml +1 -0
  373. package/domains/product/agents/auditor.md +76 -0
  374. package/domains/product/agents/conductor.md +11 -0
  375. package/domains/product/agents/data_analyst.md +11 -0
  376. package/domains/product/agents/designer.md +11 -0
  377. package/domains/product/agents/discovery.md +11 -0
  378. package/domains/product/agents/layouter.md +11 -0
  379. package/domains/product/agents/mediator.md +11 -0
  380. package/domains/product/agents/pm.md +11 -0
  381. package/domains/product/agents/product_strategist.md +11 -0
  382. package/domains/product/agents/tech_lead.md +11 -0
  383. package/domains/product/agents/ux_designer.md +11 -0
  384. package/domains/product/locales/en/.agents/skills/aarrr-metrics/SKILL.md +451 -433
  385. package/domains/product/locales/en/.agents/skills/ab-test-design/SKILL.md +428 -412
  386. package/domains/product/locales/en/.agents/skills/acceptance-criteria/SKILL.md +422 -406
  387. package/domains/product/locales/en/.agents/skills/assumption-mapping/SKILL.md +323 -307
  388. package/domains/product/locales/en/.agents/skills/board/SKILL.md +24 -0
  389. package/domains/product/locales/en/.agents/skills/design-brief/SKILL.md +433 -418
  390. package/domains/product/locales/en/.agents/skills/epic-breakdown/SKILL.md +435 -420
  391. package/domains/product/locales/en/.agents/skills/gates/SKILL.md +470 -446
  392. package/domains/product/locales/en/.agents/skills/gtm-brief/SKILL.md +18 -321
  393. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/SKILL.md +348 -0
  394. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/claude.json +17 -0
  395. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/copilot.json +17 -0
  396. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/gemini.json +17 -0
  397. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/kimi.yaml +15 -0
  398. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/openai.yaml +10 -0
  399. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/qwen.json +17 -0
  400. package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/skill.yaml +22 -0
  401. package/domains/product/locales/en/.agents/skills/handoff/SKILL.md +463 -439
  402. package/domains/product/locales/en/.agents/skills/html-pdf-report/SKILL.md +21 -663
  403. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/SKILL.md +699 -0
  404. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
  405. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
  406. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
  407. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
  408. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
  409. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
  410. package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/skill.yaml +22 -0
  411. package/domains/product/locales/en/.agents/skills/hypothesis-template/SKILL.md +484 -469
  412. package/domains/product/locales/en/.agents/skills/jtbd-canvas/SKILL.md +273 -257
  413. package/domains/product/locales/en/.agents/skills/kano-model/SKILL.md +370 -355
  414. package/domains/product/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +36 -0
  415. package/domains/product/locales/en/.agents/skills/launch-checklist/SKILL.md +434 -419
  416. package/domains/product/locales/en/.agents/skills/moscow-prioritization/SKILL.md +407 -392
  417. package/domains/product/locales/en/.agents/skills/north-star-metric/SKILL.md +317 -301
  418. package/domains/product/locales/en/.agents/skills/okr-framework/SKILL.md +299 -284
  419. package/domains/product/locales/en/.agents/skills/opportunity-solution-tree/SKILL.md +472 -456
  420. package/domains/product/locales/en/.agents/skills/prd-template/SKILL.md +18 -258
  421. package/domains/product/locales/en/.agents/skills/prd-template-reference/SKILL.md +285 -0
  422. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/claude.json +16 -0
  423. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/copilot.json +16 -0
  424. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/gemini.json +16 -0
  425. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/kimi.yaml +15 -0
  426. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/openai.yaml +10 -0
  427. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/qwen.json +16 -0
  428. package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/skill.yaml +22 -0
  429. package/domains/product/locales/en/.agents/skills/problem-statement/SKILL.md +327 -312
  430. package/domains/product/locales/en/.agents/skills/product-roadmap/SKILL.md +321 -305
  431. package/domains/product/locales/en/.agents/skills/product-vision/SKILL.md +410 -395
  432. package/domains/product/locales/en/.agents/skills/release-notes/SKILL.md +18 -258
  433. package/domains/product/locales/en/.agents/skills/release-notes-reference/SKILL.md +285 -0
  434. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/claude.json +16 -0
  435. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/copilot.json +16 -0
  436. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/gemini.json +16 -0
  437. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/kimi.yaml +14 -0
  438. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/openai.yaml +10 -0
  439. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/qwen.json +16 -0
  440. package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/skill.yaml +21 -0
  441. package/domains/product/locales/en/.agents/skills/report-design/SKILL.md +17 -307
  442. package/domains/product/locales/en/.agents/skills/report-design-reference/SKILL.md +331 -0
  443. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/claude.json +17 -0
  444. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/copilot.json +17 -0
  445. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/gemini.json +17 -0
  446. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/kimi.yaml +15 -0
  447. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/openai.yaml +10 -0
  448. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/qwen.json +17 -0
  449. package/domains/product/locales/en/.agents/skills/report-design-reference/agents/skill.yaml +22 -0
  450. package/domains/product/locales/en/.agents/skills/rice-scoring/SKILL.md +266 -251
  451. package/domains/product/locales/en/.agents/skills/saas-metrics/SKILL.md +422 -404
  452. package/domains/product/locales/en/.agents/skills/session-prompt-generator/SKILL.md +474 -450
  453. package/domains/product/locales/en/.agents/skills/user-flow/SKILL.md +491 -476
  454. package/domains/product/locales/en/.agents/skills/user-interview-script/SKILL.md +314 -297
  455. package/domains/product/locales/en/.agents/skills/user-story/SKILL.md +401 -385
  456. package/domains/product/locales/en/.agents/skills/wsjf-scoring/SKILL.md +333 -315
  457. package/domains/product/locales/en/AGENTS.md +5 -0
  458. package/domains/product/locales/en/agents/auditor.md +76 -0
  459. package/domains/product/locales/en/agents/conductor.md +11 -0
  460. package/domains/product/locales/en/agents/data_analyst.md +11 -0
  461. package/domains/product/locales/en/agents/designer.md +11 -0
  462. package/domains/product/locales/en/agents/discovery.md +11 -0
  463. package/domains/product/locales/en/agents/layouter.md +11 -0
  464. package/domains/product/locales/en/agents/mediator.md +11 -0
  465. package/domains/product/locales/en/agents/pm.md +11 -0
  466. package/domains/product/locales/en/agents/product_strategist.md +11 -0
  467. package/domains/product/locales/en/agents/tech_lead.md +11 -0
  468. package/domains/product/locales/en/agents/ux_designer.md +11 -0
  469. package/domains/product/persona/persona-base.md +94 -0
  470. package/domains/product/pipeline.yaml +115 -0
  471. package/package.json +72 -70
@@ -0,0 +1,99 @@
1
+ import { loadCodeAiConfig } from "../config.js";
2
+ import { appendReviewEvent, readProposals } from "../proposal_store.js";
3
+ import { readDomainSkillMeta, findOverlaps } from "../proposal_dedup.js";
4
+ /**
5
+ * Authorize a proposal status transition, enforcing the autonomy matrix + toggle.
6
+ *
7
+ * 4b is the AUTHORIZATION seam, not the write seam (mirrors sign_off: it authorizes a gate
8
+ * without doing the gate's work). The actual byte write into the asset is a separate
9
+ * submit_artifact/edit step the caller performs after approval — see next_step.
10
+ *
11
+ * Transitions:
12
+ * approve pending → approved (matrix/toggle-gated when decided_by=auditor_auto)
13
+ * reject pending → rejected
14
+ * applied approved → applied (bookkeeping marker after the caller wrote the asset)
15
+ *
16
+ * Matrix (ADR-DEV-122): auditor_auto may approve only low/additive AND only when the approval
17
+ * gate is OFF; destructive (high) and gate-ON always require den. den may always act.
18
+ */
19
+ export async function reviewProposal(input) {
20
+ const proposals = await readProposals();
21
+ const p = proposals.find((x) => x.id === input.id);
22
+ if (!p) {
23
+ throw new Error(`review_proposal: no proposal '${input.id}' in the store`);
24
+ }
25
+ // Transition validity.
26
+ if (input.decision === "approve" || input.decision === "reject") {
27
+ if (p.status !== "pending") {
28
+ throw new Error(`review_proposal: '${input.id}' is '${p.status}', not 'pending' — cannot ${input.decision}`);
29
+ }
30
+ }
31
+ else {
32
+ // "applied"
33
+ if (p.status !== "approved") {
34
+ throw new Error(`review_proposal: '${input.id}' is '${p.status}', not 'approved' — cannot mark applied`);
35
+ }
36
+ }
37
+ // Matrix + toggle enforcement on the capability-granting direction (approve).
38
+ if (input.decision === "approve" && input.decided_by === "auditor_auto") {
39
+ const cfg = await loadCodeAiConfig();
40
+ if (cfg.auditor.approval_gate) {
41
+ throw new Error(`review_proposal: approval gate is ON — '${input.id}' requires den approval, not auditor_auto`);
42
+ }
43
+ if (p.risk === "high") {
44
+ throw new Error(`review_proposal: '${input.id}' is high-risk (destructive) — always requires den, even in autonomy`);
45
+ }
46
+ // Additive-dedup guard (ADR-DEV-125): before auto-adding a NEW skill, block silent
47
+ // library bloat — if it overlaps an existing skill, route to den instead of auto-adding.
48
+ if (p.change_kind === "add_asset" && p.target.asset === "skill") {
49
+ const skills = await readDomainSkillMeta(p.target.domain);
50
+ const overlaps = findOverlaps({
51
+ proposalName: p.target.name,
52
+ text: `${p.rationale}\n${p.draft}`,
53
+ skills,
54
+ });
55
+ if (overlaps.length > 0) {
56
+ const summary = overlaps
57
+ .map((o) => `${o.skill} (${o.reasons.join("; ")})`)
58
+ .join("; ");
59
+ throw new Error(`review_proposal: '${input.id}' may duplicate existing skill(s) [${summary}] — additive-dedup guard routes it to den, not auto-add`);
60
+ }
61
+ }
62
+ }
63
+ const status = input.decision === "approve"
64
+ ? "approved"
65
+ : input.decision === "reject"
66
+ ? "rejected"
67
+ : "applied";
68
+ await appendReviewEvent({
69
+ kind: "review",
70
+ id: input.id,
71
+ status,
72
+ decided_by: input.decided_by,
73
+ ...(input.note !== undefined ? { note: input.note } : {}),
74
+ reviewed_at: new Date().toISOString(),
75
+ });
76
+ return {
77
+ id: input.id,
78
+ status,
79
+ risk: p.risk,
80
+ decided_by: input.decided_by,
81
+ target: p.target,
82
+ next_step: buildNextStep(status, p.target, p.draft, input.decided_by, p.change_kind),
83
+ };
84
+ }
85
+ /** Mandatory report — every decision (especially autonomous) returns a plain-language next step. */
86
+ function buildNextStep(status, target, draft, decided_by, change_kind) {
87
+ const who = decided_by === "auditor_auto" ? "Auditor (autonomous)" : "den";
88
+ const asset = `${target.asset} '${target.name}' in domain '${target.domain}'`;
89
+ if (status === "approved") {
90
+ const bloatNote = decided_by === "auditor_auto" && change_kind === "add_asset"
91
+ ? " NEW ADDITION (autonomous) — passed the dedup guard; tracked for later pruning review."
92
+ : "";
93
+ return `Approved by ${who}. Apply the draft to ${asset} via submit_artifact (class=${target.asset === "agent" ? "role" : "skill"}) or a targeted edit, then call review_proposal decision='applied'.${bloatNote} Draft:\n${draft}`;
94
+ }
95
+ if (status === "rejected") {
96
+ return `Rejected by ${who}. No change applied; the proposal stays on record.`;
97
+ }
98
+ return `Marked applied by ${who}. The change is now written to ${asset}; the proposal lifecycle is closed.`;
99
+ }
@@ -0,0 +1,11 @@
1
+ import { type RunDriftAuditInput, type RunDriftAuditOutput } from "../../shared/index.js";
2
+ /**
3
+ * Drift audit uses a PERMISSIVE YAML parser — strict SkillFrontmatter
4
+ * validation (e.g. `owners: z.array(AgentName).min(1)`) would silently skip
5
+ * the very skills the audit needs to surface. We only require:
6
+ * - frontmatter block exists
7
+ * - `name` field is a string matching the folder name
8
+ * Everything else (type, domain, owners empty/missing) is reported, not
9
+ * rejected.
10
+ */
11
+ export declare function runDriftAudit(input: RunDriftAuditInput): Promise<RunDriftAuditOutput>;
@@ -0,0 +1,79 @@
1
+ import { readdir, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { parse as parseYaml } from "yaml";
4
+ import { resolveDomainRoot, resolveSkillsRoot } from "../paths.js";
5
+ /**
6
+ * Drift audit uses a PERMISSIVE YAML parser — strict SkillFrontmatter
7
+ * validation (e.g. `owners: z.array(AgentName).min(1)`) would silently skip
8
+ * the very skills the audit needs to surface. We only require:
9
+ * - frontmatter block exists
10
+ * - `name` field is a string matching the folder name
11
+ * Everything else (type, domain, owners empty/missing) is reported, not
12
+ * rejected.
13
+ */
14
+ export async function runDriftAudit(input) {
15
+ const domainRoot = resolveDomainRoot(input.domain);
16
+ const agentsYamlPath = join(domainRoot, "AGENTS.yaml");
17
+ const yamlList = await readSkillsFromAgentsYaml(agentsYamlPath);
18
+ const { onDisk, unowned } = await scanSkillsFromDisk(input.domain);
19
+ const yamlSet = new Set(yamlList);
20
+ const diskSet = new Set(onDisk);
21
+ const orphan_skills = yamlList.filter((s) => !diskSet.has(s)).sort();
22
+ const phantom_skills = onDisk.filter((s) => !yamlSet.has(s)).sort();
23
+ return {
24
+ orphan_skills,
25
+ phantom_skills,
26
+ yaml_skew: [],
27
+ unowned: unowned.sort(),
28
+ missing_backlinks: [],
29
+ };
30
+ }
31
+ async function readSkillsFromAgentsYaml(file) {
32
+ const raw = await readFile(file, "utf8").catch(() => "");
33
+ if (!raw)
34
+ return [];
35
+ let parsed;
36
+ try {
37
+ parsed = parseYaml(raw);
38
+ }
39
+ catch {
40
+ return [];
41
+ }
42
+ const skills = parsed?.skills;
43
+ return Array.isArray(skills) ? [...skills] : [];
44
+ }
45
+ async function scanSkillsFromDisk(domain) {
46
+ const root = resolveSkillsRoot(domain);
47
+ const entries = await readdir(root, { withFileTypes: true }).catch(() => []);
48
+ const onDisk = [];
49
+ const unowned = [];
50
+ for (const entry of entries) {
51
+ if (!entry.isDirectory())
52
+ continue;
53
+ const file = join(root, entry.name, "SKILL.md");
54
+ const raw = await readFile(file, "utf8").catch(() => null);
55
+ if (!raw)
56
+ continue;
57
+ const stripped = raw.startsWith("") ? raw.slice(1) : raw;
58
+ const m = stripped.match(/^---\r?\n([\s\S]*?)\r?\n---/);
59
+ if (!m)
60
+ continue;
61
+ let parsed;
62
+ try {
63
+ parsed = parseYaml(m[1]);
64
+ }
65
+ catch {
66
+ continue;
67
+ }
68
+ const obj = parsed;
69
+ const name = obj?.name;
70
+ if (typeof name !== "string" || name !== entry.name)
71
+ continue;
72
+ onDisk.push(name);
73
+ const owners = obj?.owners;
74
+ if (!Array.isArray(owners) || owners.length === 0) {
75
+ unowned.push(name);
76
+ }
77
+ }
78
+ return { onDisk, unowned };
79
+ }
@@ -0,0 +1,2 @@
1
+ import { type RunTestsInput, type RunTestsOutput } from "../../shared/index.js";
2
+ export declare function runTests(input: RunTestsInput): Promise<RunTestsOutput>;
@@ -0,0 +1,92 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { tmpdir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { readFile, unlink } from "node:fs/promises";
5
+ import { npmCommand, spawnWithOutput, tail } from "./_subprocess.js";
6
+ export async function runTests(input) {
7
+ const cwd = input.cwd ?? process.cwd();
8
+ const outFile = join(tmpdir(), `code-ai-vitest-${randomUUID()}.json`);
9
+ const args = ["test", "--", "--reporter=json", `--outputFile=${outFile}`];
10
+ if (input.filter)
11
+ args.push(input.filter);
12
+ const result = await spawnWithOutput(npmCommand(), args, { cwd });
13
+ let raw = null;
14
+ try {
15
+ raw = await readFile(outFile, "utf8");
16
+ await unlink(outFile).catch(() => undefined);
17
+ }
18
+ catch {
19
+ // no JSON file — subprocess crashed before writing
20
+ }
21
+ if (raw === null) {
22
+ return {
23
+ passed: 0,
24
+ failed: 0,
25
+ duration_ms: result.durationMs,
26
+ failures: [
27
+ {
28
+ code: "subprocess-error",
29
+ message: `npm test did not produce a vitest JSON report (exit=${result.exitCode})`,
30
+ evidence: {
31
+ stderr: tail(result.stderr, 2000),
32
+ stdout: tail(result.stdout, 2000),
33
+ spawnError: result.spawnError?.message,
34
+ },
35
+ },
36
+ ],
37
+ };
38
+ }
39
+ let report;
40
+ try {
41
+ report = JSON.parse(raw);
42
+ }
43
+ catch (err) {
44
+ return {
45
+ passed: 0,
46
+ failed: 0,
47
+ duration_ms: result.durationMs,
48
+ failures: [
49
+ {
50
+ code: "json-parse-error",
51
+ message: `Failed to parse vitest JSON report: ${err.message}`,
52
+ evidence: { raw: raw.slice(0, 500) },
53
+ },
54
+ ],
55
+ };
56
+ }
57
+ return mapReport(report, result.durationMs);
58
+ }
59
+ function mapReport(report, durationMs) {
60
+ const failures = [];
61
+ const totalTests = report.numTotalTests ?? 0;
62
+ if (totalTests === 0 && report.success === false) {
63
+ failures.push({
64
+ code: "no-tests-found",
65
+ message: "vitest ran but found no test files in this project",
66
+ });
67
+ }
68
+ for (const file of report.testResults ?? []) {
69
+ for (const assertion of file.assertionResults ?? []) {
70
+ if (assertion.status === "failed") {
71
+ const title = assertion.fullName ??
72
+ [...(assertion.ancestorTitles ?? []), assertion.title ?? ""].filter(Boolean).join(" > ");
73
+ const message = (assertion.failureMessages?.[0] ?? "(no failure message)").split("\n")[0] ?? "";
74
+ failures.push({
75
+ code: "test-failed",
76
+ message: `${file.name ?? "<unknown>"} > ${title}: ${message}`,
77
+ evidence: {
78
+ file: file.name,
79
+ title,
80
+ failureMessages: assertion.failureMessages,
81
+ },
82
+ });
83
+ }
84
+ }
85
+ }
86
+ return {
87
+ passed: report.numPassedTests ?? 0,
88
+ failed: report.numFailedTests ?? 0,
89
+ duration_ms: durationMs,
90
+ failures,
91
+ };
92
+ }
@@ -1,6 +1,7 @@
1
1
  import { getGateConfig, loadPipeline } from "../pipeline.js";
2
2
  import { readTaskState, writeTaskState } from "../task_state.js";
3
- const DEFAULT_DOMAIN = "development";
3
+ import { recordRunScorecard } from "../audit_ledger.js";
4
+ import { resolveActiveDomain } from "../config.js";
4
5
  /**
5
6
  * Records a sign-off event for the task's current gate. Validates that:
6
7
  * 1. Task exists and is at the named gate.
@@ -14,7 +15,7 @@ const DEFAULT_DOMAIN = "development";
14
15
  * records evidence; advance_gate gates on it.
15
16
  */
16
17
  export async function signOff(input) {
17
- const pipeline = await loadPipeline(DEFAULT_DOMAIN);
18
+ const pipeline = await loadPipeline(await resolveActiveDomain());
18
19
  const state = await readTaskState(input.task_id);
19
20
  if (!state) {
20
21
  throw new Error(`sign_off: no task state for ${input.task_id} (call current_gate or classify_gate first)`);
@@ -54,5 +55,16 @@ export async function signOff(input) {
54
55
  evidence: input.evidence,
55
56
  });
56
57
  await writeTaskState(state);
58
+ // Auditor telemetry: when the terminal gate is signed, the run is complete —
59
+ // append a scorecard to the local ledger. Best-effort: a ledger failure must
60
+ // NEVER break a sign-off (telemetry is not load-bearing for the gate).
61
+ if (input.gate === "RG") {
62
+ try {
63
+ await recordRunScorecard(state);
64
+ }
65
+ catch {
66
+ /* swallow — see contract in audit_ledger.recordRunScorecard */
67
+ }
68
+ }
57
69
  return { signed: true, signer: input.signer, timestamp };
58
70
  }
@@ -16,6 +16,21 @@ import { auditTrail } from "./audit_trail.js";
16
16
  import { listArtifacts } from "./list_artifacts.js";
17
17
  import { getArtifact } from "./get_artifact.js";
18
18
  import { verifyClaim } from "./verify_claim.js";
19
+ import { runTests } from "./run_tests.js";
20
+ import { checkLint } from "./check_lint.js";
21
+ import { build } from "./build.js";
22
+ import { applyDiff } from "./apply_diff.js";
23
+ import { gitCommit } from "./git_commit.js";
24
+ import { runDriftAudit } from "./run_drift_audit.js";
25
+ import { auditBudgetCompliance } from "./audit_budget_compliance.js";
26
+ import { auditBilocaleParity } from "./audit_bilocale_parity.js";
27
+ import { aggregateRunMetrics } from "./aggregate_run_metrics.js";
28
+ import { proposeChange } from "./propose_change.js";
29
+ import { listProposals } from "./list_proposals.js";
30
+ import { reviewProposal } from "./review_proposal.js";
31
+ import { e2ePlaywright } from "./e2e_playwright.js";
32
+ import { dockerCompose } from "./docker_compose.js";
33
+ import { dependencySupplyChain } from "./dependency_supply_chain.js";
19
34
  /** Thrown by every stub until the real implementation lands. */
20
35
  export class NotImplementedError extends Error {
21
36
  constructor(tool) {
@@ -53,13 +68,19 @@ export const DEFAULT_HANDLERS = {
53
68
  audit_trail: auditTrail,
54
69
  recent_decisions: recentDecisions,
55
70
  regenerate_manifest: regenerateManifest,
56
- run_drift_audit: stub("run_drift_audit"),
57
- run_tests: stub("run_tests"),
58
- apply_diff: stub("apply_diff"),
59
- git_commit: stub("git_commit"),
60
- check_lint: stub("check_lint"),
61
- build: stub("build"),
62
- dependency_supply_chain: stub("dependency_supply_chain"),
63
- docker_compose: stub("docker_compose"),
64
- e2e_playwright: stub("e2e_playwright"),
71
+ run_drift_audit: runDriftAudit,
72
+ audit_budget_compliance: auditBudgetCompliance,
73
+ audit_bilocale_parity: auditBilocaleParity,
74
+ aggregate_run_metrics: aggregateRunMetrics,
75
+ propose_change: proposeChange,
76
+ list_proposals: listProposals,
77
+ review_proposal: reviewProposal,
78
+ run_tests: runTests,
79
+ apply_diff: applyDiff,
80
+ git_commit: gitCommit,
81
+ check_lint: checkLint,
82
+ build,
83
+ dependency_supply_chain: dependencySupplyChain,
84
+ docker_compose: dockerCompose,
85
+ e2e_playwright: e2ePlaywright,
65
86
  };
@@ -3,6 +3,9 @@ import { join } from "node:path";
3
3
  import { parse as parseYaml } from "yaml";
4
4
  import { SkillFrontmatter, TechSeed, TopicSeed, } from "../../shared/index.js";
5
5
  import { resolveSkillsRoot } from "../paths.js";
6
+ import { runTests } from "./run_tests.js";
7
+ import { checkLint } from "./check_lint.js";
8
+ import { build } from "./build.js";
6
9
  /**
7
10
  * Code-verifiable claims. Per the silent-by-default contract, every claim a
8
11
  * gate makes ("tests pass", "no orphan skills", "vocab clean") should be
@@ -31,17 +34,41 @@ export async function verifyClaim(input) {
31
34
  const result = await checkVocab(domain);
32
35
  return result;
33
36
  }
34
- case "tests_pass":
35
- case "build_succeeds":
36
- case "lint_clean":
37
+ case "tests_pass": {
38
+ const cwd = input.args.cwd ?? undefined;
39
+ const r = await runTests({ task_id: input.task_id, cwd });
40
+ return {
41
+ verified: r.failed === 0 && r.failures.length === 0,
42
+ evidence: { passed: r.passed, failed: r.failed, duration_ms: r.duration_ms },
43
+ failures: r.failures,
44
+ };
45
+ }
46
+ case "lint_clean": {
47
+ const cwd = input.args.cwd ?? undefined;
48
+ const r = await checkLint({ task_id: input.task_id, cwd });
49
+ return {
50
+ verified: r.clean,
51
+ evidence: { clean: r.clean },
52
+ failures: r.issues,
53
+ };
54
+ }
55
+ case "build_succeeds": {
56
+ const cwd = input.args.cwd ?? undefined;
57
+ const r = await build({ task_id: input.task_id, cwd });
58
+ return {
59
+ verified: r.succeeded,
60
+ evidence: { succeeded: r.succeeded },
61
+ failures: r.errors,
62
+ };
63
+ }
37
64
  case "custom": {
38
65
  return {
39
66
  verified: false,
40
- evidence: { reason: `claim_type='${input.claim_type}' not wired yet (Phase 2 tool dependency)` },
67
+ evidence: { reason: `claim_type='custom' not wired (project-specific dispatcher needed)` },
41
68
  failures: [
42
69
  {
43
- code: `${input.claim_type}-unwired`,
44
- message: `verify_claim: claim_type='${input.claim_type}' will be enabled once the corresponding Phase 2 auto-check tool lands.`,
70
+ code: `custom-unwired`,
71
+ message: `verify_claim: claim_type='custom' requires a project-specific dispatcher (not part of DEV-101).`,
45
72
  },
46
73
  ],
47
74
  };
@@ -1,10 +1,11 @@
1
+ import type { DomainId } from "./shared/index.js";
1
2
  /**
2
3
  * MCP auto-setup for `--target=claude` installs.
3
4
  *
4
5
  * Two responsibilities (ADR-DEV-099):
5
6
  * 1. Detect / install MemPalace as an opt-in mirror for decision storage.
6
7
  * 2. Write project-level `.mcp.json` registering `code-ai-mcp` (always) and
7
- * `mempalace` (when accepted) so Claude Code picks them up automatically.
8
+ * `mempalace-mcp` (when accepted) so Claude Code picks them up automatically.
8
9
  * 3. Write `.code-ai/config.json` so `code-ai-mcp` knows which backend to use.
9
10
  *
10
11
  * Non-Claude targets skip this whole flow — MCP is Claude-specific.
@@ -34,6 +35,12 @@ export interface McpSetupOptions {
34
35
  wantMempalace: boolean;
35
36
  /** When true, no files are written; the report still reflects planned actions. */
36
37
  dryRun: boolean;
38
+ /**
39
+ * The selected domain, written into `.code-ai/config.json` so the gate tools
40
+ * read this project's pipeline. Undefined for the legacy flat layout (no
41
+ * domains) — then the config omits it and the runtime defaults to development.
42
+ */
43
+ domain?: DomainId;
37
44
  }
38
45
  export interface McpSetupReport {
39
46
  mempalaceUsed: boolean;
@@ -46,8 +53,11 @@ export interface McpSetupReport {
46
53
  notices: string[];
47
54
  }
48
55
  /**
49
- * Try `mempalace --help`. Resolves true on exit code 0, false otherwise
50
- * (including ENOENT binary not on PATH).
56
+ * Try `mempalace-mcp --help` the dedicated MCP-server bin, which is exactly
57
+ * what we register in `.mcp.json`. Resolves true on exit code 0, false otherwise
58
+ * (including ENOENT — bin not on PATH). Probing the actual server bin (not the
59
+ * `mempalace` CLI) means a stale MemPalace without `mempalace-mcp` triggers a
60
+ * (re)install instead of writing a config that can't launch.
51
61
  */
52
62
  export declare function detectMemPalace(): Promise<boolean>;
53
63
  /**
@@ -83,6 +93,7 @@ export declare function mergeMcpJson(destinationDir: string, servers: Record<str
83
93
  */
84
94
  export declare function writeCodeAiConfig(destinationDir: string, config: {
85
95
  decision_store: "jsonl" | "mempalace";
96
+ domain?: DomainId;
86
97
  }, dryRun?: boolean): Promise<{
87
98
  path: string;
88
99
  }>;
package/dist/mcp_setup.js CHANGED
@@ -2,11 +2,14 @@ import { spawn } from "node:child_process";
2
2
  import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  /**
5
- * Try `mempalace --help`. Resolves true on exit code 0, false otherwise
6
- * (including ENOENT binary not on PATH).
5
+ * Try `mempalace-mcp --help` the dedicated MCP-server bin, which is exactly
6
+ * what we register in `.mcp.json`. Resolves true on exit code 0, false otherwise
7
+ * (including ENOENT — bin not on PATH). Probing the actual server bin (not the
8
+ * `mempalace` CLI) means a stale MemPalace without `mempalace-mcp` triggers a
9
+ * (re)install instead of writing a config that can't launch.
7
10
  */
8
11
  export async function detectMemPalace() {
9
- return spawnExitZero("mempalace", ["--help"]);
12
+ return spawnExitZero("mempalace-mcp", ["--help"]);
10
13
  }
11
14
  /**
12
15
  * Find the first available Python install runtime, in preference order:
@@ -151,14 +154,20 @@ export async function setupMcp(opts) {
151
154
  },
152
155
  };
153
156
  if (mempalaceUsed) {
157
+ // Use the dedicated `mempalace-mcp` stdio server bin (NOT `mempalace mcp`):
158
+ // the full CLI subcommand can emit to stdout before the MCP handshake and
159
+ // corrupt the JSON-RPC stream, so Claude Code fails to launch it.
154
160
  servers["mempalace"] = {
155
- command: "mempalace",
156
- args: ["mcp"],
161
+ command: "mempalace-mcp",
162
+ args: [],
157
163
  };
158
164
  }
159
165
  const mcp = await mergeMcpJson(opts.destinationDir, servers, opts.dryRun);
160
166
  notices.push(...mcp.notices);
161
- const cfg = await writeCodeAiConfig(opts.destinationDir, { decision_store: mempalaceUsed ? "mempalace" : "jsonl" }, opts.dryRun);
167
+ const cfg = await writeCodeAiConfig(opts.destinationDir, {
168
+ decision_store: mempalaceUsed ? "mempalace" : "jsonl",
169
+ ...(opts.domain ? { domain: opts.domain } : {}),
170
+ }, opts.dryRun);
162
171
  return {
163
172
  mempalaceUsed,
164
173
  mempalaceInstallAttempted,
@@ -1,4 +1,11 @@
1
1
  import { z } from "zod";
2
+ /**
3
+ * Single source of truth for the `budget_lines` schema caps. Used by the zod
4
+ * schemas below AND imported by audit_budget_compliance (which previously
5
+ * hardcoded duplicate copies — ADR-DEV-108 R1). Change here, not in two places.
6
+ */
7
+ export declare const SKILL_BUDGET_LINES_MAX = 800;
8
+ export declare const ROLE_BUDGET_LINES_MAX = 650;
2
9
  /**
3
10
  * Skill frontmatter — the structural anti-drift contract.
4
11
  *
@@ -49,8 +56,24 @@ export declare const SkillFrontmatter: z.ZodObject<{
49
56
  OPS: "OPS";
50
57
  TEST: "TEST";
51
58
  RG: "RG";
59
+ STRATEGIST: "STRATEGIST";
60
+ RESEARCHER: "RESEARCHER";
61
+ COPYWRITER: "COPYWRITER";
62
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
63
+ REVIEWER: "REVIEWER";
64
+ RELEASE_GATE: "RELEASE_GATE";
65
+ INTERVIEWER: "INTERVIEWER";
66
+ DATA_ANALYST: "DATA_ANALYST";
67
+ MEDIATOR: "MEDIATOR";
68
+ DESIGNER: "DESIGNER";
69
+ LAYOUTER: "LAYOUTER";
70
+ DISCOVERY: "DISCOVERY";
71
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
72
+ UX_DESIGNER: "UX_DESIGNER";
73
+ TECH_LEAD: "TECH_LEAD";
52
74
  }>>>;
53
75
  tech: z.ZodDefault<z.ZodArray<z.ZodEnum<{
76
+ mcp: "mcp";
54
77
  typescript: "typescript";
55
78
  node: "node";
56
79
  react: "react";
@@ -133,7 +156,11 @@ export declare const RoleFrontmatter: z.ZodObject<{
133
156
  analytics: "analytics";
134
157
  product: "product";
135
158
  }>;
136
- signs_off_at: z.ZodArray<z.ZodEnum<{
159
+ kind: z.ZodDefault<z.ZodEnum<{
160
+ gate: "gate";
161
+ meta: "meta";
162
+ }>>;
163
+ signs_off_at: z.ZodDefault<z.ZodArray<z.ZodEnum<{
137
164
  PM: "PM";
138
165
  UX: "UX";
139
166
  ARCH: "ARCH";
@@ -142,7 +169,22 @@ export declare const RoleFrontmatter: z.ZodObject<{
142
169
  OPS: "OPS";
143
170
  TEST: "TEST";
144
171
  RG: "RG";
145
- }>>;
172
+ STRATEGIST: "STRATEGIST";
173
+ RESEARCHER: "RESEARCHER";
174
+ COPYWRITER: "COPYWRITER";
175
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
176
+ REVIEWER: "REVIEWER";
177
+ RELEASE_GATE: "RELEASE_GATE";
178
+ INTERVIEWER: "INTERVIEWER";
179
+ DATA_ANALYST: "DATA_ANALYST";
180
+ MEDIATOR: "MEDIATOR";
181
+ DESIGNER: "DESIGNER";
182
+ LAYOUTER: "LAYOUTER";
183
+ DISCOVERY: "DISCOVERY";
184
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
185
+ UX_DESIGNER: "UX_DESIGNER";
186
+ TECH_LEAD: "TECH_LEAD";
187
+ }>>>;
146
188
  tool_allowlist: z.ZodString;
147
189
  budget_lines: z.ZodDefault<z.ZodNumber>;
148
190
  schema_version: z.ZodDefault<z.ZodLiteral<1>>;