@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
@@ -1,93 +1,152 @@
1
1
  import { test } from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import { sectionText, tables } from '../lib/sections.mjs';
3
+ import { sectionText, tables, SECTIONS } from '../lib/sections.mjs';
4
4
  import { checkDoc } from '../lib/checks-doc.mjs';
5
- import { parseFrontmatter } from '../../../analyze-requirements/scripts/lib/frontmatter.mjs';
6
5
 
7
- const estimation = { computed: { scenarios: { s1: { months: 2, totalCost: 10000 } } }, inputs: { scenarios: [{ id: 's1', team: [] }] } };
8
6
  const TODAY = new Date('2026-08-06');
9
7
 
10
- const FM = `---
11
- client: Acme Corp
12
- client_tech_level: non-tech
13
- scenario: s1
14
- currency: USD
15
- valid_until: 2099-12-31
16
- source_architecture: ../ARCHITECTURE.md
17
- source_estimation: ../estimation.json
18
- ---`;
19
-
20
- const SECTION_BODIES = `
8
+ function validFm() {
9
+ return {
10
+ client: 'Acme Corp',
11
+ client_tech_level: 'non-tech',
12
+ currency: 'USD',
13
+ valid_until: '2099-12-31',
14
+ source_architecture: '../ARCHITECTURE.md',
15
+ source_estimation: '../estimation.json',
16
+ };
17
+ }
18
+
19
+ function fullDoc() {
20
+ return `
21
21
  ## Executive Summary
22
- We fix scheduling.
22
+
23
+ We fix scheduling for $8,000 – $12,000.
24
+
23
25
  ## Background & Objectives
26
+
24
27
  Bookings are manual today.
28
+
25
29
  ## Proposed Solution
30
+
26
31
  \`\`\`mermaid
27
32
  graph LR; A[You] --> B[New system]
28
33
  \`\`\`
34
+
29
35
  ## Scope
36
+
30
37
  | Feature | What you get |
31
38
  | --- | --- |
32
39
  | Booking | Online appointments |
40
+
33
41
  ## Out of Scope & Assumptions
42
+
34
43
  - SMS reminders are out.
44
+
35
45
  ## Delivery Approach
46
+
36
47
  Two milestones, weekly demos.
48
+
37
49
  ## Investment & Timeline
38
- $8,000 – $12,000 over 1.6–2.4 months.
39
- ## Team
40
- One senior engineer, one mid-level engineer.
50
+
51
+ | Milestone | Investment |
52
+ | --- | --- |
53
+ | M1 | $6,000 – $9,000 |
54
+ | M2 | $2,000 – $3,000 |
55
+
41
56
  ## About Code Engine Studio
57
+
42
58
  We build software. Contact: hello@example.com
59
+
43
60
  ## Next Steps
61
+
44
62
  Valid until 2099-12-31. Reply to accept.
45
63
  `;
64
+ }
46
65
 
47
- const goodMd = `${FM}\n${SECTION_BODIES}`;
48
- const check = (md) => checkDoc({ fm: parseFrontmatter(md).data, md, estimation, today: TODAY });
66
+ const check = ({ fm = validFm(), md = fullDoc(), today = TODAY } = {}) => checkDoc({ fm, md, today });
49
67
 
50
68
  test('a complete document produces no findings', () => {
51
- assert.deepEqual(check(goodMd), []);
69
+ assert.deepEqual(check(), []);
52
70
  });
53
71
 
54
72
  test('sectionText slices one section and returns null for missing ones', () => {
55
- assert.match(sectionText(goodMd, 'Scope'), /Online appointments/);
56
- assert.doesNotMatch(sectionText(goodMd, 'Scope'), /SMS reminders/);
57
- assert.equal(sectionText(goodMd, 'Signature'), null);
73
+ const md = fullDoc();
74
+ assert.match(sectionText(md, 'Scope'), /Online appointments/);
75
+ assert.doesNotMatch(sectionText(md, 'Scope'), /SMS reminders/);
76
+ assert.equal(sectionText(md, 'Signature'), null);
58
77
  });
59
78
 
60
79
  test('tables groups pipe rows and drops the separator', () => {
61
- const [t] = tables(sectionText(goodMd, 'Scope'));
80
+ const [t] = tables(sectionText(fullDoc(), 'Scope'));
62
81
  assert.deepEqual(t.header, ['Feature', 'What you get']);
63
82
  assert.deepEqual(t.rows, [['Booking', 'Online appointments']]);
64
83
  });
65
84
 
66
85
  test('every missing or empty section is a finding', () => {
67
- const noTeam = goodMd.replace(/## Team[\s\S]*?(?=## About)/, '');
68
- assert.ok(check(noTeam).some((f) => f.includes('Team')));
69
- const emptyScope = goodMd.replace('| Booking | Online appointments |\n', '')
70
- .replace('## Scope\n| Feature | What you get |\n| --- | --- |', '## Scope');
71
- assert.ok(check(emptyScope).some((f) => f.includes('Scope')));
86
+ const noScope = fullDoc().replace(/## Scope[\s\S]*?(?=## Out of Scope)/, '');
87
+ assert.ok(check({ md: noScope }).some((f) => f.includes('Scope')));
88
+ const emptyScope = fullDoc().replace('| Booking | Online appointments |\n', '')
89
+ .replace('## Scope\n\n| Feature | What you get |\n| --- | --- |', '## Scope');
90
+ assert.ok(check({ md: emptyScope }).some((f) => f.includes('Scope')));
72
91
  });
73
92
 
74
- test('frontmatter contract: missing key, bad tech level, unknown scenario', () => {
75
- assert.ok(check(goodMd.replace('currency: USD\n', '')).some((f) => f.includes('currency')));
76
- assert.ok(check(goodMd.replace('non-tech', 'wizard')).some((f) => f.includes('client_tech_level')));
77
- assert.ok(check(goodMd.replace('scenario: s1', 'scenario: ghost')).some((f) => f.includes('ghost')));
93
+ test('frontmatter contract: missing key, bad tech level', () => {
94
+ const noCurrency = validFm();
95
+ delete noCurrency.currency;
96
+ assert.ok(check({ fm: noCurrency }).some((f) => f.includes('currency')));
97
+ assert.ok(check({ fm: { ...validFm(), client_tech_level: 'wizard' } })
98
+ .some((f) => f.includes('client_tech_level')));
78
99
  });
79
100
 
80
101
  test('valid_until must be a future ISO date', () => {
81
- assert.ok(check(goodMd.replace('2099-12-31', '2020-01-01')).some((f) => f.includes('valid_until')));
82
- assert.ok(check(goodMd.replace('2099-12-31', 'someday')).some((f) => f.includes('valid_until')));
102
+ assert.ok(check({ fm: { ...validFm(), valid_until: '2020-01-01' } })
103
+ .some((f) => f.includes('valid_until')));
104
+ assert.ok(check({ fm: { ...validFm(), valid_until: 'someday' } })
105
+ .some((f) => f.includes('valid_until')));
83
106
  });
84
107
 
85
108
  test('placeholders and empty tables are findings', () => {
86
- assert.ok(check(goodMd.replace('We fix scheduling.', 'TBD')).some((f) => /placeholder/i.test(f)));
87
- assert.ok(check(`${goodMd}\n| A | B |\n| --- | --- |\n`).some((f) => /empty table/i.test(f)));
109
+ assert.ok(check({ md: fullDoc().replace('We fix scheduling for $8,000 – $12,000.', 'TBD') })
110
+ .some((f) => /placeholder/i.test(f)));
111
+ assert.ok(check({ md: `${fullDoc()}\n| A | B |\n| --- | --- |\n` })
112
+ .some((f) => /empty table/i.test(f)));
88
113
  });
89
114
 
90
115
  test('Proposed Solution must carry a mermaid diagram', () => {
91
- const noDiagram = goodMd.replace(/```mermaid[\s\S]*?```/, 'A drawing.');
92
- assert.ok(check(noDiagram).some((f) => f.includes('mermaid')));
116
+ const noDiagram = fullDoc().replace(/```mermaid[\s\S]*?```/, 'A drawing.');
117
+ assert.ok(check({ md: noDiagram }).some((f) => f.includes('mermaid')));
118
+ });
119
+
120
+ test('the proposal has nine sections and no Team', () => {
121
+ assert.equal(SECTIONS.length, 9);
122
+ assert.ok(!SECTIONS.includes('Team'));
123
+ assert.deepEqual(SECTIONS.slice(0, 3), ['Executive Summary', 'Background & Objectives', 'Proposed Solution']);
124
+ });
125
+
126
+ test('frontmatter no longer requires a scenario', () => {
127
+ const fm = validFm();
128
+ delete fm.scenario;
129
+ const out = checkDoc({ fm, md: fullDoc(), today: new Date('2026-09-25') });
130
+ assert.ok(!out.some((f) => /scenario/i.test(f)), out.join('\n'));
131
+ });
132
+
133
+ test('a leftover scenario key in frontmatter is refused', () => {
134
+ const fm = { ...validFm(), scenario: '2eng-max5x' };
135
+ const out = checkDoc({ fm, md: fullDoc(), today: new Date('2026-09-25') });
136
+ assert.ok(out.some((f) => /scenario.*removed/i.test(f)), out.join('\n'));
137
+ });
138
+
139
+ test('an Investment table with a Duration column is refused', () => {
140
+ const md = fullDoc().replace(
141
+ '## Investment & Timeline\n\n',
142
+ '## Investment & Timeline\n\n| Milestone | Duration | Investment |\n|---|---|---|\n| M1 | 2 months | $32,300 |\n\n',
143
+ );
144
+ const out = checkDoc({ fm: validFm(), md, today: new Date('2026-09-25') });
145
+ assert.ok(out.some((f) => /Duration column/i.test(f)), out.join('\n'));
146
+ });
147
+
148
+ test('a proposal still carrying a Team section is refused', () => {
149
+ const md = `${fullDoc()}\n## Team\n\nTwo senior engineers.\n`;
150
+ const out = checkDoc({ fm: validFm(), md, today: new Date('2026-09-25') });
151
+ assert.ok(out.some((f) => /Team section was removed/i.test(f)), out.join('\n'));
93
152
  });
@@ -22,22 +22,24 @@ test('SKILL.md names the pipeline, both hard prerequisites, and the review gate'
22
22
  }
23
23
  });
24
24
 
25
- test('interview.md carries the prereq gate, tech levels, scenario pick, and profile scopes', () => {
25
+ test('interview.md carries the prereq gate, tech levels, and profile scopes', () => {
26
26
  const d = doc('references/interview.md');
27
- for (const needle of ['non-tech', 'low-tech', 'technical', 'scenario',
27
+ for (const needle of ['non-tech', 'low-tech', 'technical',
28
28
  'valid', 'proposal-profile.json', '.claude/', 'stop']) {
29
29
  assert.ok(d.includes(needle), `interview.md missing: ${needle}`);
30
30
  }
31
+ assert.doesNotMatch(d, /scenario/i);
31
32
  });
32
33
 
33
- test('writing.md states every validator rule family and the ten sections', () => {
34
+ test('writing.md states every validator rule family and the nine sections', () => {
34
35
  const d = doc('references/writing.md');
35
36
  for (const needle of ['Executive Summary', 'Background & Objectives', 'Proposed Solution',
36
37
  'Scope', 'Out of Scope & Assumptions', 'Delivery Approach', 'Investment & Timeline',
37
- 'Team', 'About', 'Next Steps', 'valid_until', 'jargon_allow', 'proposal-figures.json',
38
- 'Never write a number', 'rates']) {
38
+ 'About', 'Next Steps', 'valid_until', 'jargon_allow', 'proposal-figures.json',
39
+ 'Never write a number', 'rates', 'carries no timeline']) {
39
40
  assert.ok(d.includes(needle), `writing.md missing: ${needle}`);
40
41
  }
42
+ assert.doesNotMatch(d, /\*\*Team\*\*/);
41
43
  for (const term of ['kubernetes', 'api']) {
42
44
  assert.ok(JARGON.includes(term), `jargon list lost its anchor term: ${term}`);
43
45
  }
@@ -48,4 +50,8 @@ test('review.md dispatches a fresh-eyes subagent with the five-point charter', (
48
50
  for (const needle of ['fresh', 'tech level', 'hype', 'leak', 'contradiction', 'one']) {
49
51
  assert.ok(d.toLowerCase().includes(needle), `review.md missing: ${needle}`);
50
52
  }
53
+ // The estimate produces no timeline; a review that asks for one pushes the
54
+ // author to promise a duration nothing downstream can back.
55
+ assert.doesNotMatch(d, /how long/i, 'review.md must not ask how long delivery takes');
56
+ assert.match(d, /delivery duration or date/, 'a duration must be listed as a leak');
51
57
  });
@@ -0,0 +1,68 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { execFileSync, spawnSync } from 'node:child_process';
4
+ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
5
+ import { tmpdir } from 'node:os';
6
+ import { join } from 'node:path';
7
+ import { loadLead } from '../lib/workflow-lead.mjs';
8
+ import { proposalView } from '../lib/workflow-view.mjs';
9
+ import { buildDocx } from '../lib/docx-package.mjs';
10
+ import { readZip } from '../../../estimate/classic/scripts/test/zip.mjs';
11
+ import { lead, passInputs } from './workflow-stage.mjs';
12
+
13
+ const { est, req } = loadLead(lead().estimation);
14
+ const view = proposalView({ est, req, inputs: passInputs() });
15
+ // A real 1x1 PNG, standing in for a drawn diagram.
16
+ const PNG = Uint8Array.from(Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64'));
17
+ const drawn = { bytes: PNG, width: 1200, height: 300 };
18
+ // Three workflows in page order; the second one was not drawn.
19
+ const docx = () => readZip(Buffer.from(buildDocx(view, [drawn, null, drawn])));
20
+ const count = (xml, re) => (xml.match(re) ?? []).length;
21
+
22
+ test('the package has every part Word needs, and one PNG per drawn workflow', () => {
23
+ const files = docx();
24
+ assert.deepEqual([...files.keys()], ['[Content_Types].xml', '_rels/.rels', 'word/document.xml', 'word/_rels/document.xml.rels',
25
+ 'word/styles.xml', 'word/numbering.xml', 'word/media/image1.png', 'word/media/image3.png']);
26
+ const rels = files.get('word/_rels/document.xml.rels').toString('utf8');
27
+ assert.match(rels, /Id="rIdImg1"[^>]*Target="media\/image1\.png"/);
28
+ assert.doesNotMatch(rels, /rIdImg2/);
29
+ });
30
+
31
+ test('document.xml follows the page: headings, tables, lists, in order', () => {
32
+ const xml = docx().get('word/document.xml').toString('utf8');
33
+ assert.equal(count(xml, /<w:pStyle w:val="Heading1"\/>/g), 6); // scope, 2 systems, milestones, register, cost
34
+ assert.equal(count(xml, /<w:tbl>/g), 5); // scope, 2 feature tables, milestones, cost
35
+ assert.equal(count(xml, /<w:numId w:val="1"\/>/g), 4); // 2 assumptions + 2 exclusions
36
+ const order = ['Scope: what this proposal covers', 'System 1: Warehouse operations', 'System 2: Orders &amp; invoicing', 'Milestones', 'Cost estimate'];
37
+ const at = order.map((h) => xml.indexOf(`<w:t xml:space="preserve">${h}</w:t>`));
38
+ assert.ok(at.every((x, i) => x > 0 && (i === 0 || x > at[i - 1])), JSON.stringify(at));
39
+ });
40
+
41
+ test('drawn workflows become images; an undrawn one falls back to its steps', () => {
42
+ const xml = docx().get('word/document.xml').toString('utf8');
43
+ assert.deepEqual([...xml.matchAll(/r:embed="(\w+)"/g)].map((m) => m[1]), ['rIdImg1', 'rIdImg3']);
44
+ assert.match(xml, /Order received → Quote → Invoice → Paid/);
45
+ const [, cx] = /<wp:extent cx="(\d+)"/.exec(xml);
46
+ assert.equal(Number(cx), 9638 * 635); // 1200 px is wider than the page: scaled to the text width
47
+ });
48
+
49
+ test('the price, no IDs, no undefined, and text is escaped', () => {
50
+ const xml = docx().get('word/document.xml').toString('utf8');
51
+ assert.match(xml, /\$39,000 – \$48,500/);
52
+ assert.doesNotMatch(xml, /undefined|\b(?:FEAT|FR|SYS|WF|ASM)-\d|M\d - /);
53
+ const v = structuredClone(view);
54
+ v.systems[0].features[0].name = 'A <b> & "c"\u0007';
55
+ const odd = readZip(Buffer.from(buildDocx(v, [null, null, null]))).get('word/document.xml').toString('utf8');
56
+ assert.match(odd, /A &lt;b&gt; &amp; "c"<\/w:t>/);
57
+ });
58
+
59
+ const soffice = spawnSync('soffice', ['--version']).status === 0;
60
+ test('LibreOffice opens the file and reads the text back', { skip: soffice ? false : 'no soffice on PATH' }, () => {
61
+ const dir = mkdtempSync(join(tmpdir(), 'proposal-docx-'));
62
+ writeFileSync(join(dir, 'p.docx'), buildDocx(view, [drawn, null, drawn]));
63
+ execFileSync('soffice', ['--headless', `-env:UserInstallation=file://${dir}/lo`, '--convert-to', 'txt:Text', '--outdir', dir, join(dir, 'p.docx')], { stdio: 'ignore' });
64
+ const text = readFileSync(join(dir, 'p.txt'), 'utf8');
65
+ for (const s of ['Systems & Workflows Proposal', 'System 2: Orders & invoicing', 'Short-pack alert', 'Invoice from the floor', '$39,000 – $48,500']) {
66
+ assert.ok(text.includes(s), s);
67
+ }
68
+ });
@@ -10,10 +10,10 @@ const script = (p) => new URL(p, import.meta.url).pathname;
10
10
  test('compute → derive → validate → render runs clean end to end', () => {
11
11
  const dir = mkdtempSync(join(tmpdir(), 'proposal-e2e-'));
12
12
  const json = join(dir, 'estimation.json');
13
- execFileSync('node', [script('../../../estimate/scripts/compute.mjs'),
14
- '--inputs', script('../../../estimate/scripts/test/fixtures/booking-inputs.json'), '--out', json]);
13
+ execFileSync('node', [script('../../../estimate/classic/scripts/compute.mjs'),
14
+ '--inputs', script('../../../estimate/classic/scripts/test/fixtures/booking-inputs.json'), '--out', json]);
15
15
  execFileSync('node', [script('../derive.mjs'),
16
- '--estimation', json, '--scenario', '2eng-max5x', '--out', join(dir, 'proposal-figures.json')]);
16
+ '--estimation', json, '--out', join(dir, 'proposal-figures.json')]);
17
17
  execFileSync('node', [script('../validate.mjs'),
18
18
  '--md', script('./fixtures/proposal-pass.md'), '--estimation', json]);
19
19
  const bundle = join(dir, 'mermaid.js');
@@ -0,0 +1,46 @@
1
+ // The pre-fed eval fixtures feed `claude plugin eval` a finished estimate.
2
+ // If they drift from the current estimate model, every eval scores correct
3
+ // behaviour as failure. Pin them: each recomputes to its stored numbers,
4
+ // derives a price, and the figures its eval asserts are the ones derived.
5
+ import { test } from 'node:test';
6
+ import assert from 'node:assert/strict';
7
+ import { readFileSync } from 'node:fs';
8
+ import { checkInputs } from '../../../estimate/classic/scripts/lib/schema.mjs';
9
+ import { computeEstimation } from '../../../estimate/classic/scripts/lib/rollup.mjs';
10
+ import { deriveFigures } from '../lib/figures.mjs';
11
+
12
+ const evalsDir = new URL('../../evals/', import.meta.url);
13
+ const read = (p) => JSON.parse(readFileSync(new URL(p, evalsDir), 'utf8'));
14
+ const evals = read('evals.json').evals;
15
+ const PRE_FED = { 1: 'pre-fed-harborline-dispatch', 2: 'pre-fed-meridian-dental' };
16
+
17
+ const flat = (f) => [f.cost.low, f.cost.high, f.singleNumber,
18
+ ...f.milestones.flatMap((m) => [m.cost.low, m.cost.high])];
19
+
20
+ for (const [id, dir] of Object.entries(PRE_FED)) {
21
+ test(`${dir}: v2 inputs, stored numbers recompute, figures match the eval`, () => {
22
+ const inputs = read(`fixtures/${dir}/estimation-inputs.json`);
23
+ assert.deepEqual(checkInputs(inputs), []);
24
+ const stored = read(`fixtures/${dir}/estimation.json`);
25
+ assert.deepEqual(computeEstimation(stored.inputs).computed, stored.computed);
26
+ assert.deepEqual(stored.inputs, inputs, 'estimation.json was computed from other inputs');
27
+ const figures = deriveFigures(stored);
28
+ const traced = evals.find((e) => e.id === Number(id)).assertions
29
+ .find((a) => a.startsWith('every-number-traces-upstream'));
30
+ const listed = JSON.parse(`[${/\{([\d, ]+)\}/.exec(traced)[1]}]`);
31
+ assert.deepEqual([...listed].sort((a, b) => a - b), flat(figures).sort((a, b) => a - b));
32
+ });
33
+ }
34
+
35
+ test('the unpriced fixture really is unpriced, so the proposal refuses it', () => {
36
+ const stored = read('fixtures/gate-check-unpriced-harborline/estimation.json');
37
+ assert.deepEqual(computeEstimation(stored.inputs).computed, stored.computed);
38
+ assert.throws(() => deriveFigures(stored), /not priced/);
39
+ });
40
+
41
+ test('the workflow fixture lead validates as the proposal will load it', async () => {
42
+ const { loadLead } = await import('../lib/workflow-lead.mjs');
43
+ const lead = loadLead(new URL('fixtures/workflow-sin-kowa-mini/estimation.json', evalsDir).pathname);
44
+ assert.deepEqual(lead.findings, []);
45
+ assert.equal(lead.est.inputs.scopeMode, 'workflow');
46
+ });
@@ -1,81 +1,94 @@
1
+ // plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs
1
2
  import { test } from 'node:test';
2
3
  import assert from 'node:assert/strict';
3
- import { readFileSync, mkdtempSync } from 'node:fs';
4
+ import { readFileSync, writeFileSync, mkdtempSync } from 'node:fs';
4
5
  import { execFileSync } from 'node:child_process';
5
6
  import { tmpdir } from 'node:os';
6
7
  import { join } from 'node:path';
7
- import { writeFileSync } from 'node:fs';
8
- import { deriveFigures, formatMoney } from '../lib/figures.mjs';
8
+ import { deriveFigures } from '../lib/figures.mjs';
9
9
 
10
- // Hand-checkable synthetic estimation: spread ratios are lo 0.8 / hi 1.2.
11
- const estimation = {
12
- inputs: {
13
- scenarios: [{
14
- id: 's1', aiAssisted: true, toolingCostPerSeat: 100,
15
- team: [{ seniority: 'senior', rate: 50 }, { seniority: 'mid', rate: 40 }],
16
- }],
17
- },
10
+ const estimation = () => ({
11
+ inputs: { features: [] },
18
12
  computed: {
19
- features: {
20
- a: { hours: 100, low: 80, high: 120 },
21
- b: { hours: 100, low: 80, high: 120 },
22
- },
23
- scenarios: {
24
- s1: {
25
- months: 2, totalCost: 10000,
26
- roadmap: [
27
- { milestone: 'M1', startMonths: 0, endMonths: 1.5 },
28
- { milestone: 'M2', startMonths: 1.5, endMonths: 2 },
29
- ],
30
- },
31
- },
13
+ price: { presentLow: 43000, presentHigh: 58000, singleNumber: 50500, p50: 42577.08 },
14
+ roadmap: [
15
+ { milestone: 'M1 - Booking core', features: ['booking'], share: 0.75 },
16
+ { milestone: 'M2 - Notifications', features: ['reminders'], share: 0.25 },
17
+ ],
32
18
  },
33
- };
19
+ });
20
+
21
+ test('cost comes from the presented range, not from hour ratios', () => {
22
+ const f = deriveFigures(estimation());
23
+ assert.equal(f.cost.low, 43000);
24
+ assert.equal(f.cost.high, 58000);
25
+ assert.equal(f.singleNumber, 50500);
26
+ });
34
27
 
35
- test('figures scale totals by the feature spread ratios', () => {
36
- const f = deriveFigures(estimation, 's1');
37
- assert.deepEqual(f.cost, { low: 8000, high: 12000 });
38
- assert.deepEqual(f.months, { low: 1.6, high: 2.4 });
28
+ test('no months and no team survive in the figures', () => {
29
+ const f = deriveFigures(estimation());
30
+ assert.equal(f.months, undefined);
31
+ assert.equal(f.team, undefined);
32
+ for (const m of f.milestones) assert.equal(m.months, undefined);
39
33
  });
40
34
 
41
- test('milestone splits follow the roadmap band shares', () => {
42
- const f = deriveFigures(estimation, 's1');
43
- assert.deepEqual(f.milestones, [
44
- { name: 'M1', cost: { low: 6000, high: 9000 }, months: { low: 1.2, high: 1.8 } },
45
- { name: 'M2', cost: { low: 2000, high: 3000 }, months: { low: 0.4, high: 0.6 } },
46
- ]);
35
+ test('milestone cost splits follow the roadmap shares; the last takes the remainder', () => {
36
+ const f = deriveFigures(estimation());
37
+ assert.equal(f.milestones[0].cost.low, 32300); // 43000 * 0.75, rounded to 100
38
+ assert.equal(f.milestones[1].cost.low, 10700); // 43000 - 32300, not round100(10750) = 10800
47
39
  });
48
40
 
49
- test('team lists seniorities only — rates never leave the estimate', () => {
50
- const f = deriveFigures(estimation, 's1');
51
- assert.deepEqual(f.team, ['senior', 'mid']);
52
- assert.doesNotMatch(JSON.stringify(f), /rate|50|40/);
41
+ // R59: the rows above the bold Total line must add up to it exactly, and
42
+ // checkMoney refuses any hand-corrected amount, so the figures have to.
43
+ const withShares = (shares) => {
44
+ const e = estimation();
45
+ e.computed.roadmap = shares.map((share, i) => ({ milestone: `M${i + 1}`, features: [], share }));
46
+ return e;
47
+ };
48
+
49
+ test('milestone costs sum exactly to the presented range', () => {
50
+ for (const shares of [[0.75, 0.25], [0.33, 0.33, 0.33], [0.17, 0.42, 0.42]]) {
51
+ const f = deriveFigures(withShares(shares));
52
+ for (const bound of ['low', 'high']) {
53
+ const sum = f.milestones.reduce((s, m) => s + m.cost[bound], 0);
54
+ assert.equal(sum, f.cost[bound], `shares ${shares} ${bound}: rows sum to ${sum}`);
55
+ }
56
+ }
53
57
  });
54
58
 
55
- test('no roadmap means no milestones, not a crash', () => {
56
- const noRoadmap = structuredClone(estimation);
57
- delete noRoadmap.computed.scenarios.s1.roadmap;
58
- assert.deepEqual(deriveFigures(noRoadmap, 's1').milestones, []);
59
+ test('an estimate with no roadmap yields no milestones, not a crash', () => {
60
+ const e = estimation();
61
+ delete e.computed.roadmap;
62
+ assert.deepEqual(deriveFigures(e).milestones, []);
59
63
  });
60
64
 
61
- test('unknown scenario throws with the id in the message', () => {
62
- assert.throws(() => deriveFigures(estimation, 'nope'), /scenario "nope" not in estimation\.json/);
65
+ // R54: an unpriced estimate (agentic mode / QUICK depth, no scored features)
66
+ // must be refused, never quoted at $0.
67
+ test('an unpriced estimate (p50 zero) is refused, not quoted at $0', () => {
68
+ const e = estimation();
69
+ e.computed.price = { presentLow: 0, presentHigh: 0, singleNumber: 0, p50: 0 };
70
+ assert.throws(() => deriveFigures(e), /estimate is not priced \(no scored features\)/);
63
71
  });
64
72
 
65
- test('formatMoney uses en-US grouping with a dollar sign', () => {
66
- assert.equal(formatMoney(8000), '$8,000');
67
- assert.equal(formatMoney(1234500), '$1,234,500');
73
+ test('a missing price block is refused the same way', () => {
74
+ const e = estimation();
75
+ delete e.computed.price;
76
+ assert.throws(() => deriveFigures(e), /estimate is not priced \(no scored features\)/);
68
77
  });
69
78
 
70
- test('derive.mjs CLI writes the figures file and refuses unknown scenarios', () => {
79
+ test('derive.mjs CLI writes the figures file and refuses an unpriced estimate', () => {
71
80
  const dir = mkdtempSync(join(tmpdir(), 'proposal-derive-'));
72
81
  const est = join(dir, 'estimation.json');
73
- writeFileSync(est, JSON.stringify(estimation));
82
+ writeFileSync(est, JSON.stringify(estimation()));
74
83
  const out = join(dir, 'proposal-figures.json');
75
84
  const cli = new URL('../derive.mjs', import.meta.url).pathname;
76
- execFileSync('node', [cli, '--estimation', est, '--scenario', 's1', '--out', out]);
85
+ execFileSync('node', [cli, '--estimation', est, '--out', out]);
77
86
  const written = JSON.parse(readFileSync(out, 'utf8'));
78
- assert.equal(written.cost.low, 8000);
79
- assert.equal(written.milestones[0].name, 'M1');
80
- assert.throws(() => execFileSync('node', [cli, '--estimation', est, '--scenario', 'nope', '--out', out]));
87
+ assert.equal(written.cost.low, 43000);
88
+ assert.equal(written.milestones[0].name, 'M1 - Booking core');
89
+
90
+ const unpriced = estimation();
91
+ unpriced.computed.price = { presentLow: 0, presentHigh: 0, singleNumber: 0, p50: 0 };
92
+ writeFileSync(est, JSON.stringify(unpriced));
93
+ assert.throws(() => execFileSync('node', [cli, '--estimation', est, '--out', out], { stdio: 'pipe' }));
81
94
  });
@@ -19,4 +19,9 @@ TBD — we deploy the backend API for $9,999.
19
19
  | Booking | observed |
20
20
 
21
21
  ## Investment & Timeline
22
- Total: $9,999 over 1–99 months. Cheaper than 3eng-noai.
22
+ | Milestone | Duration | Investment |
23
+ | --- | --- | --- |
24
+ | M1 | 2 months | $9,999 |
25
+
26
+ ## Team
27
+ Two senior engineers.
@@ -0,0 +1,17 @@
1
+ {
2
+ "client": "Sin Kowa",
3
+ "title": "Sin Kowa Digital Transformation",
4
+ "firm": "Code Engine Studio",
5
+ "date": "2026-10-07",
6
+ "techLevel": "non-tech",
7
+ "jargonAllow": [],
8
+ "scopeIntro": "This proposal covers two systems for Phase 1: warehouse operations, and orders and invoicing. Each is described below by its workflows and the features that serve them.",
9
+ "systems": {
10
+ "SYS-002": "It closes the paper delivery-order gap that delays cash collection by weeks."
11
+ },
12
+ "milestones": {
13
+ "M1 - Walking skeleton": { "name": "Digitise core records", "demonstrates": "Orders move through each stage on screen instead of on paper." },
14
+ "M2 - Money": { "name": "Connect the workflow", "demonstrates": "Short-packs are flagged as they happen, and each person sees only their own work." },
15
+ "M3 - Operations": { "name": "Invoice from the floor", "demonstrates": "Invoices are raised from what was actually packed." }
16
+ }
17
+ }
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  client: Acme Corp
3
3
  client_tech_level: non-tech
4
- scenario: 2eng-max5x
5
4
  currency: USD
6
5
  valid_until: 2099-12-31
7
6
  source_architecture: ../ARCHITECTURE.md
@@ -11,10 +10,10 @@ source_estimation: ../estimation.json
11
10
  # Acme Corp — Proposal
12
11
 
13
12
  ## Executive Summary
14
- Your customers book by phone today; every double-booking costs you a client. We will build an online booking system for $3,400 – $10,300, delivered in 0.2–0.7 months by a two-person team.
13
+ Your customers book by phone today; every double-booking costs you a client. We will build an online booking system for $10,000 – $14,000.
15
14
 
16
15
  ## Background & Objectives
17
- Acme staff manage appointments by hand. The goal: customers book online, reminders go out automatically, and no slot is ever double-booked, live within 0.7 months.
16
+ Acme staff manage appointments by hand. The goal: customers book online, reminders go out automatically, and no slot is ever double-booked.
18
17
 
19
18
  ## Proposed Solution
20
19
  One new system with two parts: the booking page your customers see, and reminders that go out on their own.
@@ -35,18 +34,15 @@ graph LR; C[Your customers] --> B[Online booking] --> R[Automatic reminders]
35
34
  - We assume all bookings happen in a single timezone.
36
35
 
37
36
  ## Delivery Approach
38
- Two milestones. M1 - Booking core runs 0.2–0.5 months; M2 - Notifications runs 0.1–0.2 months. You see a working demo every week, and each milestone ends with your sign-off.
37
+ Two milestones. M1 - Booking core comes first; M2 - Notifications follows. You see a working demo every week, and each milestone ends with your sign-off.
39
38
 
40
39
  ## Investment & Timeline
41
- | Milestone | Duration | Investment |
42
- | --- | --- | --- |
43
- | M1 - Booking core | 0.2–0.5 months | $2,600 – $7,700 |
44
- | M2 - Notifications | 0.1–0.2 months | $900 – $2,600 |
45
-
46
- **Total: $3,400 – $10,300 over 0.2–0.7 months.** The range reflects estimation confidence; we confirm a fixed price before each milestone begins.
40
+ | Milestone | Investment |
41
+ | --- | --- |
42
+ | M1 - Booking core | $7,600 – $10,600 |
43
+ | M2 - Notifications | $2,400 – $3,400 |
47
44
 
48
- ## Team
49
- One senior engineer and one mid-level engineer, working with AI-assisted tooling.
45
+ **Total: $10,000 – $14,000**, or a single fixed price of $12,000 if you prefer one number. The range reflects estimation confidence; we confirm a fixed price before each milestone begins.
50
46
 
51
47
  ## About Code Engine Studio
52
48
  We build custom software for small businesses. Recent work: a clinic scheduling system and a salon booking app. Contact: hello@codeenginestudio.com
@@ -7,8 +7,8 @@ import { join } from 'node:path';
7
7
 
8
8
  const tpl = () => readFileSync(new URL('../../assets/proposal-template.html', import.meta.url), 'utf8');
9
9
  const cli = new URL('../render.mjs', import.meta.url).pathname;
10
- const computeCli = new URL('../../../estimate/scripts/compute.mjs', import.meta.url).pathname;
11
- const inputs = new URL('../../../estimate/scripts/test/fixtures/booking-inputs.json', import.meta.url).pathname;
10
+ const computeCli = new URL('../../../estimate/classic/scripts/compute.mjs', import.meta.url).pathname;
11
+ const inputs = new URL('../../../estimate/classic/scripts/test/fixtures/booking-inputs.json', import.meta.url).pathname;
12
12
  const passMd = new URL('./fixtures/proposal-pass.md', import.meta.url).pathname;
13
13
  const failMd = new URL('./fixtures/proposal-fail.md', import.meta.url).pathname;
14
14
 
@@ -41,7 +41,7 @@ test('render refuses a proposal that fails validation', () => {
41
41
  assert.throws(() => rendered(failMd));
42
42
  });
43
43
 
44
- test('rendered page is self-contained with fonts, nav, and all ten sections', () => {
44
+ test('rendered page is self-contained with fonts, nav, and all nine sections', () => {
45
45
  const html = rendered();
46
46
  assert.doesNotMatch(html, /<!-- slot:/);
47
47
  assert.match(html, /@font-face/);