@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
@@ -0,0 +1,79 @@
1
+ // Python twin of review.mjs: same bytes, same refusals, same exit codes.
2
+ import { test } from 'node:test';
3
+ import assert from 'node:assert/strict';
4
+ import { spawnSync } from 'node:child_process';
5
+ import { existsSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
6
+ import { tmpdir } from 'node:os';
7
+ import { join } from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+ import { noFlows } from './scope-cases.mjs';
10
+ import { DATE, decided, drafted } from './review-fixture.mjs';
11
+
12
+ const SCRIPT = {
13
+ node: fileURLToPath(new URL('../review.mjs', import.meta.url)),
14
+ python3: fileURLToPath(new URL('../review.py', import.meta.url)),
15
+ };
16
+
17
+ // Runs one review command in a fresh dir; `rest` builds the flags after the script.
18
+ function runIn(cmd, pkg, rest) {
19
+ const dir = mkdtempSync(join(tmpdir(), 'ba-review-parity-'));
20
+ const json = join(dir, 'r.json');
21
+ const out = join(dir, 'p.html');
22
+ writeFileSync(json, JSON.stringify(pkg));
23
+ const r = spawnSync(cmd, [SCRIPT[cmd], ...rest(json, out)], { encoding: 'utf8' });
24
+ return { code: r.status, out: r.stdout.replace(out, 'OUT'), err: r.stderr, html: existsSync(out) ? readFileSync(out, 'utf8') : null };
25
+ }
26
+
27
+ const page = (json, out) => ['page', '--json', json, '--out', out, '--date', DATE];
28
+ const both = (pkg, rest = page) => ['node', 'python3'].map((cmd) => runIn(cmd, pkg, rest));
29
+
30
+ const unicode = () => {
31
+ const pkg = decided();
32
+ pkg.features[0].name = 'Café order — <stage> & "pack"';
33
+ return pkg;
34
+ };
35
+ const classic = () => {
36
+ const pkg = decided();
37
+ for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
38
+ return pkg;
39
+ };
40
+ const leak = () => {
41
+ const pkg = decided();
42
+ pkg.features[3].source = 'PO in interview, see FR-004';
43
+ return pkg;
44
+ };
45
+
46
+ const pipeline = (pkg) => pkg.workflows.find((w) => w.name === 'Order pipeline');
47
+ const branchy = () => {
48
+ const pkg = decided();
49
+ pipeline(pkg).branches.unshift({ from: 'Extra box', to: 'Courier' });
50
+ pipeline(pkg).branches.push({ from: 'Pack', to: 'Extra box', label: 'needs a box' },
51
+ { from: 'Loop B', to: 'Loop A' }, { from: 'Loop A', to: 'Loop B' });
52
+ return pkg;
53
+ };
54
+
55
+ export const PAGE_CASES = [
56
+ ['siblings, a child before its parent, a cycle', branchy, 0],
57
+ ['a decided package', decided, 0],
58
+ ['markup and non-ascii text', unicode, 0],
59
+ ['undecided drafts', drafted, 1],
60
+ ['an id in a ★ New source', leak, 1],
61
+ ['a system with no workflow', () => noFlows().pkg, 0],
62
+ ['classic mode', classic, 0],
63
+ ];
64
+
65
+ for (const [name, make, code] of PAGE_CASES) {
66
+ test(`review.py page matches review.mjs: ${name}`, () => {
67
+ const [n, p] = both(make());
68
+ assert.deepEqual(p, n);
69
+ assert.equal(n.code, code);
70
+ });
71
+ }
72
+
73
+ test('review.py refuses apply and a bare flag like review.mjs', () => {
74
+ for (const rest of [(json) => ['apply', '--json', json], (json) => ['page', '--json', json, '--out']]) {
75
+ const [n, p] = both(decided(), rest);
76
+ assert.deepEqual(p, n);
77
+ assert.equal(n.code, 1);
78
+ }
79
+ });
@@ -0,0 +1,58 @@
1
+ // One broken variant of the workflow pass fixture per scope rule (spec §5).
2
+ // Shared by scope-checks.test.mjs and python-parity.test.mjs.
3
+ import { readFileSync } from 'node:fs';
4
+
5
+ const fx = (f) => readFileSync(new URL(`./fixtures/${f}`, import.meta.url), 'utf8');
6
+ export const loadWorkflow = () => ({
7
+ pkg: JSON.parse(fx('requirements-workflow-pass.json')),
8
+ md: fx('requirements-workflow-pass.md'),
9
+ });
10
+
11
+ const toClassic = (pkg) => {
12
+ for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
13
+ };
14
+ const pkgCase = (name, finding, edit) => ({ name, finding, edit: (c) => { edit(c.pkg); return c; } });
15
+ const mdCase = (name, finding, edit) => ({ name, finding, edit: (c) => ({ ...c, md: edit(c.md) }) });
16
+
17
+ export const CASES = [
18
+ pkgCase('illegal scopeMode', 'scopeMode must be workflow|classic', (p) => { p.scopeMode = 'list'; }),
19
+ pkgCase('workflow without systems', 'scopeMode workflow needs systems and features', (p) => { delete p.systems; }),
20
+ pkgCase('classic with systems', 'systems/features only in workflow mode', (p) => { p.scopeMode = 'classic'; }),
21
+ pkgCase('bad feature id', 'features: bad id F-1', (p) => { p.features[0].id = 'F-1'; }),
22
+ pkgCase('system lists an as-is workflow', 'SYS-001: workflow WF-001 is not a to-be workflow', (p) => { p.systems[0].workflows.push('WF-001'); }),
23
+ pkgCase('workflow in two systems', 'WF-002: belongs to SYS-001 and SYS-002', (p) => { p.systems[1].workflows.push('WF-002'); }),
24
+ pkgCase('feature in no system', 'FEAT-002: listed by no system', (p) => { p.systems[0].features.pop(); }),
25
+ pkgCase('unknown feature step', 'FEAT-002: unknown step WF-002:Short-pack', (p) => { p.features[1].steps = ['WF-002:Short-pack']; }),
26
+ pkgCase('branch from unknown step', 'WF-002: branch from unknown step Packing', (p) => { p.workflows[1].branches[0].from = 'Packing'; }),
27
+ pkgCase('sub starts nowhere', 'WF-004: sub.startsAt unknown', (p) => { p.workflows[3].sub.startsAt = 'WF-003:Intake'; }),
28
+ pkgCase('sub rejoins as-is', 'WF-004: sub.rejoins is not a to-be workflow', (p) => { p.workflows[3].sub.rejoins = 'WF-001'; }),
29
+ pkgCase('replaces unknown', 'WF-002: replaces unknown as-is workflow WF-009', (p) => { p.workflows[1].replaces = ['WF-009']; }),
30
+ pkgCase('in-scope FR in no feature', 'FR-003: in scope but in no feature', (p) => { p.features[2].requirements = []; }),
31
+ pkgCase('feature cites missing FR', 'FEAT-003: dangling reference FR-099', (p) => { p.features[2].requirements = ['FR-003', 'FR-099']; }),
32
+ pkgCase('duplicate feature name', 'duplicate feature name: Order intake & quotation', (p) => { p.features[1].name = 'order intake & quotation'; }),
33
+ pkgCase('tech word in name', 'FEAT-001: name uses a tech word (API)', (p) => { p.features[0].name = 'Order APIs'; }),
34
+ pkgCase('system without source', 'SYS-001: missing source', (p) => { delete p.systems[0].source; }),
35
+ pkgCase('illegal feature label', 'FEAT-001: illegal label "maybe"', (p) => { p.features[0].label = 'maybe'; }),
36
+ pkgCase('recommended without question', 'FEAT-004: recommended without a paired open question', (p) => { p.features[3].label = 'recommended'; p.openQuestions[0].affects = ['INT-001']; }),
37
+ mdCase('frontmatter mode missing', 'md: scopeMode does not match json', (md) => md.replace('scopeMode: workflow\n', '')),
38
+ mdCase('hand-edited scope', 'md: To-be scope is stale — run scope', (md) => md.replace('n3["Paid"]', 'n3["Settled"]')),
39
+ { name: 'classic with scope section', finding: 'md: To-be scope only in workflow mode', edit: (c) => { toClassic(c.pkg); return c; } },
40
+ mdCase('wrong Feature cell', 'md: FR-002 Feature column says Pack alert, json says Short-pack alert', (md) => md.replace('| in | Short-pack alert |', '| in | Pack alert |')),
41
+ pkgCase('feature without does', 'FEAT-001: missing does', (p) => { delete p.features[0].does; }),
42
+ pkgCase('feature without name', 'FEAT-002: missing name', (p) => { delete p.features[1].name; }),
43
+ pkgCase('system without purpose', 'SYS-001: missing purpose', (p) => { delete p.systems[0].purpose; }),
44
+ mdCase('unbalanced scope markers', 'md: scope markers unbalanced', (md) => md.replace('<!-- scope:end -->', '')),
45
+ mdCase('no Feature column', 'md: FR table has no Feature column', (md) => md.replace('| Label | Scope | Feature |', '| Label | Scope |')),
46
+ ];
47
+
48
+ // SYS-002 as an input that lists features but draws no workflow: the
49
+ // system owns none and its features sit on no step.
50
+ export function noFlows() {
51
+ const { pkg, md } = loadWorkflow();
52
+ const gone = new Set(['WF-003', 'WF-004']);
53
+ pkg.workflows = pkg.workflows.filter((w) => !gone.has(w.id));
54
+ pkg.systems[1].workflows = [];
55
+ for (const f of pkg.features.slice(2, 4)) f.steps = [];
56
+ for (const fr of pkg.requirements) if (gone.has(fr.traces?.workflow)) delete fr.traces.workflow;
57
+ return { pkg, md };
58
+ }
@@ -0,0 +1,31 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { checkPackage } from '../lib/checks.mjs';
4
+ import { CASES, loadWorkflow, noFlows } from './scope-cases.mjs';
5
+
6
+ test('the workflow pass pair has no findings', () => {
7
+ const { pkg, md } = loadWorkflow();
8
+ assert.deepEqual(checkPackage({ pkg, md }), []);
9
+ });
10
+
11
+ test('a classic package without scope fields is untouched', () => {
12
+ const { pkg, md } = loadWorkflow();
13
+ for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
14
+ const plain = md.replace(/<!-- scope:start -->[\s\S]*?<!-- scope:end -->\n*/, '').replace('scopeMode: workflow\n', '');
15
+ const findings = checkPackage({ pkg, md: plain });
16
+ assert.ok(findings.some((f) => f.includes('WF-002') && f.includes('absent')), 'classic still requires to-be workflow ids in md');
17
+ assert.ok(!findings.some((f) => f.includes('scope')));
18
+ });
19
+
20
+ for (const c of CASES) {
21
+ test(`scope rule: ${c.name}`, () => {
22
+ const { pkg, md } = c.edit(loadWorkflow());
23
+ const findings = checkPackage({ pkg, md });
24
+ assert.ok(findings.includes(c.finding), `expected "${c.finding}" in:\n${findings.join('\n')}`);
25
+ });
26
+ }
27
+
28
+ test('a system with no workflow and features on no step are valid', () => {
29
+ const { pkg } = noFlows();
30
+ assert.deepEqual(checkPackage({ pkg, md: null }), []);
31
+ });
@@ -0,0 +1,140 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { execFileSync } 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 { fileURLToPath } from 'node:url';
8
+ import { applyScope } from '../lib/scope-md.mjs';
9
+ import { mermaid } from '../lib/scope-render.mjs';
10
+ import { checkPackage } from '../lib/checks.mjs';
11
+ import { loadWorkflow, noFlows } from './scope-cases.mjs';
12
+
13
+ const script = fileURLToPath(new URL('../scope.mjs', import.meta.url));
14
+ const BLOCK = /<!-- scope:start -->[\s\S]*?<!-- scope:end -->\n*/;
15
+ const strip = (md) => md.replace(BLOCK, '');
16
+ const OLD_HERE = '> **Product owner? Start here:** [To-be scope](#to-be-scope) shows the systems, '
17
+ + 'workflows and features we propose to build. Items marked ⚠ are our draft; tell us in chat what to change.';
18
+
19
+ test('applyScope rebuilds the fixture from a file without the section', () => {
20
+ const { pkg, md } = loadWorkflow();
21
+ assert.equal(applyScope(strip(md), pkg), md);
22
+ });
23
+
24
+ test('applyScope is idempotent', () => {
25
+ const { pkg, md } = loadWorkflow();
26
+ assert.equal(applyScope(md, pkg), md);
27
+ });
28
+
29
+ test('classic mode removes the section', () => {
30
+ const { pkg, md } = loadWorkflow();
31
+ pkg.scopeMode = 'classic';
32
+ const out = applyScope(md, pkg);
33
+ assert.equal(out, strip(md));
34
+ });
35
+
36
+ test('an old Start-here line is removed on re-run', () => {
37
+ const { pkg, md } = loadWorkflow();
38
+ const old = md.replace(/^(# .*)$/m, `$1\n\n${OLD_HERE}`);
39
+ assert.equal(applyScope(old, pkg), md);
40
+ });
41
+
42
+ test('the section carries ids for engineers', () => {
43
+ const section = loadWorkflow().md.match(BLOCK)[0];
44
+ assert.match(section, /^### SYS-002 Orders & invoicing$/m);
45
+ assert.match(section, /^\*\*Main workflow: WF-003 Order to cash\*\*$/m);
46
+ assert.match(section, /^\| SYS-001 \| Warehouse operations \|/m);
47
+ });
48
+
49
+ test('no draft marks anywhere; features list their requirements', () => {
50
+ const { md } = loadWorkflow();
51
+ assert.doesNotMatch(md, /⚠|please confirm|Start here/);
52
+ assert.match(md, /\| FEAT-004 \| Invoice from packed quantities \| .* \| Shipped \(in Order pipeline\); Invoice → Paid \| FR-004 \|/);
53
+ });
54
+
55
+ test('mermaid: loops back to an existing step and side exits to a new one', () => {
56
+ const out = mermaid({ steps: ['A', 'B'], branches: [{ from: 'B', to: 'A', label: 'retry' }, { from: 'A', to: 'C' }] });
57
+ assert.equal(out, '```mermaid\nflowchart LR\n n0 --> n1\n n1 -.->|retry| n0\n n0 -.-> n2\n n0["A"]\n n1["B"]\n n2["C"]\n```');
58
+ });
59
+
60
+ test('scope.mjs refuses a broken scope and leaves the md alone', () => {
61
+ const dir = mkdtempSync(join(tmpdir(), 'ba-scope-'));
62
+ const { pkg, md } = loadWorkflow();
63
+ pkg.features[1].steps = ['WF-002:Nowhere'];
64
+ writeFileSync(join(dir, 'r.json'), JSON.stringify(pkg));
65
+ writeFileSync(join(dir, 'r.md'), 'untouched');
66
+ assert.throws(() => execFileSync('node', [script, '--json', join(dir, 'r.json'), '--md', join(dir, 'r.md')], { stdio: 'pipe' }));
67
+ assert.equal(readFileSync(join(dir, 'r.md'), 'utf8'), 'untouched');
68
+ assert.ok(md.length > 0);
69
+ });
70
+
71
+ test('a pipe inside feature text is escaped so the table holds', () => {
72
+ const { pkg, md } = loadWorkflow();
73
+ pkg.features[0].does = 'Moves an order | shows each stage';
74
+ const out = applyScope(md, pkg);
75
+ assert.match(out, /\| FEAT-001 \| Order pipeline & stage engine \| Moves an order \\\| shows each stage \|/);
76
+ });
77
+
78
+ test('a step name with a colon resolves and renders', () => {
79
+ const { pkg, md } = loadWorkflow();
80
+ pkg.workflows[1].steps[1] = 'Pack: scan vs order';
81
+ pkg.workflows[1].branches = [{ from: 'Pack: scan vs order', to: 'Short-pack alert' }];
82
+ pkg.features[0].steps[1] = 'WF-002:Pack: scan vs order';
83
+ assert.deepEqual(checkPackage({ pkg, md: applyScope(md, pkg) }), []);
84
+ assert.match(applyScope(md, pkg), /Order In → Pack: scan vs order → Pack Review/);
85
+ });
86
+
87
+ test('markers moved by hand stay where they are on re-run', () => {
88
+ const { pkg, md } = loadWorkflow();
89
+ const section = md.match(BLOCK)[0];
90
+ const moved = md.replace(section, '').replace('## Part 2 — Process & Domain\n\n', `## Part 2 — Process & Domain\n\n${section}`);
91
+ assert.equal(applyScope(moved, pkg), moved);
92
+ });
93
+
94
+ test('a QUICK file (no Part 2) gets the section before Part 3', () => {
95
+ const { pkg, md } = loadWorkflow();
96
+ const quick = strip(md).replace(/## Part 2[\s\S]*?(?=## Part 3)/, '');
97
+ const out = applyScope(quick, pkg);
98
+ assert.ok(out.indexOf('<!-- scope:end -->') < out.indexOf('## Part 3'));
99
+ assert.ok(out.indexOf('## Part 1') < out.indexOf('<!-- scope:start -->'));
100
+ });
101
+
102
+ test('optional fields absent: no map column, no Replaces line', () => {
103
+ const { pkg, md } = loadWorkflow();
104
+ delete pkg.mapLabel;
105
+ for (const w of pkg.workflows) delete w.replaces;
106
+ const section = applyScope(md, pkg).match(BLOCK)[0];
107
+ assert.match(section, /\| ID \| System \| Purpose \|\n\| --- \| --- \| --- \|\n/);
108
+ assert.doesNotMatch(section, /Replaces today's/);
109
+ });
110
+
111
+ test('scope.mjs refuses unbalanced markers and leaves the md alone', () => {
112
+ const dir = mkdtempSync(join(tmpdir(), 'ba-scope-'));
113
+ const { pkg, md } = loadWorkflow();
114
+ const broken = md.replace('<!-- scope:end -->', '');
115
+ writeFileSync(join(dir, 'r.json'), JSON.stringify(pkg));
116
+ writeFileSync(join(dir, 'r.md'), broken);
117
+ assert.throws(() => execFileSync('node', [script, '--json', join(dir, 'r.json'), '--md', join(dir, 'r.md')], { stdio: 'pipe' }));
118
+ assert.equal(readFileSync(join(dir, 'r.md'), 'utf8'), broken);
119
+ });
120
+
121
+ test('a pipe inside a feature name passes the Feature column check', () => {
122
+ const { pkg, md } = loadWorkflow();
123
+ pkg.features[0].name = 'Pack | ship';
124
+ const out = applyScope(md, pkg).replace('| in | Order pipeline & stage engine |', '| in | Pack \\| ship |');
125
+ assert.deepEqual(checkPackage({ pkg, md: out }), []);
126
+ });
127
+
128
+ test('a system with no workflow shows its feature table only; no step reads —', () => {
129
+ const { pkg, md } = noFlows();
130
+ const out = applyScope(md, pkg);
131
+ assert.ok(out.includes('### SYS-002 Orders & invoicing\n\nQuotation through to a paid invoice.\n\n| ID | Feature |'));
132
+ assert.ok(out.includes('| FEAT-003 | Order intake & quotation | Captures email and phone orders and prices them | — | FR-003 |'));
133
+ });
134
+
135
+ test('a system with no workflows key renders like an empty list', () => {
136
+ const { pkg, md } = noFlows();
137
+ const want = applyScope(md, pkg);
138
+ delete pkg.systems[1].workflows;
139
+ assert.equal(applyScope(md, pkg), want);
140
+ });
@@ -10,7 +10,7 @@ function parseArgs(argv) {
10
10
  }
11
11
 
12
12
  const args = parseArgs(process.argv.slice(2));
13
- const md = readFileSync(args.md, 'utf8');
13
+ const md = args.md ? readFileSync(args.md, 'utf8') : null;
14
14
  const pkg = JSON.parse(readFileSync(args.json, 'utf8'));
15
15
  const findings = checkPackage({ pkg, md });
16
16
  if (findings.length) {
@@ -7,6 +7,9 @@ import math
7
7
  import re
8
8
  import sys
9
9
 
10
+ from scope_checks import check_scope, scope_ids
11
+ from scope_render import check_scope_md
12
+
10
13
  STATUSES = ['DRAFT', 'CLARIFICATION_REQUIRED', 'ANALYZED', 'VALIDATED', 'READY_FOR_ARCHITECTURE']
11
14
  DEPTHS = ['QUICK', 'STANDARD', 'DEEP']
12
15
  MODES = ['greenfield', 'existing']
@@ -59,7 +62,7 @@ AMBIGUOUS = [
59
62
 
60
63
  PARTS = ['Part 1', 'Part 2', 'Part 3', 'Part 4', 'Part 5']
61
64
  QUICK_PARTS = ['Part 1', 'Part 3', 'Part 5']
62
- ID_TOKEN = re.compile(r'\b(?:G|ACT|WF|FR|BR|SC|NFR|INT|DAT|CON|ASM|Q|CONFLICT)-\d{3}\b')
65
+ ID_TOKEN = re.compile(r'\b(?:G|ACT|WF|FR|BR|SC|NFR|INT|DAT|CON|ASM|Q|CONFLICT|SYS|FEAT)-\d{3}\b')
63
66
 
64
67
 
65
68
  def rows(pkg, name):
@@ -228,7 +231,7 @@ def check_md(pkg, md):
228
231
  elif not bodies[key].strip():
229
232
  findings.append(f'md: empty section "## {part}"')
230
233
  md_ids = {m.group(0) for m in ID_TOKEN.finditer(md)}
231
- for rid in collect_ids(pkg):
234
+ for rid in collect_ids(pkg) + scope_ids(pkg):
232
235
  if rid not in md_ids:
233
236
  findings.append(f'md: id {rid} absent from requirements.md')
234
237
  fm_status = frontmatter(md, 'status')
@@ -253,16 +256,20 @@ def check_package(pkg, md):
253
256
  schema_findings = check_schema(pkg)
254
257
  if schema_findings:
255
258
  return schema_findings
256
- ids = set(collect_ids(pkg))
257
- return [
259
+ ids = set(collect_ids(pkg)) | set(scope_ids(pkg))
260
+ scope = check_scope(pkg, ids)
261
+ json_findings = [
258
262
  *check_duplicates(pkg),
259
263
  *check_refs(pkg, ids),
260
264
  *check_labels(pkg),
261
265
  *check_ambiguity(pkg),
262
266
  *check_readiness(pkg),
263
- *check_md(pkg, md),
264
- *check_md_orphan_ids(None, md, ids),
267
+ *scope,
265
268
  ]
269
+ if md is None:
270
+ return json_findings
271
+ return [*json_findings, *check_md(pkg, md), *check_md_orphan_ids(None, md, ids),
272
+ *([] if scope else check_scope_md(pkg, md))]
266
273
 
267
274
 
268
275
  def main(argv):
@@ -273,8 +280,10 @@ def main(argv):
273
280
  args[argv[i][2:]] = argv[i + 1]
274
281
  i += 1
275
282
  i += 1
276
- with open(args['md'], encoding='utf-8') as f:
277
- md = f.read()
283
+ md = None
284
+ if args.get('md'):
285
+ with open(args['md'], encoding='utf-8') as f:
286
+ md = f.read()
278
287
  with open(args['json'], encoding='utf-8') as f:
279
288
  pkg = json.load(f)
280
289
  findings = check_package(pkg, md)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reasoning",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Reasoning toolkit: classify a problem, pick a fitting framework, and work it to a testable next step — with evidence and assumptions kept apart.",
5
5
  "author": {
6
6
  "name": "Truong Vu",
@@ -0,0 +1,8 @@
1
+ ---
2
+ type: regex
3
+ pattern: '\.reasoning/problems/\d{4}-\d{2}-\d{2}-[a-z0-9-]+'
4
+ match: contains
5
+ target: last_message
6
+ ---
7
+
8
+ The router's hand-off names the problem folder the next skill writes into.
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: tool_used
3
+ tool: Skill
4
+ min: 1
5
+ ---
6
+
7
+ The problem-router skill must actually be invoked, not merely described.
@@ -0,0 +1,9 @@
1
+ ---
2
+ max_turns: 10
3
+ allowed_tools: [Read, Glob, Grep, Skill]
4
+ ---
5
+
6
+ Use the problem-router skill on this: every quarter the same onboarding
7
+ delays come back. We fix the handoff between sales and provisioning, it
8
+ holds for a few weeks, then a different team hits the same wall. Three
9
+ fixes in two years.
@@ -0,0 +1,8 @@
1
+ ---
2
+ type: regex
3
+ pattern: '\[e1\]'
4
+ match: contains
5
+ target: last_message
6
+ ---
7
+
8
+ Evidence ids render as small tags in chat.
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: tool_used
3
+ tool: Skill
4
+ min: 1
5
+ ---
6
+
7
+ The problem-solving skill must actually be invoked, not merely described.
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: llm
3
+ weight: 1
4
+ ---
5
+
6
+ PASS if every `evidence` entry shows an id (`e1`, `e2`, …) and a
7
+ `supports` list, and every id in those lists names a `c`-prefixed item
8
+ that appears in the `five_whys` block.
9
+ FAIL if any evidence entry has no id, has no `supports` list, or lists an
10
+ id that no framework item carries.
11
+ An empty list `[]` counts as a list and passes.
@@ -0,0 +1,8 @@
1
+ ---
2
+ max_turns: 10
3
+ allowed_tools: [Read, Glob, Grep, Skill]
4
+ ---
5
+
6
+ Use the problem-solving skill with five_whys on this: deploys fail
7
+ intermittently since Monday's runner image update. The ci-run-4471 log
8
+ shows "pull access denied for base-image".
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: llm
3
+ weight: 1
4
+ ---
5
+
6
+ The input gives no evidence for any cause.
7
+
8
+ PASS if the deepest cause in the `rca` block has a `c`-prefixed id and
9
+ carries `status: root_candidate` (or renders the status `root_candidate`
10
+ next to it).
11
+ FAIL if any cause carries `status: root`, or if the cause has no id.
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: tool_used
3
+ tool: Skill
4
+ min: 1
5
+ ---
6
+
7
+ The problem-solving skill must actually be invoked, not merely described.
@@ -0,0 +1,8 @@
1
+ ---
2
+ max_turns: 10
3
+ allowed_tools: [Read, Glob, Grep, Skill]
4
+ ---
5
+
6
+ Use the problem-solving skill with rca on this: the checkout page times
7
+ out for some users since Tuesday. The team suspects Tuesday's payment SDK
8
+ upgrade, but nobody has checked. No logs are available yet.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: llm
3
+ weight: 1
4
+ ---
5
+
6
+ PASS if the response contains the six core fields and one `iceberg`
7
+ block, and says the file was not saved exactly once.
8
+ FAIL if the analysis stops or is cut short because of the save, if the
9
+ save is retried, or if "not saved" is repeated.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: regex
3
+ pattern: 'not saved'
4
+ flags: i
5
+ match: contains
6
+ target: last_message
7
+ ---
8
+
9
+ The refused write is reported.
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: tool_used
3
+ tool: Skill
4
+ min: 1
5
+ ---
6
+
7
+ The systems-thinking skill must actually be invoked, not merely described.
@@ -0,0 +1,8 @@
1
+ ---
2
+ max_turns: 10
3
+ allowed_tools: [Read, Glob, Grep, Skill]
4
+ ---
5
+
6
+ Use the systems-thinking skill with iceberg on this: our on-call
7
+ engineers have quit at a rate of two per quarter for the last year, and
8
+ each exit interview names night pages.
@@ -44,3 +44,9 @@ for classification only.
44
44
  because `systems-thinking` and `systemic-design` aren't built yet — it
45
45
  says so and offers the closest available option with its limitation named.
46
46
  - Doesn't emit numeric confidence — only `low` / `medium` / `high`.
47
+
48
+ ## Output
49
+
50
+ Every run is also saved under `~/.reasoning/problems/`, one folder per
51
+ problem and one file per run. If Claude Code isn't allowed to write
52
+ there, the run says "not saved" and carries on.
@@ -142,6 +142,10 @@ evidence types, assumption status, and confidence rules. Don't guess at
142
142
  any of it here; the contract is the single source of truth for the field
143
143
  set.
144
144
 
145
+ Save the run per `references/contract.md` Saving. When you recommend a
146
+ skill, name the problem folder path in the hand-off so that skill writes
147
+ into it. If this run started from a hand-off that names a folder, use it.
148
+
145
149
  ## Degradation
146
150
 
147
151
  `complex` routes to `systems-thinking`, which is built. Route to it