@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.
- package/README.md +2 -1
- package/package.json +2 -2
- package/plugins/business-analyst/.claude-plugin/plugin.json +1 -1
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/conflict-quoted.md +15 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/no-internal-ids.md +9 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/one-question.md +15 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/prompt.md +31 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-internal-ids.md +9 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-setup-questions.md +16 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/one-scope-question.md +19 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/prompt.md +31 -0
- package/plugins/business-analyst/evals/ba-review-page/case.yaml +4 -0
- package/plugins/business-analyst/evals/ba-review-page/fixture.sh +12 -0
- package/plugins/business-analyst/evals/ba-review-page/graders/decide-in-interview.md +26 -0
- package/plugins/business-analyst/evals/ba-review-page/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-review-page/prompt.md +9 -0
- package/plugins/business-analyst/skills/business-analyst/README.md +8 -0
- package/plugins/business-analyst/skills/business-analyst/SKILL.md +47 -16
- package/plugins/business-analyst/skills/business-analyst/assets/review-page.html +68 -0
- package/plugins/business-analyst/skills/business-analyst/evals/evals.json +1 -1
- package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +3 -2
- package/plugins/business-analyst/skills/business-analyst/references/interview.md +156 -8
- package/plugins/business-analyst/skills/business-analyst/references/review.md +18 -4
- package/plugins/business-analyst/skills/business-analyst/references/writing.md +49 -8
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +12 -6
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-data.mjs +66 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-layout.mjs +53 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-page.mjs +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-checks.mjs +73 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-md.mjs +53 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-render.mjs +72 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-rules.mjs +90 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review.mjs +48 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review.py +60 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_data.py +81 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_layout.py +50 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_page.py +115 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope.mjs +24 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope.py +35 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope_checks.py +168 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope_render.py +140 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +27 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.json +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.md +136 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/python-parity.test.mjs +88 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/quality-gates.test.mjs +26 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-browser.test.mjs +106 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-fixture.mjs +32 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-page.test.mjs +340 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-parity.test.mjs +79 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-cases.mjs +58 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-checks.test.mjs +31 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-md.test.mjs +140 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +1 -1
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.py +17 -8
- package/plugins/reasoning/.claude-plugin/plugin.json +1 -1
- package/plugins/reasoning/evals/format-handoff-folder/graders/folder-named.md +8 -0
- package/plugins/reasoning/evals/format-handoff-folder/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-handoff-folder/prompt.md +9 -0
- package/plugins/reasoning/evals/format-ids-and-supports/graders/ids-in-chat.md +8 -0
- package/plugins/reasoning/evals/format-ids-and-supports/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-ids-and-supports/graders/supports-resolve.md +11 -0
- package/plugins/reasoning/evals/format-ids-and-supports/prompt.md +8 -0
- package/plugins/reasoning/evals/format-root-candidate-status/graders/candidate-status.md +11 -0
- package/plugins/reasoning/evals/format-root-candidate-status/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-root-candidate-status/prompt.md +8 -0
- package/plugins/reasoning/evals/format-unsaved-continues/graders/analysis-completes.md +9 -0
- package/plugins/reasoning/evals/format-unsaved-continues/graders/not-saved-stated.md +9 -0
- package/plugins/reasoning/evals/format-unsaved-continues/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-unsaved-continues/prompt.md +8 -0
- package/plugins/reasoning/skills/problem-router/README.md +6 -0
- package/plugins/reasoning/skills/problem-router/SKILL.md +4 -0
- package/plugins/reasoning/skills/problem-router/references/contract.md +114 -19
- package/plugins/reasoning/skills/problem-solving/README.md +6 -0
- package/plugins/reasoning/skills/problem-solving/SKILL.md +2 -0
- package/plugins/reasoning/skills/problem-solving/references/contract.md +114 -19
- package/plugins/reasoning/skills/problem-solving/references/interview.md +2 -0
- package/plugins/reasoning/skills/systemic-design/README.md +3 -0
- package/plugins/reasoning/skills/systemic-design/SKILL.md +2 -0
- package/plugins/reasoning/skills/systemic-design/references/contract.md +114 -19
- package/plugins/reasoning/skills/systemic-design/references/interview.md +2 -0
- package/plugins/reasoning/skills/systems-thinking/README.md +3 -0
- package/plugins/reasoning/skills/systems-thinking/SKILL.md +2 -0
- package/plugins/reasoning/skills/systems-thinking/frameworks/leverage-points.md +15 -6
- package/plugins/reasoning/skills/systems-thinking/references/contract.md +114 -19
- package/plugins/reasoning/skills/systems-thinking/references/interview.md +2 -0
- package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
- package/plugins/solution-architect/evals/proposal-workflow/case.yaml +6 -0
- package/plugins/solution-architect/evals/proposal-workflow/fixture.sh +6 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/inputs-written.md +23 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/no-proposal-md.md +7 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/validate-then-render.md +16 -0
- package/plugins/solution-architect/evals/proposal-workflow/prompt.md +10 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/case.yaml +4 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/fixture.sh +6 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +10 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/nothing-written.md +7 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +11 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/prompt.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/case.yaml +4 -0
- package/plugins/solution-architect/evals/workflow-happy-path/fixture.sh +6 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/no-estimation-md.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/pages-or-stop.md +16 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/routed-to-workflow.md +12 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/three-questions-max.md +14 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +15 -0
- package/plugins/solution-architect/evals/workflow-happy-path/prompt.md +9 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +11 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +4 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +16 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +27 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +9 -0
- package/plugins/solution-architect/skills/estimate/README.md +38 -18
- package/plugins/solution-architect/skills/estimate/SKILL.md +16 -69
- package/plugins/solution-architect/skills/estimate/classic/FLOW.md +77 -0
- package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template-agentic.html +111 -138
- package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template.html +219 -445
- package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/scores-review-template.html +5 -4
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/agentic-estimation.md +4 -2
- package/plugins/solution-architect/skills/estimate/classic/references/ai-multipliers.md +57 -0
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/interview.md +56 -35
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/scoring-guide.md +40 -4
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/task-shapes.md +1 -1
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/techniques.md +29 -21
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/writing.md +77 -45
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/compute.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/checks.mjs +38 -6
- package/plugins/solution-architect/skills/estimate/classic/scripts/lib/redact.mjs +112 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/roadmap.mjs +4 -5
- package/plugins/solution-architect/skills/estimate/classic/scripts/lib/rollup.mjs +129 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/schema.mjs +31 -38
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-csv.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-html.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/render.mjs +9 -8
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/score-review.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/baselines.test.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/browser-agentic.test.mjs +143 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser.test.mjs +211 -52
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/compute.test.mjs +58 -33
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/e2e.test.mjs +55 -3
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/estimate-math.test.mjs +44 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-fail.md +0 -10
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-pass.md +0 -10
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-inputs.json +1 -7
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/booking-inputs.json +11 -10
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-fail.md +6 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-pass.md +17 -21
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/measurements.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/pricing.test.mjs +88 -0
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/project-price.test.mjs +93 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/quality-gates.test.mjs +7 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/references.test.mjs +88 -26
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/render.test.mjs +405 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/schema.test.mjs +114 -61
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/score-review.test.mjs +37 -4
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/scoring.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/url-state.test.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/validate.test.mjs +104 -10
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/xlsx-export.test.mjs +475 -0
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/zip-store.test.mjs +26 -0
- package/plugins/solution-architect/skills/estimate/evals/evals.json +44 -9
- package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +28 -0
- package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
- package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.md +141 -0
- package/plugins/solution-architect/skills/estimate/shared/assets/xlsx-export.js +336 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/agentic-task-schema.mjs +24 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/context-schema.mjs +35 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/estimate-math.mjs +31 -0
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/inline.mjs +13 -5
- package/plugins/solution-architect/skills/estimate/shared/lib/pricing.mjs +78 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/project-price.mjs +96 -0
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring-schema.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/shared/lib/zip.mjs +60 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/FLOW.md +91 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-components.html +994 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-template.html +440 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimator-system.xlsx +0 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/score-review.html +838 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/references/hidden-work-by-type.md +429 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/references/linking.md +59 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-components-template.mjs +80 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-template.mjs +60 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +51 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-xlsx-template.py +144 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/compute.mjs +32 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-html.mjs +44 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-view.mjs +71 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/pair-findings.mjs +19 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/requirements.mjs +33 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/rollup.mjs +66 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema-components.mjs +69 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema.mjs +70 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-diff.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-html.mjs +52 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +51 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/render.mjs +42 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/score-review.mjs +46 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/arch-link.js +9 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/click.js +28 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/prelude.js +4 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/view.js +63 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/browser.test.mjs +127 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs +43 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-template.test.mjs +18 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/cli.test.mjs +48 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/estimator-system.test.mjs +66 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/ARCHITECTURE-mini.md +31 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/feedback.json +19 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/inputs-pass.json +80 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/measurements.jsonl +0 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/requirements.json +79 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/page-view.test.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/pages-browser.test.mjs +209 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/quality-gates.test.mjs +25 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/render.test.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/requirements.test.mjs +33 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/rollup.test.mjs +80 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/schema.test.mjs +61 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/score-review.test.mjs +108 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/stage.mjs +32 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/workflow-script.test.mjs +24 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +58 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/validate.mjs +19 -0
- package/plugins/solution-architect/skills/new-lead/SKILL.md +4 -3
- package/plugins/solution-architect/skills/proposal/README.md +22 -7
- package/plugins/solution-architect/skills/proposal/SKILL.md +18 -7
- package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +143 -0
- package/plugins/solution-architect/skills/proposal/evals/evals.json +29 -11
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/ARCHITECTURE.md +65 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/brief.md +21 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation-inputs.json +126 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation.json +215 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation-inputs.json +224 -34
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.json +103 -114
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.md +48 -22
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation-inputs.json +211 -33
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.json +102 -117
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.md +48 -25
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +31 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation-inputs.json +468 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation.json +773 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/measurements.jsonl +0 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
- package/plugins/solution-architect/skills/proposal/references/interview.md +3 -6
- package/plugins/solution-architect/skills/proposal/references/review.md +16 -4
- package/plugins/solution-architect/skills/proposal/references/workflow.md +88 -0
- package/plugins/solution-architect/skills/proposal/references/writing.md +33 -31
- package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +1 -1
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +5 -22
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +18 -8
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +6 -2
- package/plugins/solution-architect/skills/proposal/scripts/lib/docx-body.mjs +42 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/docx-package.mjs +56 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/docx-xml.mjs +44 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +24 -33
- package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +1 -1
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-checks.mjs +71 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-cli.mjs +46 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-html.mjs +39 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-lead.mjs +45 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-page.mjs +30 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-view.mjs +80 -0
- package/plugins/solution-architect/skills/proposal/scripts/render.mjs +5 -1
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +50 -47
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +99 -40
- package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +11 -5
- package/plugins/solution-architect/skills/proposal/scripts/test/docx.test.mjs +68 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +3 -3
- package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +46 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +67 -54
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +6 -1
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +17 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +8 -12
- package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +3 -3
- package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +5 -4
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-browser.test.mjs +96 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-checks.test.mjs +98 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-docs.test.mjs +25 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-render.test.mjs +75 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-stage.mjs +15 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-view.test.mjs +78 -0
- package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +4 -1
- package/plugins/solution-architect/workflows/review-links.js +61 -0
- package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +0 -101
- package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +0 -89
- package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +0 -64
- package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +0 -154
- package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +0 -39
- package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +0 -131
- package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +0 -251
- package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +0 -254
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/slicing.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/agentic-checks.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/components.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/md-tables.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/scoring-checks.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/measurements.jsonl +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/zip.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/validate.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/baselines.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/measurements.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/score-diff.mjs +0 -0
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"lead": "sin-kowa-mini",
|
|
4
|
+
"status": "ANALYZED",
|
|
5
|
+
"depth": "STANDARD",
|
|
6
|
+
"updated": "2026-10-06",
|
|
7
|
+
"mode": "greenfield",
|
|
8
|
+
"scopeMode": "workflow",
|
|
9
|
+
"mapLabel": "IMDA roadmap pillar",
|
|
10
|
+
"context": {
|
|
11
|
+
"problem": "Clients dispute charges after the ship sails and there is no record of what was packed.",
|
|
12
|
+
"goals": [
|
|
13
|
+
{ "id": "G-001", "goal": "Stop billing disputes after sailing", "metric": "disputes per month down 50% in 6 months", "source": "PO brief" }
|
|
14
|
+
],
|
|
15
|
+
"successMetrics": ["disputes per month down 50% within 6 months of go-live"]
|
|
16
|
+
},
|
|
17
|
+
"actors": [
|
|
18
|
+
{ "id": "ACT-001", "name": "Packer", "type": "human", "goal": "pack an order without paper lists", "painPoints": ["packs from a printed list"] },
|
|
19
|
+
{ "id": "ACT-002", "name": "Office staff", "type": "human", "goal": "invoice the moment goods are delivered", "painPoints": ["waits weeks for the paper delivery order"] }
|
|
20
|
+
],
|
|
21
|
+
"workflows": [
|
|
22
|
+
{ "id": "WF-001", "name": "Order to invoice today", "state": "as-is", "trigger": "ship sends an order by email or phone", "steps": ["office staff key the order in", "warehouse packs from a paper list", "paper delivery order signed at the dock", "invoice raised when the paper returns"], "exceptions": ["client disputes a charge after sailing"] },
|
|
23
|
+
{ "id": "WF-002", "name": "Order pipeline", "state": "to-be", "label": "confirmed", "source": "PO brief, System 1", "trigger": "order confirmed by office staff", "steps": ["Order In", "Pack", "Pack Review", "Shipped"], "branches": [{ "from": "Pack", "to": "Short-pack alert", "label": "can't fulfil" }, { "from": "Pack Review", "to": "Pack", "label": "mismatch" }], "replaces": ["WF-001"], "exceptions": [] },
|
|
24
|
+
{ "id": "WF-003", "name": "Order to cash", "state": "to-be", "label": "recommended", "source": "drafted from PO brief, System 2", "trigger": "order received by email or phone", "steps": ["Order received", "Quote", "Invoice", "Paid"], "branches": [], "replaces": ["WF-001"], "exceptions": [] },
|
|
25
|
+
{ "id": "WF-004", "name": "Custom order", "state": "to-be", "label": "confirmed", "source": "PO brief, System 2 sub-flow", "trigger": "order holds an item that is sourced, not stocked", "steps": ["Flag as custom", "Vendor PO", "Receive into stock"], "branches": [], "sub": { "startsAt": "WF-003:Order received", "rejoins": "WF-002", "share": "about 20% of orders" }, "exceptions": [] }
|
|
26
|
+
],
|
|
27
|
+
"systems": [
|
|
28
|
+
{ "id": "SYS-001", "name": "Warehouse operations", "purpose": "Moves an order from intake to the dock; the one screen a warehouse worker needs.", "map": "Warehouse Automation", "label": "confirmed", "source": "PO brief, System 1", "workflows": ["WF-002"], "features": ["FEAT-001", "FEAT-002"] },
|
|
29
|
+
{ "id": "SYS-002", "name": "Orders & invoicing", "purpose": "Quotation through to a paid invoice.", "map": "Finance/Documentation", "label": "confirmed", "source": "PO brief, System 2", "workflows": ["WF-003", "WF-004"], "features": ["FEAT-003", "FEAT-004", "FEAT-005"] }
|
|
30
|
+
],
|
|
31
|
+
"features": [
|
|
32
|
+
{ "id": "FEAT-001", "name": "Order pipeline & stage engine", "does": "Moves an order through each stage, with task views per role", "label": "confirmed", "source": "PO brief, System 1", "steps": ["WF-002:Order In", "WF-002:Pack", "WF-002:Pack Review", "WF-002:Shipped"], "requirements": ["FR-001"] },
|
|
33
|
+
{ "id": "FEAT-002", "name": "Short-pack alert", "does": "Flags an item that cannot be packed, in time to buy or cancel", "label": "confirmed", "source": "PO brief, System 1", "steps": ["WF-002:Short-pack alert"], "requirements": ["FR-002"] },
|
|
34
|
+
{ "id": "FEAT-003", "name": "Order intake & quotation", "does": "Captures email and phone orders and prices them", "label": "confirmed", "source": "PO brief, System 2", "steps": ["WF-003:Order received", "WF-003:Quote", "WF-004:Flag as custom"], "requirements": ["FR-003"] },
|
|
35
|
+
{ "id": "FEAT-004", "name": "Invoice from packed quantities", "does": "Raises the invoice from what was packed and shipped", "label": "recommended", "source": "drafted from PO brief, System 2", "steps": ["WF-002:Shipped", "WF-003:Invoice", "WF-003:Paid"], "requirements": ["FR-004"] },
|
|
36
|
+
{ "id": "FEAT-005", "name": "One login, role-based screens", "does": "One login; packers see packing tasks, office staff see orders and invoices", "label": "confirmed", "source": "PO brief, System 1", "steps": ["*"], "requirements": ["FR-005"] }
|
|
37
|
+
],
|
|
38
|
+
"requirements": [
|
|
39
|
+
{ "id": "FR-001", "text": "The system must move each order through the stages Order In, Pack, Pack Review and Shipped.", "label": "confirmed", "source": "PO brief, System 1", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "in", "acceptance": [] },
|
|
40
|
+
{ "id": "FR-002", "text": "The system must let a packer flag an item that cannot be packed and alert office staff.", "label": "confirmed", "source": "PO brief, System 1", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "in", "acceptance": [] },
|
|
41
|
+
{ "id": "FR-003", "text": "Office staff must be able to enter an order received by email or phone and produce a quotation.", "label": "confirmed", "source": "PO brief, System 2", "traces": { "goal": "G-001", "workflow": "WF-003", "rules": [] }, "scope": "in", "acceptance": [] },
|
|
42
|
+
{ "id": "FR-004", "text": "The system must raise the invoice from packed-and-audited quantities.", "label": "assumed", "source": "PO brief, System 2", "traces": { "goal": "G-001", "workflow": "WF-003", "rules": ["BR-001"] }, "scope": "in", "acceptance": ["SC-001"] },
|
|
43
|
+
{ "id": "FR-005", "text": "The system must provide one login, with packers limited to packing tasks.", "label": "confirmed", "source": "PO brief, System 1", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "in", "acceptance": [] },
|
|
44
|
+
{ "id": "FR-006", "text": "The system must print a pallet label at the Pack stage.", "label": "assumed", "source": "PO brief, System 4", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "future", "acceptance": [] }
|
|
45
|
+
],
|
|
46
|
+
"businessRules": [
|
|
47
|
+
{ "id": "BR-001", "rule": "Invoice quantity equals packed-and-audited quantity.", "source": "PO brief, System 2", "examples": ["ordered 10, packed 10 -> invoice 10", "ordered 10, packed 8 -> invoice 8"] }
|
|
48
|
+
],
|
|
49
|
+
"scenarios": [
|
|
50
|
+
{ "id": "SC-001", "requirement": "FR-004", "type": "happy", "given": "an order of 10 items with 8 packed", "when": "the invoice is raised", "then": "it bills 8 items" }
|
|
51
|
+
],
|
|
52
|
+
"nfrs": [
|
|
53
|
+
{ "id": "NFR-001", "area": "availability", "text": "Scans made without connectivity must be kept and synced within 5 minutes of reconnecting.", "label": "assumed" }
|
|
54
|
+
],
|
|
55
|
+
"integrations": [
|
|
56
|
+
{ "id": "INT-001", "system": "InvoiceNow network", "direction": "write", "label": "recommended" }
|
|
57
|
+
],
|
|
58
|
+
"data": [
|
|
59
|
+
{ "id": "DAT-001", "entity": "Order", "sensitivity": "commercial", "volume": "about 300 per month", "label": "assumed" }
|
|
60
|
+
],
|
|
61
|
+
"constraints": [
|
|
62
|
+
{ "id": "CON-001", "text": "Vessels are offline at sea; delivery orders are signed on paper at the dock today.", "source": "PO brief" }
|
|
63
|
+
],
|
|
64
|
+
"assumptions": [
|
|
65
|
+
{ "id": "ASM-001", "text": "Packers carry a phone with a camera on the warehouse floor.", "impact": "medium", "status": "unconfirmed" }
|
|
66
|
+
],
|
|
67
|
+
"openQuestions": [
|
|
68
|
+
{ "id": "Q-001", "question": "Is order to cash the right shape: quote before the order is confirmed?", "priority": "P1", "reason": "the workflow was drafted, not described by the client", "affects": ["WF-003"], "status": "open", "answer": null, "architectureBlocker": false },
|
|
69
|
+
{ "id": "Q-002", "question": "Should the invoice be raised at shipping, or when the delivery order is signed?", "priority": "P2", "reason": "decides the invoice trigger", "affects": ["FEAT-004", "INT-001"], "status": "open", "answer": null, "architectureBlocker": false }
|
|
70
|
+
],
|
|
71
|
+
"conflicts": [],
|
|
72
|
+
"scope": { "out": ["last-mile delivery tracking"], "future": ["pallet labels"], "unconfirmed": [] },
|
|
73
|
+
"ai": null,
|
|
74
|
+
"readiness": {
|
|
75
|
+
"overall": 63,
|
|
76
|
+
"areas": { "businessContext": 80, "workflows": 70, "rules": 60, "integrations": 50, "data": 60, "nfrs": 60 },
|
|
77
|
+
"blockers": []
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -12,8 +12,8 @@ Both files must exist or the skill stops:
|
|
|
12
12
|
|
|
13
13
|
Read ARCHITECTURE.md, estimation.json, and estimation.md. Load the firm
|
|
14
14
|
profile (see §3). Then state what is already known: scope, milestones,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
cost, risks, tech stack. The user corrects anything stale before questions
|
|
16
|
+
begin.
|
|
17
17
|
|
|
18
18
|
## 1. Client context — the only-human-knows questions
|
|
19
19
|
|
|
@@ -26,10 +26,7 @@ stale before questions begin.
|
|
|
26
26
|
Objectives.
|
|
27
27
|
4. What the client cares about most: price, speed, or reliability — shapes
|
|
28
28
|
the Executive Summary's emphasis.
|
|
29
|
-
5.
|
|
30
|
-
its cost and duration; the user picks exactly one. Only that one appears
|
|
31
|
-
in the proposal.
|
|
32
|
-
6. Validity period — default 30 days from today; compute the date for
|
|
29
|
+
5. Validity period — default 30 days from today; compute the date for
|
|
33
30
|
`valid_until`.
|
|
34
31
|
|
|
35
32
|
## 2. Gaps + confirmation
|
|
@@ -10,17 +10,29 @@ way the client will.
|
|
|
10
10
|
1. **Comprehension** — would a reader at the stated tech level understand
|
|
11
11
|
every sentence? Flag anything too technical; this catches jargon beyond
|
|
12
12
|
the deny-list.
|
|
13
|
-
2. **Executive summary** — does page one answer what we build
|
|
14
|
-
costs
|
|
13
|
+
2. **Executive summary** — does page one answer what we build and what it
|
|
14
|
+
costs?
|
|
15
15
|
3. **Honesty** — persuasive is fine, hype is not. Flag any claim the
|
|
16
16
|
document itself cannot back.
|
|
17
|
-
4. **Leaks** — anything internal:
|
|
18
|
-
words, confidence internals
|
|
17
|
+
4. **Leaks** — anything internal: staffing detail, rates, provenance
|
|
18
|
+
words, confidence internals, a delivery duration or date (the estimate
|
|
19
|
+
produces no timeline).
|
|
19
20
|
5. **Contradictions** — scope vs out-of-scope, price table vs summary,
|
|
20
21
|
milestones vs delivery prose.
|
|
21
22
|
|
|
22
23
|
Return findings as a list; no rewrites.
|
|
23
24
|
|
|
25
|
+
## Workflow mode
|
|
26
|
+
|
|
27
|
+
Run after `render.mjs` first writes `dist/proposal.html`, before human
|
|
28
|
+
review. Dispatch one general-purpose subagent with **only**:
|
|
29
|
+
`dist/proposal.html`, estimation.json, and the client tech level. Same
|
|
30
|
+
charter, read against the page text, except item 2, which becomes: does
|
|
31
|
+
the Scope section say what we build, and the Cost section what it costs?
|
|
32
|
+
Findings are fixed in `proposal-inputs.json` (the only text you wrote);
|
|
33
|
+
a finding about a system, feature, assumption or exclusion goes back to
|
|
34
|
+
the BA package or the estimate, never into the proposal.
|
|
35
|
+
|
|
24
36
|
## Loop bound
|
|
25
37
|
|
|
26
38
|
Fix findings → re-run `validate.mjs` → one findings-only re-review, then
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Workflow mode — Systems & Workflows proposal page
|
|
2
|
+
|
|
3
|
+
Read when `estimation.json` has `inputs.scopeMode: "workflow"`. The page
|
|
4
|
+
copies the format of the proposal sent to Sin Kowa: Scope, one section per
|
|
5
|
+
system (its workflow diagrams and a Feature | What it does table),
|
|
6
|
+
Milestones, Assumptions & exclusions, Cost estimate. Every fact on it comes
|
|
7
|
+
from data; you write only the sentences, in `proposal-inputs.json`. There
|
|
8
|
+
is no proposal.md, and nobody edits one: the human reads the page, asks for
|
|
9
|
+
changes in chat, and downloads the DOCX or PDF to send.
|
|
10
|
+
|
|
11
|
+
## 1. Where each part comes from
|
|
12
|
+
|
|
13
|
+
| Part | Source |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Systems, workflows, features and what each does, scope.out | `requirements.json` (the BA package the estimate names) |
|
|
16
|
+
| Milestone contents, assumptions, exclusions, price | `estimation.json` |
|
|
17
|
+
| Title, byline, scope intro, one optional sentence per system, milestone client names and what each demonstrates | `proposal-inputs.json` (you) |
|
|
18
|
+
|
|
19
|
+
Prices are USD. The team changes the currency, and adds an About-us or
|
|
20
|
+
next-steps section if they want one, in the copy they send — never in a
|
|
21
|
+
skill file.
|
|
22
|
+
|
|
23
|
+
## 2. Flow
|
|
24
|
+
|
|
25
|
+
1. **Gate.** `estimation.json` exists with `scopeMode: "workflow"`, and the
|
|
26
|
+
`requirements.json` it names exists. A missing estimate → stop: "run the
|
|
27
|
+
estimate skill first." `validate.mjs` (step 4) re-runs the estimate's own
|
|
28
|
+
validation; a finding there → stop and name the estimate skill.
|
|
29
|
+
2. **Interview, one question at a time, only what is unknown.** Client name;
|
|
30
|
+
tech level (non-tech | low-tech | technical, as classic
|
|
31
|
+
`references/interview.md` §1); the firm name (`firm` from the profile,
|
|
32
|
+
classic §3 lookup — ask only the name if there is no profile). Then show
|
|
33
|
+
the milestones (`computed.features[].milestone`, with the features each
|
|
34
|
+
finishes) and propose a client name and one "what it demonstrates" line
|
|
35
|
+
for each; the user corrects them.
|
|
36
|
+
3. **Write `proposal-inputs.json`** beside `estimation.json` (§3).
|
|
37
|
+
4. **Validate:** `node scripts/validate.mjs --estimation <dir>/estimation.json
|
|
38
|
+
--inputs <dir>/proposal-inputs.json` — fix findings, re-run until clean.
|
|
39
|
+
5. **Render:** `node scripts/render.mjs --estimation <dir>/estimation.json
|
|
40
|
+
--inputs <dir>/proposal-inputs.json --mermaid-bundle <path> --out <dir>/dist`
|
|
41
|
+
— the same mermaid bundle as classic step 8. It re-runs validation and
|
|
42
|
+
writes nothing on a finding.
|
|
43
|
+
6. **Fresh-eyes review** of `dist/proposal.html` (`references/review.md`,
|
|
44
|
+
Workflow mode); fix in `proposal-inputs.json`, steps 4–5 again.
|
|
45
|
+
7. **Serve and hand over.** `node ../analyze-requirements/scripts/serve.mjs <dir>`.
|
|
46
|
+
Tell the user: the URL; that the page has Download PDF and Download DOCX
|
|
47
|
+
buttons; that prices are USD and currency, About-us and next steps are
|
|
48
|
+
theirs to change in the sent copy. Changes → edit `proposal-inputs.json`
|
|
49
|
+
(or, for a fact, the BA package or estimate) → steps 4–7 again.
|
|
50
|
+
|
|
51
|
+
## 3. `proposal-inputs.json`
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"client": "Sin Kowa",
|
|
56
|
+
"title": "Sin Kowa Digital Transformation",
|
|
57
|
+
"firm": "Code Engine Studio",
|
|
58
|
+
"date": "2026-10-07",
|
|
59
|
+
"techLevel": "non-tech",
|
|
60
|
+
"jargonAllow": [],
|
|
61
|
+
"scopeIntro": "This proposal covers two systems for Phase 1 …",
|
|
62
|
+
"systems": { "SYS-002": "It closes the paper delivery-order gap …" },
|
|
63
|
+
"milestones": {
|
|
64
|
+
"M1 - Walking skeleton": { "name": "Digitise core records", "demonstrates": "Orders move through each stage on screen …" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- `title` becomes "<title> — Systems & Workflows Proposal"; `date` is today
|
|
70
|
+
(ISO) and shows as "Oct 7, 2026 · <firm>".
|
|
71
|
+
- `systems` is optional, keyed by the BA system id; the sentence follows the
|
|
72
|
+
system's own purpose line.
|
|
73
|
+
- `milestones` needs an entry for every milestone the estimate uses, keyed
|
|
74
|
+
by its estimate name, and no others. The page numbers them in order.
|
|
75
|
+
|
|
76
|
+
## 4. Sentence rules (validate.mjs refuses each)
|
|
77
|
+
|
|
78
|
+
The title counts as a sentence: it is the page heading.
|
|
79
|
+
|
|
80
|
+
- No price of any kind in a sentence (`$40k`, `USD 5,000`, `12k SGD`,
|
|
81
|
+
`5,000 dollars`, `RM 20,000`, `1.2 million usd`): the only prices on the
|
|
82
|
+
page are the estimate's.
|
|
83
|
+
- No internal ID (`FEAT-001`, `SYS-002`, `FR-003` …) and no engineer
|
|
84
|
+
milestone name (`M1 - Walking skeleton`): name the thing in words.
|
|
85
|
+
- `non-tech`: no word from the jargon list (`scripts/lib/jargon.mjs`) unless
|
|
86
|
+
listed in `jargonAllow` because the client uses it.
|
|
87
|
+
- No timeline, rate, team or score: the estimate produces none for the
|
|
88
|
+
client (the fresh-eyes review catches what no script can).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Writing — frontmatter contract,
|
|
1
|
+
# Writing — frontmatter contract, nine sections, language rules
|
|
2
2
|
|
|
3
3
|
Read while writing proposal.md. The validator enforces everything below;
|
|
4
4
|
a document that satisfies this file passes `validate.mjs` by construction.
|
|
@@ -9,7 +9,6 @@ a document that satisfies this file passes `validate.mjs` by construction.
|
|
|
9
9
|
---
|
|
10
10
|
client: Acme Corp
|
|
11
11
|
client_tech_level: non-tech # non-tech | low-tech | technical
|
|
12
|
-
scenario: 2eng-max5x # must exist in estimation.json
|
|
13
12
|
currency: USD
|
|
14
13
|
valid_until: 2026-09-06 # ISO date, must be in the future
|
|
15
14
|
jargon_allow: [] # optional, JSON array
|
|
@@ -22,21 +21,25 @@ source_estimation: ../estimation.json
|
|
|
22
21
|
|
|
23
22
|
**Never write a number that `scripts/derive.mjs` did not output.** Run it
|
|
24
23
|
first, keep proposal-figures.json open, and use only those values: the cost
|
|
25
|
-
range, the
|
|
26
|
-
`$8,000` (en-US grouping)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
figures from estimation.json itself, so editing proposal-figures.json by
|
|
31
|
-
hand changes nothing.
|
|
24
|
+
range, the single-number figure, and the per-milestone splits. Money is
|
|
25
|
+
written `$8,000` (en-US grouping). The validator extracts every money amount
|
|
26
|
+
in the document and refuses any value the derivation didn't produce — and it
|
|
27
|
+
recomputes the figures from estimation.json itself, so editing
|
|
28
|
+
proposal-figures.json by hand changes nothing.
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
The proposal carries no timeline: the estimate scores and prices features,
|
|
31
|
+
it does not schedule them, so there is no duration figure to quote — never
|
|
32
|
+
write a number of months or weeks, and the Investment & Timeline table never
|
|
33
|
+
carries a Duration column.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Rates never appear — no staffing detail of any kind does; the estimate
|
|
36
|
+
prices a package, not rates or a team roster.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
## 3. The nine sections, in order (all `##`, exact names)
|
|
39
|
+
|
|
40
|
+
1. **Executive Summary** — problem, solution, headline cost range. One page.
|
|
41
|
+
The headline range is mandatory: the validator requires cost low/high to
|
|
42
|
+
appear.
|
|
40
43
|
2. **Background & Objectives** — the client's problem in their words, then
|
|
41
44
|
measurable goals.
|
|
42
45
|
3. **Proposed Solution** — what we build, in the client's language, plus
|
|
@@ -48,18 +51,16 @@ Rates never appear. Team members are described by role/seniority only.
|
|
|
48
51
|
do not break section slicing; each table still validates on its own.
|
|
49
52
|
5. **Out of Scope & Assumptions** — explicit exclusions (from estimation.md
|
|
50
53
|
plus the interview) and the assumptions the estimate rests on.
|
|
51
|
-
6. **Delivery Approach** — milestones
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
7. **Investment & Timeline** — the milestone table:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
8. **
|
|
58
|
-
never rates.
|
|
59
|
-
9. **About <firm>** — blurb, relevant work, contact, from the profile. The
|
|
54
|
+
6. **Delivery Approach** — milestones, ways of working, QA, communication
|
|
55
|
+
cadence, and the client-relevant risks with mitigations. The full risk
|
|
56
|
+
register stays internal.
|
|
57
|
+
7. **Investment & Timeline** — the milestone table: an Investment column
|
|
58
|
+
from the figures, then the bold total line and the sentence explaining
|
|
59
|
+
the range reflects estimation confidence.
|
|
60
|
+
8. **About <firm>** — blurb, relevant work, contact, from the profile. The
|
|
60
61
|
jargon scan skips this section.
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
9. **Next Steps** — the valid_until date in prose, the acceptance path,
|
|
63
|
+
and a call to action.
|
|
63
64
|
|
|
64
65
|
## 4. Tech-level language
|
|
65
66
|
|
|
@@ -74,11 +75,12 @@ Rates never appear. Team members are described by role/seniority only.
|
|
|
74
75
|
|
|
75
76
|
## 5. What must never appear
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
A `scenario` frontmatter key (removed — the estimate produces one price, not
|
|
79
|
+
a menu of staffing scenarios), a `## Team` section, a Duration column,
|
|
80
|
+
provenance vocabulary (`observed`/`stated`/`researched`/`proposed` as table
|
|
81
|
+
cells or a `src` column), `data-internal`, placeholder text of any spelling,
|
|
82
|
+
empty tables, and any number the derivation didn't produce — all of these
|
|
83
|
+
fail `validate.mjs`. Rates, internal risk ids, and confidence internals must
|
|
82
84
|
never appear either, but no script can recognize them reliably: the
|
|
83
85
|
fresh-eyes review (`references/review.md` charter item 4) and your own
|
|
84
86
|
read before rendering are the gate for those. Unknowns are honest
|
|
@@ -91,7 +93,7 @@ proposal.md, proposal-figures.json beside ARCHITECTURE.md/estimation.md.
|
|
|
91
93
|
Run from `plugins/solution-architect/skills/proposal/`:
|
|
92
94
|
|
|
93
95
|
```
|
|
94
|
-
node scripts/derive.mjs --estimation <dir>/estimation.json --
|
|
96
|
+
node scripts/derive.mjs --estimation <dir>/estimation.json --out <dir>/proposal-figures.json
|
|
95
97
|
node scripts/validate.mjs --md <dir>/proposal.md --estimation <dir>/estimation.json
|
|
96
98
|
node scripts/render.mjs --md <dir>/proposal.md --estimation <dir>/estimation.json --mermaid-bundle <path> --out <out-dir>
|
|
97
99
|
node ../analyze-requirements/scripts/serve.mjs <out-dir>
|
|
@@ -13,7 +13,7 @@ const args = parseArgs(process.argv.slice(2));
|
|
|
13
13
|
const estimation = JSON.parse(readFileSync(args.estimation, 'utf8'));
|
|
14
14
|
let figures;
|
|
15
15
|
try {
|
|
16
|
-
figures = deriveFigures(estimation
|
|
16
|
+
figures = deriveFigures(estimation);
|
|
17
17
|
} catch (e) {
|
|
18
18
|
console.error(e.message);
|
|
19
19
|
process.exit(1);
|
|
@@ -6,8 +6,8 @@ import { sectionText, escapeRegExp } from './sections.mjs';
|
|
|
6
6
|
import { JARGON } from './jargon.mjs';
|
|
7
7
|
|
|
8
8
|
const flat = (f) => [
|
|
9
|
-
f.cost.low, f.cost.high, f.
|
|
10
|
-
...f.milestones.flatMap((m) => [m.cost.low, m.cost.high
|
|
9
|
+
f.cost.low, f.cost.high, f.singleNumber,
|
|
10
|
+
...f.milestones.flatMap((m) => [m.cost.low, m.cost.high]),
|
|
11
11
|
];
|
|
12
12
|
|
|
13
13
|
function checkMoney(md, figures, out) {
|
|
@@ -16,15 +16,6 @@ function checkMoney(md, figures, out) {
|
|
|
16
16
|
const n = Number(m[1].replaceAll(',', ''));
|
|
17
17
|
if (!allowed.has(n)) out.push(`money amount ${m[0].trim()} not derived from estimation.json`);
|
|
18
18
|
}
|
|
19
|
-
for (const m of md.matchAll(/(\d+(?:\.\d+)?)\s*[–-]\s*(\d+(?:\.\d+)?)\s+months/g)) {
|
|
20
|
-
for (const bound of [Number(m[1]), Number(m[2])]) {
|
|
21
|
-
if (!allowed.has(bound)) out.push(`duration bound ${bound} months not derived from estimation.json`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
for (const m of md.matchAll(/(\d+(?:\.\d+)?)\s+months\b/g)) {
|
|
25
|
-
const n = Number(m[1]);
|
|
26
|
-
if (!allowed.has(n)) out.push(`duration bound ${n} months not derived from estimation.json`);
|
|
27
|
-
}
|
|
28
19
|
}
|
|
29
20
|
|
|
30
21
|
function checkHeadline(md, figures, out) {
|
|
@@ -34,17 +25,9 @@ function checkHeadline(md, figures, out) {
|
|
|
34
25
|
out.push(`headline cost bound ${n.toLocaleString('en-US')} missing from Executive Summary`);
|
|
35
26
|
}
|
|
36
27
|
}
|
|
37
|
-
for (const n of [figures.months.low, figures.months.high]) {
|
|
38
|
-
if (!new RegExp(`\\b${escapeRegExp(String(n))}\\b`).test(summary)) {
|
|
39
|
-
out.push(`headline duration bound ${n} missing from Executive Summary`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
28
|
}
|
|
43
29
|
|
|
44
|
-
function checkLeaks({ md
|
|
45
|
-
for (const s of estimation.inputs.scenarios ?? []) {
|
|
46
|
-
if (s.id !== fm.scenario && md.includes(s.id)) out.push(`leak: scenario id "${s.id}"`);
|
|
47
|
-
}
|
|
30
|
+
function checkLeaks({ md }, out) {
|
|
48
31
|
if (/\|\s*src\s*\|/i.test(md)) out.push('leak: provenance "src" column');
|
|
49
32
|
if (/data-internal/.test(md)) out.push('leak: data-internal marker');
|
|
50
33
|
for (const word of ['observed', 'stated', 'researched', 'proposed']) {
|
|
@@ -66,10 +49,10 @@ function checkJargon({ md, fm }, out) {
|
|
|
66
49
|
}
|
|
67
50
|
|
|
68
51
|
export function checkClient({ md, fm, estimation }, out = []) {
|
|
69
|
-
const figures = deriveFigures(estimation
|
|
52
|
+
const figures = deriveFigures(estimation);
|
|
70
53
|
checkMoney(md, figures, out);
|
|
71
54
|
checkHeadline(md, figures, out);
|
|
72
|
-
checkLeaks({ md
|
|
55
|
+
checkLeaks({ md }, out);
|
|
73
56
|
checkJargon({ md, fm }, out);
|
|
74
57
|
return out;
|
|
75
58
|
}
|
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
// Structural half of the proposal gate: frontmatter contract, the
|
|
1
|
+
// Structural half of the proposal gate: frontmatter contract, the nine
|
|
2
2
|
// sections, placeholder scan, future validity. Client-safety checks live
|
|
3
3
|
// in checks-client.mjs.
|
|
4
4
|
import { SECTIONS, sectionText, tables } from './sections.mjs';
|
|
5
5
|
|
|
6
|
-
const FM_KEYS = ['client', 'client_tech_level', '
|
|
6
|
+
const FM_KEYS = ['client', 'client_tech_level', 'currency',
|
|
7
7
|
'valid_until', 'source_architecture', 'source_estimation'];
|
|
8
8
|
const TECH_LEVELS = ['non-tech', 'low-tech', 'technical'];
|
|
9
|
+
const DURATION_HEADER = /\|\s*Duration\s*\|/i;
|
|
9
10
|
|
|
10
|
-
function checkFrontmatter({ fm,
|
|
11
|
+
function checkFrontmatter({ fm, today }, out) {
|
|
11
12
|
for (const key of FM_KEYS) {
|
|
12
13
|
if (!fm[key]) out.push(`frontmatter: missing "${key}"`);
|
|
13
14
|
}
|
|
14
15
|
if (fm.client_tech_level && !TECH_LEVELS.includes(fm.client_tech_level)) {
|
|
15
16
|
out.push(`frontmatter: client_tech_level must be ${TECH_LEVELS.join('|')}`);
|
|
16
17
|
}
|
|
17
|
-
if (fm.scenario && !estimation.computed.scenarios[fm.scenario]) {
|
|
18
|
-
out.push(`frontmatter: scenario "${fm.scenario}" not in estimation.json`);
|
|
19
|
-
}
|
|
20
18
|
checkValidUntil(fm.valid_until, today, out);
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
// Both of these priced a team. The estimate prices a package now, so a
|
|
22
|
+
// document still carrying either is showing a number nothing computed.
|
|
23
|
+
function checkRemoved({ fm, md }, out) {
|
|
24
|
+
if ('scenario' in fm) out.push('frontmatter: "scenario" was removed — the estimate has one price');
|
|
25
|
+
if (/^##\s+Team\s*$/m.test(md)) out.push('the Team section was removed — this estimate prices a package, not a staffing plan');
|
|
26
|
+
const investment = sectionText(md, 'Investment & Timeline') ?? '';
|
|
27
|
+
if (DURATION_HEADER.test(investment)) {
|
|
28
|
+
out.push('Investment & Timeline must not carry a Duration column — the estimate produces no timeline');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
function checkValidUntil(raw, today, out) {
|
|
24
33
|
if (!raw) return;
|
|
25
34
|
const wellFormed = /^\d{4}-\d{2}-\d{2}$/.test(raw) && !Number.isNaN(Date.parse(raw));
|
|
@@ -46,8 +55,9 @@ function checkPlaceholders(md, out) {
|
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
|
|
49
|
-
export function checkDoc({ fm, md,
|
|
50
|
-
checkFrontmatter({ fm,
|
|
58
|
+
export function checkDoc({ fm, md, today }, out = []) {
|
|
59
|
+
checkFrontmatter({ fm, today }, out);
|
|
60
|
+
checkRemoved({ fm, md }, out);
|
|
51
61
|
checkSections(md, out);
|
|
52
62
|
checkPlaceholders(md, out);
|
|
53
63
|
return out;
|
|
@@ -9,9 +9,13 @@ import { checkClient } from './checks-client.mjs';
|
|
|
9
9
|
export function checkProposal({ md, estimation, today = new Date() }) {
|
|
10
10
|
const { data: fm, error } = parseFrontmatter(md);
|
|
11
11
|
if (!fm) return [`frontmatter: ${error}`];
|
|
12
|
-
const out = checkDoc({ fm, md,
|
|
13
|
-
|
|
12
|
+
const out = checkDoc({ fm, md, today });
|
|
13
|
+
// checkClient derives its figures from the estimate itself; an unpriced
|
|
14
|
+
// estimate can't quote a client, but that's a finding, not a crash.
|
|
15
|
+
try {
|
|
14
16
|
checkClient({ md, fm, estimation }, out);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
out.push(`cannot check client-facing figures: ${e.message}`);
|
|
15
19
|
}
|
|
16
20
|
return out;
|
|
17
21
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// document.xml for the proposal: the same page data the HTML prints, in the
|
|
2
|
+
// same order, as Word headings, paragraphs, tables and lists. Diagrams are
|
|
3
|
+
// the page's drawn workflows as PNGs; a workflow with no image (the drawing
|
|
4
|
+
// failed) falls back to its steps written out.
|
|
5
|
+
import { para, bullets, table, image } from './docx-xml.mjs';
|
|
6
|
+
|
|
7
|
+
const NS = 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" '
|
|
8
|
+
+ 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" '
|
|
9
|
+
+ 'xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"';
|
|
10
|
+
const SECTION = '<w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1134" w:right="1134" w:bottom="1134" w:left="1134" w:header="709" w:footer="709" w:gutter="0"/></w:sectPr>';
|
|
11
|
+
|
|
12
|
+
function scopeXml({ scope }) {
|
|
13
|
+
const head = scope.mapLabel ? ['System', scope.mapLabel] : ['System'];
|
|
14
|
+
const rows = scope.systems.map((s) => (scope.mapLabel ? [s.name, s.map] : [s.name]));
|
|
15
|
+
return para('Scope: what this proposal covers', 'Heading1') + para(scope.intro) + table(head, rows) + para(scope.outLine);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function systemXml(s, { images, first }) {
|
|
19
|
+
const flows = s.flows.map((f, i) => {
|
|
20
|
+
const img = images[first + i];
|
|
21
|
+
return para(f.label, 'Heading3') + (img ? image(img, first + i + 1) : para(f.steps));
|
|
22
|
+
}).join('');
|
|
23
|
+
return para(`System ${s.no}: ${s.name}`, 'Heading1') + para(s.purpose) + para(s.extra) + flows
|
|
24
|
+
+ table(['Feature', 'What it does'], s.features.map((f) => [f.name, f.does]));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function closingXml({ milestones, register, cost }) {
|
|
28
|
+
return para('Milestones', 'Heading1') + para(milestones.lead)
|
|
29
|
+
+ table(['Milestone', 'Includes', 'What it demonstrates'], milestones.rows.map((m) => [m.title, m.includes, m.demonstrates]))
|
|
30
|
+
+ para('Assumptions & exclusions', 'Heading1') + para(register.lead)
|
|
31
|
+
+ para('Assumptions', 'Heading2') + bullets(register.assumptions) + para('Exclusions', 'Heading2') + bullets(register.exclusions)
|
|
32
|
+
+ para('Cost estimate', 'Heading1') + para(cost.lead)
|
|
33
|
+
+ table(['Range', 'If one fixed number is needed'], [[cost.range, cost.single], [cost.rangeNote, cost.singleNote]]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// images[k] belongs to the k-th workflow in page order (null when not drawn).
|
|
37
|
+
export function documentXml(view, images) {
|
|
38
|
+
const firsts = view.systems.map((_, i) => view.systems.slice(0, i).reduce((n, s) => n + s.flows.length, 0));
|
|
39
|
+
const body = para(view.title, 'Title') + para(view.byline, 'Subtitle') + scopeXml(view)
|
|
40
|
+
+ view.systems.map((s, i) => systemXml(s, { images, first: firsts[i] })).join('') + closingXml(view);
|
|
41
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<w:document ${NS}><w:body>${body}${SECTION}</w:body></w:document>`;
|
|
42
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// The DOCX package around document.xml: content types, relationships, the
|
|
2
|
+
// built-in styles the body uses, one bullet list, and the diagram PNGs.
|
|
3
|
+
// Standard Word styles only — the team restyles the copy they send.
|
|
4
|
+
import { zipStore } from '../../../estimate/shared/lib/zip.mjs';
|
|
5
|
+
import { documentXml } from './docx-body.mjs';
|
|
6
|
+
|
|
7
|
+
const XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
8
|
+
const W = 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"';
|
|
9
|
+
const REL = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';
|
|
10
|
+
const MAIN = 'application/vnd.openxmlformats-officedocument.wordprocessingml';
|
|
11
|
+
|
|
12
|
+
const CONTENT_TYPES = `${XML}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">`
|
|
13
|
+
+ '<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>'
|
|
14
|
+
+ '<Default Extension="xml" ContentType="application/xml"/><Default Extension="png" ContentType="image/png"/>'
|
|
15
|
+
+ `<Override PartName="/word/document.xml" ContentType="${MAIN}.document.main+xml"/>`
|
|
16
|
+
+ `<Override PartName="/word/styles.xml" ContentType="${MAIN}.styles+xml"/>`
|
|
17
|
+
+ `<Override PartName="/word/numbering.xml" ContentType="${MAIN}.numbering+xml"/></Types>`;
|
|
18
|
+
|
|
19
|
+
const ROOT_RELS = `${XML}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`
|
|
20
|
+
+ `<Relationship Id="rId1" Type="${REL}/officeDocument" Target="word/document.xml"/></Relationships>`;
|
|
21
|
+
|
|
22
|
+
const pStyle = (id, name, props) => `<w:style w:type="paragraph" w:styleId="${id}"><w:name w:val="${name}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/>${props}</w:style>`;
|
|
23
|
+
const heading = (level, size, color) => pStyle(`Heading${level}`, `heading ${level}`,
|
|
24
|
+
`<w:pPr><w:keepNext/><w:spacing w:before="${level === 1 ? 360 : 240}" w:after="120"/><w:outlineLvl w:val="${level - 1}"/></w:pPr><w:rPr><w:b/><w:color w:val="${color}"/><w:sz w:val="${size}"/></w:rPr>`);
|
|
25
|
+
const BORDER = ['top', 'left', 'bottom', 'right', 'insideH', 'insideV'].map((b) => `<w:${b} w:val="single" w:sz="4" w:space="0" w:color="D9DDE3"/>`).join('');
|
|
26
|
+
|
|
27
|
+
const STYLES = `${XML}<w:styles ${W}><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Calibri"/><w:sz w:val="22"/></w:rPr></w:rPrDefault>`
|
|
28
|
+
+ '<w:pPrDefault><w:pPr><w:spacing w:after="120" w:line="276" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults>'
|
|
29
|
+
+ '<w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/></w:style>'
|
|
30
|
+
+ pStyle('Title', 'Title', '<w:pPr><w:spacing w:after="80"/></w:pPr><w:rPr><w:b/><w:sz w:val="44"/></w:rPr>')
|
|
31
|
+
+ pStyle('Subtitle', 'Subtitle', '<w:rPr><w:color w:val="5C6470"/><w:sz w:val="24"/></w:rPr>')
|
|
32
|
+
+ heading(1, 32, '0F5C5A') + heading(2, 24, '1A1D21') + heading(3, 22, '5C6470')
|
|
33
|
+
+ pStyle('ListParagraph', 'List Paragraph', '<w:pPr><w:ind w:left="720"/></w:pPr>')
|
|
34
|
+
+ `<w:style w:type="table" w:styleId="TableGrid"><w:name w:val="Table Grid"/><w:tblPr><w:tblBorders>${BORDER}</w:tblBorders>`
|
|
35
|
+
+ '<w:tblCellMar><w:top w:w="60" w:type="dxa"/><w:left w:w="100" w:type="dxa"/><w:bottom w:w="60" w:type="dxa"/><w:right w:w="100" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style></w:styles>';
|
|
36
|
+
|
|
37
|
+
const NUMBERING = `${XML}<w:numbering ${W}><w:abstractNum w:abstractNumId="0"><w:multiLevelType w:val="hybridMultilevel"/>`
|
|
38
|
+
+ '<w:lvl w:ilvl="0"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="•"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr></w:lvl>'
|
|
39
|
+
+ '</w:abstractNum><w:num w:numId="1"><w:abstractNumId w:val="0"/></w:num></w:numbering>';
|
|
40
|
+
|
|
41
|
+
function documentRels(images) {
|
|
42
|
+
const media = images.map((img, i) => (img ? `<Relationship Id="rIdImg${i + 1}" Type="${REL}/image" Target="media/image${i + 1}.png"/>` : '')).join('');
|
|
43
|
+
return `${XML}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`
|
|
44
|
+
+ `<Relationship Id="rIdStyles" Type="${REL}/styles" Target="styles.xml"/><Relationship Id="rIdNumbering" Type="${REL}/numbering" Target="numbering.xml"/>${media}</Relationships>`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// images: one entry per workflow in page order, { bytes, width, height } or null.
|
|
48
|
+
export function buildDocx(view, images) {
|
|
49
|
+
const enc = new TextEncoder();
|
|
50
|
+
const files = new Map([
|
|
51
|
+
['[Content_Types].xml', CONTENT_TYPES], ['_rels/.rels', ROOT_RELS], ['word/document.xml', documentXml(view, images)],
|
|
52
|
+
['word/_rels/document.xml.rels', documentRels(images)], ['word/styles.xml', STYLES], ['word/numbering.xml', NUMBERING],
|
|
53
|
+
].map(([path, xml]) => [path, enc.encode(xml)]));
|
|
54
|
+
images.forEach((img, i) => { if (img) files.set(`word/media/image${i + 1}.png`, img.bytes); });
|
|
55
|
+
return zipStore(files);
|
|
56
|
+
}
|