@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
@@ -16,23 +16,22 @@ test('golden numbers for the booking fixture', () => {
16
16
  assert.equal(computed.tasks['booking-api'].e, 25.33);
17
17
  assert.equal(computed.tasks['booking-rules'].e, 44);
18
18
  assert.equal(computed.tasks['reminder-jobs'].e, 21.33);
19
- assert.equal(computed.devHours, 90.67); // round2(152/6 + 44 + 128/6)
20
- assert.equal(computed.overheadHours, 31.73); // round2(90.6667 × 0.35)
21
- assert.equal(computed.spreadBufferHours, 10.91); // round2(√(4² + 9.3333² + 4²))
22
- assert.equal(computed.riskBufferHours, 12); // 0.3 × 40
23
19
  assert.equal(computed.projectConfidence, 'MED'); // critical path = booking, worst row MED
24
- const rec = computed.scenarios['2eng-max5x'];
25
- assert.ok(rec.months > 0 && rec.totalCost > 0);
26
- assert.equal(rec.totalCost, rec.laborCost + rec.toolingCost);
27
- assert.equal('planCost' in rec, false);
28
- // Same team math as before the plan→aiAssisted rename: hours and seat cost pinned
29
- assert.equal(computed.scenarios['3eng-noai'].hours, 145.31);
30
- assert.equal(rec.hours, 101.35);
31
- assert.equal(rec.toolingCost, 80.44); // 0.4022 mo × $100 × 2 seats
32
- // AI hours strictly below traditional on every task in an AI scenario
33
- for (const id of Object.keys(computed.tasks)) {
34
- assert.ok(rec.taskHours[id] < computed.tasks[id].e);
35
- }
20
+ const { price } = computed;
21
+ // booking: weighted score 14 (M, point 2541.67) · reminders: score 11 (S, point 1423.08)
22
+ assert.equal(price.featurePoints, 3964.74);
23
+ assert.equal(price.contextMultiplier, 1.4); // 1 + (.1 + 0 + .2 + 0 + .1) context deviations
24
+ assert.equal(price.adjustedBase, 5550.64);
25
+ assert.equal(price.contingencyRate, 0.15); // 0.05 + 2.5×0.02 + 2.5×0.02 avg unc/risk
26
+ assert.equal(price.p50, 9957.85);
27
+ assert.equal(price.presentLow, 10000);
28
+ assert.equal(price.presentHigh, 14000);
29
+ });
30
+
31
+ test('price.overheads.amount is rounded before it reaches estimation.json', () => {
32
+ const { computed } = computeEstimation(fixture());
33
+ // adjustedBase 5550.64 × totalPct 0.56 = 3108.3589743589755 unrounded
34
+ assert.equal(computed.price.overheads.amount, 3108.36);
36
35
  });
37
36
 
38
37
  test('CLI writes byte-identical output on repeat runs', () => {
@@ -55,18 +54,16 @@ test('CLI refuses invalid inputs, naming findings', () => {
55
54
  );
56
55
  });
57
56
 
58
- test('scenarios carry a roadmap when features have milestones', () => {
57
+ test('the roadmap is top level when features have milestones', () => {
59
58
  const { computed } = computeEstimation(fixture());
60
- const roadmap = computed.scenarios['2eng-max5x'].roadmap;
59
+ const { roadmap } = computed;
61
60
  assert.deepEqual(roadmap.map((b) => b.milestone), ['M1 - Booking core', 'M2 - Notifications']);
62
61
  assert.deepEqual(roadmap[0].features, ['booking']);
63
62
  assert.deepEqual(roadmap[1].features, ['reminders']);
64
- assert.equal(roadmap[0].startMonths, 0);
65
- assert.equal(roadmap[1].startMonths, roadmap[0].endMonths); // bands tile, no gap
66
- assert.equal(roadmap[1].endMonths, computed.scenarios['2eng-max5x'].months);
67
- // AI-adjusted shares: booking (M1) carries most of the hours
68
- assert.ok(roadmap[0].endMonths - roadmap[0].startMonths
69
- > roadmap[1].endMonths - roadmap[1].startMonths);
63
+ // booking (M1) carries most of the task hours
64
+ assert.ok(roadmap[0].share > roadmap[1].share);
65
+ assert.equal(roadmap[0].share, 0.76);
66
+ assert.equal(roadmap[1].share, 0.24);
70
67
  });
71
68
 
72
69
  test('computed.components rolls feature hours into top-level containers', () => {
@@ -87,13 +84,11 @@ test('no milestones → no roadmap key at all', () => {
87
84
  const bare = fixture();
88
85
  for (const f of bare.features) delete f.milestone;
89
86
  const { computed } = computeEstimation(bare);
90
- for (const s of Object.values(computed.scenarios)) {
91
- assert.ok(!('roadmap' in s), 'roadmap key must be absent, not empty');
92
- }
87
+ assert.ok(!('roadmap' in computed), 'roadmap key must be absent, not empty');
93
88
  });
94
89
 
95
90
  // Agentic-mode rollup.
96
- import { loadMeasurements } from '../lib/measurements.mjs';
91
+ import { loadMeasurements } from '../../../shared/lib/measurements.mjs';
97
92
 
98
93
  const agenticInputsPath = new URL('./fixtures/agentic-inputs.json', import.meta.url).pathname;
99
94
  const measurementsFixture = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
@@ -104,7 +99,7 @@ function agenticInputs() {
104
99
  }
105
100
  const measurements = () => loadMeasurements(measurementsFixture).records;
106
101
 
107
- test('agentic tasks are baseline-driven and scenario-independent', () => {
102
+ test('agentic tasks are baseline-driven', () => {
108
103
  const { computed } = computeEstimation(agenticInputs(), measurements());
109
104
  const swap = computed.tasks['swap-refactor'];
110
105
  assert.equal(swap.samples, 7);
@@ -116,13 +111,10 @@ test('agentic tasks are baseline-driven and scenario-independent', () => {
116
111
  const db = computed.tasks['swap-db'];
117
112
  assert.equal(db.confidence, 'UNCALIBRATED');
118
113
  assert.equal(db.calibrated, false);
119
- // measured durations do not vary by team or plan
120
- assert.deepEqual(computed.scenarios.solo.taskHours, computed.scenarios.pair.taskHours);
121
114
  });
122
115
 
123
- test('agentic risks convert minutes to hours; uncalibrated task taints project confidence', () => {
116
+ test('uncalibrated task taints project confidence', () => {
124
117
  const { computed } = computeEstimation(agenticInputs(), measurements());
125
- assert.equal(computed.riskBufferHours, Math.round((0.3 * 30 / 60) * 100) / 100);
126
118
  assert.equal(computed.projectConfidence, 'UNCALIBRATED'); // swap-db sits on the largest feature
127
119
  });
128
120
 
@@ -154,3 +146,36 @@ test('QUICK inputs get no score fields in computed features', () => {
154
146
  assert.equal('tier' in computed.features.booking, false);
155
147
  assert.equal('scoreTotal' in computed.features.booking, false);
156
148
  });
149
+
150
+ test('computed carries a price block and no scenarios', () => {
151
+ const { computed } = computeEstimation(fixture());
152
+ assert.equal(computed.scenarios, undefined);
153
+ assert.equal(computed.devHours, undefined);
154
+ assert.ok(computed.price.p50 > 0);
155
+ assert.ok(computed.price.presentHigh >= computed.price.presentLow);
156
+ assert.equal(computed.price.presentLow % 500, 0);
157
+ });
158
+
159
+ test('every scored feature carries its price and flag', () => {
160
+ const { computed } = computeEstimation(fixture());
161
+ for (const f of Object.values(computed.features)) {
162
+ assert.ok(Number.isFinite(f.point), 'point');
163
+ assert.ok(Number.isFinite(f.spread), 'spread');
164
+ assert.equal(typeof f.flag, 'string');
165
+ assert.ok(f.priceLow <= f.point && f.point <= f.priceHigh);
166
+ }
167
+ });
168
+
169
+ test('the roadmap is top level and its shares sum to 1', () => {
170
+ const { computed } = computeEstimation(fixture());
171
+ const total = computed.roadmap.reduce((sum, b) => sum + b.share, 0);
172
+ assert.ok(Math.abs(total - 1) < 1e-9, `shares sum to ${total}`);
173
+ assert.equal(computed.roadmap[0].startMonths, undefined);
174
+ });
175
+
176
+ test('repeat runs are byte-identical', () => {
177
+ assert.equal(
178
+ JSON.stringify(computeEstimation(fixture())),
179
+ JSON.stringify(computeEstimation(fixture())),
180
+ );
181
+ });
@@ -4,15 +4,20 @@ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
4
4
  import { execFileSync } from 'node:child_process';
5
5
  import { tmpdir } from 'node:os';
6
6
  import { join } from 'node:path';
7
- import { createServer } from '../../../analyze-requirements/scripts/serve.mjs';
8
- import { findFreePort } from '../../../analyze-requirements/scripts/lib/port.mjs';
7
+ import { pathToFileURL } from 'node:url';
8
+ import { createServer } from '../../../../analyze-requirements/scripts/serve.mjs';
9
+ import { findFreePort } from '../../../../analyze-requirements/scripts/lib/port.mjs';
10
+ import { computeEstimation } from '../lib/rollup.mjs';
11
+ import { findChrome } from '../../../../analyze-requirements/scripts/lib/chrome.mjs';
12
+ import { openPage } from '../../../../analyze-requirements/scripts/lib/cdp.mjs';
9
13
 
10
14
  const scripts = new URL('..', import.meta.url).pathname;
11
15
  const fixture = join(scripts, 'test/fixtures/booking-inputs.json');
12
16
  const passMd = join(scripts, 'test/fixtures/estimation-pass.md');
17
+ const skip = { skip: !findChrome() && 'no chrome on PATH' };
13
18
 
14
19
  test('SKILL.md exists with hard rules and auto-trigger description', () => {
15
- const skill = readFileSync(new URL('../../SKILL.md', import.meta.url), 'utf8');
20
+ const skill = readFileSync(new URL('../../../SKILL.md', import.meta.url), 'utf8') + readFileSync(new URL('../../FLOW.md', import.meta.url), 'utf8');
16
21
  assert.match(skill, /^name: estimate$/m);
17
22
  assert.match(skill, /^description: .*(estimate|effort|quote)/m);
18
23
  assert.match(skill, /never `?0`?/); // honesty rule stated
@@ -59,3 +64,50 @@ test('agentic fixture flows compute → validate → render, and a vague range i
59
64
  writeFileSync(vagueMdPath, vagueMd);
60
65
  assert.throws(() => execFileSync('node', [join(scripts, 'validate.mjs'), '--md', vagueMdPath, '--json', json]));
61
66
  });
67
+
68
+ // The workbook export (assets/estimate-template.html's __buildWorkbook) is
69
+ // deliberately left out of this check: it only runs inside a real page (it
70
+ // reads live DOM/table state), and the price cells it writes are formulas
71
+ // with their cached values stripped (dropCachedValues + recalcOnLoad) so
72
+ // Excel recomputes on open — there is no computed presentLow/presentHigh to
73
+ // read back from the raw xlsx bytes in Node.
74
+
75
+ // Browser-independent: must run (not skip) with no Chrome on PATH, so a
76
+ // price-parity regression never comes back as a silent "skipped".
77
+ test('the estimate and the proposal figures quote the same range', async () => {
78
+ const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
79
+ const estimation = computeEstimation(inputs);
80
+ const { presentLow, presentHigh } = estimation.computed.price;
81
+ const { deriveFigures } = await import('../../../../proposal/scripts/lib/figures.mjs');
82
+ const figures = deriveFigures(estimation);
83
+ assert.equal(figures.cost.low, presentLow);
84
+ assert.equal(figures.cost.high, presentHigh);
85
+ });
86
+
87
+ // The presented range is formatted by the page's own client-side script,
88
+ // not baked into the static file, so this needs a real browser — the one
89
+ // part of this check that Chrome-gates.
90
+ test('the rendered page shows the presented range', skip, async () => {
91
+ const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
92
+ const estimation = computeEstimation(inputs);
93
+ const { presentLow } = estimation.computed.price;
94
+
95
+ const dir = mkdtempSync(join(tmpdir(), 'estimate-e2e-figures-'));
96
+ const json = join(dir, 'estimation.json');
97
+ writeFileSync(json, JSON.stringify(estimation));
98
+ execFileSync('node', [join(scripts, 'render.mjs'), '--json', json, '--md', passMd, '--out', dir]);
99
+
100
+ const page = await openPage(pathToFileURL(join(dir, 'estimate.html')).href);
101
+ try {
102
+ const body = await page.eval('document.body.textContent');
103
+ assert.ok(body.includes(presentLow.toLocaleString('en-US')), 'page range');
104
+ } finally { page.close(); }
105
+ });
106
+
107
+ test('no duration survives anywhere in the pipeline', () => {
108
+ const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
109
+ const json = JSON.stringify(computeEstimation(inputs));
110
+ for (const gone of ['months', 'laborCost', 'toolingCost', 'totalCost', 'seniority', 'rate']) {
111
+ assert.ok(!json.includes(`"${gone}"`), `${gone} still present in estimation.json`);
112
+ }
113
+ });
@@ -0,0 +1,44 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { pert, roadmapBands, AI_CATEGORIES } from '../../../shared/lib/estimate-math.mjs';
4
+
5
+ const close = (got, want) => assert.ok(Math.abs(got - want) < 1e-9, `${got} !~ ${want}`);
6
+
7
+ test('pert: E=(O+4M+P)/6, sigma=(P-O)/6', () => {
8
+ const { e, sigma } = pert({ o: 16, m: 24, p: 40 });
9
+ close(e, 152 / 6);
10
+ close(sigma, 4);
11
+ });
12
+
13
+ test('the hours-to-money machinery is gone', async () => {
14
+ const mod = await import('../../../shared/lib/estimate-math.mjs');
15
+ for (const gone of ['SENIORITY_FACTOR', 'HOURS_PER_MONTH', 'COORDINATION_TAX',
16
+ 'taskHours', 'aiAdjust', 'dominantSeniority', 'effectiveCapacity',
17
+ 'scenarioRollup', 'riskBufferHours', 'projectBuffer', 'TIER_BREAKS', 'tierFor']) {
18
+ assert.equal(mod[gone], undefined, `${gone} should no longer be exported`);
19
+ }
20
+ assert.ok(mod.pert && mod.roadmapBands && mod.AI_CATEGORIES);
21
+ });
22
+
23
+ test('roadmapBands returns shares that sum to 1, with no months', () => {
24
+ const bands = roadmapBands({ milestones: [{ name: 'M1', hours: 75 }, { name: 'M2', hours: 25 }] });
25
+ assert.deepEqual(bands.map((b) => b.name), ['M1', 'M2']);
26
+ close(bands[0].share, 0.75);
27
+ close(bands[1].share, 0.25);
28
+ assert.equal(bands[0].startMonths, undefined);
29
+ });
30
+
31
+ test('roadmapBands with no hours does not divide by zero', () => {
32
+ const bands = roadmapBands({ milestones: [{ name: 'M1', hours: 0 }] });
33
+ assert.ok(Number.isFinite(bands[0].share));
34
+ close(bands[0].share, 0);
35
+ });
36
+
37
+ test('scoreSummary uses the weighted score, not the raw sum', async () => {
38
+ const { scoreSummary } = await import('../../../shared/lib/scoring.mjs');
39
+ const scores = Object.fromEntries(['tech', 'size', 'deps', 'unc', 'risk']
40
+ .map((k, i) => [k, { n: [1, 3, 3, 3, 3][i], anchor: '', cite: 'x' }]));
41
+ const got = scoreSummary({ scores });
42
+ close(got.scoreTotal, 13);
43
+ assert.equal(got.tier, 'M');
44
+ });
@@ -9,11 +9,6 @@ This will take 1–2 hours depending on complexity.
9
9
  | Planning | S | proposed |
10
10
  | API client swap | S | stated |
11
11
 
12
- | Line | Hours |
13
- | --- | --- |
14
- | Spread buffer | 0.25 |
15
- | Risk buffer | 0.15 |
16
-
17
12
  ### Out of scope
18
13
 
19
14
  - Anything not listed above.
@@ -28,11 +23,6 @@ Calibration: 20 measurement records; 1 of 4 tasks uncalibrated.
28
23
  | swap-tests | 10 | 10 | repo+agent+model | HIGH | none | proposed |
29
24
  | swap-db | not estimated | 0 | none | MED | none | proposed |
30
25
 
31
- | Scenario | Months | Total cost |
32
- | --- | --- | --- |
33
- | solo | 0.02 | $208.43 |
34
- | pair | 0.01 | $195.12 |
35
-
36
26
  ### Evidence
37
27
 
38
28
  | Id | Task | Actual (min) |
@@ -9,11 +9,6 @@ Delivery: agentic (claude-code + sonnet) · Baselines: 20 measurements, 3 shapes
9
9
  | Planning | S | proposed |
10
10
  | API client swap | S | stated |
11
11
 
12
- | Line | Hours |
13
- | --- | --- |
14
- | Spread buffer | 0.25 |
15
- | Risk buffer | 0.15 |
16
-
17
12
  ### Out of scope
18
13
 
19
14
  - Anything not listed above.
@@ -29,11 +24,6 @@ Calibration: 20 measurement records; 1 of 4 tasks uncalibrated.
29
24
  | swap-tests | 10 | 10 | repo+agent+model | HIGH | none | proposed |
30
25
  | swap-db | not estimated | 0 | none | UNCALIBRATED | none | proposed |
31
26
 
32
- | Scenario | Months | Total cost |
33
- | --- | --- | --- |
34
- | solo | 0.02 | $208.43 |
35
- | pair | 0.01 | $195.12 |
36
-
37
27
  ### Evidence
38
28
 
39
29
  | Id | Task | Actual (min) |
@@ -5,7 +5,6 @@
5
5
  "depth": "STANDARD",
6
6
  "agentContext": { "agent": "claude-code", "model": "sonnet", "repository": "project-a" },
7
7
  "measurementsPath": "FIXTURE_MEASUREMENTS",
8
- "overheadPct": 0.1,
9
8
  "assumptions": ["Existing CI pipeline stays as is"],
10
9
  "risks": [
11
10
  { "name": "SDK incompatibility", "probability": 0.3, "impactMinutes": 30, "reason": "new SDK may break integration test mocks" }
@@ -36,10 +35,5 @@
36
35
  "assumptions": [], "provenance": "proposed" }
37
36
  ]
38
37
  }
39
- ],
40
- "scenarios": [
41
- { "id": "solo", "aiAssisted": true, "toolingCostPerSeat": 100, "team": [{ "seniority": "senior", "rate": 90 }] },
42
- { "id": "pair", "aiAssisted": true, "toolingCostPerSeat": 200, "team": [{ "seniority": "senior", "rate": 90 }, { "seniority": "mid", "rate": 60 }] }
43
- ],
44
- "recommendedScenario": "solo"
38
+ ]
45
39
  }
@@ -4,9 +4,17 @@
4
4
  "technique": "three-point-pert",
5
5
  "depth": "STANDARD",
6
6
  "calibration": { "S": [20, 60], "M": [60, 160], "L": [160, 400], "XL": [400, 800] },
7
- "overheadPct": 0.35,
8
7
  "verificationPct": 0.12,
9
- "exposeRatesToClient": false,
8
+ "contextLevels": {
9
+ "codebaseMaturity": 2, "stackFamiliarity": 1, "specQuality": 3, "compliance": 1, "clientDecisions": 2
10
+ },
11
+ "contextProvenance": {
12
+ "codebaseMaturity": { "level": 2, "anchor": "young and clean", "cite": "ARCHITECTURE.md §3", "source": "derived" },
13
+ "stackFamiliarity": { "level": 1, "anchor": "core stack, done before", "cite": "interview", "source": "stated" },
14
+ "specQuality": { "level": 3, "anchor": "outline or slide deck", "cite": "requirements.json readiness 62", "source": "derived" },
15
+ "compliance": { "level": 1, "anchor": "none", "cite": "ARCHITECTURE.md §8 no PII", "source": "derived" },
16
+ "clientDecisions": { "level": 2, "anchor": "two or three", "cite": "requirements.md Part 1", "source": "derived" }
17
+ },
10
18
  "components": [
11
19
  { "id": "api", "name": "Booking API" },
12
20
  { "id": "notify", "name": "Notification Service" },
@@ -65,12 +73,5 @@
65
73
  ],
66
74
  "assumptions": [
67
75
  { "text": "single timezone", "impactIfWrong": "recompute booking-api at logic category, +30%" }
68
- ],
69
- "scenarios": [
70
- { "id": "3eng-noai", "aiAssisted": false, "toolingCostPerSeat": null,
71
- "team": [{ "seniority": "mid", "rate": 45 }, { "seniority": "mid", "rate": 45 }, { "seniority": "junior", "rate": 30 }] },
72
- { "id": "2eng-max5x", "aiAssisted": true, "toolingCostPerSeat": 100,
73
- "team": [{ "seniority": "senior", "rate": 60 }, { "seniority": "mid", "rate": 45 }] }
74
- ],
75
- "recommendedScenario": "2eng-max5x"
76
+ ]
76
77
  }
@@ -24,6 +24,12 @@ Technique: three-point PERT — detailed backlog available.
24
24
  | Slot conflict + cancellation rules | logic | 24/40/80 | 44 | MED | no recurring bookings in v1 |
25
25
  | Scheduled reminder jobs | logic | 12/20/36 | 21.33 | MED | | proposed |
26
26
 
27
+ ### Scenario comparison
28
+
29
+ | Scenario | Team | AI-assisted | Months | Cost | Notes |
30
+ | --- | --- | --- | --- | --- | --- |
31
+ | 3eng-noai | 2 mid + 1 junior | no | 0.43 | $7,266 | — |
32
+
27
33
  ### Calibration
28
34
 
29
35
  Tier hour bands used: S 20-60h · M 60-160h · L 160-400h (defaults — no
@@ -7,24 +7,15 @@
7
7
  | User can book appointment | M | 40–120 | stated |
8
8
  | Email reminders | S | 12–36 | proposed |
9
9
 
10
- Recommended delivery: 2 engineers (1 senior, 1 mid), AI-assisted — see detail.
11
-
12
- | Line | Hours |
13
- | --- | --- |
14
- | Development | 90.67 |
15
- | Overhead (35%) | 31.73 |
16
- | Risk buffer | 12 |
17
- | Estimate-spread buffer | 10.91 |
18
-
19
10
  ### Roadmap
20
11
 
21
- | Milestone | Features | Months (from start) |
12
+ | Milestone | Features | Share |
22
13
  | --- | --- | --- |
23
- | M1 - Booking core | User can book appointment | 0–0.3 |
24
- | M2 - Notifications | Email reminders | 0.3–0.4 |
14
+ | M1 - Booking core | User can book appointment | 76% |
15
+ | M2 - Notifications | Email reminders | 24% |
25
16
 
26
- Sequential delivery by the recommended scenario team. Bands are relative
27
- months, not calendar dates. Ordering: proposed.
17
+ Bands are relative shares of total effort, not durations. This estimate
18
+ produces no timeline. Ordering: proposed.
28
19
 
29
20
  ### Assumptions
30
21
 
@@ -47,14 +38,19 @@ Technique: three-point PERT — detailed backlog available.
47
38
  | Slot conflict + cancellation rules | logic | 24/40/80 | 44 | MED | no recurring bookings in v1 | proposed |
48
39
  | Scheduled reminder jobs | logic | 12/20/36 | 21.33 | MED | provider already chosen | proposed |
49
40
 
50
- ### Scenario comparison
41
+ ### Price
51
42
 
52
- | Scenario | Team | AI-assisted | Months | Cost | Notes |
53
- | --- | --- | --- | --- | --- | --- |
54
- | 3eng-noai | 2 mid + 1 junior | no | 0.43 | $7,266 | — |
55
- | 2eng-max5x | 1 senior + 1 mid | yes | 0.40 | $5,993 | recommended |
43
+ | Figure | Value |
44
+ | --- | --- |
45
+ | Presented range | $10,000 – $14,000 |
46
+ | If a single number is required | $12,000 |
47
+ | Contingency rate | 15% |
48
+ | Implied accuracy | 24% |
56
49
 
57
50
  ### Calibration
58
51
 
59
- Tier hour bands used: S 20-60h · M 60-160h · L 160-400h (defaults — no
60
- delivery history supplied).
52
+ Implied rate check: the M band's $2,750 midpoint against the 69 h behind a
53
+ comparable delivered feature is about $40/h blended — defensible for this
54
+ team. No delivery history was supplied, so the bands are the defaults;
55
+ recalibrate them against actuals roughly twice a year. Whatever AI leverage
56
+ the team has is priced into the bands already and stays as margin.
@@ -6,7 +6,7 @@ import { join } from 'node:path';
6
6
  import {
7
7
  TASK_SHAPES, DEFAULT_MEASUREMENTS_PATH, expandHome, resolveMeasurementsPath,
8
8
  checkMeasurement, loadMeasurements,
9
- } from '../lib/measurements.mjs';
9
+ } from '../../../shared/lib/measurements.mjs';
10
10
 
11
11
  const fixturePath = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
12
12
 
@@ -0,0 +1,88 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {
4
+ WEIGHTS, BANDS, weightedScore, bandFor, pointEstimate, spreadFor, featurePrice,
5
+ } from '../../../shared/lib/pricing.mjs';
6
+
7
+ const close = (got, want) => assert.ok(Math.abs(got - want) < 1e-6, `${got} !~ ${want}`);
8
+ const s = (tech, size, deps, unc, risk) => ({ tech, size, deps, unc, risk });
9
+
10
+ test('weights sum to 1 and follow v2: size lightest, uncertainty heaviest', () => {
11
+ close(Object.values(WEIGHTS).reduce((a, b) => a + b, 0), 1);
12
+ assert.equal(WEIGHTS.size, 0.10);
13
+ assert.equal(WEIGHTS.unc, 0.30);
14
+ });
15
+
16
+ test('weightedScore: SUMPRODUCT(scores, weights) x 5', () => {
17
+ close(weightedScore(s(1, 3, 3, 3, 3)), 13);
18
+ close(weightedScore(s(3, 3, 4, 2, 4)), 15.5);
19
+ close(weightedScore(s(4, 4, 4, 4, 4)), 20);
20
+ });
21
+
22
+ test('bands are continuous: each price high equals the next price low', () => {
23
+ for (let i = 0; i < BANDS.length - 1; i += 1) {
24
+ assert.equal(BANDS[i].end, BANDS[i + 1].start);
25
+ assert.equal(BANDS[i].priceHigh, BANDS[i + 1].priceLow);
26
+ }
27
+ });
28
+
29
+ test('pointEstimate interpolates inside the band', () => {
30
+ close(pointEstimate(13), 2125); // 1500 + (13-11.5)/6 * 2500
31
+ close(pointEstimate(20), 7000); // 4000 + (20-17.5)/5 * 6000
32
+ close(pointEstimate(15.5), 3166.666667);
33
+ close(pointEstimate(8), 961.538462); // 500 + (8-5)/6.5 * 1000
34
+ });
35
+
36
+ test('a band boundary picks the upper band', () => {
37
+ assert.equal(bandFor(11.5).tier, 'M');
38
+ assert.equal(bandFor(17.5).tier, 'L');
39
+ assert.equal(bandFor(22.5).tier, 'XL');
40
+ });
41
+
42
+ test('all ones lands on the bottom edge without dividing by zero', () => {
43
+ close(weightedScore(s(1, 1, 1, 1, 1)), 5);
44
+ assert.equal(bandFor(5).tier, 'S');
45
+ close(pointEstimate(5), 500);
46
+ });
47
+
48
+ test('all fives lands on the top edge and stays XL', () => {
49
+ close(weightedScore(s(5, 5, 5, 5, 5)), 25);
50
+ assert.equal(bandFor(25).tier, 'XL');
51
+ close(pointEstimate(25), 25000);
52
+ });
53
+
54
+ test('spread widens faster with uncertainty than with risk', () => {
55
+ close(spreadFor({ unc: 1, risk: 1 }), 0.15);
56
+ close(spreadFor({ unc: 3, risk: 3 }), 0.35);
57
+ close(spreadFor({ unc: 4, risk: 4 }), 0.45);
58
+ close(spreadFor({ unc: 2, risk: 4 }), 0.31);
59
+ });
60
+
61
+ test('featurePrice matches the workbook row for user authentication', () => {
62
+ const f = featurePrice(s(1, 3, 3, 3, 3));
63
+ close(f.score, 13);
64
+ assert.equal(f.tier, 'M');
65
+ close(f.point, 2125);
66
+ close(f.spread, 0.35);
67
+ close(f.low, 1381.25);
68
+ close(f.high, 2868.75);
69
+ assert.equal(f.flag, '');
70
+ });
71
+
72
+ test('a spread at or above 0.4 recommends a deep estimate', () => {
73
+ assert.equal(featurePrice(s(4, 4, 4, 4, 4)).flag, 'Deep estimate recommended');
74
+ });
75
+
76
+ test('an XL feature that is also epic-sized must be split', () => {
77
+ assert.equal(featurePrice(s(5, 5, 5, 5, 5)).flag, 'SPLIT into sub-features');
78
+ });
79
+
80
+ test('an XL feature that is not epic-sized requires a deep estimate', () => {
81
+ assert.equal(featurePrice(s(5, 3, 5, 5, 5)).flag, 'Deep estimate required');
82
+ });
83
+
84
+ test('a point estimate above the threshold recommends a deep estimate', () => {
85
+ const f = featurePrice(s(5, 5, 5, 3, 3));
86
+ assert.ok(f.point >= 6000, `expected >= 6000, got ${f.point}`);
87
+ assert.equal(f.flag, 'Deep estimate recommended');
88
+ });
@@ -0,0 +1,93 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {
4
+ CONTEXT_FACTORS, contextMultiplier, overheadFor, contingencyRate, projectPrice,
5
+ } from '../../../shared/lib/project-price.mjs';
6
+
7
+ const close = (got, want, eps = 1e-4) => assert.ok(Math.abs(got - want) < eps, `${got} !~ ${want}`);
8
+
9
+ // The workbook's own five sample features, already priced by Task 1.
10
+ const SAMPLE = [
11
+ { point: 2125, spread: 0.35, unc: 3, risk: 3 },
12
+ { point: 7000, spread: 0.45, unc: 4, risk: 4 },
13
+ { point: 3166.666667, spread: 0.31, unc: 2, risk: 4 },
14
+ { point: 961.538462, spread: 0.15, unc: 1, risk: 1 },
15
+ { point: 2958.333333, spread: 0.32, unc: 3, risk: 2 },
16
+ ];
17
+ const LEVELS = {
18
+ codebaseMaturity: 2, stackFamiliarity: 1, specQuality: 3, compliance: 1, clientDecisions: 2,
19
+ };
20
+
21
+ test('context factors cover the five v2 dimensions with four levels each', () => {
22
+ assert.deepEqual(Object.keys(CONTEXT_FACTORS).sort(), [
23
+ 'clientDecisions', 'codebaseMaturity', 'compliance', 'specQuality', 'stackFamiliarity',
24
+ ]);
25
+ for (const mults of Object.values(CONTEXT_FACTORS)) assert.equal(mults.length, 4);
26
+ });
27
+
28
+ test('context factors combine additively, not multiplicatively', () => {
29
+ close(contextMultiplier(LEVELS), 1.40);
30
+ });
31
+
32
+ test('a missing or out-of-range level falls back to a multiplier of 1', () => {
33
+ close(contextMultiplier({ ...LEVELS, compliance: 9 }), 1.40);
34
+ close(contextMultiplier({ ...LEVELS, compliance: undefined }), 1.40);
35
+ close(contextMultiplier({}), 1.0);
36
+ });
37
+
38
+ test('the composite multiplier is capped', () => {
39
+ const worst = {
40
+ codebaseMaturity: 4, stackFamiliarity: 4, specQuality: 4, compliance: 4, clientDecisions: 4,
41
+ };
42
+ close(contextMultiplier(worst), 2.5);
43
+ });
44
+
45
+ test('overheads total 62% at five features', () => {
46
+ const { totalPct, lines } = overheadFor(5);
47
+ close(totalPct, 0.62);
48
+ close(lines.integration, 0.10);
49
+ });
50
+
51
+ test('integration overhead grows per feature and caps at 25%', () => {
52
+ close(overheadFor(1).lines.integration, 0.02);
53
+ close(overheadFor(20).lines.integration, 0.25);
54
+ });
55
+
56
+ test('contingency rises with average uncertainty and risk', () => {
57
+ close(contingencyRate({ avgUnc: 2.6, avgRisk: 2.8 }), 0.158);
58
+ close(contingencyRate({ avgUnc: 0, avgRisk: 0 }), 0.05);
59
+ });
60
+
61
+ test('projectPrice reproduces the workbook total', () => {
62
+ const p = projectPrice({ features: SAMPLE, levels: LEVELS });
63
+ close(p.featurePoints, 16211.538462);
64
+ close(p.contextMultiplier, 1.40);
65
+ close(p.adjustedBase, 22696.153846, 1e-3);
66
+ close(p.overheads.amount, 14071.615385, 1e-3);
67
+ close(p.contingencyRate, 0.158);
68
+ close(p.p50, 42577.076769, 1e-2);
69
+ close(p.sigma, 9232.005917, 1e-2);
70
+ close(p.p20, 34822.1918, 1e-2);
71
+ close(p.p80, 50331.96174, 1e-2);
72
+ close(p.p95, 57763.7265, 1e-2);
73
+ assert.equal(p.presentLow, 43000);
74
+ assert.equal(p.presentHigh, 58000);
75
+ assert.equal(p.singleNumber, 50500);
76
+ close(p.impliedAccuracy, 0.216830, 1e-5);
77
+ });
78
+
79
+ test('sigma combines by root-sum-of-squares, not a plain sum', () => {
80
+ const naive = SAMPLE.reduce((sum, f) => sum + f.point * f.spread, 0);
81
+ const p = projectPrice({ features: SAMPLE, levels: LEVELS });
82
+ const buildSigma = p.sigma * p.featurePoints / p.p50;
83
+ assert.ok(buildSigma < naive, `${buildSigma} should be below the naive sum ${naive}`);
84
+ });
85
+
86
+ test('no priced features returns zeros, never NaN or Infinity', () => {
87
+ const p = projectPrice({ features: [], levels: LEVELS });
88
+ for (const k of ['featurePoints', 'p50', 'sigma', 'p80', 'impliedAccuracy']) {
89
+ assert.ok(Number.isFinite(p[k]), `${k} is ${p[k]}`);
90
+ }
91
+ assert.equal(p.p50, 0);
92
+ assert.equal(p.impliedAccuracy, 0);
93
+ });
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
3
3
  import { readFileSync } from 'node:fs';
4
4
  import {
5
5
  TEMPLATE_LIMITS, moduleFiles, templateScripts, violations,
6
- } from '../../../analyze-requirements/scripts/lib/quality-gate.mjs';
6
+ } from '../../../../analyze-requirements/scripts/lib/quality-gate.mjs';
7
7
 
8
8
  const base = new URL('../..', import.meta.url).pathname;
9
9
 
@@ -13,6 +13,12 @@ for (const file of moduleFiles(base, ['scripts/lib', 'scripts'])) {
13
13
  });
14
14
  }
15
15
 
16
+ for (const file of moduleFiles(new URL('../../../shared', import.meta.url).pathname, ['lib'])) {
17
+ test(`gates: shared ${file.split('/shared/')[1]}`, () => {
18
+ assert.deepEqual(violations(readFileSync(file, 'utf8')), []);
19
+ });
20
+ }
21
+
16
22
  for (const { file, js } of templateScripts(base)) {
17
23
  test(`gates: ${file.replace(base, '')}`, () => {
18
24
  assert.deepEqual(violations(js, TEMPLATE_LIMITS), []);