wdi-method 0.5.13 → 0.6.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 (87) hide show
  1. package/README.md +436 -271
  2. package/bin/wdi-method.js +198 -5
  3. package/kit/.constitution/method/README.md +76 -75
  4. package/kit/.constitution/method/constitution.md +2 -1
  5. package/kit/.constitution/method/document/architecture-guide.md +10 -10
  6. package/kit/.constitution/method/document/bmad-guide.md +50 -16
  7. package/kit/.constitution/method/document/bmad-skill-register.md +74 -71
  8. package/kit/.constitution/method/document/brief-guide.md +42 -11
  9. package/kit/.constitution/method/document/corpus-guide.md +146 -11
  10. package/kit/.constitution/method/document/decision-guide.md +199 -134
  11. package/kit/.constitution/method/document/delivery-flow-guide.md +154 -83
  12. package/kit/.constitution/method/document/prd-guide.md +63 -20
  13. package/kit/.constitution/method/document/sdd-guide.md +5 -4
  14. package/kit/.constitution/method/document/srs-guide.md +150 -147
  15. package/kit/.constitution/method/document/templates/addendum.md +70 -71
  16. package/kit/.constitution/method/document/templates/architecture-spine.md +6 -4
  17. package/kit/.constitution/method/document/templates/brief.md +132 -110
  18. package/kit/.constitution/method/document/templates/c4.md +11 -11
  19. package/kit/.constitution/method/document/templates/contract.md +51 -52
  20. package/kit/.constitution/method/document/templates/cross-cutting.md +1 -2
  21. package/kit/.constitution/method/document/templates/design-system.md +0 -1
  22. package/kit/.constitution/method/document/templates/integration.md +68 -69
  23. package/kit/.constitution/method/document/templates/inventory.md +0 -1
  24. package/kit/.constitution/method/document/templates/lc.md +49 -47
  25. package/kit/.constitution/method/document/templates/lifecycle.md +51 -52
  26. package/kit/.constitution/method/document/templates/model.md +68 -55
  27. package/kit/.constitution/method/document/templates/oq.md +45 -45
  28. package/kit/.constitution/method/document/templates/prd.md +244 -226
  29. package/kit/.constitution/method/document/templates/questions.md +100 -76
  30. package/kit/.constitution/method/document/templates/rules.md +46 -47
  31. package/kit/.constitution/method/document/templates/sdd.md +26 -11
  32. package/kit/.constitution/method/document/templates/srs.md +46 -25
  33. package/kit/.constitution/method/document/templates/uc.md +1 -1
  34. package/kit/.constitution/method/document/templates/ux.md +76 -77
  35. package/kit/.constitution/method/document/ux-guide.md +115 -99
  36. package/kit/.constitution/method/language-guide.md +1 -1
  37. package/kit/.constitution/method/method-glossary.md +29 -16
  38. package/kit/.constitution/method/scripts/timeline.py +663 -665
  39. package/kit/.constitution/method/scripts/validate.py +1143 -362
  40. package/kit/.constitution/method/structure-guide.md +3 -3
  41. package/kit/.constitution/method/why/README.md +184 -169
  42. package/kit/.constitution/method/why/artifact-map.md +15 -13
  43. package/kit/.constitution/method/why/mode-risk-map.md +140 -0
  44. package/kit/.constitution/method/why/portability.md +1 -1
  45. package/kit/.constitution/method/why/rationale.md +12 -5
  46. package/kit/.constitution/project/README.md +2 -2
  47. package/kit/.constitution/project/codebase-brownfield-guide.md +18 -18
  48. package/kit/.constitution/project/codebase-conventions-guide.md +18 -18
  49. package/kit/.constitution/project/codebase-stack-guide.md +18 -18
  50. package/kit/assets/bmad-custom/bmad-architecture.toml +1 -1
  51. package/kit/assets/bmad-custom/bmad-correct-course.toml +5 -5
  52. package/kit/assets/bmad-custom/bmad-prd.toml +9 -3
  53. package/kit/assets/bmad-custom/bmad-product-brief.toml +6 -2
  54. package/kit/skills/wdi-blueprint/SKILL.md +71 -10
  55. package/kit/skills/wdi-build/SKILL.md +233 -122
  56. package/kit/skills/wdi-component/SKILL.md +8 -6
  57. package/kit/skills/wdi-decision/SKILL.md +187 -183
  58. package/kit/skills/wdi-help/SKILL.md +8 -7
  59. package/kit/skills/wdi-init/SKILL.md +20 -6
  60. package/kit/skills/wdi-problem/SKILL.md +31 -13
  61. package/kit/skills/wdi-product/SKILL.md +30 -17
  62. package/kit/skills/wdi-question/SKILL.md +170 -88
  63. package/kit/skills/wdi-reconcile/SKILL.md +33 -10
  64. package/kit/skills/wdi-report/SKILL.md +77 -25
  65. package/kit/skills/wdi-review/SKILL.md +201 -118
  66. package/kit/skills/wdi-systematic-debugging/SKILL.md +7 -7
  67. package/kit/skills/wdi-upgrade/SKILL.md +179 -0
  68. package/kit/skills/wdi-ux/SKILL.md +35 -11
  69. package/kit-overlay/AGENTS.md +2 -2
  70. package/kit-overlay/README.md +76 -75
  71. package/kit-overlay/constitution.md +2 -1
  72. package/kit-overlay/portability.md +1 -1
  73. package/package.json +43 -43
  74. package/scaffold/.control/product-glossary.md +1 -1
  75. package/scaffold/.control/registry/goals.yaml +25 -0
  76. package/scaffold/.control/registry/index.yaml +5 -5
  77. package/scaffold/.control/registry/specs.yaml +5 -0
  78. package/scaffold/.control/structure-codebase.md +19 -19
  79. package/scaffold/.control/structure-document.md +25 -25
  80. package/kit/.constitution/method/document/templates/rtr.md +0 -61
  81. package/kit/assets/bmad-custom/bmad-build-auto.toml +0 -10
  82. package/kit/assets/bmad-custom/bmad-build.toml +0 -52
  83. package/kit/assets/bmad-custom/bmad-code-review.toml +0 -13
  84. package/kit/assets/bmad-custom/bmad-retrospective.toml +0 -9
  85. package/kit/assets/bmad-custom/bmad-spec.toml +0 -16
  86. package/scaffold/.control/registry/requirements.yaml +0 -15
  87. package/scaffold/.control/registry/waves.yaml +0 -5
@@ -1,99 +1,164 @@
1
1
  ---
2
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.
3
+ description: Use at G5 Release — one spec from open to closed in one supervised run. Opens the spec, hands the owner to-spec and to-tickets, ships every ticket to a green PR through a five-step pipeline, then closes the spec. One invocation, not four.
4
4
  ---
5
5
 
6
6
  # WDI Build
7
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.
8
+ One unit of work, one invocation. A spec used to need four calls — open it, produce the contract, ship each
9
+ ticket, close it — and three of those were bookkeeping. They are all in here now, because a unit of work that
10
+ needs four invocations gets three of them skipped.
11
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.
12
+ **The engine layer below this gate is not BMad's.** `to-spec`, `to-tickets`, and `implement` produce the
13
+ contract, the tickets, and the code; `tdd` and `code-review` do the work inside them. `bmad-spec`,
14
+ `bmad-build`, `bmad-build-auto`, and `bmad-code-review` are **retired** and MUST NOT be invoked.
14
15
 
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.
16
+ **Three of those engines are human-invoked.** `to-spec`, `to-tickets`, and `implement` carry
17
+ `disable-model-invocation: true`, so this skill CANNOT invoke them and MUST NOT claim to. It states the command
18
+ for the owner to run, waits, then verifies the result and lands it. That is not a workaround: the points where
19
+ those engines need a human are the gates, and owner time is what a gate is for.
20
+
21
+ **No orchestration tool is required, and this skill MUST NOT name one.** How the work is carried out is the
22
+ session's own arrangement: an orchestration skill, this CLI's native subagent tooling, or the coordinator doing
23
+ a step itself. Which CLI, which model, and which effort staff a step come from the local Agent Rules, and MUST
24
+ NOT be restated here. Every rule below holds whatever the mechanism — they are about the artifact and who
25
+ judges it, not about how an agent is launched.
26
+
27
+ Two roles exist regardless. The **coordinator** — this session — holds every judge call, the registries, and
28
+ every remote git action. The **builder** of a step holds the spec and the code.
29
+
30
+ When the coordinator is also the builder, the separation the pipeline rests on is absent. That MUST be reported
31
+ as absent rather than worked around: a step judged by whoever wrote it is a self-report. One consequence is
32
+ hard — see Step 3: at `risk_accepted: low` the panel requires reviewers who are not the builder, and a session
33
+ that cannot provide them is **blocked**, not excused.
17
34
 
18
35
  ## Precondition, and the one that is easy to miss
19
36
 
20
37
  | Check | When it fails |
21
38
  |---|---|
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 |
39
+ | Every component this spec touches has passed G4, **or** sits at `mode: catalog` | Route to `wdi-component`. `spec-after-g4` checks it, and `catalog` skipping G4 is by design, not an exception |
23
40
  | 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) |
41
+ | Every `prd` slug names a real `.what/_prd/<initiative>/` folder | A spec without a promise covering it is a spec nobody agreed to (`spec-names-release-prd`) |
25
42
 
26
43
  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.
44
+ this spec only; it MUST NOT be read as standing permission for the next change.
28
45
 
29
- ## Phase 1 — Open the wave
46
+ ## Phase 1 — Open the spec
30
47
 
31
- Record it in `.control/registry/waves.yaml`:
48
+ Record it in `.control/registry/specs.yaml`. The frame opens here; the `tickets` rows land in Phase 2, because
49
+ that is where they are born.
32
50
 
33
51
  | Field | Rule |
34
52
  |---|---|
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 |
53
+ | `id` | `SPEC-<N>`, monotonic, never reused. A `W<N>` id in a frozen record is a **retired alias** and MUST NOT be rewritten |
54
+ | `release` | MUST be stated. The release↔spec cadence is situational and MUST NOT be inferred from numbering (`spec-names-release-prd`) |
55
+ | `prd` | MUST be stated: which initiative PRDs this spec delivers against. MUST NOT be derived from `release` |
56
+ | `fr` | The `FR` this spec satisfies. Ideally one — an `FR` is human-testable from birth |
39
57
  | `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 2The 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`.
58
+ | `depends_on` | At **spec** level. A spec declaring none runs in parallel with its neighbours |
59
+ | `spec_folder` | One per spec, not one per spec × component |
60
+ | `tickets` | Flat, one row per ticket: `id` · `component` · `satisfies: [UC]` · `blocked_by` · `touches` · test names |
61
+ | a ticket `id` | `<spec-id>-<NN>` — `SPEC-3-01`. The engine numbers its files from `01` per feature, which is unique only inside one spec; the RTM needs a key that is unique across the corpus |
62
+
63
+ **`tickets` is an index, not a store.** The ticket's prose lives where the tracker put it; the row carries only
64
+ what RTM and the validators read. And ticket **status** MUST NOT be copied here — it is read from the ticket
65
+ itself when `.control/generated/` regenerates (`ticket-status-one-home`). Two homes for one fact is how registries start lying.
66
+
67
+ `ticket-status-one-home` finds the file at `{spec_folder}/issues/<NN>-*.md`, from the number at the tail of the id, and reads its
68
+ status from either a `**Status:**` body line what the engine writes, because a ticket file is a tracker
69
+ payload and trackers do not read YAML — or `status:` in frontmatter.
70
+
71
+ The `epics` nesting is **repealed**. A ticket names its `component` directly; an intermediate level that only
72
+ grouped rows bought nothing and cost a lookup.
73
+
74
+ Size does not choose which gates are active that is `mode`'s job. It decides two things: session merging
75
+ (`S` merges G4 and G5 into one 20-minute session) and whether `SPEC.md` is written at all.
76
+
77
+ ## Phase 2 The contract, and the tickets
78
+
79
+ Two engines, and **the owner runs both.** State the command, wait, then verify and land.
80
+
81
+ | Size | What the owner runs | What lands |
82
+ |---|---|---|
83
+ | `M` · `L` | `/to-spec`, then `/to-tickets` | `SPEC.md` in `spec_folder` · ticket files · the `tickets` index rows |
84
+ | `S` | `/to-tickets` only | ticket files · the `tickets` index rows. **No `SPEC.md`** |
85
+
86
+ At `S` the tickets **are** the contract. `to-tickets` accepts a conversation directly, so a middle document
87
+ buys nothing there. From `M` up it is written first, because two things have to be settled **before** tickets
88
+ are cut and neither survives being decided afterwards: the **seams** the feature will be tested at — fewest
89
+ possible, highest possible, agreed with the owner — and the **testing decisions**, which say what a good test
90
+ is here and name the prior art.
91
+
92
+ ### What you verify before landing anything
93
+
94
+ - **Nothing new.** `SPEC.md` is a **projection** of `.what/` + `.how/`. It MAY restate a promise in its own
95
+ words — a machine contract is more useful self-contained — but **every restatement MUST refer to the live
96
+ corpus document it came from.** A reference that does not resolve is not a wording problem: the gap is
97
+ upstream. Route to `wdi-component` or `wdi-blueprint`, and do not let the contract invent it.
98
+ - **Every user story resolves to an id.** A user story with no `FR` or `UC` behind it is a **new promise**,
99
+ and a new promise is `wdi-product`'s, never a spec's.
100
+ - **Every ticket names what it satisfies.** No `satisfies`, no landing: without it the chain
101
+ `FR → UC → ticket → test` breaks and RTM cannot say which promise went green. This is the one field
102
+ `to-tickets` does not ask for on its own, so it is the one most likely to be missing.
103
+ - **Every ticket is vertical.** A slice of one layer is not a ticket. The exception is a wide refactor,
104
+ sequenced expand → migrate in batches → contract; `delivery-flow-guide.md` owns that rule.
105
+ - **Ticket files land under `spec_folder`.** Their **shape** is the engine's — one file per ticket, numbered
106
+ in dependency order, blocking edges declared — and only the root is ours, because `to-tickets` states its
107
+ own location is tracker-specific and configured. A ticket at the repo root, or under `docs/` or
108
+ `.scratch/`, is drift: Article 3 names every layer this method has and those are not among them.
109
+
110
+ `SPEC.md` and ticket files **are not read by humans.** Both are machine contracts, and no review burden MAY be
111
+ moved onto them. `wdi-review` MAY still be dispatched over the contract; its trace lands on the spec in
112
+ `specs.yaml` — and where there is no `SPEC.md`, one trace covers the **ticket set as one artifact**, never one
113
+ review per ticket.
114
+
115
+ ## Phase 3 — Ship each ticket
116
+
117
+ Work the **frontier**: the tickets whose blockers are all closed. A ticket whose `blocked_by` is not yet
118
+ satisfied MUST NOT be started, however ready it looks.
67
119
 
68
120
  | # | Step | Engine | Exit condition |
69
121
  |---|---|---|---|
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 |
122
+ | 1 | Encode | `/tdd` | **Failing tests exist that encode this ticket's acceptance criteria** |
123
+ | 2 | Build | `/implement` — the owner runs it; it uses `/tdd` at the agreed seams | Those tests green, typecheck clean, full suite green once |
124
+ | 3 | Panel | `code-review`, as a **separate** dispatch | Panel adjudicated, zero unresolved must-fix |
125
+ | 4 | Publish | — | Branch pushed, PR open, ticket-closing checklist answered |
74
126
  | 5 | CI | — | All checks conclude green on the pushed head SHA |
75
127
 
128
+ **Step 1 is the change that matters most.** It used to be a plan, judged from a frontmatter field a builder
129
+ wrote about itself. Now it is a **failing test suite** — the acceptance criteria, encoded, and demonstrably
130
+ red. That is evidence rather than a claim, and it is what `ticket-has-test` and G5's ★2 have always been asking for:
131
+ *acceptance criteria proven by a test, not by an agent's statement.* Under TDD the test exists **before** the
132
+ code, so the proof is not retrofitted.
133
+
76
134
  ### Engine rules
77
135
 
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.
136
+ - **MUST judge Steps 1 and 2 from the test suite**, not from a report and not from a status field. Red at the
137
+ right assertions closes Step 1; green with a clean typecheck closes Step 2. A builder's chat report MUST NOT
138
+ settle either.
139
+ - Ticket **status** is read from the ticket itself. It MUST NOT be copied into `specs.yaml` (`ticket-status-one-home`).
140
+ - Every step MUST start from a **fresh context**, and a fix round MUST NOT go back to whoever produced the
141
+ code. The ticket carries everything the next builder needs, and inherited context is how a step stops judging
142
+ the artifact on its own merits. Where one session runs consecutive steps itself, it MUST re-read the artifact
143
+ rather than trust what it remembers writing.
144
+ - A step handed to a separate agent MUST be launched so it cannot sit waiting for input nobody will give, and
145
+ its start MUST be confirmed from observed activity — never from a readiness match alone.
146
+ - A step that fails because the agent could not spawn what it needed is a **capability** failure, not a ticket
147
+ failure. MUST retry it somewhere that can, and MUST NOT record it against the ticket.
86
148
  - 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.
149
+ - A ticket returned by the panel MUST have its acceptance criteria amended and its status reset before it is
150
+ picked up again — see Step 3.
88
151
 
89
- ### What every worker brief MUST carry
152
+ ### What every builder brief MUST carry
90
153
 
91
- Three rules this corpus adds. All three MUST be stated in the dispatch of any step that writes code.
154
+ Three rules this corpus adds, and `/implement` knows none of them. All three MUST reach whoever writes code in
155
+ this spec — in the dispatch when a step is dispatched, and in the session's own working instructions when it
156
+ is not.
92
157
 
93
158
  - **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
159
+ builder MUST run `wdi-systematic-debugging` before proposing any fix. A third failed fix attempt is the signal
95
160
  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`
161
+ - **The corpus is not the builder's to change.** A builder MUST NOT edit `.what/`, `.how/`, or an `applied`
97
162
  `DEC-`. A deviation from the SDD or an `AD-N` is **reported**, and it becomes a `DEC-` through
98
163
  `wdi-decision` — never absorbed as a code patch.
99
164
  - **Verification is run, not assumed.** The commands are this product's, and they live in
@@ -101,38 +166,52 @@ Three rules this corpus adds. All three MUST be stated in the dispatch of any st
101
166
  the directory it runs from. A skill MUST NOT carry one product's build line. A green registry workflow
102
167
  MUST NOT be reported as proof the code compiles; they answer different questions.
103
168
 
104
- ### Step 1 — plan
169
+ ### Step 1 — encode the acceptance criteria as failing tests
105
170
 
106
- - MUST include `Halt after planning.` Without it the worker runs straight through implementation and Step 2
107
- loses its gate.
108
- - Validation is not a separate step. Step-02's READY-FOR-DEVELOPMENT gate verifies the spec, repairs it once,
109
- and re-verifies. MUST NOT wrap a second validation loop around it.
110
- - `blocked / spec failed ready-for-development standard` means that repair did not converge. MUST escalate the
111
- failing criteria; MUST NOT hand-patch the spec into a pass.
112
- - `blocked / intent gap` MUST reach the owner with the worker's unanswered questions verbatim.
171
+ - The tests MUST be written **at the seams the spec agreed** existing seams preferred, highest possible,
172
+ fewest possible. Inventing a new seam here, after the agreement, is a finding: it means Step 1 is redesigning
173
+ what Phase 2 settled.
174
+ - Every acceptance criterion MUST have at least one test. A criterion no test can express is not an acceptance
175
+ criterion it goes back to the ticket, or to the owner as an intent gap.
176
+ - The tests MUST be **seen red, at the right assertions.** A test that passes before the code exists is testing
177
+ nothing, and a suite that fails for the wrong reason an import error, a missing fixture — has not encoded
178
+ anything yet.
179
+ - A test MUST NOT assert a literal where the behaviour is what matters. The panel treats that as a test that
180
+ cannot fail, and returns it.
113
181
 
114
182
  ### Step 2 — build
115
183
 
116
- - MUST dispatch with the spec file path and the three brief rules above. The worker commits locally and **never
117
- pushes**.
118
- - `blocked / review repair loop exceeded 5 iterations` means its internal loop did not converge. MUST escalate;
119
- MUST NOT re-dispatch for a sixth.
120
- - On `blocked / intent gap` the worker has reverted the code and saved a patch file. MUST retrieve that patch
121
- path from the triage log before escalating — the work is recoverable, and losing it costs the whole step.
184
+ - The owner runs `/implement`, and it MUST be given the ticket and the three brief rules above.
185
+ - It commits to the current branch and **never pushes**. That is its own behaviour and it is what we want; the
186
+ coordinator is the hand that pushes.
187
+ - **`/implement` calls `/code-review` itself, and that call does NOT satisfy Step 3.** It is the builder
188
+ reviewing its own work self-review by construction. Step 3 stands as a separate dispatch regardless of what
189
+ ran inside Step 2.
190
+ - The full suite MUST be run green once at the end, not only the tests this ticket touched. A ticket that
191
+ passes its own tests and breaks a neighbour's has not finished.
192
+ - Where the work turns out to need something the ticket does not authorise, it stops and reaches the owner with
193
+ the question verbatim. The builder MUST NOT widen its own scope.
122
194
 
123
195
  ### Step 3 — panel, then judge
124
196
 
125
197
  Panel composition follows `risk_accepted`: at `low` a two-reviewer panel is **required** on the code; at
126
198
  `medium` and `high` it is available and SHOULD be used when the diff touches money, personal data, or a third
127
- party. The Agent Rules `bmad-code-review panel` section defines the pairing, and it MUST be followed exactly —
128
- the worker's own review layers are same-family by construction and never satisfy it.
199
+ party. The local Agent Rules govern which CLIs and models staff the panel. **A reviewer MUST be a different
200
+ agent from the builder** — the builder's own review layers, `/implement`'s internal `/code-review` included,
201
+ are self-review by construction and never satisfy the panel. This is the one separation in the pipeline that
202
+ MUST NOT be collapsed: where the session cannot provide it and `risk_accepted` is `low`, the ticket is blocked
203
+ and the owner MUST be told, because the field they set is what makes the panel required.
204
+
205
+ `code-review` reviews along two axes — **Standards**, against this repo's documented conventions, and
206
+ **Spec**, against what the ticket asked for. Both MUST run. Reporting one axis as the panel is reporting half
207
+ a review.
129
208
 
130
209
  - MUST adjudicate every contested finding by reading the cited lines. Votes MUST NOT settle a finding. A finding
131
210
  neither reviewer can locate in the diff is dismissed with that reason stated.
132
211
 
133
212
  **MUST return to Step 2:**
134
213
 
135
- - Breaks a story AC, or contradicts the SPEC, the SDD, an `AD-N`, or an `applied` `DEC-`
214
+ - Breaks a ticket's acceptance criterion, or contradicts the contract, the SDD, an `AD-N`, or an `applied` `DEC-`
136
215
  - Wrong behaviour, crash, or data loss reachable from the running app
137
216
  - Corpus drift: an `LC` touched but not registered, a contract changed in code but not in `02-contracts/`, a
138
217
  screen added without its `01-ux/` entry
@@ -142,25 +221,45 @@ the worker's own review layers are same-family by construction and never satisfy
142
221
  claims to cover
143
222
 
144
223
  **MUST record as follow-up and MUST NOT return to Step 2:** style or naming with no behaviour delta · a
145
- refactor outside this story's scope · a pre-existing defect this story did not touch · a speculative risk with
146
- no reachable path.
224
+ refactor outside this ticket's scope · a pre-existing defect this ticket did not touch · a speculative risk
225
+ with no reachable path.
147
226
 
148
- A must-fix MUST return as a **spec amendment**, never a chat instruction: amend the sections outside
149
- `<intent-contract>`, append a `## Spec Change Log` entry naming the finding, reset `status` to `ready-for-dev`,
150
- then re-dispatch. Content inside `<intent-contract>` is the owner's alone; a must-fix rooted there is an intent
151
- gap and goes to the owner.
227
+ A must-fix MUST return as a **ticket amendment**, never a chat instruction: amend what the ticket asks for,
228
+ note the finding that caused it, reset the ticket's status to `ready-for-agent`, then pick it up again. **What
229
+ a ticket `satisfies` is not amendable here** — that is the promise, and a must-fix rooted in the promise is an
230
+ intent gap that goes to the owner through `wdi-product`. Changing the `FR` a ticket serves in order to make the
231
+ code pass is how a corpus starts agreeing with whatever was built.
152
232
 
153
233
  Cap: **2 return trips.** MUST re-run the whole panel after each fix round — a fix introduces defects. On hitting
154
234
  the cap MUST escalate and MUST NOT open a PR carrying an unresolved must-fix.
155
235
 
156
- ### Step 4 story-closing checklist, then push and PR
236
+ ### When the code turns out to be right and the document wrong
237
+
238
+ This is normal during G5 and it is **not drift**. Building a thing is how you find out what the thing is.
239
+
240
+ The builder still MUST NOT edit `.what/`, `.how/`, or an `applied` `DEC-` to make its own code fit — that is
241
+ the corpus learning to agree with whatever was built, and it is a different failure. What happens instead:
157
242
 
158
- The checklist is **three items** now, and it MUST be answered before the PR opens:
243
+ 1. **Say it once.** Name what the code does, which promise it contradicts, and what that costs. One place,
244
+ one time. An `AD-N` is the one contradiction that **stops** — `decision-guide.md` owns it.
245
+ 2. **The owner decides.** If they adopt the code, that survey is spent.
246
+ 3. **The owning skill edits**, in the present tense, as if the design had always said this — `wdi-product`
247
+ for an `FR`, `wdi-component` for behaviour or design, `wdi-blueprint` for a cross-component rule.
159
248
 
160
- 1. A decision worth remembering? `wdi-decision`. A story contradicting an `AD-N` **stops** rather than
161
- closing.
249
+ What MUST NOT happen after step 2: raising the same conflict again in a later pass, opening an `OQ-` for it,
250
+ dispatching a review over it, or writing anywhere in the corpus that the change arrived late. The commit is
251
+ that record. `corpus-guide.md` § The corpus is written in the present tense is the binding rule.
252
+
253
+ ### Step 4 — ticket-closing checklist, then push and PR
254
+
255
+ The checklist is **three items**, and it MUST be answered before the PR opens:
256
+
257
+ 1. Something the next person needs to know? → **into the document that carries it**, and that is almost
258
+ always where it ends. It reaches `wdi-decision` only when no design document has a home for it —
259
+ `decision-guide.md` § A decision's first home. A ticket contradicting an `AD-N` **stops** rather than
260
+ closing; that is the one case where recording is mandatory.
162
261
  2. A trap for the next agent? → recorded where the next agent will read it.
163
- 3. Test names matching what `waves.yaml` records?
262
+ 3. Test names matching what `specs.yaml` records?
164
263
 
165
264
  The five items that left this list moved to Phase 4, where the information actually exists.
166
265
 
@@ -174,63 +273,75 @@ The five items that left this list moved to Phase 4, where the information actua
174
273
  - MUST wait for every check to conclude, then confirm the checks belong to the **pushed head SHA**. A green
175
274
  report from a stale run is a false report.
176
275
  - `korpus.yml` validates the corpus, not the code. Build and test evidence comes from Step 2's own runs.
177
- - Classify each failure before acting: a defect from this change → Step 2, with `wdi-systematic-debugging` when
276
+ - Classify each failure before acting: a defect from this change → Step 1 if the test was missing, Step 2 if
277
+ the code was wrong, with `wdi-systematic-debugging` when
178
278
  the cause is unknown · infrastructure or flake → re-run **once**, and MUST NOT patch code to mask it; a second
179
279
  identical failure is a defect · a guard failure → fix the content.
180
280
  - Cap: 2 return trips. On hitting the cap MUST report red honestly rather than keep pushing.
181
281
 
182
- ### Parallel stories
282
+ ### Parallel tickets
183
283
 
184
- Stories without a `depends_on` path between them MAY run at once, but four conditions MUST hold: each worker in
185
- its own worktree; V11 green for every pair released together; the first story of an epic already `done` so later
186
- stories inherit its code map; and no shared registry write in flight.
284
+ Tickets with no blocking edge between them MAY run at once that is what the frontier is — but four
285
+ conditions MUST hold: each concurrent builder in its own worktree; `parallel-tickets-blocked` green for every pair released together;
286
+ the first ticket that establishes a component's shape already closed, so later tickets inherit its code map;
287
+ and no shared registry write in flight.
288
+
289
+ **A wide refactor is the exception, and it inverts the rule.** Its batches MUST run in sequence, not in
290
+ parallel, because each keeps CI green only while the expand still stands. Where even a batch cannot stay green
291
+ alone, they share an integration branch and green is promised only at the final integrate-and-verify ticket.
187
292
 
188
293
  The pattern that MUST be preferred: run the biggest blocker alone first, let its shape decisions land, then fan
189
294
  out.
190
295
 
191
- ## Phase 4 — Close the wave
296
+ ## Phase 4 — Close the spec
192
297
 
193
- Run in this order and stop at the first failure:
298
+ **Six steps.** Run in this order and stop at the first failure.
194
299
 
195
- 1. **Registry catch-up.** Every `LC` the wave's design named is registered in `components.yaml`, and every
196
- `touches` value resolves — V12. This is the moment those questions have answers.
300
+ 1. **Registry catch-up.** Every `LC` the spec's design named is registered in `components.yaml`, and every
301
+ `touches` value resolves — `lc-registered`. This is the moment those questions have answers.
197
302
  2. **Inventories refreshed from code.** Run `.constitution/method/scripts/inventory.py`. The plan-versus-reality
198
303
  difference is reported as a finding; it MUST NOT be patched into agreement by hand.
199
304
  3. **Structure maps refreshed** through `wdi-init` intent `structure`, if a base folder was born or removed or a
200
305
  key file moved.
201
306
  4. **Distillation.** Every applicable row of the ownership table in `corpus-guide.md` has been landed by its
202
- owner. Anything durable in the spec folder leaves it now, or dies with it.
203
- 5. **Retrospective.** On wave `L`, dispatch `bmad-retrospective` and archive `RETROSPECTIVE.md` as
204
- `RTR-<wave>.md` in `.control/reports/`. On `S` and `M` it is advisory V19 says so, and skipping it MUST be
205
- stated rather than silent.
206
- 6. **RTM green.** Every traceability row for this wave is closed. New risks are in the risk register with an
307
+ owner. Anything durable in the spec folder leaves it now, or dies with it — **the ticket files included.**
308
+ Their prose is working output; what survives is the index in `specs.yaml` and whatever the checklist routed.
309
+ 5. **RTM green.** Every traceability row for this spec is closed. New risks are in the risk register with an
207
310
  owner.
208
- 7. Mark the wave `status: closed` in `waves.yaml`.
311
+ 6. Mark the spec `status: closed` in `specs.yaml`.
312
+
313
+ The retrospective step is **repealed**, and `RTR-` with it. It was the only thing size `L` decided, and the
314
+ only thing `V19` checked.
209
315
 
210
- - You MUST NOT close a wave with an open distillation row. The whole point of an ephemeral working layer is that
316
+ - You MUST NOT close a spec with an open distillation row. The whole point of an ephemeral working layer is that
211
317
  durable truth leaves it first.
212
- - You MUST NOT reopen a closed wave to add scope. Scope arriving late opens a new wave, or goes through
318
+ - You MUST NOT reopen a closed spec to add scope. Scope arriving late opens a new spec, or goes through
213
319
  `wdi-decision` if it invalidates what is already planned.
214
- - A change invalidating more than 30% of a wave's stories MUST go through `wdi-decision`, not a patch to
215
- `waves.yaml`.
320
+ - A change invalidating more than 30% of a spec's tickets MUST go through `wdi-decision`, not a patch to
321
+ `specs.yaml`.
216
322
  - Fast Path work is recorded as `fastpath` with no gates. If an `FR` turns out to be touched, the work MUST stop
217
- and be raised to a wave `S`.
323
+ and be raised to a spec `S`.
218
324
 
219
325
  ## Red Flags — STOP
220
326
 
221
327
  - "One reviewer approved, good enough"
222
- - Judging a step from a chat report instead of the spec's frontmatter `status`
223
- - Dispatching Step 1 without `Halt after planning.`
224
- - Editing content inside `<intent-contract>` on the owner's behalf
225
- - A worker editing `.what/`, `.how/`, or an `applied` `DEC-` to make its code fit
328
+ - Judging Step 1 or Step 2 from a report instead of from the test suite
329
+ - **Counting `/implement`'s own `/code-review` as the panel** — that is the builder reviewing itself
330
+ - Writing `SPEC.md` at size `S`, or skipping it at `M` and up
331
+ - Landing a ticket with no `satisfies` the RTM chain breaks silently and nothing else notices
332
+ - Amending what a ticket `satisfies` to make a must-fix go away
333
+ - A ticket that slices one layer instead of cutting through all of them, outside a wide refactor
334
+ - Running a wide refactor's batches in parallel
335
+ - Claiming this skill invoked `to-spec`, `to-tickets`, or `implement` — it cannot; the owner runs them
336
+ - A builder editing `.what/`, `.how/`, or an `applied` `DEC-` to make its code fit
226
337
  - Fixing a failing test without knowing why it failed
227
- - Opening a PR with an unresolved must-fix, or before the story-closing checklist is answered
338
+ - Opening a PR with an unresolved must-fix, or before the ticket-closing checklist is answered
228
339
  - Editing a guard, a test, or an assertion to turn something green
229
340
  - Reporting green without checking the head SHA, or reading green `korpus.yml` as a passing build
230
- - A reviewer from the same CLI family as the builder
231
- - Dispatching a worker without its Unattended flag
232
- - Closing the wave without the registry catch-up in Phase 4 — that is where five checklist items now live
233
- - Letting `SPEC.md` state something `.what/` and `.how/` do not
341
+ - Leaving a dispatched step able to stall on a question nobody is there to answer
342
+ - Naming an orchestration tool as this skill's requirement, or restating a CLI/model mapping the Agent Rules own
343
+ - Closing the spec without the registry catch-up in Phase 4 — that is where five checklist items now live
344
+ - Letting the contract state something `.what/` and `.how/` do not, or restate it without a reference
234
345
 
235
346
  **Each of these means: stop, return to the step or phase that owns it, or escalate to the owner.**
236
347
 
@@ -238,9 +349,9 @@ Run in this order and stop at the first failure:
238
349
 
239
350
  MUST follow the Agent Rules `Answer Closing` block, carrying these additions:
240
351
 
241
- - **what was done** — wave, `FR` satisfied, every story with its branch and PR URL, what the code now does
352
+ - **what was done** — spec, `FR` satisfied, every ticket with its branch and PR URL, what the code now does
242
353
  - **what blocked it** — every step that looped, every dismissed finding and why, anything left red, and every
243
354
  Phase 4 item that did not pass
244
- - **what comes next** — every finding recorded as follow-up, every entry in a spec's `deferred` list, every
245
- story-closing item routed to another skill, and the plan-versus-code inventory differences. A follow-up absent
246
- here is a lost finding.
355
+ - **what comes next** — every finding recorded as follow-up, every entry in a contract's `deferred` list, every
356
+ ticket-closing item routed to another skill, and the plan-versus-code inventory differences. A follow-up
357
+ absent here is a lost finding.
@@ -18,7 +18,7 @@ shape with `mode`, and the only one that runs more than once for a reason other
18
18
  This table said `outline` → `behaviour` only until 2026-08-18. It contradicted **Step 4 of this same
19
19
  skill**, which starts `Decision Summary` and `Structure` "from `outline`", and it contradicted
20
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
21
+ have left every `outline` component with an SDD that is a template skeleton forever — and `review-trace` would have
22
22
  been right to keep flagging it.
23
23
 
24
24
  Read the component's `mode` from its row in `components.yaml`, falling back to `mode:` in `index.yaml`. Read
@@ -67,7 +67,7 @@ None of these are yours to create.
67
67
  | Its `mode` is not `catalog` | Stop. G4 is skipped, and the work goes straight to `wdi-build` |
68
68
  | G3 has passed | Route to `wdi-blueprint`. Depth written against a moving portrait is rewritten |
69
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 |
70
+ | For `design`: the container this component runs in is registered | Route to `wdi-blueprint`. G3 has passed by now, so the answer exists — an `LC` written here MUST carry it. Only a screen `LC` born at G2 is allowed an empty one, and G3 fills it |
71
71
 
72
72
  ## Step 3 — Intent `behaviour`
73
73
 
@@ -112,7 +112,7 @@ Write in this order, stopping at whatever the `mode` does not reach:
112
112
  a reason where one does not apply. The data model carries a dictionary beside its diagram.
113
113
 
114
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
115
+ too. Registration is checked **when the spec closes** — `lc-registered` — not before a ticket is picked up. You MUST
116
116
  NOT register a `container`, and you MUST NOT register `ui-screen` or `ui-composite`.
117
117
 
118
118
  ## Step 5 — Evidence, and the as-built case
@@ -154,13 +154,15 @@ You MUST NOT open G4 on depth that has not been through it.
154
154
 
155
155
  ## Rules
156
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.
157
+ - A decision taken while writing is **written into the document as its own content**, stated as what now
158
+ holds. Never as a parenthetical aside — there is no memlog here to catch one. It goes to `wdi-decision`
159
+ only when no design document has a home for it, or it touches an `AD-N`; `decision-guide.md` § A
160
+ decision's first home owns that split.
159
161
  - You MUST NOT write into `.what/_prd/`, `.what/business-rules.md`, `.how/_platform/`, or `.how/<pc>/01-ux/`.
160
162
  - You MUST NOT raise `status:`. Status is a stage; the `reviewed:` block is an event.
161
163
  - You MUST NOT lower or raise the component's `mode` to fit what you want to write. That is `wdi-init`, and it
162
164
  is the owner's call.
163
- - `bmad-spec` runs **after** this, never before, and it MUST NOT introduce anything these documents do not say.
165
+ - The spec's contract is cut **after** this, never before, and it MUST NOT introduce anything these documents do not say.
164
166
  - Memlog: `.control/memlog/<pc>.md`, through `memlog.py --path`. `--workspace` MUST NOT be used.
165
167
  - Questions arrive as **one** ranked batch at the gate, not as they surface.
166
168