@v11g/agents-rock 1.0.10 → 1.0.11

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 (112) hide show
  1. package/README.md +2 -1
  2. package/package.json +1 -1
  3. package/plugins/business-analyst/.claude-plugin/plugin.json +2 -2
  4. package/plugins/business-analyst/evals/draft-scope-rich/case.yaml +4 -0
  5. package/plugins/business-analyst/evals/draft-scope-rich/fixture.sh +5 -0
  6. package/plugins/business-analyst/evals/draft-scope-rich/graders/conflict-question.md +11 -0
  7. package/plugins/business-analyst/evals/draft-scope-rich/graders/keep-and-exclude.md +14 -0
  8. package/plugins/business-analyst/evals/draft-scope-rich/graders/noise-and-shape.md +13 -0
  9. package/plugins/business-analyst/evals/draft-scope-rich/graders/problem-not-solution.md +13 -0
  10. package/plugins/business-analyst/evals/draft-scope-rich/graders/share-kept.md +11 -0
  11. package/plugins/business-analyst/evals/draft-scope-rich/graders/skill-fired.md +7 -0
  12. package/plugins/business-analyst/evals/draft-scope-rich/graders/vague-word.md +13 -0
  13. package/plugins/business-analyst/evals/draft-scope-rich/inputs/C1.txt +10 -0
  14. package/plugins/business-analyst/evals/draft-scope-rich/inputs/E1.txt +5 -0
  15. package/plugins/business-analyst/evals/draft-scope-rich/inputs/E2.txt +5 -0
  16. package/plugins/business-analyst/evals/draft-scope-rich/inputs/E3.txt +5 -0
  17. package/plugins/business-analyst/evals/draft-scope-rich/prompt.md +9 -0
  18. package/plugins/business-analyst/evals/draft-scope-thin/case.yaml +4 -0
  19. package/plugins/business-analyst/evals/draft-scope-thin/fixture.sh +4 -0
  20. package/plugins/business-analyst/evals/draft-scope-thin/graders/no-invention.md +18 -0
  21. package/plugins/business-analyst/evals/draft-scope-thin/graders/skill-fired.md +7 -0
  22. package/plugins/business-analyst/evals/draft-scope-thin/inputs/E1.txt +5 -0
  23. package/plugins/business-analyst/evals/draft-scope-thin/prompt.md +8 -0
  24. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
  25. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
  26. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
  27. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
  28. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
  29. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
  30. package/plugins/business-analyst/skills/draft-scope/SKILL.md +46 -0
  31. package/plugins/business-analyst/skills/draft-scope/references/credits.md +12 -0
  32. package/plugins/business-analyst/skills/draft-scope/references/draft-schema.md +44 -0
  33. package/plugins/business-analyst/skills/draft-scope/references/rules.md +24 -0
  34. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_body.cpython-312.pyc +0 -0
  35. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_flow.cpython-312.pyc +0 -0
  36. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_package.cpython-312.pyc +0 -0
  37. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_xml.cpython-312.pyc +0 -0
  38. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_quotes.cpython-312.pyc +0 -0
  39. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_rules.cpython-312.pyc +0 -0
  40. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_schema.cpython-312.pyc +0 -0
  41. package/plugins/business-analyst/skills/draft-scope/scripts/build_docx.py +36 -0
  42. package/plugins/business-analyst/skills/draft-scope/scripts/check.py +53 -0
  43. package/plugins/business-analyst/skills/draft-scope/scripts/docx_body.py +58 -0
  44. package/plugins/business-analyst/skills/draft-scope/scripts/docx_flow.py +52 -0
  45. package/plugins/business-analyst/skills/draft-scope/scripts/docx_package.py +62 -0
  46. package/plugins/business-analyst/skills/draft-scope/scripts/docx_xml.py +44 -0
  47. package/plugins/business-analyst/skills/draft-scope/scripts/draft_quotes.py +49 -0
  48. package/plugins/business-analyst/skills/draft-scope/scripts/draft_rules.py +106 -0
  49. package/plugins/business-analyst/skills/draft-scope/scripts/draft_schema.py +87 -0
  50. package/plugins/business-analyst/skills/draft-scope/scripts/test/build-docx.test.mjs +76 -0
  51. package/plugins/business-analyst/skills/draft-scope/scripts/test/check-rules.test.mjs +131 -0
  52. package/plugins/business-analyst/skills/draft-scope/scripts/test/check-shape.test.mjs +70 -0
  53. package/plugins/business-analyst/skills/draft-scope/scripts/test/fixtures/draft-pass.json +40 -0
  54. package/plugins/business-analyst/skills/draft-scope/scripts/test/fixtures/sources/C1.txt +7 -0
  55. package/plugins/business-analyst/skills/draft-scope/scripts/test/fixtures/sources/E1.txt +5 -0
  56. package/plugins/business-analyst/skills/draft-scope/scripts/test/gates.test.mjs +39 -0
  57. package/plugins/business-analyst/skills/draft-scope/scripts/test/helpers.mjs +30 -0
  58. package/plugins/business-analyst/skills/draft-scope/scripts/test/skill-files.test.mjs +59 -0
  59. package/plugins/business-analyst/skills/draft-scope/steps/assumptions.md +24 -0
  60. package/plugins/business-analyst/skills/draft-scope/steps/check.md +24 -0
  61. package/plugins/business-analyst/skills/draft-scope/steps/discover.md +53 -0
  62. package/plugins/business-analyst/skills/draft-scope/steps/draft.md +64 -0
  63. package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
  64. package/plugins/solution-architect/skills/analyze-requirements/SKILL.md +8 -7
  65. package/plugins/solution-architect/skills/analyze-requirements/assets/section-help.json +5 -5
  66. package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +15 -3
  67. package/plugins/solution-architect/skills/analyze-requirements/evals/evals.json +50 -6
  68. package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/ba-package-citations/requirements.json +31 -0
  69. package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/ba-package-citations/requirements.md +17 -0
  70. package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/transcript-citations/C1-kickoff-call.txt +16 -0
  71. package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/transcript-citations/E1-intro-email.md +9 -0
  72. package/plugins/solution-architect/skills/analyze-requirements/references/extract.md +108 -0
  73. package/plugins/solution-architect/skills/analyze-requirements/references/interview.md +39 -5
  74. package/plugins/solution-architect/skills/analyze-requirements/references/project-types.md +1 -1
  75. package/plugins/solution-architect/skills/analyze-requirements/references/quality-goals.md +84 -0
  76. package/plugins/solution-architect/skills/analyze-requirements/references/research.md +1 -1
  77. package/plugins/solution-architect/skills/analyze-requirements/references/rewriting.md +7 -2
  78. package/plugins/solution-architect/skills/analyze-requirements/references/viewer.md +10 -6
  79. package/plugins/solution-architect/skills/analyze-requirements/references/writing.md +45 -3
  80. package/plugins/solution-architect/skills/analyze-requirements/scripts/ba-facts.mjs +32 -0
  81. package/plugins/solution-architect/skills/analyze-requirements/scripts/check-quotes.mjs +39 -0
  82. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/ba-package.mjs +75 -0
  83. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-links.mjs +19 -7
  84. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-routes.mjs +1 -1
  85. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/inputs.mjs +42 -11
  86. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-render.mjs +15 -4
  87. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/section-help.mjs +1 -1
  88. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/strategy-sections.mjs +30 -0
  89. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-provenance.mjs +14 -2
  90. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-quotes.mjs +55 -0
  91. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-strategy.mjs +65 -0
  92. package/plugins/solution-architect/skills/analyze-requirements/scripts/render.mjs +18 -5
  93. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-facts-cli.test.mjs +55 -0
  94. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-package-cli.test.mjs +101 -0
  95. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-package.test.mjs +115 -0
  96. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +50 -2
  97. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/check-quotes-cli.test.mjs +49 -0
  98. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-links.test.mjs +49 -4
  99. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/extract-workflow.test.mjs +69 -0
  100. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/inputs.test.mjs +14 -0
  101. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-render.test.mjs +19 -5
  102. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/record-cli.test.mjs +1 -1
  103. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/render.test.mjs +69 -2
  104. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/rewriting.test.mjs +1 -1
  105. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/section-help.test.mjs +6 -0
  106. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-provenance.test.mjs +19 -0
  107. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-quotes-cli.test.mjs +58 -0
  108. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-quotes.test.mjs +81 -0
  109. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-strategy-cli.test.mjs +32 -0
  110. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-strategy.test.mjs +118 -0
  111. package/plugins/solution-architect/skills/analyze-requirements/scripts/validate.mjs +17 -6
  112. package/plugins/solution-architect/skills/analyze-requirements/workflows/extract.js +51 -0
package/README.md CHANGED
@@ -81,7 +81,7 @@ rather than a hang.
81
81
 
82
82
  | Plugin | Description | Version |
83
83
  | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
84
- | `business-analyst` | Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture. | 0.2.0 |
84
+ | `business-analyst` | Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture, plus a drafter that turns raw emails and call transcripts into an editable workflow-based scope document. | 0.5.0 |
85
85
  | `solution-architect` | Solution-architecture toolkit: interview-driven architecture documentation with interactive diagrams and provenance-tagged facts, AI-aware project estimation, and client-ready proposals. | 3.0.1 |
86
86
  | `lmk` | Terminal-native visual explainer: explains the current topic with cheap diagrams (flowcharts, sequences, timelines, tables) rendered directly in the terminal via a bundled Mermaid renderer. | 0.1.0 |
87
87
  | `reasoning` | Reasoning toolkit: classify a problem, pick a fitting framework, and work it to a testable next step — with evidence and assumptions kept apart. | 0.5.0 |
@@ -101,6 +101,7 @@ for automatically by the agent when the task fits.
101
101
  **Model-invoked**
102
102
 
103
103
  - **[business-analyst](./plugins/business-analyst/skills/business-analyst/SKILL.md)** (`business-analyst`) — Interview-driven requirements discovery: turns raw client input (emails, notes, transcripts) into a validated requirements package (requirements.md + requirements.json) with labeled facts, open questions, and a readiness gate; triggers on asks to analyze client requirements, run discovery, or clarify a vague request. `new-lead` offers it as optional step 0 when installed.
104
+ - **[draft-scope](./plugins/business-analyst/skills/draft-scope/SKILL.md)** (`business-analyst`) — Drafts a workflow-based scope document (problems, systems, step lines, features, assumptions, client questions) from raw emails and call transcripts as an editable DOCX; every line cites its source. The PO edits it, then uses it with business-analyst.
104
105
  - **[analyze-requirements](./plugins/solution-architect/skills/analyze-requirements/SKILL.md)** (`solution-architect`) — Interview-driven architecture documentation with interactive diagrams and provenance-tagged facts; triggers on asks for architecture docs, C4 diagrams, ADRs, or a threat model.
105
106
  - **[estimate](./plugins/solution-architect/skills/estimate/SKILL.md)** (`solution-architect`) — Interview-driven, AI-aware project estimation with an interactive what-if page; triggers on asks for an estimate, quote, timeline, or "how long would this take".
106
107
  - **[proposal](./plugins/solution-architect/skills/proposal/SKILL.md)** (`solution-architect`) — Pre-sales client proposal rendered as a print-ready page; triggers on asks for a proposal, client pitch, or "something I can send the client".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v11g/agents-rock",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "business-analyst",
3
- "version": "0.4.0",
4
- "description": "Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture.",
3
+ "version": "0.5.0",
4
+ "description": "Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture, plus a drafter that turns raw emails and call transcripts into an editable workflow-based scope document.",
5
5
  "author": {
6
6
  "name": "Truong Vu",
7
7
  "email": "vukhanhtruong@gmail.com"
@@ -0,0 +1,4 @@
1
+ schema_version: "1.1"
2
+ name: draft-scope-rich
3
+ context:
4
+ scaffold_script: fixture.sh
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ # Seeds the workspace with Riverside Bakery's raw material: three emails and
3
+ # one call transcript, each holding one planted trap the graders look for.
4
+ set -euo pipefail
5
+ cp "$(cd "$(dirname "$0")" && pwd)"/inputs/*.txt .
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ E2 promises "next-morning delivery"; C1 says "Same day, if the order is in
7
+ before 10am."
8
+
9
+ PASS if one client question puts both promises side by side (quoting or
10
+ naming next-morning and same-day) and asks which holds.
11
+ FAIL if the draft picks one silently, or never mentions the conflict.
@@ -0,0 +1,14 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ C1 says "Orders come in by WhatsApp, that stays." and "The courier company
7
+ handles routes, not us."
8
+
9
+ PASS if both hold:
10
+ - WhatsApp ordering is kept as-is: an assumption, an exclusion, or a scope
11
+ line saying ordering stays on WhatsApp; no feature replaces WhatsApp.
12
+ - Delivery routes are excluded with a reason that says the courier owns
13
+ them (owned by someone else).
14
+ FAIL if either is missing, or a feature plans or optimises delivery routes.
@@ -0,0 +1,13 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ PASS if all hold:
7
+ - Nothing in the draft is about the café playlist, music or jazz.
8
+ - Systems are named as business areas (e.g. Orders, Stock, Delivery), not
9
+ technical parts (backend, database, mobile app, API).
10
+ - The draft has at most 8 assumptions.
11
+ - The reply asks the user no question to answer before drafting (client
12
+ questions inside the draft are fine).
13
+ FAIL if any of these is broken.
@@ -0,0 +1,13 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ E1 asks "can you build us an app so we stop running out of flour?". The
7
+ sandbox has no Bash; judge the draft shown in the final reply.
8
+
9
+ PASS if running out of flour appears as a problem in the client's terms
10
+ (e.g. "we run out of flour before we notice"), backed by a quote from E1,
11
+ and no feature is named or described simply as "an app" or "flour app".
12
+ FAIL if the draft states the problem as "build an app", or has no
13
+ flour-related problem.
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ E3 says "About 30% of our orders are custom cakes. Those need the customer
7
+ to approve the design before we bake."
8
+
9
+ PASS if the draft shows custom cakes as a sub-workflow or side path whose
10
+ line or description keeps the 30% (as "30%", "~30%" or "about 30%").
11
+ FAIL if custom cakes are missing, or the 30% is dropped or changed.
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: tool_used
3
+ tool: Skill
4
+ min: 1
5
+ ---
6
+
7
+ The skill must actually be invoked, not merely described.
@@ -0,0 +1,13 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ E2 says "Deliveries must be fast."
7
+
8
+ PASS if the word "fast" appears nowhere in the draft's problems, system
9
+ purposes, feature names, "What it does" text or assumptions, except inside
10
+ a quotation of the client's words, AND a client question asks what "fast"
11
+ means in measurable terms (hours, a cut-off time) or quotes it.
12
+ FAIL if a feature, purpose or assumption says "fast" in its own words, or
13
+ no question asks for the measurable meaning.
@@ -0,0 +1,10 @@
1
+ Call 2026-09-10 · Dana Lee (owner), Sam (our PO)
2
+
3
+ Dana: Orders come in by WhatsApp, that stays. Customers like it.
4
+ Dana: We write each order on a paper ticket, bake, pack and hand it to the courier.
5
+ Dana: When a ticket gets lost the customer calls us and we have no idea where the cake is.
6
+ Sam: How quickly do cakes go out?
7
+ Dana: Same day, if the order is in before 10am.
8
+ Sam: Who plans the delivery routes?
9
+ Dana: The courier company handles routes, not us.
10
+ Dana: By the way, we changed the café playlist last week, everyone loves the new jazz mix.
@@ -0,0 +1,5 @@
1
+ From: Dana Lee, owner, Riverside Bakery
2
+ Date: 2026-09-02
3
+ Subject: Running out of flour
4
+
5
+ Hi, can you build us an app so we stop running out of flour? Last month we ran out twice on a Saturday and had to close the cake counter by noon.
@@ -0,0 +1,5 @@
1
+ From: Dana Lee, owner, Riverside Bakery
2
+ Date: 2026-09-04
3
+ Subject: Deliveries
4
+
5
+ Deliveries must be fast. We promise next-morning delivery for every cake order.
@@ -0,0 +1,5 @@
1
+ From: Dana Lee, owner, Riverside Bakery
2
+ Date: 2026-09-05
3
+ Subject: Custom cakes
4
+
5
+ About 30% of our orders are custom cakes. Those need the customer to approve the design before we bake.
@@ -0,0 +1,9 @@
1
+ ---
2
+ max_turns: 25
3
+ allowed_tools: [Read, Glob, Grep, Skill, TodoWrite]
4
+ ---
5
+
6
+ Use the draft-scope skill. I'm the PO for Riverside Bakery. All I have are
7
+ the emails and the call transcript in this folder (E1.txt, E2.txt, E3.txt,
8
+ C1.txt). Draft the scope document from them. If you cannot run the
9
+ scripts or write files here, show the full draft in your reply.
@@ -0,0 +1,4 @@
1
+ schema_version: "1.1"
2
+ name: draft-scope-thin
3
+ context:
4
+ scaffold_script: fixture.sh
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ # Seeds one short email: too little to draft systems from without inventing.
3
+ set -euo pipefail
4
+ cp "$(cd "$(dirname "$0")" && pwd)"/inputs/*.txt .
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: llm
3
+ focus: last_message
4
+ ---
5
+
6
+ The only input is a three-line email: wedding orders "keep getting mixed
7
+ up". Judge the draft in the final reply.
8
+
9
+ PASS if all hold:
10
+ - At most one system, about wedding orders.
11
+ - No workflow steps, or only steps the email names (it names none), with
12
+ the missing steps raised as a client question.
13
+ - Every feature (if any) is about keeping wedding orders from being mixed
14
+ up; nothing about payments, delivery, stock, websites or marketing.
15
+ - At least three client questions, at least one about a real past case
16
+ ("last time an order got mixed up…").
17
+ FAIL if the draft invents systems, steps or features the email does not
18
+ support, or has fewer than three client questions.
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: tool_used
3
+ tool: Skill
4
+ min: 1
5
+ ---
6
+
7
+ The skill must actually be invoked, not merely described.
@@ -0,0 +1,5 @@
1
+ From: Mia Tan, Bloom & Co (florist)
2
+ Date: 2026-09-20
3
+ Subject: Wedding orders
4
+
5
+ Hi, we'd like something to handle our wedding orders better. They keep getting mixed up. Can we chat next week?
@@ -0,0 +1,8 @@
1
+ ---
2
+ max_turns: 20
3
+ allowed_tools: [Read, Glob, Grep, Skill, TodoWrite]
4
+ ---
5
+
6
+ Use the draft-scope skill. I'm the PO for Bloom & Co. All I have is the
7
+ email in E1.txt. Draft the scope document from it. If you cannot run the
8
+ scripts or write files here, show the full draft in your reply.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: draft-scope
3
+ description: Draft a workflow-based scope document (problems, systems, workflow steps, features, assumptions, client questions) from raw client emails, call transcripts or notes, as an editable DOCX the PO corrects before using the business-analyst skill. Use when the user has only raw client material, no scope document yet, and asks to draft the scope, systems, workflows or features from it.
4
+ ---
5
+
6
+ # draft-scope
7
+
8
+ Turns raw client material into a first draft of the scope document a PO
9
+ would otherwise write by hand: systems, their workflow steps, features,
10
+ assumptions and exclusions, plus the problems heard and the questions to
11
+ ask the client. The PO edits the DOCX in Word or Google Docs, then uses it
12
+ with the business-analyst skill.
13
+
14
+ ## Rules that hold in every step
15
+
16
+ 1. Ask the user nothing. Every gap becomes a client question (step 3f).
17
+ 2. Every line cites a source id (E1, C1, N1). Quotes are the source's exact
18
+ words. Anything you cannot source, cut.
19
+ 3. One draft only. No alternative drafts, no ranking of features.
20
+ 4. Follow `references/rules.md` for every text you write.
21
+
22
+ ## Flow
23
+
24
+ 0. **Intake.** Number every source: emails E1, E2…, calls C1…, other notes
25
+ N1…, in date order. Save each source's text as `sources/<id>.txt` in the
26
+ working folder (pasted text included), so quotes can be checked.
27
+ 1. **Discover.** Read `steps/discover.md`. One note per source.
28
+ 2. **Define** and 3. **Draft.** Read `steps/draft.md`, and
29
+ `steps/assumptions.md` for the assumptions. Write `draft.json` in the
30
+ shape of `references/draft-schema.md`.
31
+ 4. **Check** and 5. **Build.** Read `steps/check.md`:
32
+ `python3 scripts/check.py --draft <dir>/draft.json` until it prints
33
+ `draft clean`, then
34
+ `python3 scripts/build_docx.py --draft <dir>/draft.json --out <dir>/draft-scope.docx`.
35
+
36
+ No shell or no Python (some sandboxes): skip the scripts, run the checks in
37
+ `steps/check.md` yourself, and show the draft in your reply in the same
38
+ section order as the docx.
39
+
40
+ ## Finish
41
+
42
+ claude.ai: present `draft-scope.docx` and `discover-notes.md`. Claude Code:
43
+ give their paths. Then one line: "Edit it in Word or Google Docs, then use
44
+ it with the business-analyst skill."
45
+
46
+ Credits: `references/credits.md`.
@@ -0,0 +1,12 @@
1
+ # Credits
2
+
3
+ Ideas adapted, in our own words, from phuryn/pm-skills
4
+ (https://github.com/phuryn/pm-skills, MIT licence, Paweł Huryn):
5
+
6
+ - `summarize-interview` → the per-source note template (steps/discover.md):
7
+ its labels and order adapted, with three lines added for the draft.
8
+ - `analyze-feature-requests` → grouping requests into named themes (steps/draft.md 3a).
9
+ - `identify-assumptions-existing` → the four checks per feature (steps/assumptions.md).
10
+ - `prioritize-assumptions` → the impact × uncertainty grid (steps/assumptions.md).
11
+
12
+ Apart from the note template's labels, no text was copied.
@@ -0,0 +1,44 @@
1
+ # draft.json
2
+
3
+ All fields required unless marked optional. `check.py` enforces this file.
4
+
5
+ ```json
6
+ {
7
+ "client": "Riverside Bakery",
8
+ "date": "2026-10-08",
9
+ "sources": [
10
+ { "id": "E1", "kind": "email", "date": "2026-09-02", "who": "Dana Lee — Running out of flour", "file": "sources/E1.txt" }
11
+ ],
12
+ "problems": [
13
+ { "id": "P1", "text": "We run out of flour before we notice",
14
+ "quotes": [{ "source": "E1", "text": "exact words from E1" }] }
15
+ ],
16
+ "scope": {
17
+ "covered": "…",
18
+ "pillars": [{ "system": "Stock", "pillar": "…" }],
19
+ "exclusions": [{ "text": "Delivery routes", "reason": "owned-elsewhere", "source": "C1" }]
20
+ },
21
+ "systems": [
22
+ { "name": "Stock", "purpose": "…; closes P1", "problem": "P1",
23
+ "workflows": [
24
+ { "kind": "main", "steps": ["Order In", "Bake"], "source": "C1" },
25
+ { "kind": "side", "steps": ["Pack", "Short-pack alert"], "returnsTo": "Order In", "source": "C1" },
26
+ { "kind": "sub", "name": "Custom cake", "steps": ["Quote", "Confirm Design"],
27
+ "startsAt": "Order In", "rejoinsAt": "Bake", "share": "~30% of orders", "source": "C1" }
28
+ ],
29
+ "features": [{ "name": "Low-flour alert", "does": "Warns …", "problem": "P1", "source": "E1" }] }
30
+ ],
31
+ "assumptions": [{ "text": "…", "feature": "Low-flour alert", "source": "E1" }],
32
+ "questions": [{ "text": "…", "why": "…", "assume": "…", "refs": ["P1", "E1"] }]
33
+ }
34
+ ```
35
+
36
+ - `sources[].id`: `E`, `C` or `N` and a number. `kind`: `email`, `call`
37
+ or `note`. `file`: path relative to `draft.json`.
38
+ - `problems[].id`: `P` and a number.
39
+ - `scope.pillars`: optional. `exclusions[].reason`: `owned-elsewhere`,
40
+ `later-phase` or `no-detail`.
41
+ - `workflows[].kind`: `main`, `side` or `sub`. `returnsTo`, `name`,
42
+ `startsAt`, `rejoinsAt`, `share`: optional.
43
+ - `assumptions[].feature`: a feature `name` in the draft.
44
+ - `questions[].refs`: problem and source ids.
@@ -0,0 +1,24 @@
1
+ # Writing rules
2
+
3
+ - **Problems**: 1–6, one sentence each, client's terms, never a solution.
4
+ At least one exact quote each.
5
+ - **Systems**: business areas the client would name; purpose = area + the
6
+ problem it closes.
7
+ - **Steps**: to-be only, 1–5 words each.
8
+ - **Features**: name 2–6 words; `does` = one verb-first sentence: who, the
9
+ client's number, what changes against today.
10
+ - **Assumptions**: at most 8; each names its feature and the source whose
11
+ words support it. Unsupported ones go in a client question's `assume`.
12
+ - **Exclusions**: only what a source names; each has a reason (owned by
13
+ someone else, later phase, no process detail yet) and that source.
14
+ - **Client questions**: about a real past case; say why it matters and what
15
+ to assume without an answer; conflicting sources quoted together.
16
+ - **Sources**: a cited source must say the thing it is cited for.
17
+ - **Quotes**: exact words. Never reword, never shorten inside the quote.
18
+ - **Numbers**: keep the client's numbers as written; never round them away.
19
+ - **Banned words** outside quotes (checked by `check.py`): fast, quick,
20
+ easy, simple, user-friendly, intuitive, flexible, robust, seamless,
21
+ efficient, optimal, appropriate, various, etc, some, many, several,
22
+ as needed. Say the measurable thing instead.
23
+ - **Ids**: only source ids (E1, C1, N1) and problem ids (P1…) appear in the
24
+ draft.
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env python3
2
+ """Builds draft-scope.docx from a draft.json that check.py passed.
3
+
4
+ python3 build_docx.py --draft <dir>/draft.json --out <dir>/draft-scope.docx
5
+
6
+ Standard library only. Run check.py first: this script trusts the shape.
7
+ """
8
+ import json
9
+ import sys
10
+
11
+ from docx_body import document_xml
12
+ from docx_package import write_docx
13
+
14
+ USAGE = 'usage: build_docx.py --draft <draft.json> --out <draft-scope.docx>'
15
+
16
+
17
+ def parse(argv):
18
+ if len(argv) != 4 or argv[0] != '--draft' or argv[2] != '--out':
19
+ return None
20
+ return argv[1], argv[3]
21
+
22
+
23
+ def main(argv):
24
+ args = parse(argv)
25
+ if args is None:
26
+ print(USAGE, file=sys.stderr)
27
+ return 2
28
+ with open(args[0], encoding='utf-8') as f:
29
+ draft = json.load(f)
30
+ write_docx(args[1], document_xml(draft))
31
+ print(args[1])
32
+ return 0
33
+
34
+
35
+ if __name__ == '__main__':
36
+ sys.exit(main(sys.argv[1:]))
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env python3
2
+ """Checks draft.json before the docx is built (steps/check.md).
3
+
4
+ python3 check.py --draft <dir>/draft.json
5
+
6
+ Source files are read relative to the draft's folder. Prints `draft clean`
7
+ and exits 0, or prints one finding per line on stderr and exits 1.
8
+ """
9
+ import json
10
+ import os
11
+ import sys
12
+
13
+ from draft_quotes import quote_findings
14
+ from draft_rules import coverage_findings, limit_findings, ref_findings, word_findings
15
+ from draft_schema import shape_findings
16
+
17
+ USAGE = 'usage: check.py --draft <draft.json>'
18
+ RULES = [ref_findings, coverage_findings, limit_findings, word_findings]
19
+
20
+
21
+ def findings_for(draft, base):
22
+ out = shape_findings(draft)
23
+ if out:
24
+ return out
25
+ for rule in RULES:
26
+ out += rule(draft)
27
+ return out + quote_findings(draft, base)
28
+
29
+
30
+ def load(path):
31
+ with open(path, encoding='utf-8') as f:
32
+ return json.load(f)
33
+
34
+
35
+ def main(argv):
36
+ if len(argv) != 2 or argv[0] != '--draft':
37
+ print(USAGE, file=sys.stderr)
38
+ return 2
39
+ try:
40
+ draft = load(argv[1])
41
+ except (OSError, ValueError) as e:
42
+ print(f'{os.path.basename(argv[1])}: {e}', file=sys.stderr)
43
+ return 1
44
+ out = findings_for(draft, os.path.dirname(os.path.abspath(argv[1])))
45
+ if out:
46
+ print('\n'.join(out), file=sys.stderr)
47
+ return 1
48
+ print('draft clean')
49
+ return 0
50
+
51
+
52
+ if __name__ == '__main__':
53
+ sys.exit(main(sys.argv[1:]))
@@ -0,0 +1,58 @@
1
+ """document.xml for draft-scope.docx, in the order of the spec's 'Document shape'."""
2
+ from docx_flow import flow_xml
3
+ from docx_xml import bullets, para, table
4
+
5
+ NS = 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"'
6
+ SECTION = ('<w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1134" w:right="1134" '
7
+ 'w:bottom="1134" w:left="1134" w:header="709" w:footer="709" w:gutter="0"/></w:sectPr>')
8
+ NOTE = ('Drafted from the sources below. It holds only what the client said; '
9
+ 'the PO adds value-add features while editing.')
10
+ REASONS = {'owned-elsewhere': 'Owned by someone else', 'later-phase': 'Later phase',
11
+ 'no-detail': 'No process detail yet'}
12
+
13
+
14
+ def head_xml(d):
15
+ rows = [[s['id'], s['kind'], s['date'], s['who']] for s in d['sources']]
16
+ return (para(f"{d['client']} — Scope draft", 'Title') + para(d['date'], 'Subtitle') + para(NOTE)
17
+ + para('Sources', 'Heading1') + table(['Source', 'Kind', 'Date', 'Who / subject'], rows))
18
+
19
+
20
+ def problems_xml(d):
21
+ out = para('Problems we heard', 'Heading1')
22
+ for p in d['problems']:
23
+ heard = ', '.join(sorted({q['source'] for q in p['quotes']}))
24
+ out += para(f"{p['id']} {p['text']}", 'Heading3')
25
+ out += bullets([f'"{q["text"]}" ({q["source"]})' for q in p['quotes']])
26
+ out += para(f'Heard in: {heard}')
27
+ return out
28
+
29
+
30
+ def scope_xml(scope):
31
+ out = para('Scope', 'Heading1') + para(scope['covered'])
32
+ pillars = scope.get('pillars') or []
33
+ if pillars:
34
+ out += table(['System', 'Client pillar'], [[x['system'], x['pillar']] for x in pillars])
35
+ rows = [[x['text'], REASONS[x['reason']], x['source']] for x in scope['exclusions']]
36
+ return out + para('Exclusions', 'Heading2') + table(['Exclusion', 'Reason', 'From'], rows)
37
+
38
+
39
+ def system_xml(s, n):
40
+ rows = [[f['name'], f['does'], f['source']] for f in s['features']]
41
+ flows = ''.join(flow_xml(w) for w in s['workflows'])
42
+ return (para(f"System {n}: {s['name']}", 'Heading1') + para(s['purpose']) + flows
43
+ + table(['Feature', 'What it does', 'From'], rows))
44
+
45
+
46
+ def closing_xml(d):
47
+ a = [[x['text'], x['feature'], x['source']] for x in d['assumptions']]
48
+ q = [[x['text'], x['why'], x['assume'], ', '.join(x['refs'])] for x in d['questions']]
49
+ return (para('Assumptions', 'Heading1') + table(['Assumption', 'For feature', 'From'], a)
50
+ + para('Questions for the client', 'Heading1')
51
+ + table(['Question', 'Why it matters', 'If no answer, assume', 'About'], q))
52
+
53
+
54
+ def document_xml(d):
55
+ systems = ''.join(system_xml(s, i + 1) for i, s in enumerate(d['systems']))
56
+ body = head_xml(d) + problems_xml(d) + scope_xml(d['scope']) + systems + closing_xml(d)
57
+ return ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n'
58
+ f'<w:document {NS}><w:body>{body}{SECTION}</w:body></w:document>')
@@ -0,0 +1,52 @@
1
+ """Workflow step lines drawn as boxes: one bordered table cell per step, arrow
2
+ cells between (spec D3). A plain table, so Word and Google Docs both draw it
3
+ and the PO edits a step by typing in its box."""
4
+ from docx_xml import TEXT_WIDTH, para, run
5
+
6
+ PER_ROW = 5
7
+ ARROW_W = 400
8
+ STEP_W = (TEXT_WIDTH - ARROW_W * (PER_ROW - 1)) // PER_ROW
9
+ LINE = '<w:{0} w:val="single" w:sz="8" w:space="0" w:color="5C6470"/>'
10
+ BOX = '<w:tcBorders>' + ''.join(LINE.format(b) for b in ('top', 'left', 'bottom', 'right')) + '</w:tcBorders>'
11
+ NO_BORDERS = ('<w:tblBorders>' + ''.join(f'<w:{b} w:val="nil"/>'
12
+ for b in ('top', 'left', 'bottom', 'right', 'insideH', 'insideV')) + '</w:tblBorders>')
13
+ GAP = ('<w:tr><w:trPr><w:trHeight w:val="120" w:hRule="exact"/></w:trPr>'
14
+ + '<w:tc><w:p/></w:tc>' * (PER_ROW * 2 - 1) + '</w:tr>')
15
+ CENTER = '<w:pPr><w:spacing w:before="60" w:after="60"/><w:jc w:val="center"/></w:pPr>'
16
+
17
+
18
+ def cell(text, width, box):
19
+ props = f'<w:tcPr><w:tcW w:w="{width}" w:type="dxa"/>{BOX if box else ""}<w:vAlign w:val="center"/></w:tcPr>'
20
+ return f'<w:tc>{props}<w:p>{CENTER}{run(text) if text else ""}</w:p></w:tc>'
21
+
22
+
23
+ def flow_row(steps):
24
+ """Up to PER_ROW steps; a short row is padded with empty borderless cells."""
25
+ cells = ''
26
+ for i in range(PER_ROW):
27
+ step = steps[i] if i < len(steps) else ''
28
+ if i:
29
+ cells += cell('→' if step else '', ARROW_W, False)
30
+ cells += cell(step, STEP_W, bool(step))
31
+ return f'<w:tr><w:trPr><w:cantSplit/></w:trPr>{cells}</w:tr>'
32
+
33
+
34
+ def flow_label(w):
35
+ if w['kind'] == 'main':
36
+ return 'Main workflow'
37
+ if w['kind'] == 'side':
38
+ return f"Side path, back to {w['returnsTo']}" if w.get('returnsTo') else 'Side path'
39
+ parts = [f"starts at {w['startsAt']}" if w.get('startsAt') else '',
40
+ f"rejoins at {w['rejoinsAt']}" if w.get('rejoinsAt') else '', w.get('share') or '']
41
+ where = ', '.join(p for p in parts if p)
42
+ name = w.get('name') or 'Sub-workflow'
43
+ return f'{name}: {where}' if where else name
44
+
45
+
46
+ def flow_xml(w):
47
+ widths = [STEP_W] + [ARROW_W, STEP_W] * (PER_ROW - 1)
48
+ grid = ''.join(f'<w:gridCol w:w="{x}"/>' for x in widths)
49
+ rows = GAP.join(flow_row(w['steps'][i:i + PER_ROW]) for i in range(0, len(w['steps']), PER_ROW))
50
+ return (para(flow_label(w), 'Heading3')
51
+ + f'<w:tbl><w:tblPr><w:tblW w:w="{sum(widths)}" w:type="dxa"/>{NO_BORDERS}'
52
+ f'<w:tblLayout w:type="fixed"/></w:tblPr><w:tblGrid>{grid}</w:tblGrid>{rows}</w:tbl><w:p/>')