code-ai-installer 4.0.0 → 4.0.1-a

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 +36 -0
  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 +8 -0
  65. package/dist/mcp_setup.js +4 -1
  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,32 @@
1
+ import { type DomainId } from "../shared/index.js";
2
+ export interface SkillMeta {
3
+ name: string;
4
+ topic: string[];
5
+ tech: string[];
6
+ related: string[];
7
+ }
8
+ export interface DedupOverlap {
9
+ skill: string;
10
+ reasons: string[];
11
+ }
12
+ /**
13
+ * Read each SKILL.md frontmatter in a domain (name + topic/tech/related). Narrow reader — it does
14
+ * NOT change list_skills' public contract; 4c just needs fields list_skills doesn't surface.
15
+ * Tolerant: a folder without SKILL.md or with bad frontmatter is skipped.
16
+ */
17
+ export declare function readDomainSkillMeta(domain: DomainId): Promise<SkillMeta[]>;
18
+ /**
19
+ * Overlap of an additive (new-skill) proposal against existing domain skills (ADR-DEV-125, Plan A).
20
+ * Pure + deterministic — callers inject the skill list (readDomainSkillMeta in prod, fixtures in tests).
21
+ *
22
+ * A skill is flagged when ANY of:
23
+ * - exact name match, OR
24
+ * - shares a name token AND a vocab term with the skill's topic/tech, OR
25
+ * - near-duplicate name (one name contains the other), OR
26
+ * - the skill's related[] already lists the proposed name.
27
+ */
28
+ export declare function findOverlaps(args: {
29
+ proposalName: string;
30
+ text: string;
31
+ skills: SkillMeta[];
32
+ }): DedupOverlap[];
@@ -0,0 +1,102 @@
1
+ import { readdir, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { parse as parseYaml } from "yaml";
4
+ import { SkillFrontmatter, TechSeed, TopicSeed } from "../shared/index.js";
5
+ import { resolveSkillsRoot } from "./paths.js";
6
+ /**
7
+ * Read each SKILL.md frontmatter in a domain (name + topic/tech/related). Narrow reader — it does
8
+ * NOT change list_skills' public contract; 4c just needs fields list_skills doesn't surface.
9
+ * Tolerant: a folder without SKILL.md or with bad frontmatter is skipped.
10
+ */
11
+ export async function readDomainSkillMeta(domain) {
12
+ const root = resolveSkillsRoot(domain);
13
+ const dirs = await readdir(root, { withFileTypes: true }).catch(() => []);
14
+ const out = [];
15
+ for (const d of dirs) {
16
+ if (!d.isDirectory())
17
+ continue;
18
+ const raw = await readFile(join(root, d.name, "SKILL.md"), "utf8").catch(() => null);
19
+ if (!raw)
20
+ continue;
21
+ const stripped = raw.startsWith("") ? raw.slice(1) : raw;
22
+ const m = stripped.match(/^---\r?\n([\s\S]*?)\r?\n---/);
23
+ if (!m)
24
+ continue;
25
+ let fm;
26
+ try {
27
+ fm = SkillFrontmatter.safeParse(parseYaml(m[1]));
28
+ }
29
+ catch {
30
+ continue;
31
+ }
32
+ if (!fm.success)
33
+ continue;
34
+ out.push({
35
+ name: fm.data.name,
36
+ topic: fm.data.topic ?? [],
37
+ tech: fm.data.tech ?? [],
38
+ related: fm.data.related ?? [],
39
+ });
40
+ }
41
+ return out;
42
+ }
43
+ /** Generic kebab tokens that carry no disambiguating signal — ignored in name overlap. */
44
+ const NAME_STOPWORDS = new Set([
45
+ "workflow", "skill", "review", "guide", "reference", "setup", "and", "the", "a",
46
+ ]);
47
+ function nameTokens(name) {
48
+ return new Set(name
49
+ .toLowerCase()
50
+ .split(/[^a-z0-9]+/)
51
+ .filter((t) => t.length > 1 && !NAME_STOPWORDS.has(t)));
52
+ }
53
+ /** Controlled-vocab terms (TechSeed/TopicSeed) that appear as whole tokens in free text. */
54
+ function vocabTermsInText(text) {
55
+ const tokens = new Set(text.toLowerCase().split(/[^a-z0-9_-]+/).filter(Boolean));
56
+ const found = new Set();
57
+ for (const t of [...TechSeed.options, ...TopicSeed.options]) {
58
+ if (tokens.has(t))
59
+ found.add(t);
60
+ }
61
+ return found;
62
+ }
63
+ /**
64
+ * Overlap of an additive (new-skill) proposal against existing domain skills (ADR-DEV-125, Plan A).
65
+ * Pure + deterministic — callers inject the skill list (readDomainSkillMeta in prod, fixtures in tests).
66
+ *
67
+ * A skill is flagged when ANY of:
68
+ * - exact name match, OR
69
+ * - shares a name token AND a vocab term with the skill's topic/tech, OR
70
+ * - near-duplicate name (one name contains the other), OR
71
+ * - the skill's related[] already lists the proposed name.
72
+ */
73
+ export function findOverlaps(args) {
74
+ const pTokens = nameTokens(args.proposalName);
75
+ const pVocab = vocabTermsInText(args.text);
76
+ const pNameLc = args.proposalName.toLowerCase();
77
+ const overlaps = [];
78
+ for (const s of args.skills) {
79
+ const sNameLc = s.name.toLowerCase();
80
+ if (sNameLc === pNameLc) {
81
+ overlaps.push({ skill: s.name, reasons: ["exact name match"] });
82
+ continue;
83
+ }
84
+ const reasons = [];
85
+ const sTokens = nameTokens(s.name);
86
+ const sharedName = [...pTokens].filter((t) => sTokens.has(t));
87
+ const sMeta = new Set([...s.topic, ...s.tech]);
88
+ const sharedVocab = [...pVocab].filter((v) => sMeta.has(v));
89
+ if (sharedName.length > 0 && sharedVocab.length > 0) {
90
+ reasons.push(`shares name token(s) [${sharedName.join(", ")}] and topic/tech [${sharedVocab.join(", ")}]`);
91
+ }
92
+ if (pNameLc.includes(sNameLc) || sNameLc.includes(pNameLc)) {
93
+ reasons.push("near-duplicate name (one contains the other)");
94
+ }
95
+ if (s.related.includes(args.proposalName)) {
96
+ reasons.push("already referenced in this skill's related[]");
97
+ }
98
+ if (reasons.length > 0)
99
+ overlaps.push({ skill: s.name, reasons });
100
+ }
101
+ return overlaps;
102
+ }
@@ -0,0 +1,18 @@
1
+ import { ProposalRecord, ProposalReviewEvent } from "../shared/index.js";
2
+ type ProposalRecordT = ReturnType<typeof ProposalRecord.parse>;
3
+ type ProposalReviewEventT = ReturnType<typeof ProposalReviewEvent.parse>;
4
+ /** Append one proposal as a JSON line (creates the audit dir if needed). */
5
+ export declare function appendProposal(record: ProposalRecordT): Promise<void>;
6
+ /** Append a status-transition event (event-sourcing; never rewrites the original record). */
7
+ export declare function appendReviewEvent(event: ProposalReviewEventT): Promise<void>;
8
+ /**
9
+ * All proposals with their EFFECTIVE status (latest review event folded in). The on-disk
10
+ * record is never mutated — folding happens on read. list_proposals consumes this.
11
+ */
12
+ export declare function readProposals(): Promise<ProposalRecordT[]>;
13
+ /**
14
+ * Next sequential id, derived from the count of base proposal RECORDS (not raw lines, so
15
+ * review events never inflate the counter): prop-0001, prop-0002, …
16
+ */
17
+ export declare function nextProposalId(): Promise<string>;
18
+ export {};
@@ -0,0 +1,74 @@
1
+ import { mkdir, readFile, appendFile } from "node:fs/promises";
2
+ import { dirname } from "node:path";
3
+ import { ProposalRecord, ProposalReviewEvent } from "../shared/index.js";
4
+ import { resolveProposalsPath } from "./paths.js";
5
+ /** Append one proposal as a JSON line (creates the audit dir if needed). */
6
+ export async function appendProposal(record) {
7
+ const path = resolveProposalsPath();
8
+ await mkdir(dirname(path), { recursive: true });
9
+ await appendFile(path, JSON.stringify(record) + "\n", "utf8");
10
+ }
11
+ /** Append a status-transition event (event-sourcing; never rewrites the original record). */
12
+ export async function appendReviewEvent(event) {
13
+ const path = resolveProposalsPath();
14
+ await mkdir(dirname(path), { recursive: true });
15
+ await appendFile(path, JSON.stringify(event) + "\n", "utf8");
16
+ }
17
+ /**
18
+ * Read+classify every line as a base proposal record or a review event. A line that parses
19
+ * as neither is skipped (tolerant, like the run ledger). Records are tried first; a review
20
+ * event lacks the record's required fields so it can never be misread as a record.
21
+ */
22
+ async function readEntries() {
23
+ const raw = await readFile(resolveProposalsPath(), "utf8").catch(() => "");
24
+ const records = [];
25
+ const events = [];
26
+ if (!raw)
27
+ return { records, events };
28
+ for (const line of raw.split("\n")) {
29
+ if (!line.trim())
30
+ continue;
31
+ let obj;
32
+ try {
33
+ obj = JSON.parse(line);
34
+ }
35
+ catch {
36
+ continue;
37
+ }
38
+ const rec = ProposalRecord.safeParse(obj);
39
+ if (rec.success) {
40
+ records.push(rec.data);
41
+ continue;
42
+ }
43
+ const ev = ProposalReviewEvent.safeParse(obj);
44
+ if (ev.success)
45
+ events.push(ev.data);
46
+ // else: skip
47
+ }
48
+ return { records, events };
49
+ }
50
+ /**
51
+ * All proposals with their EFFECTIVE status (latest review event folded in). The on-disk
52
+ * record is never mutated — folding happens on read. list_proposals consumes this.
53
+ */
54
+ export async function readProposals() {
55
+ const { records, events } = await readEntries();
56
+ const latest = new Map();
57
+ for (const e of events) {
58
+ const prev = latest.get(e.id);
59
+ if (!prev || e.reviewed_at >= prev.reviewed_at)
60
+ latest.set(e.id, e);
61
+ }
62
+ return records.map((r) => {
63
+ const e = latest.get(r.id);
64
+ return e ? { ...r, status: e.status } : r;
65
+ });
66
+ }
67
+ /**
68
+ * Next sequential id, derived from the count of base proposal RECORDS (not raw lines, so
69
+ * review events never inflate the counter): prop-0001, prop-0002, …
70
+ */
71
+ export async function nextProposalId() {
72
+ const { records } = await readEntries();
73
+ return `prop-${String(records.length + 1).padStart(4, "0")}`;
74
+ }
@@ -0,0 +1,140 @@
1
+ import { z } from "zod";
2
+ import type { TaskState } from "./task_state.js";
3
+ /**
4
+ * Run scorecard — a compact, per-pipeline-run summary derived ENTIRELY from
5
+ * telemetry the MCP state machine already persists (task state + jsonl side
6
+ * logs). One scorecard is appended to the run ledger when a run completes
7
+ * (RG signed). The Auditor's aggregation tool crunches >=3 of these.
8
+ *
9
+ * Deliberately records raw signals, not judgments — interpretation belongs to
10
+ * the aggregator (numbers) and, later, the Auditor agent (findings).
11
+ *
12
+ * Attribution note: scorecards record GATES, not agents. The gate→agent mapping
13
+ * lives in pipeline.yaml (produced_by) and is applied at aggregation time, so
14
+ * the ledger never duplicates that mapping (single source).
15
+ */
16
+ export declare const SCORECARD_SCHEMA_VERSION: 1;
17
+ export declare const GateScore: z.ZodObject<{
18
+ gate: z.ZodEnum<{
19
+ PM: "PM";
20
+ UX: "UX";
21
+ ARCH: "ARCH";
22
+ DEV: "DEV";
23
+ REV: "REV";
24
+ OPS: "OPS";
25
+ TEST: "TEST";
26
+ RG: "RG";
27
+ STRATEGIST: "STRATEGIST";
28
+ RESEARCHER: "RESEARCHER";
29
+ COPYWRITER: "COPYWRITER";
30
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
31
+ REVIEWER: "REVIEWER";
32
+ RELEASE_GATE: "RELEASE_GATE";
33
+ INTERVIEWER: "INTERVIEWER";
34
+ DATA_ANALYST: "DATA_ANALYST";
35
+ MEDIATOR: "MEDIATOR";
36
+ DESIGNER: "DESIGNER";
37
+ LAYOUTER: "LAYOUTER";
38
+ DISCOVERY: "DISCOVERY";
39
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
40
+ UX_DESIGNER: "UX_DESIGNER";
41
+ TECH_LEAD: "TECH_LEAD";
42
+ }>;
43
+ signoff_count: z.ZodNumber;
44
+ last_signer: z.ZodNullable<z.ZodEnum<{
45
+ den: "den";
46
+ mcp: "mcp";
47
+ system: "system";
48
+ }>>;
49
+ classification: z.ZodNullable<z.ZodEnum<{
50
+ auto_resolve: "auto_resolve";
51
+ fork: "fork";
52
+ exception: "exception";
53
+ }>>;
54
+ exceptions_count: z.ZodNumber;
55
+ }, z.core.$strip>;
56
+ export type GateScore = z.infer<typeof GateScore>;
57
+ export declare const SkillInvocationScore: z.ZodObject<{
58
+ skill: z.ZodString;
59
+ gate: z.ZodNullable<z.ZodString>;
60
+ count: z.ZodNumber;
61
+ }, z.core.$strip>;
62
+ export type SkillInvocationScore = z.infer<typeof SkillInvocationScore>;
63
+ export declare const RunScorecard: z.ZodObject<{
64
+ schema_version: z.ZodLiteral<1>;
65
+ task_id: z.ZodString;
66
+ mode: z.ZodEnum<{
67
+ full: "full";
68
+ bugfix: "bugfix";
69
+ hotfix: "hotfix";
70
+ }>;
71
+ completed: z.ZodBoolean;
72
+ created_at: z.ZodString;
73
+ completed_at: z.ZodNullable<z.ZodString>;
74
+ gates: z.ZodArray<z.ZodObject<{
75
+ gate: z.ZodEnum<{
76
+ PM: "PM";
77
+ UX: "UX";
78
+ ARCH: "ARCH";
79
+ DEV: "DEV";
80
+ REV: "REV";
81
+ OPS: "OPS";
82
+ TEST: "TEST";
83
+ RG: "RG";
84
+ STRATEGIST: "STRATEGIST";
85
+ RESEARCHER: "RESEARCHER";
86
+ COPYWRITER: "COPYWRITER";
87
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
88
+ REVIEWER: "REVIEWER";
89
+ RELEASE_GATE: "RELEASE_GATE";
90
+ INTERVIEWER: "INTERVIEWER";
91
+ DATA_ANALYST: "DATA_ANALYST";
92
+ MEDIATOR: "MEDIATOR";
93
+ DESIGNER: "DESIGNER";
94
+ LAYOUTER: "LAYOUTER";
95
+ DISCOVERY: "DISCOVERY";
96
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
97
+ UX_DESIGNER: "UX_DESIGNER";
98
+ TECH_LEAD: "TECH_LEAD";
99
+ }>;
100
+ signoff_count: z.ZodNumber;
101
+ last_signer: z.ZodNullable<z.ZodEnum<{
102
+ den: "den";
103
+ mcp: "mcp";
104
+ system: "system";
105
+ }>>;
106
+ classification: z.ZodNullable<z.ZodEnum<{
107
+ auto_resolve: "auto_resolve";
108
+ fork: "fork";
109
+ exception: "exception";
110
+ }>>;
111
+ exceptions_count: z.ZodNumber;
112
+ }, z.core.$strip>>;
113
+ dev_rollback_count: z.ZodNumber;
114
+ circuit_breaker_tripped: z.ZodBoolean;
115
+ exceptions_count: z.ZodNumber;
116
+ decisions_count: z.ZodNumber;
117
+ skill_invocations: z.ZodDefault<z.ZodArray<z.ZodObject<{
118
+ skill: z.ZodString;
119
+ gate: z.ZodNullable<z.ZodString>;
120
+ count: z.ZodNumber;
121
+ }, z.core.$strip>>>;
122
+ }, z.core.$strip>;
123
+ export type RunScorecard = z.infer<typeof RunScorecard>;
124
+ /** Side telemetry the builder cannot read from task state alone. */
125
+ export type ScorecardExtras = {
126
+ /** Exceptions grouped by gate name (from exceptions.jsonl). */
127
+ exceptions_by_gate: Partial<Record<string, number>>;
128
+ /** Total ADR decisions recorded for the task (from decisions.jsonl). */
129
+ decisions_count: number;
130
+ /** Raw skill-invocation events for the task (from skill_invocations.jsonl). */
131
+ skill_invocations?: Array<{
132
+ skill: string;
133
+ gate: string | null;
134
+ }>;
135
+ };
136
+ /**
137
+ * Build a run scorecard from a task's persisted state plus side-log counts.
138
+ * Pure + synchronous: deterministic and unit-testable on synthetic state.
139
+ */
140
+ export declare function buildScorecard(state: TaskState, extras: ScorecardExtras): RunScorecard;
@@ -0,0 +1,103 @@
1
+ import { z } from "zod";
2
+ import { ClassificationOutcome, GateName, PipelineMode, Signer, } from "../shared/index.js";
3
+ /**
4
+ * Run scorecard — a compact, per-pipeline-run summary derived ENTIRELY from
5
+ * telemetry the MCP state machine already persists (task state + jsonl side
6
+ * logs). One scorecard is appended to the run ledger when a run completes
7
+ * (RG signed). The Auditor's aggregation tool crunches >=3 of these.
8
+ *
9
+ * Deliberately records raw signals, not judgments — interpretation belongs to
10
+ * the aggregator (numbers) and, later, the Auditor agent (findings).
11
+ *
12
+ * Attribution note: scorecards record GATES, not agents. The gate→agent mapping
13
+ * lives in pipeline.yaml (produced_by) and is applied at aggregation time, so
14
+ * the ledger never duplicates that mapping (single source).
15
+ */
16
+ export const SCORECARD_SCHEMA_VERSION = 1;
17
+ export const GateScore = z.object({
18
+ gate: GateName,
19
+ /** How many sign-offs this gate received. >1 means the gate was reworked. */
20
+ signoff_count: z.number().int().nonnegative(),
21
+ last_signer: Signer.nullable(),
22
+ /** Latest classification outcome recorded for the gate, if any. */
23
+ classification: ClassificationOutcome.nullable(),
24
+ /** Exceptions filed AT this gate (from exceptions.jsonl, grouped by gate). */
25
+ exceptions_count: z.number().int().nonnegative(),
26
+ });
27
+ export const SkillInvocationScore = z.object({
28
+ skill: z.string(),
29
+ /** Gate the skill was pulled at, or null. String (not GateName) — tolerant of
30
+ * hand-edited telemetry; this is a surfacing layer, not gate-machine state. */
31
+ gate: z.string().nullable(),
32
+ count: z.number().int().positive(),
33
+ });
34
+ export const RunScorecard = z.object({
35
+ schema_version: z.literal(SCORECARD_SCHEMA_VERSION),
36
+ task_id: z.string().min(1),
37
+ mode: PipelineMode,
38
+ /** True when an RG sign-off exists (the state machine does not set completed_at). */
39
+ completed: z.boolean(),
40
+ created_at: z.string(),
41
+ /** Timestamp of the RG sign-off, or null if not completed. */
42
+ completed_at: z.string().nullable(),
43
+ gates: z.array(GateScore),
44
+ dev_rollback_count: z.number().int().nonnegative(),
45
+ circuit_breaker_tripped: z.boolean(),
46
+ exceptions_count: z.number().int().nonnegative(),
47
+ decisions_count: z.number().int().nonnegative(),
48
+ /** Skills pulled via get_skill during the run, grouped by skill+gate. */
49
+ skill_invocations: z.array(SkillInvocationScore).default([]),
50
+ });
51
+ /**
52
+ * Build a run scorecard from a task's persisted state plus side-log counts.
53
+ * Pure + synchronous: deterministic and unit-testable on synthetic state.
54
+ */
55
+ export function buildScorecard(state, extras) {
56
+ // Group sign-offs by gate: count + last signer (last in chronological array).
57
+ const signoffCount = new Map();
58
+ const lastSigner = new Map();
59
+ for (const s of state.signoffs) {
60
+ signoffCount.set(s.gate, (signoffCount.get(s.gate) ?? 0) + 1);
61
+ lastSigner.set(s.gate, s.signer);
62
+ }
63
+ // Latest classification per gate (last wins).
64
+ const lastClass = new Map();
65
+ for (const c of state.classifications)
66
+ lastClass.set(c.gate, c.outcome);
67
+ // Union of gates that have any signal (signoff or classification).
68
+ const gateNames = new Set([...signoffCount.keys(), ...lastClass.keys()]);
69
+ const gates = [...gateNames].sort().map((gate) => ({
70
+ gate: gate,
71
+ signoff_count: signoffCount.get(gate) ?? 0,
72
+ last_signer: lastSigner.get(gate) ?? null,
73
+ classification: lastClass.get(gate) ?? null,
74
+ exceptions_count: extras.exceptions_by_gate[gate] ?? 0,
75
+ }));
76
+ const rgSignoffs = state.signoffs.filter((s) => s.gate === "RG");
77
+ const completed = rgSignoffs.length > 0;
78
+ const completed_at = completed ? rgSignoffs[rgSignoffs.length - 1].timestamp : null;
79
+ const exceptions_count = Object.values(extras.exceptions_by_gate).reduce((a, b) => a + (b ?? 0), 0);
80
+ // Group skill invocations by skill + gate into counts.
81
+ const skillAgg = new Map();
82
+ for (const ev of extras.skill_invocations ?? []) {
83
+ const key = `${ev.skill}|${ev.gate ?? ""}`;
84
+ const e = skillAgg.get(key) ?? { skill: ev.skill, gate: ev.gate, count: 0 };
85
+ e.count++;
86
+ skillAgg.set(key, e);
87
+ }
88
+ const skill_invocations = [...skillAgg.values()].sort((a, b) => (a.skill + (a.gate ?? "")).localeCompare(b.skill + (b.gate ?? "")));
89
+ return RunScorecard.parse({
90
+ schema_version: SCORECARD_SCHEMA_VERSION,
91
+ task_id: state.task_id,
92
+ mode: state.mode,
93
+ completed,
94
+ created_at: state.created_at,
95
+ completed_at,
96
+ gates,
97
+ dev_rollback_count: state.dev_rollback_count,
98
+ circuit_breaker_tripped: state.audit_required_at !== undefined,
99
+ exceptions_count,
100
+ decisions_count: extras.decisions_count,
101
+ skill_invocations,
102
+ });
103
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Skill-invocation telemetry. A `get_skill` fetch associated with a run is the
3
+ * invocation signal — the agent decided the skill was relevant and pulled it.
4
+ * Append-only JSONL; one event per line. Read back per task by the scorecard
5
+ * builder. Best-effort by contract: a logging failure must never break a read.
6
+ */
7
+ export type SkillInvocation = {
8
+ task_id: string;
9
+ gate: string | null;
10
+ skill: string;
11
+ timestamp: string;
12
+ };
13
+ export declare function recordSkillInvocation(ev: SkillInvocation): Promise<void>;
14
+ /** All invocation events for one task. Malformed / partial lines are skipped. */
15
+ export declare function readSkillInvocations(taskId: string): Promise<SkillInvocation[]>;
@@ -0,0 +1,28 @@
1
+ import { mkdir, readFile, appendFile } from "node:fs/promises";
2
+ import { dirname } from "node:path";
3
+ import { resolveSkillInvocationsPath } from "./paths.js";
4
+ export async function recordSkillInvocation(ev) {
5
+ const path = resolveSkillInvocationsPath();
6
+ await mkdir(dirname(path), { recursive: true });
7
+ await appendFile(path, JSON.stringify(ev) + "\n", "utf8");
8
+ }
9
+ /** All invocation events for one task. Malformed / partial lines are skipped. */
10
+ export async function readSkillInvocations(taskId) {
11
+ const raw = await readFile(resolveSkillInvocationsPath(), "utf8").catch(() => "");
12
+ if (!raw)
13
+ return [];
14
+ const out = [];
15
+ for (const line of raw.split("\n")) {
16
+ if (!line.trim())
17
+ continue;
18
+ try {
19
+ const o = JSON.parse(line);
20
+ if (o.task_id === taskId)
21
+ out.push(o);
22
+ }
23
+ catch {
24
+ continue;
25
+ }
26
+ }
27
+ return out;
28
+ }
@@ -18,10 +18,25 @@ export declare const GateSignoff: z.ZodObject<{
18
18
  OPS: "OPS";
19
19
  TEST: "TEST";
20
20
  RG: "RG";
21
+ STRATEGIST: "STRATEGIST";
22
+ RESEARCHER: "RESEARCHER";
23
+ COPYWRITER: "COPYWRITER";
24
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
25
+ REVIEWER: "REVIEWER";
26
+ RELEASE_GATE: "RELEASE_GATE";
27
+ INTERVIEWER: "INTERVIEWER";
28
+ DATA_ANALYST: "DATA_ANALYST";
29
+ MEDIATOR: "MEDIATOR";
30
+ DESIGNER: "DESIGNER";
31
+ LAYOUTER: "LAYOUTER";
32
+ DISCOVERY: "DISCOVERY";
33
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
34
+ UX_DESIGNER: "UX_DESIGNER";
35
+ TECH_LEAD: "TECH_LEAD";
21
36
  }>;
22
37
  signer: z.ZodEnum<{
23
- mcp: "mcp";
24
38
  den: "den";
39
+ mcp: "mcp";
25
40
  system: "system";
26
41
  }>;
27
42
  timestamp: z.ZodString;
@@ -38,6 +53,21 @@ export declare const GateClassification: z.ZodObject<{
38
53
  OPS: "OPS";
39
54
  TEST: "TEST";
40
55
  RG: "RG";
56
+ STRATEGIST: "STRATEGIST";
57
+ RESEARCHER: "RESEARCHER";
58
+ COPYWRITER: "COPYWRITER";
59
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
60
+ REVIEWER: "REVIEWER";
61
+ RELEASE_GATE: "RELEASE_GATE";
62
+ INTERVIEWER: "INTERVIEWER";
63
+ DATA_ANALYST: "DATA_ANALYST";
64
+ MEDIATOR: "MEDIATOR";
65
+ DESIGNER: "DESIGNER";
66
+ LAYOUTER: "LAYOUTER";
67
+ DISCOVERY: "DISCOVERY";
68
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
69
+ UX_DESIGNER: "UX_DESIGNER";
70
+ TECH_LEAD: "TECH_LEAD";
41
71
  }>;
42
72
  outcome: z.ZodEnum<{
43
73
  auto_resolve: "auto_resolve";
@@ -64,6 +94,21 @@ export declare const TaskState: z.ZodObject<{
64
94
  OPS: "OPS";
65
95
  TEST: "TEST";
66
96
  RG: "RG";
97
+ STRATEGIST: "STRATEGIST";
98
+ RESEARCHER: "RESEARCHER";
99
+ COPYWRITER: "COPYWRITER";
100
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
101
+ REVIEWER: "REVIEWER";
102
+ RELEASE_GATE: "RELEASE_GATE";
103
+ INTERVIEWER: "INTERVIEWER";
104
+ DATA_ANALYST: "DATA_ANALYST";
105
+ MEDIATOR: "MEDIATOR";
106
+ DESIGNER: "DESIGNER";
107
+ LAYOUTER: "LAYOUTER";
108
+ DISCOVERY: "DISCOVERY";
109
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
110
+ UX_DESIGNER: "UX_DESIGNER";
111
+ TECH_LEAD: "TECH_LEAD";
67
112
  }>;
68
113
  signoffs: z.ZodDefault<z.ZodArray<z.ZodObject<{
69
114
  gate: z.ZodEnum<{
@@ -75,10 +120,25 @@ export declare const TaskState: z.ZodObject<{
75
120
  OPS: "OPS";
76
121
  TEST: "TEST";
77
122
  RG: "RG";
123
+ STRATEGIST: "STRATEGIST";
124
+ RESEARCHER: "RESEARCHER";
125
+ COPYWRITER: "COPYWRITER";
126
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
127
+ REVIEWER: "REVIEWER";
128
+ RELEASE_GATE: "RELEASE_GATE";
129
+ INTERVIEWER: "INTERVIEWER";
130
+ DATA_ANALYST: "DATA_ANALYST";
131
+ MEDIATOR: "MEDIATOR";
132
+ DESIGNER: "DESIGNER";
133
+ LAYOUTER: "LAYOUTER";
134
+ DISCOVERY: "DISCOVERY";
135
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
136
+ UX_DESIGNER: "UX_DESIGNER";
137
+ TECH_LEAD: "TECH_LEAD";
78
138
  }>;
79
139
  signer: z.ZodEnum<{
80
- mcp: "mcp";
81
140
  den: "den";
141
+ mcp: "mcp";
82
142
  system: "system";
83
143
  }>;
84
144
  timestamp: z.ZodString;
@@ -94,6 +154,21 @@ export declare const TaskState: z.ZodObject<{
94
154
  OPS: "OPS";
95
155
  TEST: "TEST";
96
156
  RG: "RG";
157
+ STRATEGIST: "STRATEGIST";
158
+ RESEARCHER: "RESEARCHER";
159
+ COPYWRITER: "COPYWRITER";
160
+ VISUAL_CONCEPT: "VISUAL_CONCEPT";
161
+ REVIEWER: "REVIEWER";
162
+ RELEASE_GATE: "RELEASE_GATE";
163
+ INTERVIEWER: "INTERVIEWER";
164
+ DATA_ANALYST: "DATA_ANALYST";
165
+ MEDIATOR: "MEDIATOR";
166
+ DESIGNER: "DESIGNER";
167
+ LAYOUTER: "LAYOUTER";
168
+ DISCOVERY: "DISCOVERY";
169
+ PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
170
+ UX_DESIGNER: "UX_DESIGNER";
171
+ TECH_LEAD: "TECH_LEAD";
97
172
  }>;
98
173
  outcome: z.ZodEnum<{
99
174
  auto_resolve: "auto_resolve";
@@ -0,0 +1,16 @@
1
+ export interface SubprocessResult {
2
+ exitCode: number | null;
3
+ stdout: string;
4
+ stderr: string;
5
+ durationMs: number;
6
+ spawnError?: Error;
7
+ }
8
+ export interface SpawnOptions {
9
+ cwd: string;
10
+ env?: Record<string, string>;
11
+ /** When set, the string is written to the process's stdin then closed. */
12
+ stdin?: string;
13
+ }
14
+ export declare function npmCommand(): string;
15
+ export declare function spawnWithOutput(command: string, args: string[], opts: SpawnOptions): Promise<SubprocessResult>;
16
+ export declare function tail(text: string, maxBytes: number): string;