@v11g/agents-rock 1.0.8 → 1.0.10

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 (314) hide show
  1. package/README.md +2 -1
  2. package/package.json +2 -2
  3. package/plugins/business-analyst/.claude-plugin/plugin.json +1 -1
  4. package/plugins/business-analyst/evals/ba-interview-conflict/graders/conflict-quoted.md +15 -0
  5. package/plugins/business-analyst/evals/ba-interview-conflict/graders/no-internal-ids.md +9 -0
  6. package/plugins/business-analyst/evals/ba-interview-conflict/graders/one-question.md +15 -0
  7. package/plugins/business-analyst/evals/ba-interview-conflict/graders/skill-fired.md +7 -0
  8. package/plugins/business-analyst/evals/ba-interview-conflict/prompt.md +31 -0
  9. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-internal-ids.md +9 -0
  10. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-setup-questions.md +16 -0
  11. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/one-scope-question.md +19 -0
  12. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/skill-fired.md +7 -0
  13. package/plugins/business-analyst/evals/ba-interview-first-turn/prompt.md +31 -0
  14. package/plugins/business-analyst/evals/ba-review-page/case.yaml +4 -0
  15. package/plugins/business-analyst/evals/ba-review-page/fixture.sh +12 -0
  16. package/plugins/business-analyst/evals/ba-review-page/graders/decide-in-interview.md +26 -0
  17. package/plugins/business-analyst/evals/ba-review-page/graders/skill-fired.md +7 -0
  18. package/plugins/business-analyst/evals/ba-review-page/prompt.md +9 -0
  19. package/plugins/business-analyst/skills/business-analyst/README.md +8 -0
  20. package/plugins/business-analyst/skills/business-analyst/SKILL.md +47 -16
  21. package/plugins/business-analyst/skills/business-analyst/assets/review-page.html +68 -0
  22. package/plugins/business-analyst/skills/business-analyst/evals/evals.json +1 -1
  23. package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +3 -2
  24. package/plugins/business-analyst/skills/business-analyst/references/interview.md +156 -8
  25. package/plugins/business-analyst/skills/business-analyst/references/review.md +18 -4
  26. package/plugins/business-analyst/skills/business-analyst/references/writing.md +49 -8
  27. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
  28. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
  29. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
  30. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
  31. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
  32. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
  33. package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +12 -6
  34. package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-data.mjs +66 -0
  35. package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-layout.mjs +53 -0
  36. package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-page.mjs +78 -0
  37. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-checks.mjs +73 -0
  38. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-md.mjs +53 -0
  39. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-render.mjs +72 -0
  40. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-rules.mjs +90 -0
  41. package/plugins/business-analyst/skills/business-analyst/scripts/review.mjs +48 -0
  42. package/plugins/business-analyst/skills/business-analyst/scripts/review.py +60 -0
  43. package/plugins/business-analyst/skills/business-analyst/scripts/review_data.py +81 -0
  44. package/plugins/business-analyst/skills/business-analyst/scripts/review_layout.py +50 -0
  45. package/plugins/business-analyst/skills/business-analyst/scripts/review_page.py +115 -0
  46. package/plugins/business-analyst/skills/business-analyst/scripts/scope.mjs +24 -0
  47. package/plugins/business-analyst/skills/business-analyst/scripts/scope.py +35 -0
  48. package/plugins/business-analyst/skills/business-analyst/scripts/scope_checks.py +168 -0
  49. package/plugins/business-analyst/skills/business-analyst/scripts/scope_render.py +140 -0
  50. package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +27 -0
  51. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.json +78 -0
  52. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.md +136 -0
  53. package/plugins/business-analyst/skills/business-analyst/scripts/test/python-parity.test.mjs +88 -0
  54. package/plugins/business-analyst/skills/business-analyst/scripts/test/quality-gates.test.mjs +26 -0
  55. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-browser.test.mjs +106 -0
  56. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-fixture.mjs +32 -0
  57. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-page.test.mjs +340 -0
  58. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-parity.test.mjs +79 -0
  59. package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-cases.mjs +58 -0
  60. package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-checks.test.mjs +31 -0
  61. package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-md.test.mjs +140 -0
  62. package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +1 -1
  63. package/plugins/business-analyst/skills/business-analyst/scripts/validate.py +17 -8
  64. package/plugins/reasoning/.claude-plugin/plugin.json +1 -1
  65. package/plugins/reasoning/evals/format-handoff-folder/graders/folder-named.md +8 -0
  66. package/plugins/reasoning/evals/format-handoff-folder/graders/skill-fired.md +7 -0
  67. package/plugins/reasoning/evals/format-handoff-folder/prompt.md +9 -0
  68. package/plugins/reasoning/evals/format-ids-and-supports/graders/ids-in-chat.md +8 -0
  69. package/plugins/reasoning/evals/format-ids-and-supports/graders/skill-fired.md +7 -0
  70. package/plugins/reasoning/evals/format-ids-and-supports/graders/supports-resolve.md +11 -0
  71. package/plugins/reasoning/evals/format-ids-and-supports/prompt.md +8 -0
  72. package/plugins/reasoning/evals/format-root-candidate-status/graders/candidate-status.md +11 -0
  73. package/plugins/reasoning/evals/format-root-candidate-status/graders/skill-fired.md +7 -0
  74. package/plugins/reasoning/evals/format-root-candidate-status/prompt.md +8 -0
  75. package/plugins/reasoning/evals/format-unsaved-continues/graders/analysis-completes.md +9 -0
  76. package/plugins/reasoning/evals/format-unsaved-continues/graders/not-saved-stated.md +9 -0
  77. package/plugins/reasoning/evals/format-unsaved-continues/graders/skill-fired.md +7 -0
  78. package/plugins/reasoning/evals/format-unsaved-continues/prompt.md +8 -0
  79. package/plugins/reasoning/skills/problem-router/README.md +6 -0
  80. package/plugins/reasoning/skills/problem-router/SKILL.md +4 -0
  81. package/plugins/reasoning/skills/problem-router/references/contract.md +114 -19
  82. package/plugins/reasoning/skills/problem-solving/README.md +6 -0
  83. package/plugins/reasoning/skills/problem-solving/SKILL.md +2 -0
  84. package/plugins/reasoning/skills/problem-solving/references/contract.md +114 -19
  85. package/plugins/reasoning/skills/problem-solving/references/interview.md +2 -0
  86. package/plugins/reasoning/skills/systemic-design/README.md +3 -0
  87. package/plugins/reasoning/skills/systemic-design/SKILL.md +2 -0
  88. package/plugins/reasoning/skills/systemic-design/references/contract.md +114 -19
  89. package/plugins/reasoning/skills/systemic-design/references/interview.md +2 -0
  90. package/plugins/reasoning/skills/systems-thinking/README.md +3 -0
  91. package/plugins/reasoning/skills/systems-thinking/SKILL.md +2 -0
  92. package/plugins/reasoning/skills/systems-thinking/frameworks/leverage-points.md +15 -6
  93. package/plugins/reasoning/skills/systems-thinking/references/contract.md +114 -19
  94. package/plugins/reasoning/skills/systems-thinking/references/interview.md +2 -0
  95. package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
  96. package/plugins/solution-architect/evals/proposal-workflow/case.yaml +6 -0
  97. package/plugins/solution-architect/evals/proposal-workflow/fixture.sh +6 -0
  98. package/plugins/solution-architect/evals/proposal-workflow/graders/inputs-written.md +23 -0
  99. package/plugins/solution-architect/evals/proposal-workflow/graders/no-proposal-md.md +7 -0
  100. package/plugins/solution-architect/evals/proposal-workflow/graders/skill-fired.md +7 -0
  101. package/plugins/solution-architect/evals/proposal-workflow/graders/validate-then-render.md +16 -0
  102. package/plugins/solution-architect/evals/proposal-workflow/prompt.md +10 -0
  103. package/plugins/solution-architect/evals/workflow-gate-no-architecture/case.yaml +4 -0
  104. package/plugins/solution-architect/evals/workflow-gate-no-architecture/fixture.sh +6 -0
  105. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +10 -0
  106. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/nothing-written.md +7 -0
  107. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/skill-fired.md +7 -0
  108. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +11 -0
  109. package/plugins/solution-architect/evals/workflow-gate-no-architecture/prompt.md +7 -0
  110. package/plugins/solution-architect/evals/workflow-happy-path/case.yaml +4 -0
  111. package/plugins/solution-architect/evals/workflow-happy-path/fixture.sh +6 -0
  112. package/plugins/solution-architect/evals/workflow-happy-path/graders/no-estimation-md.md +7 -0
  113. package/plugins/solution-architect/evals/workflow-happy-path/graders/pages-or-stop.md +16 -0
  114. package/plugins/solution-architect/evals/workflow-happy-path/graders/routed-to-workflow.md +12 -0
  115. package/plugins/solution-architect/evals/workflow-happy-path/graders/skill-fired.md +7 -0
  116. package/plugins/solution-architect/evals/workflow-happy-path/graders/three-questions-max.md +14 -0
  117. package/plugins/solution-architect/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +15 -0
  118. package/plugins/solution-architect/evals/workflow-happy-path/prompt.md +9 -0
  119. package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +11 -1
  120. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +4 -1
  121. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +16 -1
  122. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +27 -0
  123. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +9 -0
  124. package/plugins/solution-architect/skills/estimate/README.md +38 -18
  125. package/plugins/solution-architect/skills/estimate/SKILL.md +16 -69
  126. package/plugins/solution-architect/skills/estimate/classic/FLOW.md +77 -0
  127. package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template-agentic.html +111 -138
  128. package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template.html +219 -445
  129. package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/scores-review-template.html +5 -4
  130. package/plugins/solution-architect/skills/estimate/{references → classic/references}/agentic-estimation.md +4 -2
  131. package/plugins/solution-architect/skills/estimate/classic/references/ai-multipliers.md +57 -0
  132. package/plugins/solution-architect/skills/estimate/{references → classic/references}/interview.md +56 -35
  133. package/plugins/solution-architect/skills/estimate/{references → classic/references}/scoring-guide.md +40 -4
  134. package/plugins/solution-architect/skills/estimate/{references → classic/references}/task-shapes.md +1 -1
  135. package/plugins/solution-architect/skills/estimate/{references → classic/references}/techniques.md +29 -21
  136. package/plugins/solution-architect/skills/estimate/{references → classic/references}/writing.md +77 -45
  137. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/compute.mjs +1 -1
  138. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/checks.mjs +38 -6
  139. package/plugins/solution-architect/skills/estimate/classic/scripts/lib/redact.mjs +112 -0
  140. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/roadmap.mjs +4 -5
  141. package/plugins/solution-architect/skills/estimate/classic/scripts/lib/rollup.mjs +129 -0
  142. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/schema.mjs +31 -38
  143. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-csv.mjs +3 -3
  144. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-html.mjs +3 -3
  145. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/render.mjs +9 -8
  146. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/score-review.mjs +3 -3
  147. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/baselines.test.mjs +3 -3
  148. package/plugins/solution-architect/skills/estimate/classic/scripts/test/browser-agentic.test.mjs +143 -0
  149. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser.test.mjs +211 -52
  150. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/compute.test.mjs +58 -33
  151. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/e2e.test.mjs +55 -3
  152. package/plugins/solution-architect/skills/estimate/classic/scripts/test/estimate-math.test.mjs +44 -0
  153. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-fail.md +0 -10
  154. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-pass.md +0 -10
  155. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-inputs.json +1 -7
  156. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/booking-inputs.json +11 -10
  157. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-fail.md +6 -0
  158. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-pass.md +17 -21
  159. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/measurements.test.mjs +1 -1
  160. package/plugins/solution-architect/skills/estimate/classic/scripts/test/pricing.test.mjs +88 -0
  161. package/plugins/solution-architect/skills/estimate/classic/scripts/test/project-price.test.mjs +93 -0
  162. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/quality-gates.test.mjs +7 -1
  163. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/references.test.mjs +88 -26
  164. package/plugins/solution-architect/skills/estimate/classic/scripts/test/render.test.mjs +405 -0
  165. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/schema.test.mjs +114 -61
  166. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/score-review.test.mjs +37 -4
  167. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/scoring.test.mjs +1 -1
  168. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/url-state.test.mjs +2 -2
  169. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/validate.test.mjs +104 -10
  170. package/plugins/solution-architect/skills/estimate/classic/scripts/test/xlsx-export.test.mjs +475 -0
  171. package/plugins/solution-architect/skills/estimate/classic/scripts/test/zip-store.test.mjs +26 -0
  172. package/plugins/solution-architect/skills/estimate/evals/evals.json +44 -9
  173. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +28 -0
  174. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
  175. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.md +141 -0
  176. package/plugins/solution-architect/skills/estimate/shared/assets/xlsx-export.js +336 -0
  177. package/plugins/solution-architect/skills/estimate/shared/lib/agentic-task-schema.mjs +24 -0
  178. package/plugins/solution-architect/skills/estimate/shared/lib/context-schema.mjs +35 -0
  179. package/plugins/solution-architect/skills/estimate/shared/lib/estimate-math.mjs +31 -0
  180. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/inline.mjs +13 -5
  181. package/plugins/solution-architect/skills/estimate/shared/lib/pricing.mjs +78 -0
  182. package/plugins/solution-architect/skills/estimate/shared/lib/project-price.mjs +96 -0
  183. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring-schema.mjs +1 -1
  184. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring.mjs +3 -3
  185. package/plugins/solution-architect/skills/estimate/shared/lib/zip.mjs +60 -0
  186. package/plugins/solution-architect/skills/estimate/workflow-based/FLOW.md +91 -0
  187. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-components.html +994 -0
  188. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-template.html +440 -0
  189. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimator-system.xlsx +0 -0
  190. package/plugins/solution-architect/skills/estimate/workflow-based/assets/score-review.html +838 -0
  191. package/plugins/solution-architect/skills/estimate/workflow-based/references/hidden-work-by-type.md +429 -0
  192. package/plugins/solution-architect/skills/estimate/workflow-based/references/linking.md +59 -0
  193. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-components-template.mjs +80 -0
  194. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-template.mjs +60 -0
  195. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +51 -0
  196. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-xlsx-template.py +144 -0
  197. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/compute.mjs +32 -0
  198. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-html.mjs +44 -0
  199. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-view.mjs +71 -0
  200. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/pair-findings.mjs +19 -0
  201. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/requirements.mjs +33 -0
  202. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/rollup.mjs +66 -0
  203. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema-components.mjs +69 -0
  204. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema.mjs +70 -0
  205. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-diff.mjs +54 -0
  206. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-html.mjs +52 -0
  207. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +51 -0
  208. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/render.mjs +42 -0
  209. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/score-review.mjs +46 -0
  210. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/arch-link.js +9 -0
  211. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/click.js +28 -0
  212. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/prelude.js +4 -0
  213. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/view.js +63 -0
  214. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/browser.test.mjs +127 -0
  215. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs +43 -0
  216. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-template.test.mjs +18 -0
  217. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/cli.test.mjs +48 -0
  218. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/estimator-system.test.mjs +66 -0
  219. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/ARCHITECTURE-mini.md +31 -0
  220. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/feedback.json +19 -0
  221. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/inputs-pass.json +80 -0
  222. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/measurements.jsonl +0 -0
  223. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/requirements.json +79 -0
  224. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/page-view.test.mjs +54 -0
  225. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/pages-browser.test.mjs +209 -0
  226. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/quality-gates.test.mjs +25 -0
  227. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/render.test.mjs +54 -0
  228. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/requirements.test.mjs +33 -0
  229. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/rollup.test.mjs +80 -0
  230. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/schema.test.mjs +61 -0
  231. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/score-review.test.mjs +108 -0
  232. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/stage.mjs +32 -0
  233. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/workflow-script.test.mjs +24 -0
  234. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +58 -0
  235. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/validate.mjs +19 -0
  236. package/plugins/solution-architect/skills/new-lead/SKILL.md +4 -3
  237. package/plugins/solution-architect/skills/proposal/README.md +22 -7
  238. package/plugins/solution-architect/skills/proposal/SKILL.md +18 -7
  239. package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +143 -0
  240. package/plugins/solution-architect/skills/proposal/evals/evals.json +29 -11
  241. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/ARCHITECTURE.md +65 -0
  242. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/brief.md +21 -0
  243. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation-inputs.json +126 -0
  244. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation.json +215 -0
  245. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation-inputs.json +224 -34
  246. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.json +103 -114
  247. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.md +48 -22
  248. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation-inputs.json +211 -33
  249. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.json +102 -117
  250. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.md +48 -25
  251. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +31 -0
  252. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation-inputs.json +468 -0
  253. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation.json +773 -0
  254. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/measurements.jsonl +0 -0
  255. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
  256. package/plugins/solution-architect/skills/proposal/references/interview.md +3 -6
  257. package/plugins/solution-architect/skills/proposal/references/review.md +16 -4
  258. package/plugins/solution-architect/skills/proposal/references/workflow.md +88 -0
  259. package/plugins/solution-architect/skills/proposal/references/writing.md +33 -31
  260. package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +1 -1
  261. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +5 -22
  262. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +18 -8
  263. package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +6 -2
  264. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-body.mjs +42 -0
  265. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-package.mjs +56 -0
  266. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-xml.mjs +44 -0
  267. package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +24 -33
  268. package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +1 -1
  269. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-checks.mjs +71 -0
  270. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-cli.mjs +46 -0
  271. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-html.mjs +39 -0
  272. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-lead.mjs +45 -0
  273. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-page.mjs +30 -0
  274. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-view.mjs +80 -0
  275. package/plugins/solution-architect/skills/proposal/scripts/render.mjs +5 -1
  276. package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +50 -47
  277. package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +99 -40
  278. package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +11 -5
  279. package/plugins/solution-architect/skills/proposal/scripts/test/docx.test.mjs +68 -0
  280. package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +3 -3
  281. package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +46 -0
  282. package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +67 -54
  283. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +6 -1
  284. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +17 -0
  285. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +8 -12
  286. package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +3 -3
  287. package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +5 -4
  288. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-browser.test.mjs +96 -0
  289. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-checks.test.mjs +98 -0
  290. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-docs.test.mjs +25 -0
  291. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-render.test.mjs +75 -0
  292. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-stage.mjs +15 -0
  293. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-view.test.mjs +78 -0
  294. package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +4 -1
  295. package/plugins/solution-architect/workflows/review-links.js +61 -0
  296. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +0 -101
  297. package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +0 -89
  298. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +0 -64
  299. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +0 -154
  300. package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +0 -39
  301. package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +0 -131
  302. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +0 -251
  303. package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +0 -254
  304. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/slicing.md +0 -0
  305. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/agentic-checks.mjs +0 -0
  306. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/components.mjs +0 -0
  307. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/md-tables.mjs +0 -0
  308. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/scoring-checks.mjs +0 -0
  309. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/measurements.jsonl +0 -0
  310. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/zip.mjs +0 -0
  311. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/validate.mjs +0 -0
  312. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/baselines.mjs +0 -0
  313. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/measurements.mjs +0 -0
  314. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/score-diff.mjs +0 -0
@@ -6,8 +6,8 @@ import { tmpdir } from 'node:os';
6
6
  import { join } from 'node:path';
7
7
 
8
8
  const cli = new URL('../validate.mjs', import.meta.url).pathname;
9
- const computeCli = new URL('../../../estimate/scripts/compute.mjs', import.meta.url).pathname;
10
- const inputs = new URL('../../../estimate/scripts/test/fixtures/booking-inputs.json', import.meta.url).pathname;
9
+ const computeCli = new URL('../../../estimate/classic/scripts/compute.mjs', import.meta.url).pathname;
10
+ const inputs = new URL('../../../estimate/classic/scripts/test/fixtures/booking-inputs.json', import.meta.url).pathname;
11
11
  const passMd = new URL('./fixtures/proposal-pass.md', import.meta.url).pathname;
12
12
  const failMd = new URL('./fixtures/proposal-fail.md', import.meta.url).pathname;
13
13
 
@@ -30,11 +30,12 @@ test('the fail fixture exits 1 and names every violation class', () => {
30
30
  } catch (e) { err = e; }
31
31
  assert.ok(err, 'expected non-zero exit');
32
32
  const findings = err.stderr.toString();
33
- assert.match(findings, /missing ## Team/);
33
+ assert.match(findings, /scenario.*removed/i);
34
+ assert.match(findings, /Team section was removed/i);
35
+ assert.match(findings, /Duration column/i);
34
36
  assert.match(findings, /placeholder/i);
35
37
  assert.match(findings, /valid_until/);
36
38
  assert.match(findings, /9,999|9999/);
37
39
  assert.match(findings, /"src"/);
38
- assert.match(findings, /3eng-noai/);
39
40
  assert.match(findings, /jargon/i);
40
41
  });
@@ -0,0 +1,96 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { execFileSync } from 'node:child_process';
4
+ import { writeFileSync } from 'node:fs';
5
+ import { join } from 'node:path';
6
+ import { pathToFileURL } from 'node:url';
7
+ import { findChrome } from '../../../analyze-requirements/scripts/lib/chrome.mjs';
8
+ import { openPage } from '../../../analyze-requirements/scripts/lib/cdp.mjs';
9
+ import { readZip } from '../../../estimate/classic/scripts/test/zip.mjs';
10
+ import { noFlowsAt } from '../../../estimate/workflow-based/scripts/test/stage.mjs';
11
+ import { lead } from './workflow-stage.mjs';
12
+
13
+ const skip = findChrome() ? false : 'no chrome on PATH';
14
+ const settle = () => new Promise((r) => setTimeout(r, 1500));
15
+ // Draws a small SVG into each diagram, as mermaid would, so the PNG path runs for real.
16
+ const DRAWING_STUB = 'globalThis.mermaid={initialize(){},async run({querySelector}){for(const el of document.querySelectorAll(querySelector)){'
17
+ + 'el.innerHTML=\'<svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" viewBox="0 0 300 80"><rect x="5" y="5" width="120" height="40" fill="#eee" stroke="#333"/><text x="20" y="30">Step</text></svg>\';}}};';
18
+
19
+ // Fails the second diagram as real mermaid does: an error drawing in its
20
+ // place unless suppressErrorRendering is set, then run() rejects.
21
+ const FAILING_STUB = 'globalThis.mermaid={cfg:{},initialize(c){this.cfg=c;},async run({querySelector}){let err;'
22
+ + '[...document.querySelectorAll(querySelector)].forEach((el,i)=>{if(i===1){err=new Error("Syntax error in text");'
23
+ + 'if(!this.cfg.suppressErrorRendering)el.innerHTML=\'<svg xmlns="http://www.w3.org/2000/svg" aria-roledescription="error" width="300" height="80"><text x="10" y="40">Syntax error</text></svg>\';return;}'
24
+ + 'el.innerHTML=\'<svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" viewBox="0 0 300 80"><rect x="5" y="5" width="120" height="40" fill="#eee"/></svg>\';});if(err)throw err;}};';
25
+
26
+ function proposalUrl(stub = DRAWING_STUB, edit = null) {
27
+ const l = lead();
28
+ if (edit) edit(l.dir);
29
+ const bundle = join(l.dir, 'mermaid.js');
30
+ writeFileSync(bundle, stub);
31
+ execFileSync('node', [new URL('../render.mjs', import.meta.url).pathname, '--estimation', l.estimation, '--inputs', l.inputs,
32
+ '--mermaid-bundle', bundle, '--out', join(l.dir, 'dist')]);
33
+ return pathToFileURL(join(l.dir, 'dist', 'proposal.html')).href;
34
+ }
35
+
36
+ test('the page renders every section with no console errors', { skip }, async () => {
37
+ const page = await openPage(proposalUrl());
38
+ try {
39
+ await settle();
40
+ assert.deepEqual(page.errors, []);
41
+ assert.equal(await page.eval('document.querySelectorAll("nav a").length'), 6);
42
+ assert.equal(await page.eval('document.querySelectorAll(".mermaid-canvas svg").length'), 3);
43
+ assert.match(await page.eval('document.getElementById("cost").textContent'), /\$39,000 – \$48,500/);
44
+ } finally { await page.close(); }
45
+ });
46
+
47
+ test('Download DOCX builds a Word file with one PNG per diagram and well-formed XML', { skip }, async () => {
48
+ const page = await openPage(proposalUrl());
49
+ try {
50
+ await settle();
51
+ const files = readZip(Buffer.from(await page.eval('window.__buildDocx()'), 'base64'));
52
+ const pngs = [...files.keys()].filter((k) => k.startsWith('word/media/'));
53
+ assert.deepEqual(pngs, ['word/media/image1.png', 'word/media/image2.png', 'word/media/image3.png']);
54
+ assert.equal(files.get('word/media/image1.png').subarray(1, 4).toString('latin1'), 'PNG');
55
+ for (const part of ['word/document.xml', 'word/styles.xml', 'word/numbering.xml', '[Content_Types].xml']) {
56
+ const xml = JSON.stringify(files.get(part).toString('utf8'));
57
+ const broken = await page.eval(`new DOMParser().parseFromString(${xml}, 'application/xml').getElementsByTagName('parsererror').length`);
58
+ assert.equal(broken, 0, part);
59
+ }
60
+ } finally { await page.close(); }
61
+ });
62
+
63
+ test('the print layout hides the menu and both buttons', { skip }, async () => {
64
+ const page = await openPage(proposalUrl());
65
+ try {
66
+ await page.send('Emulation.setEmulatedMedia', { media: 'print' });
67
+ assert.equal(await page.eval('getComputedStyle(document.querySelector(".tools")).display'), 'none');
68
+ assert.equal(await page.eval('getComputedStyle(document.querySelector("nav")).display'), 'none');
69
+ assert.equal(await page.eval('getComputedStyle(document.getElementById("system-2")).breakBefore'), 'page');
70
+ } finally { await page.close(); }
71
+ });
72
+
73
+ test('a diagram that fails to draw shows its steps on the page and in the DOCX, never an error picture', { skip }, async () => {
74
+ const page = await openPage(proposalUrl(FAILING_STUB));
75
+ try {
76
+ await settle();
77
+ assert.deepEqual(page.errors, []);
78
+ const steps = await page.eval('JSON.parse(document.getElementById("proposal-data").textContent).systems.flatMap((s) => s.flows)[1].steps');
79
+ assert.equal(await page.eval('document.querySelectorAll(".mermaid-canvas")[1].querySelector("svg") === null'), true);
80
+ assert.equal(await page.eval('document.querySelectorAll(".mermaid-canvas")[1].textContent'), steps);
81
+ const files = readZip(Buffer.from(await page.eval('window.__buildDocx()'), 'base64'));
82
+ assert.deepEqual([...files.keys()].filter((k) => k.startsWith('word/media/')), ['word/media/image1.png', 'word/media/image3.png']);
83
+ assert.ok(files.get('word/document.xml').toString('utf8').includes(steps.replaceAll('&', '&amp;')));
84
+ } finally { await page.close(); }
85
+ });
86
+
87
+ test('a system with no workflow: one diagram fewer on the page and in the DOCX, no errors', { skip }, async () => {
88
+ const page = await openPage(proposalUrl(DRAWING_STUB, noFlowsAt));
89
+ try {
90
+ await settle();
91
+ assert.deepEqual(page.errors, []);
92
+ assert.equal(await page.eval('document.querySelectorAll(".mermaid-canvas svg").length'), 1);
93
+ const files = readZip(Buffer.from(await page.eval('window.__buildDocx()'), 'base64'));
94
+ assert.deepEqual([...files.keys()].filter((k) => k.startsWith('word/media/')), ['word/media/image1.png']);
95
+ } finally { await page.close(); }
96
+ });
@@ -0,0 +1,98 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { readFileSync, writeFileSync, unlinkSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { loadLead, proposalFindings, isWorkflow } from '../lib/workflow-lead.mjs';
6
+ import { checkProposalInputs } from '../lib/workflow-checks.mjs';
7
+ import { lead, passInputs } from './workflow-stage.mjs';
8
+
9
+ const staged = lead();
10
+ const { est, req } = loadLead(staged.estimation);
11
+ const check = (edit) => { const inputs = passInputs(); edit(inputs); return checkProposalInputs({ inputs, est, req }); };
12
+
13
+ test('the sin-kowa-mini lead and its sentences pass', () => {
14
+ assert.equal(isWorkflow(est), true);
15
+ assert.deepEqual(proposalFindings(staged).findings, []);
16
+ });
17
+
18
+ test('W1: client, title, firm, scope intro, ISO date and tech level are required', () => {
19
+ const out = check((i) => { delete i.firm; i.scopeIntro = ' '; i.date = '7 Oct 2026'; i.techLevel = 'expert'; });
20
+ assert.deepEqual(out, [
21
+ 'proposal-inputs.json: missing "firm"',
22
+ 'proposal-inputs.json: missing "scopeIntro"',
23
+ 'proposal-inputs.json: "date" must be an ISO date (YYYY-MM-DD)',
24
+ 'proposal-inputs.json: "techLevel" must be non-tech | low-tech | technical',
25
+ ]);
26
+ });
27
+
28
+ test('W2: every milestone the features use needs a name and what it demonstrates; no unknown keys', () => {
29
+ const out = check((i) => {
30
+ delete i.milestones['M2 - Money'].demonstrates;
31
+ i.milestones['M9 - Later'] = { name: 'x', demonstrates: 'y' };
32
+ i.systems['SYS-404'] = 'nothing';
33
+ i.systems['SYS-001'] = '';
34
+ });
35
+ assert.deepEqual(out, [
36
+ 'milestone "M2 - Money": needs a client "name" and "demonstrates"',
37
+ 'milestones: "M9 - Later" is not a milestone of this estimate',
38
+ 'systems: "SYS-404" is not a system in requirements.json',
39
+ 'systems: "SYS-001" needs a sentence or no entry',
40
+ ]);
41
+ });
42
+
43
+ test('W3: a price written in a sentence is refused, in any common spelling', () => {
44
+ for (const said of ['$40k', 'USD 5,000', 'SGD150,000', '5,000 dollars', '12k SGD', '€300']) {
45
+ const out = check((i) => { i.scopeIntro = `Phase 1 costs about ${said} in total.`; });
46
+ assert.equal(out.length, 1, said);
47
+ assert.match(out[0], /^scopeIntro: price ".+" — prices come only from the estimate$/, said);
48
+ }
49
+ assert.deepEqual(check((i) => { i.scopeIntro = 'It covers 2 systems and 5 features in 3 milestones.'; }), []);
50
+ });
51
+
52
+ test('W3: lowercase, regional and spelled-out prices are refused too', () => {
53
+ for (const said of ['5000 usd', 'usd 5,000', '5,000 Dollars', 'RM 20,000', 'MYR 20,000', 'HKD 10k', 'JPY 300000',
54
+ 'VND 500,000,000', '¥300,000', '₹50,000', '1.2 million USD', '40 thousand dollars']) {
55
+ const out = check((i) => { i.scopeIntro = `Phase 1 costs about ${said} in total.`; });
56
+ assert.equal(out.length, 1, said);
57
+ assert.match(out[0], /^scopeIntro: price ".+" — prices come only from the estimate$/, said);
58
+ }
59
+ assert.deepEqual(check((i) => { i.scopeIntro = 'In 2 months, 3 teams cover 5 features over 2026.'; }), []);
60
+ });
61
+
62
+ test('W3/W4: the title is the page heading, so it is held to the sentence rules', () => {
63
+ const out = check((i) => { i.title = 'Sin Kowa FEAT-001 for $40k'; });
64
+ assert.deepEqual(out, ['title: price "$40k" — prices come only from the estimate', 'title: internal ID "FEAT-001" — name the thing in words']);
65
+ });
66
+
67
+ test('W4: an engineer milestone name in a sentence is refused (P6)', () => {
68
+ const out = check((i) => { i.scopeIntro = 'After M1 - Walking skeleton the team moves on.'; });
69
+ assert.deepEqual(out, ['scopeIntro: internal ID "M1 - " — name the thing in words']);
70
+ });
71
+
72
+ test('W4: an internal ID in a sentence is refused', () => {
73
+ const out = check((i) => { i.milestones['M1 - Walking skeleton'].demonstrates = 'FEAT-001 works end to end.'; });
74
+ assert.deepEqual(out, ['milestones.M1 - Walking skeleton.demonstrates: internal ID "FEAT-001" — name the thing in words']);
75
+ });
76
+
77
+ test('W5: jargon is refused for a non-tech client, allowed when listed or for a technical one', () => {
78
+ const said = (i) => { i.systems['SYS-002'] = 'A backend checks every order.'; };
79
+ assert.deepEqual(check(said), ['systems.SYS-002: jargon for a non-tech client: "backend" (rewrite plainly or add to jargonAllow)']);
80
+ assert.deepEqual(check((i) => { said(i); i.jargonAllow = ['Backend']; }), []);
81
+ assert.deepEqual(check((i) => { said(i); i.techLevel = 'technical'; }), []);
82
+ });
83
+
84
+ test('W6: a stale estimate, a missing BA package or bad inputs JSON stop before the sentences', () => {
85
+ const stale = lead();
86
+ const e = JSON.parse(readFileSync(stale.estimation, 'utf8'));
87
+ e.computed.features['FEAT-001'].point += 1;
88
+ writeFileSync(stale.estimation, JSON.stringify(e));
89
+ assert.match(proposalFindings(stale).findings.join('\n'), /computed block differs/);
90
+ const noReq = lead();
91
+ unlinkSync(join(noReq.dir, 'requirements.json'));
92
+ assert.match(proposalFindings(noReq).findings[0], /^requirements\.json not found/);
93
+ const bad = lead();
94
+ writeFileSync(bad.inputs, '{ “client”: "Sin Kowa" }');
95
+ const { findings } = proposalFindings(bad);
96
+ assert.equal(findings.length, 1);
97
+ assert.match(findings[0], /^proposal-inputs\.json: /);
98
+ });
@@ -0,0 +1,25 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { readFileSync } from 'node:fs';
4
+
5
+ const doc = (p) => readFileSync(new URL(`../../${p}`, import.meta.url), 'utf8');
6
+
7
+ test('SKILL.md routes a workflow estimate to references/workflow.md', () => {
8
+ const skill = doc('SKILL.md');
9
+ assert.match(skill, /scopeMode` is `"workflow"` → follow\s+`references\/workflow\.md`/);
10
+ assert.ok(skill.includes('proposal-inputs.json'));
11
+ });
12
+
13
+ test('workflow.md carries the inputs contract, both commands and the hand-over', () => {
14
+ const d = doc('references/workflow.md');
15
+ for (const needle of ['proposal-inputs.json', 'scripts/validate.mjs --estimation', '--inputs', 'scripts/render.mjs --estimation',
16
+ '--mermaid-bundle', 'Download PDF', 'Download DOCX', 'USD', 'jargonAllow', 'techLevel', 'demonstrates', 'no proposal.md']) {
17
+ assert.ok(d.includes(needle), `workflow.md missing: ${needle}`);
18
+ }
19
+ assert.doesNotMatch(d, /\bTBD\b|\bTODO\b/);
20
+ });
21
+
22
+ test('review.md has a workflow charter that reads the rendered page', () => {
23
+ const d = doc('references/review.md');
24
+ assert.match(d, /## Workflow mode[\s\S]*dist\/proposal\.html/);
25
+ });
@@ -0,0 +1,75 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { spawnSync } from 'node:child_process';
4
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
5
+ import { join } from 'node:path';
6
+ import { lead } from './workflow-stage.mjs';
7
+
8
+ const cli = (name) => new URL(`../${name}.mjs`, import.meta.url).pathname;
9
+ const tpl = () => readFileSync(new URL('../../assets/proposal-workflow.html', import.meta.url), 'utf8');
10
+ const STUB_BUNDLE = 'globalThis.mermaid={initialize(){},run(){return Promise.resolve();}};';
11
+
12
+ function render(l, bundleText = STUB_BUNDLE) {
13
+ const bundle = join(l.dir, 'mermaid.js');
14
+ writeFileSync(bundle, bundleText);
15
+ return spawnSync('node', [cli('render'), '--estimation', l.estimation, '--inputs', l.inputs, '--mermaid-bundle', bundle, '--out', join(l.dir, 'dist')], { encoding: 'utf8' });
16
+ }
17
+ const page = (l) => readFileSync(join(l.dir, 'dist', 'proposal.html'), 'utf8');
18
+
19
+ test('template carries exactly its seven slots, both buttons, a print layout and no external URL', () => {
20
+ const markers = [...new Set([...tpl().matchAll(/<!-- slot:(\w+) -->/g)].map((m) => m[1]))].sort();
21
+ assert.deepEqual(markers, ['CONTENT', 'DATA', 'DOCX', 'FONTS', 'MERMAID_BUNDLE', 'NAV', 'TITLE']);
22
+ assert.match(tpl(), /id="pdf"[^>]*>Download PDF</);
23
+ assert.match(tpl(), /id="docx"[^>]*>Download DOCX</);
24
+ assert.match(tpl(), /@media print[\s\S]*\.tools[\s\S]*break-before: page/);
25
+ assert.doesNotMatch(tpl(), /https?:\/\/(?!www\.w3\.org)/);
26
+ });
27
+
28
+ test('validate routes a workflow estimate to the inputs checks', () => {
29
+ const ok = lead();
30
+ const r = spawnSync('node', [cli('validate'), '--estimation', ok.estimation, '--inputs', ok.inputs], { encoding: 'utf8' });
31
+ assert.equal(r.status, 0, r.stderr);
32
+ assert.match(r.stdout, /proposal inputs valid/);
33
+ const noInputs = spawnSync('node', [cli('validate'), '--estimation', ok.estimation], { encoding: 'utf8' });
34
+ assert.equal(noInputs.status, 1);
35
+ assert.match(noInputs.stderr, /^usage: validate\.mjs --estimation estimation\.json --inputs proposal-inputs\.json/);
36
+ const bad = lead((i) => { i.scopeIntro = 'About $40k.'; });
37
+ const r2 = spawnSync('node', [cli('validate'), '--estimation', bad.estimation, '--inputs', bad.inputs], { encoding: 'utf8' });
38
+ assert.equal(r2.status, 1);
39
+ assert.match(r2.stderr, /scopeIntro: price "\$40k"/);
40
+ });
41
+
42
+ test('render writes a self-contained proposal.html with the page data and the DOCX writer', () => {
43
+ const l = lead();
44
+ const r = render(l);
45
+ assert.equal(r.status, 0, r.stderr);
46
+ const html = page(l);
47
+ assert.doesNotMatch(html, /<!-- slot:/);
48
+ assert.doesNotMatch(html, /<(link|script|img)[^>]+(href|src)="https?:/);
49
+ assert.match(html, /<title>Proposal — Sin Kowa<\/title>/);
50
+ assert.match(html, /<h1>Sin Kowa Digital Transformation — Systems &amp; Workflows Proposal<\/h1>/);
51
+ assert.match(html, /function zipStore\(/);
52
+ assert.match(html, /function buildDocx\(/);
53
+ assert.doesNotMatch(html, /^\s*(?:export|import) /m);
54
+ const data = JSON.parse(/<script type="application\/json" id="proposal-data">([\s\S]*?)<\/script>/.exec(html)[1]);
55
+ assert.equal(data.cost.range, '$39,000 – $48,500');
56
+ assert.equal(data.systems.length, 2);
57
+ });
58
+
59
+ test('a name cannot close the data script tag', () => {
60
+ const l = lead((i) => { i.scopeIntro = 'Ends here </script><script>alert(1)</script>'; });
61
+ assert.equal(render(l).status, 0);
62
+ const html = page(l);
63
+ assert.equal((html.match(/<script>alert/g) ?? []).length, 0);
64
+ });
65
+
66
+ test('render refuses on a finding, or a bundle with a script terminator, and writes nothing', () => {
67
+ const bad = lead((i) => { delete i.milestones['M3 - Operations']; });
68
+ const r = render(bad);
69
+ assert.equal(r.status, 1);
70
+ assert.match(r.stderr, /milestone "M3 - Operations": needs a client "name" and "demonstrates"/);
71
+ assert.equal(existsSync(join(bad.dir, 'dist', 'proposal.html')), false);
72
+ const l = lead();
73
+ assert.equal(render(l, 'var x = "</script>";').status, 1);
74
+ assert.equal(existsSync(join(l.dir, 'dist', 'proposal.html')), false);
75
+ });
@@ -0,0 +1,15 @@
1
+ // A computed sin-kowa-mini lead (the estimate's own workflow test lead) plus
2
+ // the proposal's sentences, in a temp folder.
3
+ import { readFileSync, writeFileSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { staged } from '../../../estimate/workflow-based/scripts/test/stage.mjs';
6
+
7
+ export const passInputs = () => JSON.parse(readFileSync(new URL('./fixtures/proposal-inputs-pass.json', import.meta.url), 'utf8'));
8
+
9
+ export function lead(edit) {
10
+ const dir = staged();
11
+ const inputs = passInputs();
12
+ if (edit) edit(inputs);
13
+ writeFileSync(join(dir, 'proposal-inputs.json'), JSON.stringify(inputs));
14
+ return { dir, estimation: join(dir, 'estimation.json'), inputs: join(dir, 'proposal-inputs.json') };
15
+ }
@@ -0,0 +1,78 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { loadLead } from '../lib/workflow-lead.mjs';
4
+ import { proposalView, flowCode } from '../lib/workflow-view.mjs';
5
+ import { contentHtml, navHtml } from '../lib/workflow-html.mjs';
6
+ import { noFlowsAt } from '../../../estimate/workflow-based/scripts/test/stage.mjs';
7
+ import { lead, passInputs } from './workflow-stage.mjs';
8
+
9
+ const { est, req } = loadLead(lead().estimation);
10
+ const view = (edit) => { const inputs = passInputs(); if (edit) edit(inputs); return proposalView({ est, req, inputs }); };
11
+ const ID = /\b(?:FEAT|FR|NFR|SYS|WF|BR|ASM|INT|SC|Q)-\d+|\bM\d+ - /;
12
+
13
+ test('systems in BA order, with purpose, the agent sentence, flows and features in words', () => {
14
+ const v = view();
15
+ assert.deepEqual(v.systems.map((s) => [s.no, s.name, s.extra !== '']), [[1, 'Warehouse operations', false], [2, 'Orders & invoicing', true]]);
16
+ assert.deepEqual(v.systems[1].flows.map((f) => f.label), ['Main workflow · Order to cash', 'Sub-workflow · Custom order']);
17
+ assert.equal(v.systems[1].flows[1].steps, 'Flag as custom → Vendor PO → Receive into stock');
18
+ assert.deepEqual(v.systems[0].features[1], { name: 'Short-pack alert', does: 'Flags an item that cannot be packed, in time to buy or cancel' });
19
+ });
20
+
21
+ test('milestones carry client names, numbered, with the features each one finishes', () => {
22
+ const { milestones } = view();
23
+ assert.deepEqual(milestones.rows.map((m) => m.title), ['1. Digitise core records', '2. Connect the workflow', '3. Invoice from the floor']);
24
+ assert.equal(milestones.rows[0].includes, 'Order pipeline & stage engine and Order intake & quotation');
25
+ assert.match(milestones.lead, /^The 5 features sequence into 3 milestones;/);
26
+ });
27
+
28
+ test('register, cost and byline come from the estimate and the inputs', () => {
29
+ const v = view();
30
+ assert.deepEqual(v.register.exclusions, ['last-mile delivery tracking', 'Hosting and third-party subscription fees']);
31
+ assert.equal(v.register.assumptions[0], 'InvoiceNow is a data model only, with no live connection');
32
+ assert.equal(v.cost.range, '$39,000 – $48,500');
33
+ assert.equal(v.cost.single, '$44,000');
34
+ assert.equal(v.byline, 'Oct 7, 2026 · Code Engine Studio');
35
+ assert.equal(v.file, 'sin-kowa-proposal.docx');
36
+ assert.match(v.scope.outLine, /^Explicitly excluded: last-mile delivery tracking\./);
37
+ });
38
+
39
+ test('nothing on the page carries an internal ID or engineer milestone name', () => {
40
+ const v = view();
41
+ assert.doesNotMatch(JSON.stringify(v), ID);
42
+ assert.doesNotMatch(contentHtml(v) + navHtml(v), ID);
43
+ });
44
+
45
+ test('flow code quotes labels, keeps branch labels and survives a quote in a name', () => {
46
+ const code = flowCode({ steps: ['Say "hi"', 'Pack'], branches: [{ from: 'Pack', to: 'Say "hi"', label: 'redo' }] });
47
+ assert.equal(code, 'flowchart LR\n n0 --> n1\n n1 -.->|"redo"| n0\n n0["Say \'hi\'"]\n n1["Pack"]');
48
+ });
49
+
50
+ test('markup in a name is shown as text, never as HTML', () => {
51
+ const v = view();
52
+ v.systems[0].features[0].name = '<img src=x onerror=alert(1)>';
53
+ v.scope.intro = 'Fish & <b>chips</b>';
54
+ const html = contentHtml(v);
55
+ assert.doesNotMatch(html, /<img|<b>chips/);
56
+ assert.match(html, /&lt;img src=x onerror=alert\(1\)&gt;/);
57
+ assert.match(html, /Fish &amp; &lt;b&gt;chips&lt;\/b&gt;/);
58
+ });
59
+
60
+ test('without a map label the scope table has one column', () => {
61
+ const v = view();
62
+ v.scope.mapLabel = null;
63
+ assert.match(contentHtml(v), /<thead><tr><th>System<\/th><\/tr><\/thead>/);
64
+ });
65
+
66
+ test('the menu links every section in page order', () => {
67
+ const links = [...navHtml(view()).matchAll(/href="#([\w-]+)"/g)].map((m) => m[1]);
68
+ assert.deepEqual(links, ['scope', 'system-1', 'system-2', 'milestones', 'register', 'cost']);
69
+ });
70
+
71
+ test('a system the PO document draws no workflow for: no flows, features still listed', () => {
72
+ const l = lead();
73
+ noFlowsAt(l.dir);
74
+ const { est: e, req: r } = loadLead(l.estimation);
75
+ const v = proposalView({ est: e, req: r, inputs: passInputs() });
76
+ assert.deepEqual(v.systems[1].flows, []);
77
+ assert.deepEqual(v.systems[1].features.map((f) => f.name), ['Order intake & quotation', 'Invoice from packed quantities', 'One login, role-based screens']);
78
+ });
@@ -1,5 +1,7 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { checkProposal } from './lib/checks.mjs';
3
+ import { isWorkflow } from './lib/workflow-lead.mjs';
4
+ import { validateWorkflow } from './lib/workflow-cli.mjs';
3
5
 
4
6
  function parseArgs(argv) {
5
7
  const args = {};
@@ -10,8 +12,9 @@ function parseArgs(argv) {
10
12
  }
11
13
 
12
14
  const args = parseArgs(process.argv.slice(2));
13
- const md = readFileSync(args.md, 'utf8');
14
15
  const estimation = JSON.parse(readFileSync(args.estimation, 'utf8'));
16
+ if (isWorkflow(estimation)) process.exit(validateWorkflow(args));
17
+ const md = readFileSync(args.md, 'utf8');
15
18
  const findings = checkProposal({ md, estimation });
16
19
  if (findings.length) {
17
20
  console.error(findings.join('\n'));
@@ -0,0 +1,61 @@
1
+ export const meta = {
2
+ name: 'review-links',
3
+ description: 'Fresh-eyes review of feature→component links and component tasks, then adversarial verify of every proposed add',
4
+ phases: [{ title: 'Review' }, { title: 'Verify' }],
5
+ }
6
+
7
+ const FINDINGS = {
8
+ type: 'object',
9
+ required: ['findings'],
10
+ properties: {
11
+ findings: {
12
+ type: 'array',
13
+ items: {
14
+ type: 'object',
15
+ required: ['feature', 'action', 'component', 'why'],
16
+ properties: {
17
+ feature: { type: 'string' },
18
+ action: { type: 'string', enum: ['add', 'drop', 'task'] },
19
+ component: { type: 'string' },
20
+ why: { type: 'string' },
21
+ },
22
+ },
23
+ },
24
+ },
25
+ }
26
+ const VERDICT = {
27
+ type: 'object',
28
+ required: ['verdict', 'why'],
29
+ properties: {
30
+ verdict: { type: 'string', enum: ['ACCEPT', 'REJECT'] },
31
+ why: { type: 'string' },
32
+ quoted: { type: 'string' },
33
+ },
34
+ }
35
+
36
+ const read = `Read ${args.linking} (core rubric + task rubric), then ${args.architecture} (§6 components, §9 externals), then ${args.requirements}, then ${args.inputs}.`
37
+
38
+ phase('Review')
39
+ const review = await agent(`${read}
40
+ You are a fresh-eyes reviewer of the feature→component links (components[].builds) and the component tasks in the inputs file.
41
+ A link is right only when the feature CHANGES the component: a new rule, new data, a new kind of event, a new constraint.
42
+ Propose "add" only when you can name the change inside that component. Propose "drop" only when the linker's why describes use, not change.
43
+ Propose "task" for a task-rubric breach (component in "component", what is wrong in "why"). When unsure, leave it alone. Fewer, surer findings beat many.`, { schema: FINDINGS })
44
+
45
+ // agent() is null when the reviewer is skipped or dies: nothing to apply.
46
+ const findings = review?.findings ?? []
47
+ if (!review) log('review returned nothing; no findings to verify')
48
+
49
+ phase('Verify')
50
+ const verified = await pipeline(findings, (f) => (f.action !== 'add' ? { ...f, verdict: 'ACCEPT' }
51
+ : agent(`Read ${args.architecture} (§6, §9) and the features in ${args.requirements}.
52
+ Proposed link: feature ${f.feature} → component "${f.component}". Proposer's why: "${f.why}".
53
+ 1. Does the §6 Responsibility of this component ALREADY describe the behaviour the proposal says the feature needs? If yes → REJECT.
54
+ 2. Does the feature's description ask for this work, or is it operational scope nobody asked for (monitoring, tests, docs)? If not asked → REJECT.
55
+ 3. Can you name the concrete change inside this component that §6 does not already list? If yes → ACCEPT.
56
+ Quote (at most 15 words) the §6 text you relied on in "quoted".`, { schema: VERDICT, phase: 'Verify', label: `${f.feature} → ${f.component}` })
57
+ // the proposer's why stays the link's why; the verdict travels beside it
58
+ .then((v) => v && ({ ...f, verdict: v.verdict, verifyWhy: v.why, quoted: v.quoted }))))
59
+
60
+ log(`${findings.length} findings, ${verified.filter(Boolean).filter((f) => f.verdict === 'ACCEPT').length} confirmed`)
61
+ return verified.filter(Boolean).filter((f) => f.verdict === 'ACCEPT')
@@ -1,101 +0,0 @@
1
- # AI multipliers — categories, formula, seniority, the blanket-multiplier ban
2
-
3
- Read while assigning a `category` to each task and again while choosing
4
- `verificationPct`. Defines what each AI-speedup category means concretely,
5
- how the formula in `estimate-math.mjs` uses it, and the one rule that keeps
6
- an agent from inventing a project-wide speedup number.
7
-
8
- **In AGENTIC delivery mode this model is retired from estimation** —
9
- measurement-based baselines (`references/agentic-estimation.md`) replace
10
- category scoring and the formula below entirely; agentic tasks carry a
11
- `shape`, not a `category`, and `schema.mjs` rejects `category` on an agentic
12
- task outright. This doc's model survives only as intuition for
13
- `seedMinutes` on an uncalibrated shape — the categories below are a useful
14
- gut-check for an o/m/p seed guess, nothing more, in that one case. For
15
- TRADITIONAL scenarios (humans code, with or without AI-assisted plans), the
16
- categories and formula below are unchanged.
17
-
18
- ## 1. Category table
19
-
20
- | Category | AI speedup range | Example tasks |
21
- | --- | --- | --- |
22
- | `boilerplate` | 50-80% | CRUD endpoint, DB migration, form scaffold, DTO/type definitions, config wiring, standard test scaffolding |
23
- | `logic` | 20-40% | validation rules, state machines, pricing/scheduling rules, non-trivial data transforms, API integration glue |
24
- | `novel` | 0-10% | new algorithm design, novel UX interaction, unfamiliar third-party API with thin docs, performance-critical tuning, security-sensitive design |
25
-
26
- Pick the category per task, not per feature or per project — a feature that
27
- mixes a CRUD endpoint (`boilerplate`) with a pricing rule engine (`logic`)
28
- has tasks in both categories.
29
-
30
- ## 2. Formula
31
-
32
- The blended AI-adjusted estimate for a task is:
33
-
34
- ```
35
- (AO + 2×AR + TR) / 4
36
- ```
37
-
38
- where `TR` is the task's seniority-scaled hours with no AI help, `AR` is TR
39
- reduced by the category's average speedup, and `AO` is TR reduced by the
40
- category's *maximum* speedup — the optimistic case weighted at 1, the
41
- average case weighted at 2, so a single lucky run doesn't drag the whole
42
- estimate down. This doc explains the formula; the code computes it, in
43
- `taskHours()`/`aiAdjust()` in `scripts/lib/estimate-math.mjs`. Never
44
- re-derive this arithmetic by hand or in prose — call the function.
45
-
46
- ## 3. Seniority scaling
47
-
48
- Task PERT hours assume a mid-level engineer. `SENIORITY_FACTOR` scales the
49
- **base effort** on every path — traditional and AI alike:
50
-
51
- | Seniority | Factor | Effect |
52
- | --- | --- | --- |
53
- | junior | 1.15 | slower baseline — same task takes 15% longer |
54
- | mid | 1.0 | baseline, no scaling |
55
- | senior | 0.85 | faster baseline — same task takes 15% less |
56
-
57
- The AI reduction itself is a property of the task category, not of the
58
- engineer: scaling the reduction by seniority (an earlier draft of this
59
- model) made juniors come out *faster than seniors* on AI plans, which no
60
- delivery data supports. With base-effort scaling, a senior with AI is always
61
- at or below a junior with AI on the same task.
62
-
63
- ## 4. Verification overhead
64
-
65
- Default `verificationPct` is **12%**, added on top of the blended AI-adjusted
66
- hours. AI output is not free to trust: someone still reads the diff, runs
67
- it, and checks it against the actual requirement. Skipping this line item
68
- means the estimate only counts the time to generate code, not the time to
69
- ship code — the two are not the same number.
70
-
71
- ## 5. Blanket-multiplier prohibition — hard rule
72
-
73
- **Never apply a single AI speedup percentage to a whole project or a whole
74
- feature.** Assign category and speedup per task, and let the formula roll
75
- totals up from there.
76
-
77
- The reason: a project that is 70% faster on its CRUD tasks is not 70% faster
78
- overall. The CRUD tasks might be 20% of total hours; the other 80% is
79
- `logic` and `novel` work where AI barely moves the needle. Blending at the
80
- project level erases that mix and produces a number nobody can defend.
81
-
82
- ## Tooling seat cost
83
-
84
- Seat pricing is an interview input (`toolingCostPerSeat`, per seat per
85
- month, any vendor), not a constant — see `interview.md` §4 question 5. It
86
- prices `toolingCost = months × seat cost × team size` and never touches
87
- hours; only `aiAssisted` gates the per-category reduction above.
88
-
89
- ## Sources
90
-
91
- - Formula `(AO + 2×AR + TR) / 4`, per-category reduction ranges, and the
92
- non-uniform-acceleration warning — Kmino, *Software Estimation with AI*
93
- (kmino.io/blog/software-estimation-with-ai). Published practitioner
94
- observations, not peer-reviewed data. Kmino also varies AI gains by
95
- seniority; this skill departs from that and scales base effort instead
96
- (see §3 for why).
97
- - Blanket-multiplier prohibition — Kmino's caveat, promoted to hard rule here.
98
- - Capacity and calibration constants (`HOURS_PER_MONTH`, `COORDINATION_TAX`,
99
- seniority factors, 12% verification overhead) — this skill's own defaults,
100
- not sourced; tune against real delivery history.
101
- - Plan prices — manual snapshot, see the dated table above.