wdi-method 0.3.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 (122) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +203 -0
  3. package/bin/wdi-method.js +906 -0
  4. package/kit/.constitution/README.md +66 -0
  5. package/kit/.constitution/codebase/brownfield-guide.md +18 -0
  6. package/kit/.constitution/codebase/conventions-guide.md +18 -0
  7. package/kit/.constitution/codebase/stack-guide.md +18 -0
  8. package/kit/.constitution/constitution.md +135 -0
  9. package/kit/.constitution/document/architecture-guide.md +209 -0
  10. package/kit/.constitution/document/bmad-guide.md +151 -0
  11. package/kit/.constitution/document/bmad-skill-register.md +71 -0
  12. package/kit/.constitution/document/brief-guide.md +94 -0
  13. package/kit/.constitution/document/corpus-guide.md +341 -0
  14. package/kit/.constitution/document/decision-guide.md +134 -0
  15. package/kit/.constitution/document/delivery-flow-guide.md +338 -0
  16. package/kit/.constitution/document/prd-guide.md +202 -0
  17. package/kit/.constitution/document/sdd-guide.md +206 -0
  18. package/kit/.constitution/document/srs-guide.md +147 -0
  19. package/kit/.constitution/document/templates/addendum.md +71 -0
  20. package/kit/.constitution/document/templates/architecture-spine.md +100 -0
  21. package/kit/.constitution/document/templates/brief.md +110 -0
  22. package/kit/.constitution/document/templates/c4.md +77 -0
  23. package/kit/.constitution/document/templates/contract.md +52 -0
  24. package/kit/.constitution/document/templates/cross-cutting.md +80 -0
  25. package/kit/.constitution/document/templates/decision.md +64 -0
  26. package/kit/.constitution/document/templates/design-system.md +67 -0
  27. package/kit/.constitution/document/templates/flow.md +51 -0
  28. package/kit/.constitution/document/templates/integration.md +69 -0
  29. package/kit/.constitution/document/templates/inventory.md +69 -0
  30. package/kit/.constitution/document/templates/lc.md +47 -0
  31. package/kit/.constitution/document/templates/lifecycle.md +52 -0
  32. package/kit/.constitution/document/templates/meeting.md +47 -0
  33. package/kit/.constitution/document/templates/model.md +55 -0
  34. package/kit/.constitution/document/templates/oq.md +45 -0
  35. package/kit/.constitution/document/templates/prd.md +226 -0
  36. package/kit/.constitution/document/templates/questions.md +75 -0
  37. package/kit/.constitution/document/templates/rtr.md +61 -0
  38. package/kit/.constitution/document/templates/rules.md +47 -0
  39. package/kit/.constitution/document/templates/scn.md +40 -0
  40. package/kit/.constitution/document/templates/sdd.md +146 -0
  41. package/kit/.constitution/document/templates/srs.md +149 -0
  42. package/kit/.constitution/document/templates/structure-codebase.md +129 -0
  43. package/kit/.constitution/document/templates/structure-document.md +90 -0
  44. package/kit/.constitution/document/templates/uc.md +69 -0
  45. package/kit/.constitution/document/templates/ux.md +77 -0
  46. package/kit/.constitution/document/ux-guide.md +99 -0
  47. package/kit/.constitution/language-guide.md +69 -0
  48. package/kit/.constitution/method/README.md +169 -0
  49. package/kit/.constitution/method/artifact-map.md +155 -0
  50. package/kit/.constitution/method/portability.md +91 -0
  51. package/kit/.constitution/method/rationale.md +246 -0
  52. package/kit/.constitution/method-glossary.md +169 -0
  53. package/kit/.constitution/project/README.md +68 -0
  54. package/kit/.constitution/repo-guide.md +97 -0
  55. package/kit/.constitution/scripts/inventory.py +527 -0
  56. package/kit/.constitution/scripts/timeline.py +665 -0
  57. package/kit/.constitution/scripts/validate.py +1579 -0
  58. package/kit/.constitution/structure-guide.md +202 -0
  59. package/kit/assets/bmad-custom/bmad-advanced-elicitation.toml +15 -0
  60. package/kit/assets/bmad-custom/bmad-architecture.toml +31 -0
  61. package/kit/assets/bmad-custom/bmad-build-auto.toml +10 -0
  62. package/kit/assets/bmad-custom/bmad-build.toml +52 -0
  63. package/kit/assets/bmad-custom/bmad-code-review.toml +12 -0
  64. package/kit/assets/bmad-custom/bmad-correct-course.toml +27 -0
  65. package/kit/assets/bmad-custom/bmad-deep-recon.toml +11 -0
  66. package/kit/assets/bmad-custom/bmad-prd.toml +42 -0
  67. package/kit/assets/bmad-custom/bmad-product-brief.toml +34 -0
  68. package/kit/assets/bmad-custom/bmad-retrospective.toml +9 -0
  69. package/kit/assets/bmad-custom/bmad-spec.toml +15 -0
  70. package/kit/assets/bmad-custom/bmad-ux.toml +19 -0
  71. package/kit/assets/bmad-custom/config.toml +6 -0
  72. package/kit/skills/wdi-blueprint/SKILL.md +203 -0
  73. package/kit/skills/wdi-build/SKILL.md +244 -0
  74. package/kit/skills/wdi-component/SKILL.md +172 -0
  75. package/kit/skills/wdi-decision/.gitkeep +0 -0
  76. package/kit/skills/wdi-decision/SKILL.md +183 -0
  77. package/kit/skills/wdi-help/.gitkeep +0 -0
  78. package/kit/skills/wdi-help/SKILL.md +98 -0
  79. package/kit/skills/wdi-init/SKILL.md +149 -0
  80. package/kit/skills/wdi-log/SKILL.md +107 -0
  81. package/kit/skills/wdi-problem/SKILL.md +90 -0
  82. package/kit/skills/wdi-product/SKILL.md +127 -0
  83. package/kit/skills/wdi-question/.gitkeep +0 -0
  84. package/kit/skills/wdi-question/SKILL.md +88 -0
  85. package/kit/skills/wdi-reconcile/.gitkeep +0 -0
  86. package/kit/skills/wdi-reconcile/SKILL.md +146 -0
  87. package/kit/skills/wdi-report/SKILL.md +205 -0
  88. package/kit/skills/wdi-review/SKILL.md +118 -0
  89. package/kit/skills/wdi-systematic-debugging/SKILL.md +193 -0
  90. package/kit/skills/wdi-systematic-debugging/references/condition-based-waiting.md +115 -0
  91. package/kit/skills/wdi-systematic-debugging/references/defense-in-depth.md +122 -0
  92. package/kit/skills/wdi-systematic-debugging/references/find-polluter.sh +72 -0
  93. package/kit/skills/wdi-systematic-debugging/references/root-cause-tracing.md +169 -0
  94. package/kit/skills/wdi-ux/SKILL.md +145 -0
  95. package/kit-overlay/AGENTS.md +196 -0
  96. package/kit-overlay/README.md +66 -0
  97. package/kit-overlay/constitution.md +135 -0
  98. package/kit-overlay/portability.md +91 -0
  99. package/kit-overlay/repo-guide.md +97 -0
  100. package/lib/agents-block.mjs +52 -0
  101. package/lib/identity.mjs +65 -0
  102. package/package.json +37 -0
  103. package/scaffold/.control/decisions/.gitkeep +0 -0
  104. package/scaffold/.control/generated/.gitkeep +2 -0
  105. package/scaffold/.control/meetings/.gitkeep +0 -0
  106. package/scaffold/.control/memlog/.gitkeep +0 -0
  107. package/scaffold/.control/product-glossary.md +21 -0
  108. package/scaffold/.control/project-non-technical-log.md +23 -0
  109. package/scaffold/.control/questions/answered.md +11 -0
  110. package/scaffold/.control/questions/assumptions.md +15 -0
  111. package/scaffold/.control/questions/blocking.md +21 -0
  112. package/scaffold/.control/questions/external.md +11 -0
  113. package/scaffold/.control/registry/components.yaml +21 -0
  114. package/scaffold/.control/registry/decisions.yaml +6 -0
  115. package/scaffold/.control/registry/defects.yaml +3 -0
  116. package/scaffold/.control/registry/index.yaml +46 -0
  117. package/scaffold/.control/registry/requirements.yaml +15 -0
  118. package/scaffold/.control/registry/risks.yaml +5 -0
  119. package/scaffold/.control/registry/usecases.yaml +6 -0
  120. package/scaffold/.control/registry/waves.yaml +5 -0
  121. package/scaffold/.control/structure-codebase.md +19 -0
  122. package/scaffold/.control/structure-document.md +25 -0
@@ -0,0 +1,338 @@
1
+ ---
2
+ status: Accepted
3
+ ---
4
+
5
+ # Delivery Flow Guide
6
+
7
+ **Loaded when:** opening or closing a gate, opening or closing a wave, setting `mode` or
8
+ `risk_accepted`, and any time something already agreed has to change
9
+
10
+ This is the flow itself: five gates, the one knob that sets document depth, the one field that sets
11
+ review intensity, wave sizing, and what happens when a settled thing has to move. Every other guide
12
+ describes one document; this one describes the order they arrive in.
13
+
14
+ ## Two fields, and the separation between them is the point
15
+
16
+ | Field | Where | Controls | Values | Default |
17
+ |---|---|---|---|---|
18
+ | `mode` | `index.yaml` (global) **and** `components.yaml` (per component) | **Document depth** — only this | `catalog` · `outline` · `guarded` · `deep` | `catalog` |
19
+ | `risk_accepted` | `components.yaml`, per component | **Review intensity**, and the risk-acceptance record | `low` · `medium` · `high` | proposed by the agent, confirmed by the owner |
20
+
21
+ Both belong to the owner. They MUST NOT be merged, and neither MUST be derived from the other.
22
+
23
+ Merging them makes one legitimate position unsayable: *"this part is risky, I know, and I manage it with
24
+ tests and review — not with prose."* If depth were controlled by `risk_accepted`, the only route to a
25
+ thin document would be raising `risk_accepted` — which means **lying in the risk record** to buy the
26
+ depth you wanted. Recording what is accepted is the entire reason that field exists.
27
+
28
+ Project size MUST NOT appear as an input anywhere. Size decides how many components there are, not how
29
+ deep each one goes.
30
+
31
+ ### `mode` — two scopes, and the per-component one wins
32
+
33
+ | Scope | Where | Means |
34
+ |---|---|---|
35
+ | Global | `mode:` in `.control/registry/index.yaml` | The default for every component that does not state its own |
36
+ | Per component | `mode:` on the component's row in `components.yaml` | Wins over global. Written only where a component genuinely needs to differ |
37
+
38
+ Raising and lowering are both **free and need no justification** — it is a preference, and a preference
39
+ does not have to be defended.
40
+
41
+ **There is no third scope.** `mode` MUST NOT be overridden per wave or per `SPEC.md`. A wave MAY cross
42
+ several components, so a per-wave override would give one component two different depths depending on
43
+ which wave touched it — while the document is one, and living.
44
+
45
+ > Depth belongs to the component, not to the work.
46
+
47
+ ### The four modes
48
+
49
+ Each contains everything in the one to its left. Value names are English in YAML **and in prose** — one
50
+ thing, one name.
51
+
52
+ | `mode` | What is written for that component, beyond the blueprint | G4 |
53
+ |---|---|---|
54
+ | `catalog` | Nothing. Code is written from the use case catalogue, the three inventories, and C4 | **skipped** |
55
+ | `outline` | Full flow for the use cases the component exists for — at most 3 · local business rules · `Decision Summary` + the `LC` list in the SDD | 20 min |
56
+ | `guarded` | + **`Failure Behaviour` for every boundary** · `Inherited Constraints` · third-party integration documents | 20 min |
57
+ | `deep` | + ABCE robustness analysis · a contract spec per endpoint · data dictionary · flow diagrams · state machines · branch scenarios | 30 min |
58
+
59
+ **A component at `mode: catalog` skips G4 entirely**, and that is what makes a global `catalog` genuinely
60
+ fast. Control does not disappear; it moves to G3, where the use cases, tables, endpoints, screens, domain
61
+ model, and C4 were all approved.
62
+
63
+ **`guarded` is the mode most often needed and most often absent.** It buys the single most expensive thing
64
+ to lose — the answer to *"what happens if this fails halfway"* for each boundary — without buying the
65
+ machinery around it. It stands without ABCE because the boundary list already exists: the API inventory
66
+ names the endpoints, the screen inventory names the screens.
67
+
68
+ Nine things `mode` never touches: the use case list, the API list, the table list, the screen list, the
69
+ domain model, the actor list, the spine, C4 L1/L2/L3, and cross-component business rules. All nine belong
70
+ to the blueprint at G3, so they exist even at `catalog`. The complete per-file manifest is in
71
+ `.constitution/method/artifact-map.md`.
72
+
73
+ **Lowering `mode` deletes nothing.** A file already written stops being required, and that is all.
74
+
75
+ **Raising `mode` on a component whose code already runs** produces an **as-built record**, not a design.
76
+ The evidence labels in `sdd-guide.md` are mandatory there.
77
+
78
+ ### `risk_accepted` — review intensity, never depth
79
+
80
+ The direction is readable from the field name: `high` means *"I accept a lot of risk here"*, so its review
81
+ is the lightest.
82
+
83
+ `structure` and `prose` are the baseline everywhere. What `risk_accepted` decides is what is **added**:
84
+
85
+ | Value | Lenses on the documents | On the code |
86
+ |---|---|---|
87
+ | `low` | `structure` · `prose` · **`edge-case-hunter`** | a two-reviewer panel is **required** |
88
+ | `medium` | `structure` · `prose` · **`edge-case-hunter`** | — |
89
+ | `high` | `structure` · `prose` | — |
90
+
91
+ Review lenses are decided here and **nowhere else**. They MUST NOT be read off `mode`: one component MAY
92
+ sit at `mode: catalog` and still be reviewed the hardest.
93
+
94
+ Two things are not free, and `wdi-init` owns the conversation around both: `risk_accepted: high` on a
95
+ component touching money, personal data, an irreversible action, a contractual promise, or an
96
+ un-rollbackable integration requires a `DEC-` of `type: risk-acceptance` with `risk_accepted_by:` pointing
97
+ at it (V23) — and an outside party who will demand the artifacts as a deliverable puts the touched
98
+ component at `mode: deep` and `risk_accepted: low` whatever the global setting says.
99
+
100
+ ## Five gates
101
+
102
+ A gate is named for **what is decided there**, never for the work that precedes it. Owner time is spent at
103
+ these five points only; between them the agents work alone.
104
+
105
+ | Gate | Decides | How often | Budget | Varies by `mode`? |
106
+ |---|---|---|---|---|
107
+ | **G1 Problem** | What the problem is, whose it is, why it earns work | once | 20' | no |
108
+ | **G2 Product** | What is built, and how it feels to use | once per PRD | 45' | no |
109
+ | **G3 Blueprint** | The whole portrait: which use cases, their entities, tables, endpoints, screens, and the invariants binding them | **once per product** | 45' | no |
110
+ | **G4 Component** | How one Product Component is built, and what the choice costs | **once per Product Component** | 20–30' | **yes — the only one** |
111
+ | **G5 Release** | Whether it is done and proven | once per wave | 10' | flags only |
112
+
113
+ **Only one gate changes shape with `mode`.** That is what makes this holdable in one head: four of the five
114
+ are always the same, whatever the setting.
115
+
116
+ The word "area" is not used anywhere. There is only Product Component.
117
+
118
+ ### What is in the blueprint, and what is not
119
+
120
+ The most decisive boundary in the method. The previous run broke because "complete" was read as "fully
121
+ specified".
122
+
123
+ | In the blueprint — G3, once | Not in it — G4, per component |
124
+ |---|---|
125
+ | Actor list | Full UC flows |
126
+ | **Use case list**: one line per UC — id, title, actor, the `FR` it satisfies, `critical` | ABCE robustness analysis |
127
+ | Domain entities + relations + columns | Failure behaviour per boundary |
128
+ | **Table list**: one line per table plus its key columns | Data dictionary per column |
129
+ | **Endpoint list**: one line per endpoint | Five-lane contract spec per endpoint |
130
+ | **Screen list**: one line per screen | Field detail per form |
131
+ | **C4 L1 + L2 + L3** | Sequence and flow diagrams |
132
+ | Spine: `AD-N` only | State machines per entity |
133
+ | The error envelope and anything else cross-component | A component's local business rules |
134
+ | Business rules binding more than one component | Branch scenarios |
135
+
136
+ **Blueprint content is untouched by `mode` and by `risk_accepted`.** That is what keeps the order
137
+ non-circular: `mode` is first needed at G4, and it has been available since the tail of G2.
138
+
139
+ **G3 is written per component and gated once.** Both are true and it is not a compromise. The UC catalogue,
140
+ actors, and entities fall into each `<pc>`, so they parallelise with the component as the key. The gate is
141
+ one for the whole product, because its value is seeing the whole picture before choosing which component to
142
+ build. Gating per component means approving seven times, each time seeing a seventh of the picture.
143
+
144
+ Two blueprint contents cannot be per component: a per-component DB inventory is a lie because tables are
145
+ shared, and a per-component spine contradicts what a spine is.
146
+
147
+ **What is reviewed at G3 is the generated roll-up**, `.control/generated/blueprint.md`, not seven files. The
148
+ catalogue, actor list, and domain model stay in their component kernels as their permanent home; the roll-up
149
+ assembles them into one page to read. One fact, one home, one view.
150
+
151
+ ### `critical` — narrowed, and it decides something only at `deep`
152
+
153
+ A use case is `critical` when it touches **money, personal data, or an irreversible action.** That is the
154
+ whole definition. The two elastic criteria — "the reason this component exists" and "expensive to discover
155
+ late" — are **repealed**, because with them every use case passed.
156
+
157
+ If the count exceeds a third of a component's use cases, the definition was misapplied: derive it again. It
158
+ MUST NOT be negotiated.
159
+
160
+ ## Gate checklists
161
+
162
+ Each question is answered **ya / tidak / ubah**. One "tidak" on a ★ question holds the gate.
163
+
164
+ **On `mode: catalog`, only the ★ questions are asked** — fourteen across all five gates. The rest stay here
165
+ as material, and asking them is never wrong; requiring them is.
166
+
167
+ ### G1 Problem · 20'
168
+
169
+ 1. ★ Who experiences this problem, by name?
170
+ 2. ★ What single number proves this worked, three months from now?
171
+ 3. If we do not build it, what breaks or is lost?
172
+ 4. Who wins and who loses if this ships?
173
+ 5. What is the most fragile assumption here, and what does being wrong cost?
174
+ 6. What are we deliberately **not** doing?
175
+ 7. Is there a cheaper way to the same outcome?
176
+
177
+ ### G2 Product · 45'
178
+
179
+ 1. ★ For each `FR`: without it, can the user still finish their job? (yes → defer or drop)
180
+ 2. ★ Does every `FR` have a proof of done, in a sentence I understand?
181
+ 3. ★ Does this still make sense released on its own?
182
+ 4. Do the `NFR` numbers come from reality or from feeling?
183
+ 5. Can I retell the main UX flow in five sentences without opening the document?
184
+ 6. Which `FR` touch money, personal data, or the client's reputation?
185
+ 7. What changed from what I approved at G1, and why?
186
+
187
+ ### G3 Blueprint · 45'
188
+
189
+ Read against `.control/generated/blueprint.md`, not against seven files.
190
+
191
+ 1. ★ Is every use case title a sentence a user would say, not a system term?
192
+ 2. ★ Any `FR` with no use case? (the validator answers this, not an opinion)
193
+ 3. ★ Do the three inventories and the use case catalogue describe one system — nothing promised with
194
+ nowhere to live, nothing listed that nothing promised?
195
+ 4. Actor list: is one missing, or are two actually the same person?
196
+ 5. Does every `AD-N` name the concrete failure it prevents, and would breaking it in one component break
197
+ another?
198
+ 6. Which business rule am I not sure is right, and who at the client can confirm it?
199
+ 7. Is there still a term I have to guess the meaning of?
200
+
201
+ ### G4 Component · 20–30'
202
+
203
+ Skipped entirely at `mode: catalog`.
204
+
205
+ 1. ★ What is being staked in this component — and does `risk_accepted` say so out loud?
206
+ 2. ★ From `guarded` up: which boundary still has no answer for "the other side is slow, absent, or lying"?
207
+ 3. ★ What stops us starting tomorrow? (MUST be empty)
208
+ 4. ★ Validators green **and** the review leaving no open finding? (both — one is fact, one is judgement)
209
+ 5. Does any choice here lock us to one vendor or technology for more than a year?
210
+ 6. From the DAG: which story blocks the most other stories?
211
+ 7. Top risk: who owns it, and what is the pivot trigger to turn or give up?
212
+
213
+ ### G5 Release · 10'
214
+
215
+ 1. ★ Is every RTM row for this wave green?
216
+ 2. ★ Is every story's acceptance criteria proven by a test, not by an agent's statement?
217
+ 3. What was dropped from the plan, and where is it recorded?
218
+ 4. Are new risks found while building in the Risk Register?
219
+ 5. What one thing made this wave take longer than expected?
220
+ 6. What does the client need to know before this goes live?
221
+ 7. What is watched in the first week?
222
+
223
+ ## Units of work — `FR`, wave, `SPEC`, story
224
+
225
+ | Unit | Is | Lifetime |
226
+ |---|---|---|
227
+ | `FR-N` | One **feature** — one promise to a user. Born at G2 | permanent, lives across releases |
228
+ | wave | One **unit of work**. Opens at G4 or G5, closes at G5 | one slice of work |
229
+ | `SPEC.md` | The machine contract for **one wave**. A projection of `.what/` + `.how/`, and MUST NOT contain anything new | one wave |
230
+ | story | One piece taken by one builder to a green PR | one wave |
231
+
232
+ **One wave = one `SPEC` = one tracker Task.** One to one to one, with no compound joins.
233
+
234
+ A wave's scope is flexible and **ideally one `FR`**, because an `FR` is human-testable from birth — it has a
235
+ proof of done. One `FR` MAY span several waves, one wave MAY carry several small neighbouring `FR`, and a
236
+ wave MAY be a standalone slice of one large `FR`.
237
+
238
+ A wave MAY cross several Product Components. One condition: **G4 has passed for every component the wave
239
+ touches**, or that component is at `mode: catalog`, whose G4 is skipped by design (V22). That is why G4 and
240
+ the wave are deliberately different units — G4 decides *how one component is built*, a wave decides *which
241
+ work happens now*.
242
+
243
+ `SPEC.md` and story files **are not read by humans.** Both are machine contracts, and no review burden MAY
244
+ be moved onto them. The human review surface stops at the PRD, `.what/`, and `.how/`.
245
+
246
+ ### Mapping to a tracker
247
+
248
+ | Jira | WDI | Lifetime |
249
+ |---|---|---|
250
+ | Epic | Product Component | permanent — an Epic never closes |
251
+ | Task | **wave = `SPEC.md`** | one wave |
252
+ | Sub-task | story | one wave |
253
+ | Fix Version | release | one release |
254
+ | Label / custom field | the `CAP-N` and `FR-N` the wave satisfies | — |
255
+ | — a document, not an issue | `.what/` · `.how/` · `SPEC.md` | — |
256
+
257
+ **`FR` is not a Task.** It sits at the level of *promise*, not of *work*: one `FR` MAY be delivered by
258
+ stories in two waves, and one story MAY satisfy part of two `FR`. Mapping promise onto work-issue forces a
259
+ 1:1 that does not exist, and produces Tasks opened at G2 that hang across releases. `FR` travels as a label
260
+ on the Task.
261
+
262
+ **The corpus stays the source of truth; the tracker is a view.** Story status is read from story-file
263
+ frontmatter, never copied into two places.
264
+
265
+ **Parallelism.** Between stories through the `depends_on` and `touches` DAG; between waves through
266
+ `depends_on` at wave level. A wave that declares no dependency runs in parallel.
267
+
268
+ ## Wave size, and what it does not decide
269
+
270
+ | Size | Shape | Effect |
271
+ |---|---|---|
272
+ | **S** | ≤3 stories, no new `FR` | G4 and G5 merge into one 20-minute session |
273
+ | **M** | 4–12 stories | as usual |
274
+ | **L** | >12 stories, or a new container | the retrospective runs |
275
+
276
+ Size is recorded in `waves.yaml`. It MAY be raised mid-flight; it MUST NOT be lowered.
277
+
278
+ **Size does not choose which gates are active** — that is `mode`'s job. It only governs session merging and
279
+ whether the retrospective is required.
280
+
281
+ **Fast Path** skips every gate. It is available for a fix that changes no `FR`, `UC`, `AD-N`, or domain
282
+ model, is at most one story, and touches no money, personal data, or third-party integration. If an `FR`
283
+ turns out to be touched, work MUST stop and become a wave `S`.
284
+
285
+ ## Story-closing checklist — three items
286
+
287
+ Answered as each story finishes, before the next is picked up.
288
+
289
+ 1. A decision worth remembering? → `wdi-decision`. A story that contradicts an `AD-N` **stops** rather than
290
+ closing; that is the one case where recording is mandatory.
291
+ 2. A trap for the next agent? → recorded where the next agent will read it.
292
+ 3. Test names matching what `waves.yaml` records?
293
+
294
+ Five items left this list and did not disappear — they moved to **wave close**, where the information is
295
+ actually available: `LC` registration (V12), the `touches` check, SPEC companion distillation, and the
296
+ structure-map refresh. Registering an `LC` before a story was `ready-for-dev` demanded the answer at the
297
+ moment it was thinnest.
298
+
299
+ ## When something settled has to change
300
+
301
+ One trigger: **an artifact other people agreed to needs to change.** Run this matrix and reopen the gates it
302
+ names.
303
+
304
+ | What changes | MUST be re-reviewed | Gate reopened |
305
+ |---|---|---|
306
+ | Business Goal | The whole chain beneath it | G1 |
307
+ | `FR` — its **promise** | Related `UC`, decisions naming it, stories not yet `in-progress`, RTM rows | G2 then G3 |
308
+ | `FR` — its **wording** only | Nothing. The skill at work fixes it, one Revision History row per pass | none |
309
+ | `NFR` | Its enforcing decisions and tests | G4 |
310
+ | UX flow | Related use case specifications, stories not yet `in-progress` | G3 |
311
+ | Business rule | `UC` using it, related tests | G3 for a cross-component rule, G4 for a local one |
312
+ | An `AD-N` | Affected C4 components, stories not yet `in-progress` | G4 |
313
+ | Story acceptance criteria | That story's tests, its RTM row | none — the row going green again is enough |
314
+
315
+ The promise-versus-wording split is owned by `prd-guide.md` and MUST NOT be re-decided here.
316
+
317
+ - A story already `in-progress` MUST NOT have its contract changed. Stop it, return it to `ready-for-dev`,
318
+ then change it.
319
+ - Superseded artifacts are never deleted. Their status becomes `superseded` and points at the replacement.
320
+ - A change that cancels more than 30% of a wave's stories MUST go through `wdi-decision`, which wraps
321
+ `bmad-correct-course`, rather than being patched.
322
+
323
+ **A new PRD arriving after G3 amends the blueprint; it does not repeat it.** The new components are born,
324
+ their rows join the catalogue and the three inventories, and **G3 reopens over the delta only**. The
325
+ 45-minute session does not run again for one additional initiative.
326
+
327
+ ## Roles
328
+
329
+ | Role | Does | Does not |
330
+ |---|---|---|
331
+ | Product Owner | Answers the checklists, decides at the five gates, sets `mode` and `risk_accepted`, owns risk | Write artifacts, read machine contracts |
332
+ | Agent at G1–G3 | Writes the brief, the PRD, and the blueprint | Decide depth or accept risk |
333
+ | Agent at G4 | Writes one component's behaviour and mechanism | Write code |
334
+ | Builder | One story through to a green PR | Change `.what/`, `.how/`, or an `applied` decision |
335
+ | Review panel | Two different CLI families, neither the builder's | Give a final verdict — findings are adjudicated by the coordinator |
336
+
337
+ Panel composition and CLI/model selection are governed by the global Agent Rules and MUST NOT be restated
338
+ here.
@@ -0,0 +1,202 @@
1
+ ---
2
+ status: Accepted
3
+ ---
4
+
5
+ # PRD Guide
6
+
7
+ **Loaded when:** writing, updating, or validating a PRD
8
+
9
+ A PRD states what the product promises a user for one functional area. It does not describe how the
10
+ system behaves — that is `SRS-<pc>.md` — and it does not describe how it is built — that is
11
+ `SDD-<pc>.md`. When a sentence here could only be checked by reading code, it is in the wrong file.
12
+
13
+ ## Home and life cycle
14
+
15
+ - One PRD per **initiative / functional area**. It MUST live at `.what/_prd/<initiative>/prd.md`,
16
+ with `addendum.md` beside it. Set through `prd_output_path` and `run_folder_pattern` in
17
+ `_bmad/custom/bmad-prd.toml`.
18
+ - A PRD is a **living document**. It MUST NOT be frozen, archived, or superseded when a release
19
+ ships.
20
+ - Memlog MUST go to `.control/memlog/prd-<slug>.md` via `--path`, with the slug matching the folder.
21
+ `--workspace` MUST NOT be used; it would leave a `.memlog.md` inside `.what/`.
22
+ - `run_folder_pattern` ships as `ISI-slug-inisiatif`, which is deliberately unusable. A PRD found in
23
+ a folder by that name means the override was never pointed at a real initiative slug; `wdi-product`
24
+ check 1 catches it, and it MUST be moved before G2.
25
+
26
+ ## Update, or a new PRD
27
+
28
+ This is the decision the guide exists for, and the default is **Update**.
29
+
30
+ | Situation | What to do |
31
+ |---|---|
32
+ | Behaviour of an existing promise changes | Update |
33
+ | A promise turns out to be wrong and must be withdrawn | Update — and the withdrawal MUST be visible in Revision History, not silently deleted |
34
+ | A new feature that a reader would expect to find in this PRD | Update |
35
+ | The next release extends what this PRD already promises | Update. A release is never a reason on its own |
36
+ | A functional area a reader would not think to look for here | New PRD |
37
+
38
+ The test is the reader, not the calendar: **would someone looking for this promise open this
39
+ document?** If yes, it belongs here however large the change. A PRD MUST NOT be split because it
40
+ grew long — length is what `addendum.md` and feature grouping are for. It is split only when the two
41
+ areas have different readers, different stakeholders, or no shared vocabulary.
42
+
43
+ When a split is genuinely right, the existing PRD MUST keep its own IDs. `FR-N` never moves between
44
+ PRDs; the sequence is global to the product.
45
+
46
+ ## One home, and what `.what/<pc>/` may take from it
47
+
48
+ A PRD is the **reference** the blueprint and each component work from, not a quarry. `.what/<pc>/` is distilled from it — the
49
+ same promise restated as behaviour, at the altitude a builder needs — and the PRD stays the one place
50
+ that promise lives.
51
+
52
+ - One PRD per initiative. Its content MUST NOT be split into pieces spread across `.what/<pc>/`, and
53
+ a fragment MUST NOT be moved out of it. A promise with two homes drifts, and the copy people read
54
+ is whichever they open first.
55
+ - `.what/<pc>/` MUST cite the `FR`/`NFR` it realises by ID rather than restating its text. A use case
56
+ saying what the system does is derivation; a use case reproducing the PRD's paragraph is a second
57
+ copy.
58
+ - One initiative MAY span several Product Components, and one component MAY serve several PRDs. That
59
+ is why neither can absorb the other — `corpus-guide.md` owns the two-axis rule.
60
+ - When the distillation proves a promise cannot be behaved into, the PRD changes first, through
61
+ `wdi-product` intent `update`. The SRS MUST NOT narrow it quietly.
62
+
63
+ ## Revision History
64
+
65
+ - Every `update` run MUST add **exactly one row**, appended at the bottom — one row per **pass**, never
66
+ one per correction.
67
+ - Rows MUST be written for someone who was not in the room — a client, a sponsor, an auditor. State
68
+ what the promise now is, not which section was edited. "Payment retries now cap at three attempts,
69
+ down from unlimited, because support could not explain the charges" is a row. "Updated §4.2" is
70
+ not.
71
+ - The `Releases affected` column names the releases whose promise changed. It MUST match
72
+ `target_release` on the affected `CAP` entries.
73
+ - A row MUST NOT be edited after the run that wrote it. A correction is a new row.
74
+
75
+ The boundary against the memlog matters and MUST NOT be collapsed:
76
+
77
+ | | Memlog | Revision History |
78
+ |---|---|---|
79
+ | Records | Every decision, change, override, assumption inside a run | What changed for the reader |
80
+ | Written | Continuously, by `memlog.py`, append-only | Once per run, by hand |
81
+ | Read by | The next run, and audits | Anyone opening the PRD |
82
+ | Lives in | `.control/memlog/` | The PRD itself |
83
+
84
+ Neither MUST be written in place of the other. A PRD whose only change record is the memlog is
85
+ unreadable to the people it was written for.
86
+
87
+ ## Release lives in the registry
88
+
89
+ Release MUST NOT be expressed through this document's folder name, title, or frontmatter. It is
90
+ carried by:
91
+
92
+ | Field | Answers |
93
+ |---|---|
94
+ | `CAP.target_release` | Which release this capability is planned for. **The only place a promise's release is written** |
95
+ | `waves.yaml` `release` | Which release a wave of work belongs to — the execution side |
96
+
97
+ An `FR` MUST NOT carry a release of its own. It inherits one from its `CAP`, the same way it reaches
98
+ its `BG`: each child names only its parent. A capability whose requirements genuinely land in
99
+ different releases is two capabilities, and MUST be split rather than annotated.
100
+
101
+ Naming a release in prose as context MAY happen; the registry is what binds.
102
+
103
+ ## Numbering
104
+
105
+ `BG-N`, `CAP-N`, `FR-N`, `NFR-N`, and `UJ-N` MUST be allocated from `.control/registry/requirements.yaml`
106
+ and MUST NOT restart at 1. The chain runs `BG → CAP → FR/NFR → UC → DEC → Story → Test`, and each
107
+ child names only its parent:
108
+
109
+ - Each feature in §4 MUST declare its `CAP-N` and the `BG-N` it serves.
110
+ - Each `FR` MUST declare its `capability`. Its goal is reached *through* the capability and MUST NOT
111
+ be restated on the FR.
112
+ - Each `NFR` attaches to `BG` directly — it does not pass through `CAP`.
113
+
114
+ V15 checks both links. An FR with no capability is a promise nobody asked for.
115
+
116
+ ## Proof of done — one, in business language
117
+
118
+ Every `FR` MUST carry **exactly one** proof of done: a sentence a Product Owner can check without opening
119
+ the code. It is what lets one `FR` become one testable unit of work, and it is why a wave is ideally one
120
+ `FR`.
121
+
122
+ **The double proof of done is repealed.** Requiring a business sentence *and* a technical restatement
123
+ naming status codes, limits, and payloads meant writing the same acceptance twice, in two vocabularies that
124
+ then drifted. The technical form is represented by the **test name** recorded in `waves.yaml`, where it is
125
+ checked mechanically (V4) instead of read.
126
+
127
+ A technical detail that genuinely has to be written down belongs in `addendum.md` or in the SDD, not in a
128
+ second proof of done.
129
+
130
+ ## Wording versus promise — two different journeys
131
+
132
+ The distinction this guide exists to protect, and the one that produced three corrections that ended
133
+ "reported but not fixed":
134
+
135
+ | What changes | Route |
136
+ |---|---|
137
+ | The **wording** of an `FR` — a wrong cross-reference, a retired term, a word no longer consistent with an `applied` decision, while **the promise is the same** | The skill already at work fixes it directly. Recorded in the memlog, and **one** Revision History row per pass, not per correction |
138
+ | The **promise** of an `FR` — scope changes, the proof of done changes, an `FR` is retired or born | `wdi-product` intent `update`, and the change-control matrix in `delivery-flow-guide.md` says which gates reopen |
139
+
140
+ The guard against abuse is already in the Revision History rule: a row is written for someone who was not in
141
+ the room. A wording correction produces no row a client would find interesting, and that is precisely the
142
+ evidence it was not a change of promise.
143
+
144
+ Treating a wording fix as a promise change is not caution — it is what made three corrections queue behind a
145
+ gate and then get dropped.
146
+
147
+ ## `owns:` — one entity, one writer
148
+
149
+ A domain entity MUST have exactly one owner authorised to write it. Usually that is a Product Component,
150
+ declared as `owns:` on its row in `components.yaml`; an `FR` from another PRD that needs to change the entity
151
+ MUST point at the owner's `FR` through `defers_to`, rather than promising to write it itself. V21 checks this.
152
+
153
+ **A few entities belong to no Product Component at all** — a product-wide setting, the trace of one shared
154
+ outbound channel. Those are owned by `_platform` through `platform_owns`, and the test for when that is
155
+ legitimate lives in `corpus-guide.md`. `_platform` has no `FR`, so an `FR` writing a platform-owned entity is
156
+ **not** asked for a `defers_to`; what binds instead is the shape documented in `cross-cutting.md`. Reaching
157
+ for `_platform` because the owner is hard to decide is the one use of it that the test refuses.
158
+
159
+ This is not theoretical: two PRDs have already collided semantically over one shared numbering series. Two
160
+ `FR` claiming write authority over the same entity, with neither pointing at the other, is a defect at the
161
+ moment it is written — not at the moment the code disagrees.
162
+
163
+ ## Sections that stop being optional
164
+
165
+ BMad's Adapt-In Menu is conditional by design. Two clusters MUST always be present here:
166
+
167
+ | Cluster | Why it is required |
168
+ |---|---|
169
+ | **Cross-Cutting NFRs** | G2 passes on numbered FR **and NFR**. Each NFR MUST name `enforced_by` — an `AD-N`, a `DEC-`, or a test name. An NFR nothing enforces is decoration (V5) |
170
+ | **Constraints and Guardrails** | A constraint found at G4 costs a decision that one sentence here would have prevented |
171
+
172
+ Constraints MUST state only the delta beyond `.what/_product-brief/brief.md`, and MUST say "none
173
+ beyond the brief" when there is nothing. An absent section reads as "not checked".
174
+
175
+ Prerequisites MUST NOT be written as prose. An initiative blocked on another is a `depends_on`
176
+ between `CAP` entries.
177
+
178
+ ## What goes to `addendum.md`
179
+
180
+ `addendum.md` is **not** a change log — Revision History is. It holds depth that belongs downstream
181
+ or earned its place but does not fit the narrative: rejected-alternative rationale, options matrices,
182
+ mechanism and transport decisions, technical how, in-depth personas, sizing data.
183
+
184
+ Content MUST be captured there *during* the conversation when the user volunteers it, not swept
185
+ there at Finalize. What in the addendum turns out to bind a later document MUST be written into that
186
+ document by the skill owning its layer, rather than cited from the addendum forever.
187
+
188
+ Audit and override information MUST NOT go to the addendum; it belongs in the memlog.
189
+
190
+ ## Passing G2
191
+
192
+ - Every `[ASSUMPTION]` still unresolved at Finalize MUST be filed through `wdi-question` before the gate
193
+ opens — into `assumptions.md` by default, and into `blocking.md` only through the three tests that file
194
+ states. Filing one as blocking "to be safe" is the habit that produced 146 ids.
195
+ - `bmad-review` runs automatically through `doc_standards` on `prd.md` and `addendum.md`. It MUST
196
+ have run before the gate — a Product Owner's 45 minutes are for deciding, not proofreading.
197
+ - The gate reads `prd.md` and `EXPERIENCE.md` together. A PRD that passes while the experience side
198
+ is missing has answered only half of what G2 decides.
199
+ - Solution shape MUST NOT appear. If a sentence names a framework, a table, or a transport, it belongs in
200
+ `addendum.md` or in the spine.
201
+ - Invoke through `wdi-product`, never `bmad-prd` directly — the wrapper is what checks the rules on this
202
+ page and lands the memlog.