wdi-method 0.4.6 → 0.5.2

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 (87) hide show
  1. package/README.md +271 -252
  2. package/bin/wdi-method.js +1221 -1030
  3. package/kit/.constitution/method/README.md +73 -169
  4. package/kit/.constitution/{constitution.md → method/constitution.md} +10 -56
  5. package/kit/.constitution/{document → method/document}/architecture-guide.md +209 -209
  6. package/kit/.constitution/{document → method/document}/corpus-guide.md +4 -4
  7. package/kit/.constitution/{document → method/document}/delivery-flow-guide.md +338 -338
  8. package/kit/.constitution/{document → method/document}/sdd-guide.md +1 -1
  9. package/kit/.constitution/{document → method/document}/templates/cross-cutting.md +2 -2
  10. package/kit/.constitution/{document → method/document}/templates/design-system.md +67 -67
  11. package/kit/.constitution/{document → method/document}/templates/inventory.md +69 -69
  12. package/kit/.constitution/{document → method/document}/templates/sdd.md +1 -1
  13. package/kit/.constitution/{document → method/document}/templates/structure-codebase.md +129 -129
  14. package/kit/.constitution/{document → method/document}/templates/structure-document.md +90 -90
  15. package/kit/.constitution/{language-guide.md → method/language-guide.md} +2 -2
  16. package/kit/.constitution/{method-glossary.md → method/method-glossary.md} +169 -169
  17. package/kit/.constitution/{repo-guide.md → method/repo-guide.md} +120 -97
  18. package/kit/.constitution/method/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  19. package/kit/.constitution/{scripts → method/scripts}/timeline.py +2 -2
  20. package/kit/.constitution/{scripts → method/scripts}/validate.py +1648 -1581
  21. package/kit/.constitution/{structure-guide.md → method/structure-guide.md} +3 -3
  22. package/kit/.constitution/method/why/README.md +169 -0
  23. package/kit/.constitution/method/{artifact-map.md → why/artifact-map.md} +5 -5
  24. package/kit/.constitution/method/{portability.md → why/portability.md} +6 -6
  25. package/kit/.constitution/method/{rationale.md → why/rationale.md} +5 -5
  26. package/kit/.constitution/project/README.md +68 -68
  27. package/kit/.constitution/project/constitution.md +64 -0
  28. package/kit/assets/bmad-custom/bmad-advanced-elicitation.toml +15 -15
  29. package/kit/assets/bmad-custom/bmad-architecture.toml +33 -33
  30. package/kit/assets/bmad-custom/bmad-code-review.toml +13 -13
  31. package/kit/assets/bmad-custom/bmad-correct-course.toml +28 -28
  32. package/kit/assets/bmad-custom/bmad-prd.toml +42 -42
  33. package/kit/assets/bmad-custom/bmad-product-brief.toml +34 -34
  34. package/kit/assets/bmad-custom/bmad-retrospective.toml +9 -9
  35. package/kit/assets/bmad-custom/bmad-spec.toml +16 -16
  36. package/kit/assets/bmad-custom/bmad-ux.toml +19 -19
  37. package/kit/skills/wdi-blueprint/SKILL.md +203 -203
  38. package/kit/skills/wdi-build/SKILL.md +244 -244
  39. package/kit/skills/wdi-component/SKILL.md +1 -1
  40. package/kit/skills/wdi-help/SKILL.md +98 -98
  41. package/kit/skills/wdi-init/SKILL.md +1 -1
  42. package/kit/skills/wdi-problem/SKILL.md +90 -90
  43. package/kit/skills/wdi-product/SKILL.md +127 -127
  44. package/kit/skills/wdi-reconcile/SKILL.md +2 -2
  45. package/kit/skills/wdi-report/SKILL.md +205 -205
  46. package/kit/skills/wdi-systematic-debugging/SKILL.md +193 -193
  47. package/kit/skills/wdi-ux/SKILL.md +145 -145
  48. package/kit-overlay/AGENTS.md +215 -212
  49. package/kit-overlay/README.md +24 -17
  50. package/kit-overlay/constitution.md +10 -56
  51. package/kit-overlay/portability.md +6 -6
  52. package/kit-overlay/repo-guide.md +120 -97
  53. package/package.json +4 -2
  54. package/scaffold/.control/questions/blocking.md +1 -1
  55. package/kit/.constitution/README.md +0 -66
  56. /package/kit/.constitution/{document → method/document}/bmad-guide.md +0 -0
  57. /package/kit/.constitution/{document → method/document}/bmad-skill-register.md +0 -0
  58. /package/kit/.constitution/{document → method/document}/brief-guide.md +0 -0
  59. /package/kit/.constitution/{document → method/document}/decision-guide.md +0 -0
  60. /package/kit/.constitution/{document → method/document}/prd-guide.md +0 -0
  61. /package/kit/.constitution/{document → method/document}/srs-guide.md +0 -0
  62. /package/kit/.constitution/{document → method/document}/templates/addendum.md +0 -0
  63. /package/kit/.constitution/{document → method/document}/templates/architecture-spine.md +0 -0
  64. /package/kit/.constitution/{document → method/document}/templates/brief.md +0 -0
  65. /package/kit/.constitution/{document → method/document}/templates/c4.md +0 -0
  66. /package/kit/.constitution/{document → method/document}/templates/contract.md +0 -0
  67. /package/kit/.constitution/{document → method/document}/templates/decision.md +0 -0
  68. /package/kit/.constitution/{document → method/document}/templates/flow.md +0 -0
  69. /package/kit/.constitution/{document → method/document}/templates/integration.md +0 -0
  70. /package/kit/.constitution/{document → method/document}/templates/lc.md +0 -0
  71. /package/kit/.constitution/{document → method/document}/templates/lifecycle.md +0 -0
  72. /package/kit/.constitution/{document → method/document}/templates/meeting.md +0 -0
  73. /package/kit/.constitution/{document → method/document}/templates/model.md +0 -0
  74. /package/kit/.constitution/{document → method/document}/templates/oq.md +0 -0
  75. /package/kit/.constitution/{document → method/document}/templates/prd.md +0 -0
  76. /package/kit/.constitution/{document → method/document}/templates/questions.md +0 -0
  77. /package/kit/.constitution/{document → method/document}/templates/rtr.md +0 -0
  78. /package/kit/.constitution/{document → method/document}/templates/rules.md +0 -0
  79. /package/kit/.constitution/{document → method/document}/templates/scn.md +0 -0
  80. /package/kit/.constitution/{document → method/document}/templates/srs.md +0 -0
  81. /package/kit/.constitution/{document → method/document}/templates/uc.md +0 -0
  82. /package/kit/.constitution/{document → method/document}/templates/ux.md +0 -0
  83. /package/kit/.constitution/{document → method/document}/ux-guide.md +0 -0
  84. /package/kit/.constitution/{scripts → method/scripts}/inventory.py +0 -0
  85. /package/kit/.constitution/{codebase/brownfield-guide.md → project/codebase-brownfield-guide.md} +0 -0
  86. /package/kit/.constitution/{codebase/conventions-guide.md → project/codebase-conventions-guide.md} +0 -0
  87. /package/kit/.constitution/{codebase/stack-guide.md → project/codebase-stack-guide.md} +0 -0
@@ -1,244 +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.
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/method/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.
@@ -43,7 +43,7 @@ between them is intact and it is **horizontal**: `behaviour` writes what the sys
43
43
  | `.how/_platform/ARCHITECTURE-SPINE.md` | Every `AD-N` that binds this component |
44
44
  | `.how/_platform/cross-cutting.md` | The error envelope, and anything else decided once |
45
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 |
46
+ | `.constitution/method/document/srs-guide.md` · `sdd-guide.md` | The rules the result is checked against |
47
47
  | `src/` · `web/` | Only as evidence when the code already exists. Never as a substitute for the SRS |
48
48
 
49
49
  ## Step 1 — Scope, one component