@juancr11/sibu 0.16.0 → 0.17.0

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 (28) hide show
  1. package/bin/modules/sync-review/action-prompt.js +14 -1
  2. package/bin/modules/sync-review/handler.js +54 -7
  3. package/bin/modules/sync-review/index.js +1 -0
  4. package/bin/modules/sync-review/unsupported-agent-cleanup.js +57 -0
  5. package/bin/modules/template-catalog-rendering/index.js +1 -1
  6. package/bin/modules/template-catalog-rendering/templates.js +65 -1
  7. package/bin/modules/workflow-mutation-readiness/workflow-mutation-readiness.js +9 -0
  8. package/bin/modules/workflow-target-planning/catalog.js +83 -26
  9. package/bin/modules/workflow-target-planning/workflow-targets.js +2 -1
  10. package/package.json +1 -1
  11. package/templates/.claude/agents/sibu-implementation-executor.md +30 -0
  12. package/templates/.claude/agents/sibu-implementation-planner.md +30 -0
  13. package/templates/.codex/agents/sibu-implementation-executor.toml +30 -0
  14. package/templates/.codex/agents/sibu-implementation-planner.toml +30 -0
  15. package/templates/.gemini/agents/sibu-implementation-executor.md +30 -0
  16. package/templates/.gemini/agents/sibu-implementation-planner.md +30 -0
  17. package/templates/AGENTS.md +4 -2
  18. package/templates/manifest.json +94 -17
  19. package/templates/skills/ai-implementation-executor-toolbox/SKILL.md +78 -0
  20. package/templates/skills/ai-implementation-plan-executor/SKILL.md +64 -108
  21. package/templates/skills/ai-implementation-planner/SKILL.md +55 -138
  22. package/templates/skills/ai-implementation-planner-toolbox/SKILL.md +78 -0
  23. package/templates/skills/business-domain-model-writer/SKILL.md +313 -0
  24. package/templates/skills/capabilities-map-writer/SKILL.md +271 -0
  25. package/templates/skills/deep-module-map-writer/SKILL.md +50 -14
  26. package/templates/skills/feature-brief-writer/SKILL.md +72 -32
  27. package/templates/skills/technical-design-writer/SKILL.md +10 -10
  28. package/templates/skills/ux-expert/SKILL.md +62 -17
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: ai-implementation-planner-toolbox
3
+ description: Worker-only operating rules for Sibu implementation planner sub-agents that create one story-local implementation plan.
4
+ ---
5
+
6
+ # AI Implementation Planner Toolbox
7
+
8
+ This toolbox is for `sibu-implementation-planner` workers only. It is not a normal user-invoked skill.
9
+
10
+ ## Focused worker routing
11
+
12
+ {{PLANNER_WORKER_ROUTING}}
13
+
14
+ ## Worker packet contract
15
+
16
+ Use only the narrow packet from the main agent. The packet must include:
17
+
18
+ - exactly one User Story path
19
+ - required source artifact paths: Epic brief, feature brief, technical design, and UX spec when the story or feature has UI impact
20
+ - this toolbox skill path
21
+ - required skill paths, including `clean-code`
22
+ - optional installed skill paths relevant to the story
23
+ - distilled skill constraints that are binding for this planning task
24
+ - expected final output format
25
+
26
+ If the packet names multiple stories, an Epic without one story, a feature without one story, or no story, stop and ask the main agent for exactly one User Story path.
27
+
28
+ If a required source artifact or required skill path is missing, stop and report the blocker. Do not invent scope from partial context.
29
+
30
+ ## Planning rules
31
+
32
+ - Read the story and required source artifacts before writing step files.
33
+ - Read required skills and relevant optional installed skills from the packet before writing step files.
34
+ - Inspect repository files narrowly, only enough to make the plan executable.
35
+ - Preserve story scope, acceptance criteria, technical design boundaries, and UX constraints when applicable.
36
+ - Create ordered story-local implementation step files under `<story-slug>.impl_plan/*.md`.
37
+ - Never write production code, tests, templates, or unrelated documentation.
38
+ - Never create or change product vision, Deep Module Map, feature brief, technical design, UX, Epic, or User Story artifacts.
39
+ - If an optional relevant skill is absent and the story involves an unmapped language, framework, database, or architecture pattern, continue only when safe and flag it as a plan risk.
40
+
41
+ ## Step file format
42
+
43
+ Every step file must use this exact section structure:
44
+
45
+ ```md
46
+ # Step: <Imperative step title>
47
+
48
+ ## Goal
49
+
50
+ <One short paragraph describing the implementation outcome for this step.>
51
+
52
+ ## Scope
53
+
54
+ - <Specific in-scope action or boundary>
55
+ - <Specific in-scope action or boundary>
56
+ - Do not <explicit out-of-scope boundary when useful>
57
+
58
+ ## Files
59
+
60
+ - <path/to/file.ext>
61
+ - <path/to/test_file.ext>
62
+
63
+ ## Done when
64
+
65
+ - <Specific observable completion condition>
66
+ - <Acceptance criterion or technical requirement covered by this step is satisfied>
67
+ - <Relevant compile, test, lint, build, or manual validation passes>
68
+ ```
69
+
70
+ ## Final result
71
+
72
+ Return a compact planning result with:
73
+
74
+ - story path
75
+ - implementation plan folder
76
+ - step files created or updated
77
+ - source artifacts and skills used
78
+ - plan risks or blockers, if any
@@ -0,0 +1,313 @@
1
+ ---
2
+ name: business-domain-model-writer
3
+ description: Create or update docs/business-domain-model.md from Product Vision plus assistant-led discovery, extracting likely business language, concepts, rules, lifecycles, workflows, events, boundaries, and hard parts before Deep Module Map or Feature Brief work.
4
+ ---
5
+
6
+ # Business Domain Model Writer
7
+
8
+ ## Purpose
9
+
10
+ Create or update `docs/business-domain-model.md`, a project-owned Business Domain Model that captures the product's business language and rules before downstream planning starts.
11
+
12
+ This skill owns the Business Domain Model only. It does not own Product Vision, Deep Module Maps, feature briefs, UX specs, technical designs, Epics, User Stories, implementation plans, production code, or Sibu template changes.
13
+
14
+ ## Pipeline Contract
15
+
16
+ ### What this skill needs
17
+
18
+ - `docs/product-vision.md`.
19
+ - Existing `docs/business-domain-model.md` when revising the model.
20
+ - Assistant-generated domain hypotheses grounded in Product Vision, then user review/corrections for concrete examples, scenarios, workflows, rules, states, events, and confusing boundaries.
21
+
22
+ ### What this skill writes
23
+
24
+ - `docs/business-domain-model.md`.
25
+
26
+ This is generated project-owned content. It is not a Sibu-managed workflow template.
27
+
28
+ ### When this skill stops
29
+
30
+ - `docs/product-vision.md` is missing; tell the user to create it first with `product-vision-writer`.
31
+ - The request belongs to another pipeline stage, such as Product Vision, Deep Module Map, feature brief, UX design, technical design, Scrum planning, implementation planning, or implementation execution.
32
+ - Product Vision plus user review still leave material ambiguity about domain language, concepts, bounded contexts, subdomains, relationships, rules, lifecycles, workflows, events, boundaries, or hard parts; ask one focused review question instead of drafting.
33
+
34
+ ### What this skill must not do
35
+
36
+ - Do not create Product Vision, Deep Module Maps, feature briefs, UX specs, technical designs, Epics, User Stories, implementation plans, or production code.
37
+ - Do not inspect implementation code or derive domain truth from existing architecture, folder names, database tables, commands, screens, or APIs by default.
38
+ - Do not use existing implementation code as the source of truth for business concepts, rules, or boundaries.
39
+ - Do not make the user invent the Business Domain Model from scratch. The assistant must first mine Product Vision for likely concepts, rules, workflows, lifecycles, and boundaries, then ask the user to confirm or correct its interpretation.
40
+ - Do not ask technical or domain-modeling questions that expect the user to provide terms like entities, bounded contexts, subdomains, business objects, lifecycle states, or domain events unless the assistant has already proposed concrete candidate language in plain product terms.
41
+ - Do not skip the user review/correction pass or the final “I am clear; are you good?” check-in before writing.
42
+ - Do not write any file except `docs/business-domain-model.md` unless the user explicitly asks for a different path for this same artifact.
43
+
44
+ ## Required source of truth
45
+
46
+ Before doing any Business Domain Model work, read:
47
+
48
+ ```txt
49
+ docs/product-vision.md
50
+ ```
51
+
52
+ Use Product Vision as the source of truth for product purpose, target user, positioning, product principles, boundaries, voice, trust expectations, and success signals.
53
+
54
+ The Business Domain Model source of truth is Product Vision plus the user's review of assistant-generated hypotheses. Repository code may be inspected only when the user explicitly requests a later code-alignment check, and only after the domain model has been drafted from Product Vision and user-reviewed context.
55
+
56
+ ## Hard start rule
57
+
58
+ Do not create or update a Business Domain Model if `docs/product-vision.md` is missing.
59
+
60
+ If Product Vision is missing:
61
+
62
+ 1. Stop.
63
+ 2. Tell the user that a Business Domain Model requires `docs/product-vision.md`.
64
+ 3. Instruct the user to create Product Vision first with `product-vision-writer`.
65
+ 4. Do not draft, infer, or save a Business Domain Model until Product Vision exists.
66
+
67
+ ## No-code-inspection boundary
68
+
69
+ For initial creation and substantial revisions, do not inspect implementation code by default. Do not reverse-engineer the domain model from:
70
+
71
+ - current architecture
72
+ - folders or packages
73
+ - database schemas
74
+ - command names
75
+ - UI screens
76
+ - APIs
77
+ - tests
78
+ - helper names
79
+
80
+ Those artifacts can reflect accidental implementation structure, stale terminology, or technical shortcuts. They are not business-domain truth.
81
+
82
+ If the user explicitly requests a code-alignment check, first draft the Business Domain Model from Product Vision and user-reviewed hypotheses. Then inspect code narrowly to identify terminology or migration implications, not to redefine the domain model around current implementation.
83
+
84
+ ## Discovery posture
85
+
86
+ Be assistant-led before writing. The user is asking for help defining the model; do not make them supply the model.
87
+
88
+ Before asking questions, extract as much as possible from Product Vision:
89
+
90
+ - likely domain purpose
91
+ - likely user-facing and business vocabulary
92
+ - likely core concepts and relationships
93
+ - likely domain boundaries, bounded contexts, and subdomains
94
+ - likely states, lifecycles, workflows, rules, events, boundaries, and hard parts
95
+ - places where Product Vision is silent or ambiguous
96
+
97
+ Then present a concise first-pass interpretation and ask the user to correct one specific part of it. The user's job is reviewer, not author.
98
+
99
+ Use plain product language. Prefer questions like “Does this read right?” or “Which of these feels wrong?” over questions that require domain-modeling skill.
100
+
101
+ This user review pass is mandatory and non-skippable. Even when Product Vision is rich, ask at least one explicit user-facing review/correction question before drafting or writing the Business Domain Model.
102
+
103
+ Prefer proposed examples and scenarios before asking for abstract glossary terms. Derive candidate concepts and vocabulary from Product Vision, then confirm them with the user. Mine Product Vision for as many concrete examples, implied scenarios, value moments, decisions, state changes, rules, exceptions, and language boundaries as it can support before interviewing the user. Ask only for specific gaps that remain.
104
+
105
+ Ask one focused question at a time. Never ask the user to answer a list of questions, fill out a questionnaire, or respond to multiple numbered gaps in one turn. Walk down the domain decision tree branch by branch, resolving dependencies between concepts, rules, states, workflows, boundaries, and hard parts before moving on. When useful, include your recommended answer or a concise default assumption with the single question so the user can confirm, correct, or reject it quickly.
106
+
107
+ Do not optimize for the fewest questions. Optimize for ending the interview with no material open domain questions. If a question can be answered from Product Vision or an existing Business Domain Model during revision, inspect those artifacts instead of asking.
108
+
109
+ Before drafting, always perform one final check-in as a single question in the spirit of: “I am clear on my end. Are you good, or is there anything else you want to cover before I proceed?” If the user adds context, incorporate or clarify it before writing. Once the user confirms there is nothing else to cover, write without requiring a separate artifact approval step.
110
+
111
+ Start with a response shaped like this, with exactly one user-facing question:
112
+
113
+ ```markdown
114
+ I’ll take the first pass from Product Vision and ask you to correct it.
115
+
116
+ My read is:
117
+ - <plain-language domain purpose>
118
+ - <likely concept/workflow/rule/lifecycle/boundary>
119
+ - <likely concept/workflow/rule/lifecycle/boundary>
120
+
121
+ First question: <one focused review question about the highest-leverage uncertainty or assumption>
122
+ ```
123
+
124
+ Use review questions like:
125
+
126
+ - "My read is that the core lifecycle is `<plain lifecycle>`. Does that feel right, or would you name the moments differently?"
127
+ - "I think the main things this product tracks are `<candidate concepts>`. Which of these feels wrong or missing?"
128
+ - "Product Vision seems to imply this rule: `<plain rule>`. Is that true?"
129
+ - "I see this boundary: `<plain boundary>`. Is that the right boundary?"
130
+ - "This part is still ambiguous to me: `<specific ambiguity>`. My default assumption would be `<assumption>`. Should I use that?"
131
+
132
+ Avoid broad “tell me a real example” discovery as the first move. It makes the user invent the domain from scratch and often repeats work already captured in Product Vision. If Product Vision is too thin, first propose the most likely example or scenario from it, then ask the user to correct or fill one specific missing part.
133
+
134
+ Prefer focused gap-fill questions like:
135
+
136
+ - "Product Vision suggests this value moment: `<specific scenario>`. Is that accurate, or what part should change?"
137
+ - "I can infer `<workflow step A>` and `<workflow step C>`, but not what happens between them. What decision or handoff occurs there?"
138
+ - "I see `<candidate rule>`, but not the exception path. What should happen when `<specific exception>` occurs?"
139
+ - "What rule must always be true, even if the implementation changes?"
140
+ - "What exceptions or edge cases create business consequences rather than only technical errors?"
141
+ - "Where do people currently use inconsistent names for the same concept?"
142
+ - "What part of the domain feels hardest to explain to a new teammate?"
143
+
144
+ Ask these questions one at a time only. After each user answer, update your understanding, choose the next highest-value unresolved domain point, and ask one next question. Do not bundle follow-ups.
145
+
146
+ Avoid starting with:
147
+
148
+ - "What entities should exist?"
149
+ - "What bounded contexts should we use?"
150
+ - "What business objects change state?"
151
+ - "What domain events would matter?"
152
+ - "What database tables should model this?"
153
+ - "What services or modules should own this?"
154
+ - "How is the code structured today?"
155
+ - "What concepts should be external?"
156
+
157
+ ## Gather the required domain context
158
+
159
+ Keep extracting from Product Vision and asking focused review questions until the following are clear enough to defend:
160
+
161
+ - domain purpose
162
+ - user-facing and business vocabulary
163
+ - core business concepts
164
+ - bounded contexts and subdomains
165
+ - relationships between concepts
166
+ - states and lifecycles
167
+ - business rules and invariants
168
+ - user and business workflows
169
+ - domain events
170
+ - external concepts and boundaries
171
+ - open tensions, tradeoffs, and hard parts
172
+
173
+ Do not draft with material unresolved domain questions. If the conversation stalls, offer one concise assumption for the next unresolved point and ask the user to confirm, correct, or reject it.
174
+
175
+ ## Document shape
176
+
177
+ Write `docs/business-domain-model.md` in Markdown using these sections:
178
+
179
+ ```markdown
180
+ # Business Domain Model
181
+
182
+ ## Document Control & Context
183
+
184
+ ### Executive Summary / Purpose
185
+
186
+ ### Domain Scope & Boundaries
187
+
188
+ ## Ubiquitous Language
189
+
190
+ ### Terms and Definitions
191
+
192
+ ### Synonym Clarification
193
+
194
+ ## Bounded Contexts & Subdomains
195
+
196
+ ### Subdomains
197
+
198
+ ### Context Map
199
+
200
+ Include a subdomain-focused Mermaid diagram here, usually a `flowchart TB`, that visualizes:
201
+
202
+ - core subdomains
203
+ - supporting subdomains
204
+ - project-owned outputs or artifacts
205
+ - external/generic domains
206
+ - only the most important ownership or dependency relationships
207
+
208
+ Keep the diagram conceptual, sparse, and business-facing. Avoid drawing every operational relationship. Avoid database tables, class names, deployment nodes, or low-level service architecture.
209
+
210
+ Recommended shape:
211
+
212
+ ```mermaid
213
+ flowchart TB
214
+ subgraph ProductDomain["Product Domain"]
215
+ direction TB
216
+
217
+ subgraph Core["Core Subdomains"]
218
+ CoreA["Core Subdomain A"]
219
+ CoreB["Core Subdomain B"]
220
+ end
221
+
222
+ subgraph Supporting["Supporting Subdomains"]
223
+ SupportA["Supporting Subdomain A"]
224
+ SupportB["Supporting Subdomain B"]
225
+ end
226
+ end
227
+
228
+ subgraph ProjectOwned["Project-Owned Outputs"]
229
+ ArtifactA["Artifact / File A"]
230
+ ArtifactB["Artifact / File B"]
231
+ end
232
+
233
+ subgraph External["External / Generic Domains"]
234
+ ExternalA["External System A"]
235
+ ExternalB["External System B"]
236
+ end
237
+
238
+ CoreA --> ArtifactA
239
+ CoreB --> ArtifactB
240
+ SupportA --> ArtifactA
241
+ ProductDomain -. guides but does not own .-> External
242
+ ProjectOwned -. owned by user / team .-> ProductDomain
243
+ ```
244
+
245
+ ## Domain Concepts & Conceptual Diagram
246
+ ## Domain Concepts & Conceptual Diagram
247
+
248
+ ### Conceptual Entities / Objects
249
+
250
+ ### Attributes / Characteristics
251
+
252
+ ### Relationships & Cardinality
253
+
254
+ ## Domain Invariants & Business Rules
255
+
256
+ ### Invariants
257
+
258
+ ### Policies
259
+
260
+ ## Domain Events & Behaviors
261
+
262
+ ### Key Lifecycle Triggers
263
+
264
+ ### Domain Events
265
+
266
+ ## Out of Scope & Future Evolution
267
+
268
+ ### Assumptions
269
+
270
+ ### Known Variations / Debt
271
+ ```
272
+
273
+ Keep the document as concise as the product allows. Simple projects may have short sections, but every section should contain useful domain guidance or explicitly state the current known absence of that concern.
274
+
275
+ ### Section guidance
276
+
277
+ - **Document Control & Context** establishes why the domain is being modeled and the business boundary of the model before listing concepts.
278
+ - **Ubiquitous Language** is the shared glossary for business experts and engineers. Give every important term one strict definition. Call out synonyms, overloaded terms, and terms that mean different things in different contexts.
279
+ - **Bounded Contexts & Subdomains** names the meaningful business boundaries in the product. For simple products, a short list is fine. For complex products, classify subdomains as core, supporting, or generic. The `### Context Map` section should include a subdomain-focused Mermaid diagram that groups core subdomains, supporting subdomains, project-owned outputs, and external/generic domains. Keep the diagram business-oriented and sparse; do not draw every operational relationship, and do not turn it into infrastructure architecture.
280
+ - **Domain Concepts & Conceptual Diagram** describes business concepts, their important characteristics, and relationships/cardinality in plain business English. This is not a database schema, ORM model, or implementation design.
281
+ - **Domain Invariants & Business Rules** separates rules that must always be true from reactive policies that describe what should happen when a business condition occurs.
282
+ - **Domain Events & Behaviors** captures meaningful lifecycle triggers and past-tense business events that other parts of the business or system may care about.
283
+ - **Out of Scope & Future Evolution** records assumptions, explicitly excluded areas, known variation, unresolved debt, and business processes likely to change.
284
+
285
+ ## Writing guidance
286
+
287
+ - Use the user's natural business language when it is clear and consistent.
288
+ - Make domain boundaries and subdomains explicit enough that downstream Deep Module Map and Feature Brief work can tell what domain each concern belongs to. Use the Mermaid context map to make subdomain groups and inside/outside ownership boundaries visually obvious.
289
+ - Prefer concrete definitions, examples, and rules over generic taxonomy.
290
+ - Name concepts for business meaning, not implementation shape.
291
+ - Describe relationships and cardinality in business language when they matter.
292
+ - Separate business rules from technical validation details.
293
+ - Mark external concepts as external even when the product stores references to them.
294
+ - Capture hard parts honestly so downstream planning does not smooth over important ambiguity.
295
+ - Avoid turning the document into an implementation design, database model, or module map.
296
+
297
+ ## Save the document
298
+
299
+ When working in a repository, write the Business Domain Model to:
300
+
301
+ ```txt
302
+ docs/business-domain-model.md
303
+ ```
304
+
305
+ Create the `docs/` directory if needed.
306
+
307
+ If `docs/business-domain-model.md` already exists, read it before revising. Treat the request as a revision when the user asks to revise, clarify, or update the Business Domain Model.
308
+
309
+ ## Final response behavior
310
+
311
+ After writing the file, final-answer with only the path created or updated. Do not paste the document body, excerpt, outline, or section summaries.
312
+
313
+ Only include the full document when the user explicitly asks for inline review in the current request. If file writes are unavailable, provide the Markdown content and state that it is intended for `docs/business-domain-model.md`.
@@ -0,0 +1,271 @@
1
+ ---
2
+ name: capabilities-map-writer
3
+ description: Create or update docs/capabilities-map.md from Product Vision and Business Domain Model, mapping business/product capabilities by subdomain before Deep Module Map or Feature Brief work.
4
+ ---
5
+
6
+ # Capabilities Map Writer
7
+
8
+ ## Purpose
9
+
10
+ Create or update `docs/capabilities-map.md`, a project-owned Capabilities Map that translates Product Vision and Business Domain Model context into clear business/product abilities organized by subdomain.
11
+
12
+ This skill owns the Capabilities Map only. It does not own Product Vision, Business Domain Models, Deep Module Maps, feature briefs, UX specs, technical designs, Epics, User Stories, implementation plans, production code, or Sibu template changes.
13
+
14
+ ## Pipeline Contract
15
+
16
+ ### What this skill needs
17
+
18
+ - `docs/product-vision.md`.
19
+ - `docs/business-domain-model.md`.
20
+ - Existing `docs/capabilities-map.md` when revising the map.
21
+ - Assistant-generated capability hypotheses grounded in Product Vision and Business Domain Model, then user review/corrections before writing.
22
+
23
+ ### What this skill writes
24
+
25
+ - `docs/capabilities-map.md`.
26
+
27
+ This is generated project-owned content. It is not a Sibu-managed workflow template.
28
+
29
+ ### When this skill stops
30
+
31
+ - `docs/product-vision.md` is missing; tell the user to create it first with `product-vision-writer`.
32
+ - `docs/business-domain-model.md` is missing; tell the user to create it first with `business-domain-model-writer`.
33
+ - The request belongs to another pipeline stage, such as Product Vision, Business Domain Model, Deep Module Map, feature brief, UX design, technical design, Scrum planning, implementation planning, or implementation execution.
34
+ - Product Vision appears to need new or changed product direction, target user, boundaries, principles, trust expectations, or success signals; stop with a ready-to-paste `product-vision-writer` repair prompt.
35
+ - Business Domain Model appears to need new or changed subdomains, concepts, relationships, rules, workflows, lifecycles, events, boundaries, or hard parts; stop with a ready-to-paste `business-domain-model-writer` repair prompt.
36
+ - Product Vision, Business Domain Model, and user review still leave material ambiguity about core, supporting, generic, or external capabilities; ask one focused review question instead of drafting.
37
+
38
+ ### What this skill must not do
39
+
40
+ - Do not create Product Vision, Business Domain Models, Deep Module Maps, feature briefs, UX specs, technical designs, Epics, User Stories, implementation plans, or production code.
41
+ - Do not turn modules, commands, services, APIs, database tables, files, classes, packages, screens, jobs, queues, deployment units, or other implementation structure into primary capabilities.
42
+ - Do not inspect implementation code or derive capabilities from current architecture, folder names, database schemas, commands, screens, APIs, or tests by default.
43
+ - Do not skip the user review/correction pass or the final “I am clear; are you good?” check-in before writing.
44
+ - Do not write any file except `docs/capabilities-map.md` unless the user explicitly asks for a different path for this same artifact.
45
+
46
+ ## Required source of truth
47
+
48
+ Before doing any Capabilities Map work, read:
49
+
50
+ ```txt
51
+ docs/product-vision.md
52
+ docs/business-domain-model.md
53
+ ```
54
+
55
+ Use Product Vision as the source of truth for product purpose, target user, positioning, product principles, boundaries, voice, trust expectations, and success signals.
56
+
57
+ Use Business Domain Model as the source of truth for core, supporting, generic, and external subdomains; ubiquitous language; concepts; relationships; rules; workflows; lifecycles; events; boundaries; and hard parts.
58
+
59
+ The Capabilities Map source of truth is Product Vision, Business Domain Model, and the user's review of assistant-generated capability hypotheses. Repository code may be inspected only when the user explicitly requests a later code-alignment check, and only after the business/product capability map has been drafted from upstream artifacts and user-reviewed context.
60
+
61
+ ## Hard start rule
62
+
63
+ Do not create or update a Capabilities Map if either required upstream artifact is missing.
64
+
65
+ If Product Vision is missing:
66
+
67
+ 1. Stop.
68
+ 2. Tell the user that a Capabilities Map requires `docs/product-vision.md`.
69
+ 3. Instruct the user to create Product Vision first with `product-vision-writer`.
70
+ 4. Do not draft, infer, or save a Capabilities Map until Product Vision exists.
71
+
72
+ If Business Domain Model is missing:
73
+
74
+ 1. Stop.
75
+ 2. Tell the user that a Capabilities Map requires `docs/business-domain-model.md`.
76
+ 3. Instruct the user to create the Business Domain Model first with `business-domain-model-writer`.
77
+ 4. Do not draft, infer, or save a Capabilities Map until the Business Domain Model exists.
78
+
79
+ ## Upstream gap detection and repair prompts
80
+
81
+ Do not use the Capabilities Map to patch over missing upstream foundations. While reading Product Vision and Business Domain Model, actively check whether the requested capability work exposes an upstream gap.
82
+
83
+ Hard-stop and provide a ready-to-paste repair prompt when either upstream artifact needs revision before capabilities can be mapped safely. The prompt must include the user's capability-map request, the suspected gap, and the specific decision needed so the upstream skill can repair the source artifact.
84
+
85
+ Product Vision gaps include missing or changed product purpose, target user, positioning, product boundaries, product principles, voice, trust expectations, or success signals. When found, stop and give a prompt shaped like:
86
+
87
+ ```markdown
88
+ Use product-vision-writer to revise docs/product-vision.md before Capabilities Map work continues.
89
+
90
+ Capability-map request: <user request or concise summary>
91
+
92
+ Suspected Product Vision gap: <what direction, target user, boundary, principle, trust expectation, or success signal is missing or changing>
93
+
94
+ Decision needed: <the product-level decision needed before capabilities can be mapped>
95
+
96
+ After docs/product-vision.md is updated, return to capabilities-map-writer to create or revise docs/capabilities-map.md.
97
+ ```
98
+
99
+ Business Domain Model gaps include missing or changed core/supporting subdomains, ubiquitous language, domain concepts, relationships, business rules, workflows, lifecycles, events, boundaries, or hard parts. When found, stop and give a prompt shaped like:
100
+
101
+ ```markdown
102
+ Use business-domain-model-writer to revise docs/business-domain-model.md before Capabilities Map work continues.
103
+
104
+ Capability-map request: <user request or concise summary>
105
+
106
+ Suspected Business Domain Model gap: <what subdomain, concept, relationship, rule, workflow, lifecycle, event, boundary, or hard part is missing or changing>
107
+
108
+ Decision needed: <the domain-level decision needed before capabilities can be mapped>
109
+
110
+ After docs/business-domain-model.md is updated, return to capabilities-map-writer to create or revise docs/capabilities-map.md.
111
+ ```
112
+
113
+ If the upstream artifacts are present and only the capability wording is unclear, do not route away. Continue the normal assistant-led review with one focused question.
114
+
115
+ ## Business/product-level boundary
116
+
117
+ Capabilities describe what the product or business must be able to do, not how the software is structured.
118
+
119
+ Use capability names like:
120
+
121
+ - “Capture workflow decisions”
122
+ - “Surface upstream planning gaps”
123
+ - “Preserve user-controlled artifact review”
124
+ - “Coordinate external export handoff”
125
+
126
+ Avoid capability names like:
127
+
128
+ - “Create `CapabilityRepository`”
129
+ - “Add `/api/capabilities` endpoint”
130
+ - “Implement command handler”
131
+ - “Store rows in `capabilities` table”
132
+ - “Render React capability list component”
133
+
134
+ If an upstream artifact only provides technical language, translate it into the underlying business/product ability and ask the user to confirm the translation.
135
+
136
+ ## Discovery posture
137
+
138
+ Be assistant-led before writing. The user is asking for help defining capabilities; do not make them supply the map from scratch.
139
+
140
+ Before asking questions, extract as much as possible from Product Vision and Business Domain Model:
141
+
142
+ - likely product abilities implied by product goals and success signals
143
+ - capabilities owned by each core subdomain
144
+ - capabilities owned by each supporting subdomain
145
+ - generic or external capabilities that matter for boundaries
146
+ - capability dependencies or sequencing constraints
147
+ - capability gaps, tensions, or future evolution notes
148
+ - places where upstream artifacts are silent or ambiguous
149
+
150
+ Then present a concise first-pass interpretation and ask the user to correct one specific part of it. The user's job is reviewer, not author.
151
+
152
+ Use plain product language. Prefer questions like “Does this read right?” or “Which of these feels wrong?” over questions that require capability-modeling expertise.
153
+
154
+ This user review pass is mandatory and non-skippable. Even when upstream artifacts are rich, ask at least one explicit user-facing review/correction question before drafting or writing the Capabilities Map.
155
+
156
+ Ask one focused question at a time. Never ask the user to answer a list of questions, fill out a questionnaire, or respond to multiple numbered gaps in one turn. When useful, include your recommended answer or a concise default assumption with the single question so the user can confirm, correct, or reject it quickly.
157
+
158
+ Do not optimize for the fewest questions. Optimize for ending the interview with no material open capability questions. If a question can be answered from Product Vision, Business Domain Model, or an existing Capabilities Map during revision, inspect those artifacts instead of asking.
159
+
160
+ Before drafting, always perform one final check-in as a single question in the spirit of: “I am clear on my end. Are you good, or is there anything else you want to cover before I proceed?” If the user adds context, incorporate or clarify it before writing. Once the user confirms there is nothing else to cover, write without requiring a separate artifact approval step.
161
+
162
+ Start with a response shaped like this, with exactly one user-facing question:
163
+
164
+ ```markdown
165
+ I’ll take the first pass from Product Vision and the Business Domain Model, then ask you to correct it.
166
+
167
+ My read is:
168
+ - <core subdomain> likely needs capabilities around <plain product/business abilities>
169
+ - <supporting subdomain> likely needs capabilities around <plain product/business abilities>
170
+ - <generic/external capability area> may matter because <boundary or dependency>
171
+
172
+ First question: <one focused review question about the highest-leverage capability assumption>
173
+ ```
174
+
175
+ Use review questions like:
176
+
177
+ - “My read is that `<subdomain>` owns the ability to `<plain product ability>`. Does that feel right?”
178
+ - “I think these are the main capabilities under `<subdomain>`: `<short list>`. Which one feels wrong or missing?”
179
+ - “This capability sounds technical in the source docs: `<technical phrase>`. Would you describe the business ability as `<plain-language translation>`?”
180
+ - “Product Vision suggests this dependency: `<capability A>` must exist before `<capability B>`. Is that true?”
181
+ - “This part is still ambiguous to me: `<specific ambiguity>`. My default assumption would be `<assumption>`. Should I use that?”
182
+
183
+ Avoid starting with:
184
+
185
+ - “What capabilities should exist?”
186
+ - “What modules should own this?”
187
+ - “What services or commands do we need?”
188
+ - “What API endpoints should we support?”
189
+ - “What database tables should model capabilities?”
190
+ - “How is the code structured today?”
191
+
192
+ ## Gather the required capability context
193
+
194
+ Keep extracting from Product Vision and Business Domain Model and asking focused review questions until the following are clear enough to defend:
195
+
196
+ - core subdomain capabilities
197
+ - supporting subdomain capabilities
198
+ - generic or external capabilities when useful for boundaries
199
+ - capability descriptions or outcome statements
200
+ - capability dependencies or sequencing
201
+ - known gaps or evolution notes
202
+ - capability names that stay business/product-level
203
+
204
+ Do not draft with material unresolved capability questions. If the conversation stalls, offer one concise assumption for the next unresolved point and ask the user to confirm, correct, or reject it.
205
+
206
+ ## Document shape
207
+
208
+ Write `docs/capabilities-map.md` in Markdown using these sections:
209
+
210
+ ```markdown
211
+ # Capabilities Map
212
+
213
+ ## Purpose
214
+
215
+ ## Capability Map
216
+
217
+ ### Core Subdomains
218
+
219
+ #### <Subdomain>
220
+ - **<Capability>**: <business/product ability and outcome>
221
+
222
+ ### Supporting Subdomains
223
+
224
+ #### <Subdomain>
225
+ - **<Capability>**: <business/product ability and outcome>
226
+
227
+ ### Generic / External Capabilities
228
+
229
+ ## Capability Dependencies / Sequencing
230
+
231
+ ## Known Gaps / Evolution Notes
232
+ ```
233
+
234
+ Adapt section names when useful, but preserve the distinction between core, supporting, and generic/external capabilities when those categories exist in the Business Domain Model.
235
+
236
+ Keep “Known Gaps / Evolution Notes” for acknowledged future evolution, not unresolved questions in the drafting process. Resolve material open questions before writing.
237
+
238
+ ## Writing style
239
+
240
+ Write capabilities as concise business/product abilities with outcome-oriented descriptions.
241
+
242
+ Prefer:
243
+
244
+ - short capability names
245
+ - plain product language
246
+ - bullets grouped by subdomain
247
+ - clear statements of user or business outcome
248
+ - explicit dependency notes only where they affect planning
249
+
250
+ Avoid:
251
+
252
+ - implementation tasks
253
+ - architecture diagrams
254
+ - module or service ownership
255
+ - database or API design
256
+ - exhaustive process documentation
257
+ - generic filler capabilities that could apply to any product
258
+
259
+ ## Save the document
260
+
261
+ When working in a repository, write the Capabilities Map to `docs/capabilities-map.md` by default. Create the `docs/` directory if needed.
262
+
263
+ If `docs/capabilities-map.md` already exists, read it before drafting. Treat the request as a revision when the user asks to revise, clarify, or update the map. Ask before overwriting an existing map when the user appears to be asking for a separate artifact.
264
+
265
+ If the user explicitly requests a different path, use that path instead.
266
+
267
+ ## Final response behavior
268
+
269
+ After writing the file, final-answer with only the path created or updated. Do not paste the document body, excerpt, outline, or section summaries.
270
+
271
+ Only include the full document when the user explicitly asks for inline review in the current request. If file writes are unavailable, provide the Markdown content and state that it is intended for `docs/capabilities-map.md`.