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,203 @@
1
+ ---
2
+ name: wdi-blueprint
3
+ description: Use at G3 Blueprint — the one whole-product portrait, written once. Two intents, catalog and platform. Owns the use case catalogue, actors, domain model, cross-component business rules, the glossary, the spine, C4, cross-cutting, and the three inventories. Never writes a single component's depth.
4
+ ---
5
+
6
+ # WDI Blueprint
7
+
8
+ G3 decides **the whole portrait of the system**: which use cases exist, their entities, their tables, their
9
+ endpoints, their screens, and the invariants that bind everything built from them. Once per product.
10
+
11
+ Two intents, run in this order:
12
+
13
+ | Intent | Writes | Wraps |
14
+ |---|---|---|
15
+ | `catalog` | Per `<pc>`: § Actor Register · § UC Catalogue · `03-domain/domain-model.md`. Product level: `.what/business-rules.md` · `.control/product-glossary.md` · `usecases.yaml` | — |
16
+ | `platform` | `.how/_platform/`: the spine · C4 L1/L2/L3 · `cross-cutting.md` · the three inventories. Registry: `containers` | `bmad-architecture` |
17
+
18
+ **Blueprint content is untouched by `mode` and by `risk_accepted`.** Everything above exists at every mode,
19
+ including `catalog`. That is what keeps the order non-circular: `mode` is first needed at G4.
20
+
21
+ You MUST NOT write a single component's depth — full UC flows, local rules, failure behaviour, contracts. All
22
+ of that is `wdi-component` at G4. You MUST NOT write a promise; when the blueprint proves a PRD wrong, that is
23
+ `wdi-product`, not a quiet edit here.
24
+
25
+ ## Inputs
26
+
27
+ | Source | What it answers |
28
+ |---|---|
29
+ | `.what/_product-brief/brief.md` | The problem, the primary user, the boundary the portrait MUST respect |
30
+ | `.what/_prd/*/prd.md` — **every one** | Every promise made: the `FR`/`NFR` the portrait has to cover |
31
+ | `.control/registry/components.yaml` | Which components exist, and their `owns:` |
32
+ | `.control/product-glossary.md` | Terms already fixed |
33
+ | `.control/decisions/` | `accepted` and `applied` decisions an `AD-N` usually sits behind |
34
+ | `src/` · `web/` | What actually runs, when this is not a new project |
35
+ | `.constitution/document/srs-guide.md` · `architecture-guide.md` | The rules the result is checked against |
36
+
37
+ ## Step 1 — Position
38
+
39
+ - The components MUST already exist. If `components.yaml` holds no `product_components`, route to `wdi-init`
40
+ intent `component` — the slicing is born at the tail of G2, from the brief plus every PRD.
41
+ - `catalog` runs before `platform`. The spine is written against a portrait that exists.
42
+ - If the spine and C4 set already exist, `platform` is an **amendment**, never a create. A second create
43
+ overwrites what three waves of annotation put there.
44
+ - If the ask is one component's mechanism or its full flows, route to `wdi-component`.
45
+ - If the ask is what the product promises, route to `wdi-product` — an invariant is not a promise.
46
+
47
+ ## Step 2 — Intent `catalog`, in order
48
+
49
+ The order is binding, and each step is the input to the next. Writing them out of order produces use cases
50
+ whose nouns nobody defined.
51
+
52
+ 1. **Glossary.** Every domain noun, into `.control/product-glossary.md`, alphabetically, each citing the
53
+ document and section its definition came from. You MUST NOT invent a definition — cite a source, or route
54
+ the term to `wdi-question`. Two words meaning one thing is **drift**, and it MUST be resolved to one word
55
+ in the same pass, with the losing synonym corrected in the documents that use it.
56
+ 2. **UC Catalogue**, per component. One line per use case: `UC-N` · title · actor · the `FR` it satisfies ·
57
+ `critical` yes/no. A title MUST be a sentence a user would say, not a system term.
58
+ 3. **Actor Register**, per component. It stays in the SRS kernel; it is the SSOT the SDD mirrors.
59
+ 4. **Domain model** — entities, relations, columns — into `.what/<pc>/03-domain/domain-model.md`. Conceptual;
60
+ database column types belong to `.how/`.
61
+ 5. **Cross-component business rules** into `.what/business-rules.md`. A rule binding only one component is
62
+ G4 work and MUST NOT be written here.
63
+
64
+ `critical` means the use case touches **money, personal data, or an irreversible action**. Nothing else. If
65
+ the count passes a third of a component's use cases, derive it again — `delivery-flow-guide.md` owns the rule
66
+ and it MUST NOT be negotiated.
67
+
68
+ **A method term MUST NOT be written into `.constitution/method-glossary.md`.** A product term binds one
69
+ project; a method term binds every project the method is installed in. Raise it as a proposal, state where it
70
+ appeared and why the existing vocabulary does not cover it, and hand it to the owner.
71
+
72
+ ## Step 3 — Parallel where there is a key, serial where there is not
73
+
74
+ This is not theory. In the previous run, 41 cross-component business rules from seven parallel agents had to
75
+ be merged and de-duplicated **serially**, because the target file had no key — and that merge was the most
76
+ expensive part of the pass.
77
+
78
+ > Parallel fan-out is only for output with a natural key. Output that is a shared list with no key MUST be
79
+ > written by one agent that reads the whole input.
80
+
81
+ | Work | Parallel? | Key |
82
+ |---|---|---|
83
+ | UC catalogue, actors, entities per component | yes | Product Component |
84
+ | Glossary, cross-component business rules, the spine | **no** | there is none |
85
+ | The three inventories | yes, one agent per source | table · endpoint · screen |
86
+
87
+ Three guards when running parallel: each agent writes only its own keyed file; shared files are written in one
88
+ serial pass afterwards; the owner reviews the merged result, not N agent reports. Open questions from N agents
89
+ arrive as **one** ranked batch.
90
+
91
+ ## Step 4 — Intent `platform`
92
+
93
+ Dispatch `bmad-architecture` at **initiative** altitude for the spine. Do not restate the rules to it — they
94
+ arrive through `persistent_facts` in `_bmad/custom/bmad-architecture.toml`, which installs
95
+ `architecture-guide.md` there rather than as `doc_standards` deliberately.
96
+
97
+ Then verify and land:
98
+
99
+ | # | Check | Fails when |
100
+ |---|---|---|
101
+ | 1 | Home | The spine landed anywhere but `.how/_platform/ARCHITECTURE-SPINE.md` |
102
+ | 2 | Every `AD-N` carries Binds, Prevents, and Rule | One is blank — an `AD-N` with no Prevents is a preference |
103
+ | 3 | Every `AD-N` is an invariant | Breaking it in one component would not break another. It is a seed, and MUST be marked as one |
104
+ | 4 | Stack, tree, and data shapes marked as seeds | Written as contracts, which makes the spine wrong at the first upgrade |
105
+ | 5 | No alternatives or cost in the spine | Those live in the `DEC-` behind it; a second copy drifts |
106
+ | 6 | Nothing but invariants | A statement affecting one component only — that is its SDD |
107
+ | 7 | Memlog at `.control/memlog/spine.md` | A `.memlog.md` appeared inside `.how/` — `--workspace` was used |
108
+
109
+ Check 7 MUST be fixed immediately. V16 rejects a memlog inside the corpus.
110
+
111
+ **Land the C4 set by amending, never overwriting.** The files are living and already carry annotations,
112
+ including a pre-method provenance note that MUST survive. When the incoming set contradicts an annotation
113
+ already there, you MUST stop and report it, and MUST NOT resolve it by preferring the newer drawing. Where a
114
+ C4 file and the spine disagree, the spine wins and the disagreement MUST be reported. One
115
+ `c4-l3-<container>.md` per `built: true` container **holding more than one Product Component**. A
116
+ `built: false` container gets no L3 at all, and a one-PC container needs none because the L2 matrix already
117
+ places it. **Not one of the three waits for a wave** — `architecture-guide.md` owns that.
118
+
119
+ **Register the containers** in `containers:` in `components.yaml`, in the same act as landing the L2. It is
120
+ not a follow-up, and it unblocks everyone else: an `LC` MUST name its container.
121
+
122
+ Each container MUST carry `built:` — `true` when we write what is inside it, `false` when we deploy
123
+ someone else's implementation. It decides whether the container gets an L3, an `LC`, and a heading in the
124
+ codebase map (V25). Something whose **runtime we do not deploy** is an external system: it belongs at L1,
125
+ and registering it here promises a codebase-map section that will never exist.
126
+
127
+ **Fill each PC's `containers:` in the same act, and land the matrix at L2** — the registry is the SSOT and
128
+ the L2 table renders it. A PC MUST list every `built: true` container it lives in; listing only the main
129
+ one is the error the matrix exists to catch. Complete for every PC at G3, untouched by `mode`.
130
+
131
+ You MUST NOT register a
132
+ `product_component` or a `logical_component`.
133
+
134
+ **Register what `_platform` owns** in the same pass — a domain entity through `platform_owns`, an inventory
135
+ row through that inventory's `platform_rows:`, an `LC` through its `component:`. The test is in
136
+ `corpus-guide.md` and both halves MUST hold. Each one MUST then be described under `## Milik platform` in
137
+ `cross-cutting.md`, in the same act: V21 checks that second half, because owning something without
138
+ documenting it is taking ownership without taking responsibility.
139
+
140
+ A judgement the pattern cannot derive MUST live in the artifact it governs, not in a script and not in a
141
+ skill: an inventory's `platform_rows:` and `states:` are declared in that inventory's own frontmatter, so
142
+ re-derivation preserves them. Anywhere else, the next run deletes the owner's decision.
143
+
144
+ `_platform` is **not** a Product Component. You MUST NOT give it a `mode`, a `risk_accepted`, an SRS, or a
145
+ G4, and you MUST NOT move an entity there because its owner is hard to decide.
146
+
147
+ ## Step 5 — The three inventories
148
+
149
+ They land in `.how/_platform/` with **one owner: this skill.** No negotiation with `wdi-ux`, and no second
150
+ copy inside any SDD.
151
+
152
+ | State | How each is born |
153
+ |---|---|
154
+ | No code yet | Written as a **plan** — the tables, endpoints, and screens intended. Nothing can be derived, because there is no source |
155
+ | Code exists | **Derived first** by `.constitution/scripts/inventory.py` — migrations for tables, route registration for endpoints, pages for screens — then compared with the plan. The difference is a **finding**, not hand work |
156
+
157
+ An inventory MUST NOT be assembled from a README or from route names that look plausible. Numbers are stable:
158
+ a new row takes the next number, never a renumber.
159
+
160
+ ## Step 6 — The roll-up, and what the owner actually reads
161
+
162
+ Regenerate `.control/generated/blueprint.md` with `validate.py --generate`. It assembles the UC catalogue, the
163
+ actor lists, the domain model, and the three inventories into **one page**.
164
+
165
+ **That page is what G3 reviews** — not seven files. The catalogue and actors stay in their component kernels as
166
+ their permanent home; the roll-up is a view. One fact, one home, one view.
167
+
168
+ You MUST NOT hand-write anything under `.control/generated/`.
169
+
170
+ ## Step 7 — Review and questions
171
+
172
+ - No `doc_standards` fires for an SRS or for the spine. Dispatch `wdi-review`, which reads the lens set from
173
+ each component's `risk_accepted`.
174
+ - You MUST NOT open G3 on a portrait that has not been through it.
175
+ - Every unresolved to-be-confirmed MUST be filed through `wdi-question`, in **one** ranked batch — into
176
+ `assumptions.md` by default, `blocking.md` only through its three tests.
177
+ - A decision surfacing while writing goes to `wdi-decision`, never into the document as a parenthetical.
178
+ - An `AD-N` that reverses or narrows an earlier one MUST go through `wdi-decision` first. Editing an `AD-N` in
179
+ place is how a reversal happens with nobody deciding it.
180
+
181
+ ## Step 8 — A PRD that arrives after G3
182
+
183
+ The blueprint is **living and amended**, not repeated. `wdi-init` intent `component` births the new
184
+ components, this skill adds their rows to the catalogue and the three inventories, and **G3 reopens over the
185
+ delta only**. The 45-minute session does not run again for one additional initiative.
186
+
187
+ ## Rules
188
+
189
+ - You MUST NOT write into `.how/<pc>/`, and `design-system.md` in `_platform/` belongs to `wdi-ux`.
190
+ - You MUST NOT regenerate the C4 set from scratch. The loss of annotations is invisible in a diff that reads
191
+ as a rewrite.
192
+ - You MUST NOT raise `status:`. Status is a stage; the `reviewed:` block is an event.
193
+ - You MUST NOT write a definition into `.constitution/` at all — not the method glossary, not a guide.
194
+ - When the portrait cannot be drawn because a PRD has not settled what it must cover, say so and stop.
195
+ - Memlog: one per Product Component at `.control/memlog/<pc>.md`, plus `.control/memlog/spine.md` for
196
+ `platform`, through `memlog.py --path`. `--workspace` MUST NOT be used.
197
+
198
+ ## Output
199
+
200
+ Intents run · the catalogue and inventories as counts, per component · glossary terms written, proposed, and
201
+ rejected with the rule that rejected each · the `AD-N` that are new or changed · what was amended in the C4
202
+ set and what contradicted it · containers registered · plan-versus-code differences reported · whether the
203
+ roll-up regenerated and `wdi-review` ran · the one ranked batch of questions.
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: wdi-build
3
+ description: Use at G5 Release — one wave from open to closed in one supervised run. Opens the wave, runs bmad-spec, ships every story to a green PR through a five-step pipeline, then closes the wave. One invocation, not four.
4
+ ---
5
+
6
+ # WDI Build
7
+
8
+ One unit of work, one invocation. A wave used to need four calls — open it, run `bmad-spec`, ship each story,
9
+ close it — and three of those were bookkeeping. They are all in here now, because a unit of work that needs
10
+ four invocations gets three of them skipped.
11
+
12
+ **REQUIRED SUB-SKILL:** MUST dispatch, wait, and escalate through `orchestration`. Worker CLI/model/effort MUST
13
+ come from the Orca Agent Dispatch tables in the user's Agent Rules; this skill MUST NOT restate them.
14
+
15
+ The coordinator (this session) holds every judge call, the registries, and every remote git action. Dispatched
16
+ workers hold the spec and the code.
17
+
18
+ ## Precondition, and the one that is easy to miss
19
+
20
+ | Check | When it fails |
21
+ |---|---|
22
+ | Every component this wave touches has passed G4, **or** sits at `mode: catalog` | Route to `wdi-component`. V22 checks it, and `catalog` skipping G4 is by design, not an exception |
23
+ | An isolated worktree | Isolate first. MUST NOT run in a shared checkout |
24
+ | Every `prd` slug names a real `.what/_prd/<initiative>/` folder | A wave without a promise covering it is a wave nobody agreed to (V17) |
25
+
26
+ The repo commits straight to `main` and opens a PR only when asked. **Invoking this skill is that ask**, for
27
+ this wave only; it MUST NOT be read as standing permission for the next change.
28
+
29
+ ## Phase 1 — Open the wave
30
+
31
+ Record it in `.control/registry/waves.yaml`:
32
+
33
+ | Field | Rule |
34
+ |---|---|
35
+ | `id` | `W<N>`, monotonic, never reused |
36
+ | `release` | MUST be stated. The release↔wave cadence is situational and MUST NOT be inferred from numbering (V17) |
37
+ | `prd` | MUST be stated: which initiative PRDs this wave delivers against. MUST NOT be derived from `release` |
38
+ | `fr` | The `FR` this wave satisfies. Ideally one — an `FR` is human-testable from birth |
39
+ | `size` | `S` · `M` · `L`. MAY be raised mid-flight; MUST NOT be lowered |
40
+ | `depends_on` | At **wave** level. A wave declaring none runs in parallel with its neighbours |
41
+ | `spec_folder` | One per wave, not one per wave × component |
42
+ | `epics` → `stories` | With `satisfies: [UC]`, `depends_on`, `touches`, and test names |
43
+
44
+ Story **status** MUST NOT be copied into `waves.yaml`. It is read from story-file frontmatter when
45
+ `.control/generated/` regenerates (V18). Two homes for one fact is how registries start lying.
46
+
47
+ Size does not choose which gates are active — that is `mode`'s job. It governs session merging (`S` merges G4
48
+ and G5 into one 20-minute session) and whether the retrospective runs (`L`).
49
+
50
+ ## Phase 2 — The SPEC
51
+
52
+ Dispatch `bmad-spec` for the wave, slug `w<N>-<slug>`. **One wave = one `SPEC` = one tracker Task**, with no
53
+ compound joins.
54
+
55
+ `SPEC.md` is a **projection** of `.what/` + `.how/` onto this wave and MUST NOT introduce anything new. When it
56
+ needs something that is not in either, the gap is upstream: route to `wdi-component` or `wdi-blueprint`, and do
57
+ not let the SPEC invent it.
58
+
59
+ `SPEC.md` and story files **are not read by humans.** Both are machine contracts, and no review burden MAY be
60
+ moved onto them. `wdi-review` MAY still be dispatched over the SPEC; its trace lands on the wave in
61
+ `waves.yaml`, because `bmad-spec` is the sole author of the file and overwrites hand edits.
62
+
63
+ ## Phase 3 — Ship each story
64
+
65
+ Steps 1–2 run `bmad-build-auto` under **folder+id dispatch**: the coordinator supplies `spec_folder` and
66
+ `story_id`, and the worker resolves everything else from `{spec_folder}/stories.yaml` and `SPEC.md`.
67
+
68
+ | # | Step | Engine | Exit condition |
69
+ |---|---|---|---|
70
+ | 1 | Plan | `bmad-build-auto` + `Halt after planning.` | Spec frontmatter reads `status: ready-for-dev` |
71
+ | 2 | Build | `bmad-build-auto` given the spec path | Spec frontmatter reads `status: done` |
72
+ | 3 | Panel | `bmad-code-review` | Panel adjudicated, zero unresolved must-fix |
73
+ | 4 | Publish | — | Branch pushed, PR open, story-closing checklist answered |
74
+ | 5 | CI | — | All checks conclude green on the pushed head SHA |
75
+
76
+ ### Engine rules
77
+
78
+ - MUST judge a step from the spec's frontmatter `status`. A worker's chat report MUST NOT settle it.
79
+ - Every step MUST go to a **fresh** worker, and a fix round MUST NOT go back to the worker that produced the
80
+ code. The spec carries everything the next worker needs, and inherited context is how a step stops judging
81
+ the artifact on its own merits.
82
+ - MUST launch every worker with its Unattended flag, and MUST confirm each started from observed activity —
83
+ never from a readiness match alone.
84
+ - MUST NOT dispatch to a CLI that cannot spawn subagents. `blocked / no subagents` is a CLI capability failure,
85
+ not a story failure: re-dispatch the same step on the other CLI in that row.
86
+ - MUST NOT reorder or drop a step. A step with nothing to do MUST be reported as such, not skipped silently.
87
+ - A spec already at `status: blocked` MUST be repaired and its status reset before re-dispatch.
88
+
89
+ ### What every worker brief MUST carry
90
+
91
+ Three rules this corpus adds. All three MUST be stated in the dispatch of any step that writes code.
92
+
93
+ - **Debugging is conditional, never a phase.** When a test or build fails and the cause is not known, the
94
+ worker MUST run `wdi-systematic-debugging` before proposing any fix. A third failed fix attempt is the signal
95
+ to escalate, not to try a fourth.
96
+ - **The corpus is not the worker's to change.** A worker MUST NOT edit `.what/`, `.how/`, or an `applied`
97
+ `DEC-`. A deviation from the SDD or an `AD-N` is **reported**, and it becomes a `DEC-` through
98
+ `wdi-decision` — never absorbed as a code patch.
99
+ - **Verification is run, not assumed.** `go build ./...` and `go test ./...` from `src/`, where `go.mod` lives;
100
+ `npm run check` from `web/`. A green `korpus.yml` MUST NOT be reported as proof the code compiles.
101
+
102
+ ### Step 1 — plan
103
+
104
+ - MUST include `Halt after planning.` Without it the worker runs straight through implementation and Step 2
105
+ loses its gate.
106
+ - Validation is not a separate step. Step-02's READY-FOR-DEVELOPMENT gate verifies the spec, repairs it once,
107
+ and re-verifies. MUST NOT wrap a second validation loop around it.
108
+ - `blocked / spec failed ready-for-development standard` means that repair did not converge. MUST escalate the
109
+ failing criteria; MUST NOT hand-patch the spec into a pass.
110
+ - `blocked / intent gap` MUST reach the owner with the worker's unanswered questions verbatim.
111
+
112
+ ### Step 2 — build
113
+
114
+ - MUST dispatch with the spec file path and the three brief rules above. The worker commits locally and **never
115
+ pushes**.
116
+ - `blocked / review repair loop exceeded 5 iterations` means its internal loop did not converge. MUST escalate;
117
+ MUST NOT re-dispatch for a sixth.
118
+ - On `blocked / intent gap` the worker has reverted the code and saved a patch file. MUST retrieve that patch
119
+ path from the triage log before escalating — the work is recoverable, and losing it costs the whole step.
120
+
121
+ ### Step 3 — panel, then judge
122
+
123
+ Panel composition follows `risk_accepted`: at `low` a two-reviewer panel is **required** on the code; at
124
+ `medium` and `high` it is available and SHOULD be used when the diff touches money, personal data, or a third
125
+ party. The Agent Rules `bmad-code-review panel` section defines the pairing, and it MUST be followed exactly —
126
+ the worker's own review layers are same-family by construction and never satisfy it.
127
+
128
+ - MUST adjudicate every contested finding by reading the cited lines. Votes MUST NOT settle a finding. A finding
129
+ neither reviewer can locate in the diff is dismissed with that reason stated.
130
+
131
+ **MUST return to Step 2:**
132
+
133
+ - Breaks a story AC, or contradicts the SPEC, the SDD, an `AD-N`, or an `applied` `DEC-`
134
+ - Wrong behaviour, crash, or data loss reachable from the running app
135
+ - Corpus drift: an `LC` touched but not registered, a contract changed in code but not in `02-contracts/`, a
136
+ screen added without its `01-ux/` entry
137
+ - An enum value rendered straight to the screen instead of read off its label map
138
+ - Payment or private data reaching a tracked file
139
+ - A weakened guard, or a test that cannot fail — including one asserting a literal instead of the behaviour it
140
+ claims to cover
141
+
142
+ **MUST record as follow-up and MUST NOT return to Step 2:** style or naming with no behaviour delta · a
143
+ refactor outside this story's scope · a pre-existing defect this story did not touch · a speculative risk with
144
+ no reachable path.
145
+
146
+ A must-fix MUST return as a **spec amendment**, never a chat instruction: amend the sections outside
147
+ `<intent-contract>`, append a `## Spec Change Log` entry naming the finding, reset `status` to `ready-for-dev`,
148
+ then re-dispatch. Content inside `<intent-contract>` is the owner's alone; a must-fix rooted there is an intent
149
+ gap and goes to the owner.
150
+
151
+ Cap: **2 return trips.** MUST re-run the whole panel after each fix round — a fix introduces defects. On hitting
152
+ the cap MUST escalate and MUST NOT open a PR carrying an unresolved must-fix.
153
+
154
+ ### Step 4 — story-closing checklist, then push and PR
155
+
156
+ The checklist is **three items** now, and it MUST be answered before the PR opens:
157
+
158
+ 1. A decision worth remembering? → `wdi-decision`. A story contradicting an `AD-N` **stops** rather than
159
+ closing.
160
+ 2. A trap for the next agent? → recorded where the next agent will read it.
161
+ 3. Test names matching what `waves.yaml` records?
162
+
163
+ The five items that left this list moved to Phase 4, where the information actually exists.
164
+
165
+ - MUST run the repository's commit/push audit before `git push`: refuse the forbidden paths, run the guard test,
166
+ fix content on failure. A failing guard is a finding about the content — MUST NOT weaken the guard or the test.
167
+ - MUST NOT push to `main`/`master`, MUST NOT force-push, MUST NOT merge.
168
+ - The coordinator MUST be the hand that pushes and opens the PR.
169
+
170
+ ### Step 5 — watch CI, then judge
171
+
172
+ - MUST wait for every check to conclude, then confirm the checks belong to the **pushed head SHA**. A green
173
+ report from a stale run is a false report.
174
+ - `korpus.yml` validates the corpus, not the code. Build and test evidence comes from Step 2's own runs.
175
+ - Classify each failure before acting: a defect from this change → Step 2, with `wdi-systematic-debugging` when
176
+ the cause is unknown · infrastructure or flake → re-run **once**, and MUST NOT patch code to mask it; a second
177
+ identical failure is a defect · a guard failure → fix the content.
178
+ - Cap: 2 return trips. On hitting the cap MUST report red honestly rather than keep pushing.
179
+
180
+ ### Parallel stories
181
+
182
+ Stories without a `depends_on` path between them MAY run at once, but four conditions MUST hold: each worker in
183
+ its own worktree; V11 green for every pair released together; the first story of an epic already `done` so later
184
+ stories inherit its code map; and no shared registry write in flight.
185
+
186
+ The pattern that MUST be preferred: run the biggest blocker alone first, let its shape decisions land, then fan
187
+ out.
188
+
189
+ ## Phase 4 — Close the wave
190
+
191
+ Run in this order and stop at the first failure:
192
+
193
+ 1. **Registry catch-up.** Every `LC` the wave's design named is registered in `components.yaml`, and every
194
+ `touches` value resolves — V12. This is the moment those questions have answers.
195
+ 2. **Inventories refreshed from code.** Run `.constitution/scripts/inventory.py`. The plan-versus-reality
196
+ difference is reported as a finding; it MUST NOT be patched into agreement by hand.
197
+ 3. **Structure maps refreshed** through `wdi-init` intent `structure`, if a base folder was born or removed or a
198
+ key file moved.
199
+ 4. **Distillation.** Every applicable row of the ownership table in `corpus-guide.md` has been landed by its
200
+ owner. Anything durable in the spec folder leaves it now, or dies with it.
201
+ 5. **Retrospective.** On wave `L`, dispatch `bmad-retrospective` and archive `RETROSPECTIVE.md` as
202
+ `RTR-<wave>.md` in `.control/reports/`. On `S` and `M` it is advisory — V19 says so, and skipping it MUST be
203
+ stated rather than silent.
204
+ 6. **RTM green.** Every traceability row for this wave is closed. New risks are in the risk register with an
205
+ owner.
206
+ 7. Mark the wave `status: closed` in `waves.yaml`.
207
+
208
+ - You MUST NOT close a wave with an open distillation row. The whole point of an ephemeral working layer is that
209
+ durable truth leaves it first.
210
+ - You MUST NOT reopen a closed wave to add scope. Scope arriving late opens a new wave, or goes through
211
+ `wdi-decision` if it invalidates what is already planned.
212
+ - A change invalidating more than 30% of a wave's stories MUST go through `wdi-decision`, not a patch to
213
+ `waves.yaml`.
214
+ - Fast Path work is recorded as `fastpath` with no gates. If an `FR` turns out to be touched, the work MUST stop
215
+ and be raised to a wave `S`.
216
+
217
+ ## Red Flags — STOP
218
+
219
+ - "One reviewer approved, good enough"
220
+ - Judging a step from a chat report instead of the spec's frontmatter `status`
221
+ - Dispatching Step 1 without `Halt after planning.`
222
+ - Editing content inside `<intent-contract>` on the owner's behalf
223
+ - A worker editing `.what/`, `.how/`, or an `applied` `DEC-` to make its code fit
224
+ - Fixing a failing test without knowing why it failed
225
+ - Opening a PR with an unresolved must-fix, or before the story-closing checklist is answered
226
+ - Editing a guard, a test, or an assertion to turn something green
227
+ - Reporting green without checking the head SHA, or reading green `korpus.yml` as a passing build
228
+ - A reviewer from the same CLI family as the builder
229
+ - Dispatching a worker without its Unattended flag
230
+ - Closing the wave without the registry catch-up in Phase 4 — that is where five checklist items now live
231
+ - Letting `SPEC.md` state something `.what/` and `.how/` do not
232
+
233
+ **Each of these means: stop, return to the step or phase that owns it, or escalate to the owner.**
234
+
235
+ ## Output
236
+
237
+ MUST follow the Agent Rules `Answer Closing` block, carrying these additions:
238
+
239
+ - **what was done** — wave, `FR` satisfied, every story with its branch and PR URL, what the code now does
240
+ - **what blocked it** — every step that looped, every dismissed finding and why, anything left red, and every
241
+ Phase 4 item that did not pass
242
+ - **what comes next** — every finding recorded as follow-up, every entry in a spec's `deferred` list, every
243
+ story-closing item routed to another skill, and the plan-versus-code inventory differences. A follow-up absent
244
+ here is a lost finding.
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: wdi-component
3
+ description: Use at G4 Component — the depth of one Product Component, as deep as that component's mode and no deeper. Two intents, behaviour and design. Owns .what/<pc>/ slots 02-05 and .how/<pc>/ minus 01-ux. Skipped entirely at mode catalog.
4
+ ---
5
+
6
+ # WDI Component
7
+
8
+ G4 decides **how one Product Component is built, and what the choice costs.** It is the only gate that changes
9
+ shape with `mode`, and the only one that runs more than once for a reason other than a new PRD.
10
+
11
+ | `mode` | This skill |
12
+ |---|---|
13
+ | `catalog` | **Not run. G4 is skipped.** |
14
+ | `outline` | `behaviour` + `design` **as far as § Structure**, and no further |
15
+ | `guarded` | `behaviour` + `design` |
16
+ | `deep` | `behaviour` + `design` |
17
+
18
+ This table said `outline` → `behaviour` only until 2026-08-18. It contradicted **Step 4 of this same
19
+ skill**, which starts `Decision Summary` and `Structure` "from `outline`", and it contradicted
20
+ `delivery-flow-guide.md`, which owns the mapping and lists both for `outline`. Read literally, it would
21
+ have left every `outline` component with an SDD that is a template skeleton forever — and V13 would have
22
+ been right to keep flagging it.
23
+
24
+ Read the component's `mode` from its row in `components.yaml`, falling back to `mode:` in `index.yaml`. Read
25
+ its `risk_accepted` from the same row; it decides the review lenses and nothing else.
26
+
27
+ **You MUST NOT write more than the component's `mode` demands.** Writing a section the mode does not ask for is
28
+ the failure this gate was rebuilt to stop — it is how 41 of 56 use cases ended up marked `critical` and how the
29
+ previous run stalled. Depth is a preference the owner set, and exceeding it is not diligence.
30
+
31
+ Stage-3 and Stage-4 work were two skills before and are one now, because they are one gate. The boundary
32
+ between them is intact and it is **horizontal**: `behaviour` writes what the system does, `design` writes how.
33
+
34
+ ## Inputs
35
+
36
+ | Source | What it answers |
37
+ |---|---|
38
+ | `.control/registry/components.yaml` | This component's `mode`, `risk_accepted`, `risk_note`, `owns` |
39
+ | `.what/<pc>/SRS-<pc>.md` § UC Catalogue · § Actor Register | Which use cases exist, and which are `critical` |
40
+ | `.what/_prd/*/prd.md` | The `FR` this component has to make true |
41
+ | `.what/business-rules.md` | Rules that already bind more than one component |
42
+ | `.how/_platform/inventory-api.md` · `inventory-screen.md` | **The boundary list.** It is already derived; do not derive it again |
43
+ | `.how/_platform/ARCHITECTURE-SPINE.md` | Every `AD-N` that binds this component |
44
+ | `.how/_platform/cross-cutting.md` | The error envelope, and anything else decided once |
45
+ | `.control/decisions/` | `applied` decisions this must not contradict |
46
+ | `.constitution/document/srs-guide.md` · `sdd-guide.md` | The rules the result is checked against |
47
+ | `src/` · `web/` | Only as evidence when the code already exists. Never as a substitute for the SRS |
48
+
49
+ ## Step 1 — Scope, one component
50
+
51
+ State it in one line before doing anything. A pass MUST NOT write content for several components: an SDD is per
52
+ component by construction, and one pass over two of them inherits the wrong constraints.
53
+
54
+ | Ask | Scope |
55
+ |---|---|
56
+ | "Take `<pc>` to G4" | One component, both intents as its `mode` demands |
57
+ | "Write the failure behaviour for `<pc>`" | One section of one component |
58
+ | "Is our design consistent?" | Read-only across components — that is `wdi-reconcile`. Route there |
59
+
60
+ ## Step 2 — Preconditions
61
+
62
+ None of these are yours to create.
63
+
64
+ | Check | When it fails |
65
+ |---|---|
66
+ | The component is registered with `mode` and `risk_accepted` set | Route to `wdi-init` intents `component`, `mode`, `risk` |
67
+ | Its `mode` is not `catalog` | Stop. G4 is skipped, and the work goes straight to `wdi-build` |
68
+ | G3 has passed | Route to `wdi-blueprint`. Depth written against a moving portrait is rewritten |
69
+ | The spine exists and its `AD-N` are readable | Route to `wdi-blueprint`. You MUST NOT write the spine |
70
+ | For `design`: the container this component runs in is registered | Route to `wdi-blueprint`. An `LC` MUST name its container |
71
+
72
+ ## Step 3 — Intent `behaviour`
73
+
74
+ Writes `.what/<pc>/`, slots `02`–`05`. You MUST NOT write solution shape: no framework, no table, no endpoint,
75
+ no class, no queue, no file path.
76
+
77
+ | `mode` | Written |
78
+ |---|---|
79
+ | `outline` · `guarded` | Full flows for the use cases the component exists for, **at most 3**, in `04-usecases/UC-<n>-<slug>.md` · local business rules in `02-rules/rules-<pc>.md` |
80
+ | `deep` | + a full flow for **every** `critical` use case · `03-domain/state-machines.md` · `05-scenarios/SCN-<nn>-<slug>.md` |
81
+
82
+ A flow is at most **eight steps**. A flow needing more is either two use cases or has started describing
83
+ implementation, and the cap is what makes that visible while it is still cheap to fix. Branches go to
84
+ `05-scenarios/` — at `deep` only — never into a fatter UC file.
85
+
86
+ A rule that turns out to bind a second component MUST be **promoted** to `.what/business-rules.md` through
87
+ `wdi-blueprint`, not copied. Two copies of one rule is how components start disagreeing about the same policy.
88
+
89
+ ## Step 4 — Intent `design`
90
+
91
+ Writes `.how/<pc>/`. Two carve-outs that are not negotiable: `01-ux/` belongs to `wdi-ux`, and all of
92
+ `.how/_platform/` belongs to `wdi-blueprint`. You MUST NOT write into either.
93
+
94
+ Write in this order, stopping at whatever the `mode` does not reach:
95
+
96
+ 1. **`Decision Summary`** — from `outline`. One page: what this component is built as, and the one or two most
97
+ expensive choices reversed.
98
+ 2. **`Structure`** — from `outline`. The `LC` list and the direction of their dependencies.
99
+ 3. **`Inherited Constraints`** — from `guarded`. Every `AD-N` reaching this component, **quoted verbatim**. A
100
+ paraphrase drifts, and the drift is invisible because both texts read reasonably. A design that must deviate
101
+ does not argue here: it goes to `wdi-decision`, and either the spine changes or the design does.
102
+ 4. **`Failure Behaviour`** — from `guarded`, for **every** boundary. The boundary list is the endpoints and
103
+ screens this component owns in the two platform inventories. Per boundary: what happens when the other side
104
+ is slow, absent, or lying — timeout, retry policy, what the user sees, what gets logged. "Returns an error"
105
+ is not an answer.
106
+ 5. **`03-integrations/<name>.md`** — from `guarded`, when the component has a third party. It MUST name the
107
+ owner outside the team, and what happens when they change it without telling anyone.
108
+ 6. **The ABCE pass** — `deep` only, in order: Boundary → Control → Entity → Behaviour. It MUST NOT have
109
+ appeared in the SRS, and below `deep` it MUST NOT be written at all.
110
+ 7. **`02-contracts/`, `04-components/`, `05-model/data-model.md`, `06-flows/`** — `deep` only. The contract
111
+ inventory comes first and specs carry its stable numbers; every spec answers all five lanes, with `none` and
112
+ a reason where one does not apply. The data model carries a dictionary beside its diagram.
113
+
114
+ From `guarded` up, every Boundary object MUST become an `LC` in `components.yaml`; at `deep`, Control objects
115
+ too. Registration is checked **when the wave closes** — V12 — not before a story is `ready-for-dev`. You MUST
116
+ NOT register a `container`, and you MUST NOT register `ui-screen` or `ui-composite`.
117
+
118
+ ## Step 5 — Evidence, and the as-built case
119
+
120
+ Every technical claim about code that already exists MUST name what was read. The four labels — `[ASSUMED]` ·
121
+ `[PARTIAL]` · `[NEEDS CONFIRMATION]` · `[MISSING]` — are mandatory, and their ladder rules are in
122
+ `sdd-guide.md`.
123
+
124
+ **Raising a component's `mode` after its code runs is the case this matters most for.** What you write then is
125
+ an **as-built record, not a design**, and you MUST NOT raise a claim to verified without naming the file that
126
+ proves it. Two labels MUST be acted on rather than left in the text:
127
+
128
+ - `[NEEDS CONFIRMATION]` → `wdi-question`, before G4 opens.
129
+ - `[MISSING]` → dispositioned as a `BUG-`, a correction, or planned work. It MUST NOT be deleted; the
130
+ sentence is the only surviving evidence that somebody once believed the thing existed.
131
+
132
+ ## Step 6 — Drift
133
+
134
+ Check against the layer above and the code below, and **report** — never edit the other side.
135
+
136
+ | Found | Where it goes |
137
+ |---|---|
138
+ | Depth needs behaviour the catalogue never listed | `wdi-blueprint` — into the catalogue, before any code |
139
+ | The catalogue promised behaviour this component cannot deliver | `wdi-product`. Do not quietly narrow it here |
140
+ | A contradiction with an `applied` decision or an `AD-N` | `wdi-decision` — a new `DEC-`, never an edit to one already applied |
141
+ | A decision that would bind a second component | `wdi-blueprint` — it is an `AD-N`, not an SDD paragraph |
142
+ | The code does something this document does not describe | Here, as a labelled claim, or as a `BUG-` when the code is wrong |
143
+
144
+ `wdi-reconcile` is the read-only sweep across all layers. Run it rather than reimplementing it.
145
+
146
+ ## Step 7 — Review
147
+
148
+ No `doc_standards` fires for an SRS or an SDD. Dispatch `wdi-review`, which reads the lens set from this
149
+ component's `risk_accepted` — `edge-case-hunter` at `low` and `medium`, `structure` + `prose` at `high`, plus a
150
+ two-reviewer code panel at `low`. Slots are part of the artifact; reviewing a kernel alone misses where the
151
+ branches and contracts live.
152
+
153
+ You MUST NOT open G4 on depth that has not been through it.
154
+
155
+ ## Rules
156
+
157
+ - A decision taken while writing MUST go to `wdi-decision`, never into the document as a parenthetical. There
158
+ is no memlog here to catch it.
159
+ - You MUST NOT write into `.what/_prd/`, `.what/business-rules.md`, `.how/_platform/`, or `.how/<pc>/01-ux/`.
160
+ - You MUST NOT raise `status:`. Status is a stage; the `reviewed:` block is an event.
161
+ - You MUST NOT lower or raise the component's `mode` to fit what you want to write. That is `wdi-init`, and it
162
+ is the owner's call.
163
+ - `bmad-spec` runs **after** this, never before, and it MUST NOT introduce anything these documents do not say.
164
+ - Memlog: `.control/memlog/<pc>.md`, through `memlog.py --path`. `--workspace` MUST NOT be used.
165
+ - Questions arrive as **one** ranked batch at the gate, not as they surface.
166
+
167
+ ## Output
168
+
169
+ Component and its `mode` and `risk_accepted` · which intents ran · what was written per slot and **what the
170
+ mode deliberately left unwritten** · the `AD-N` inherited · the `LC` registered and their types · evidence
171
+ labels outstanding by kind · drift found and where it was routed · whether `wdi-review` ran · the one ranked
172
+ batch of questions.
File without changes