wdi-method 0.6.5 → 0.6.7

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.
package/README.md CHANGED
@@ -1,495 +1,495 @@
1
- # WDI Method
2
-
3
- **The review layer BMad leaves thin — documents a human reads to check a decision before code gets written, sized to what the change actually deserves.**
4
-
5
- [BMad](https://github.com/bmad-code-org/BMAD-METHOD) decides *what* to build and *how* to build it well. WDI Method wraps it — it does not replace it — and adds the part between those two decisions and the code: inventories, a use case catalogue, a component design record, and a way to choose how much of that a given change actually needs.
6
-
7
- > This repository is **public and generic**. It MUST NOT carry a client name, a product name, or a
8
- > link to a private repository — product identity lives entirely in the repo that installs it.
9
-
10
- ---
11
-
12
- ## Prerequisites — two engines, and both are required
13
-
14
- | Engine | What it does here | Source |
15
- |---|---|---|
16
- | **BMad Method** | Writes the documents behind G1–G4 — brief, PRD, architecture, UX | [github.com/bmad-code-org/BMAD-METHOD](https://github.com/bmad-code-org/BMAD-METHOD) |
17
- | **mattpocock/skills** | Cuts the work at G5 — `to-spec`, `to-tickets`; runs the Fast Path and every `wdi-autopilot` iteration — `implement` | [github.com/mattpocock/skills](https://github.com/mattpocock/skills) |
18
-
19
- **The installer refuses without either.** BMad has always been checked. The ticket engines are checked
20
- too, since 0.6.4: G1–G4 genuinely run without them, and every repo that relied on that learned they were
21
- missing inside `wdi-build` with a spec already open. `--skip-engines-check` is the escape for the two
22
- cases that earn it — CI, and a repo that will never reach G5.
23
-
24
- No engine skill is invoked on its own. Each has a wrapper (`wdi-*`) that checks where the project is,
25
- runs the engine, verifies what came back, and records it. The engine is the pen; the wrapper knows what
26
- page it is on.
27
-
28
- ---
29
-
30
- ## Install
31
-
32
- Three steps, in this order. The first is required before step 3 will run; the second can wait until
33
- **Both are required, and the installer refuses without either.** BMad has always been checked; the ticket
34
- engines are checked too, because every repo that learned they were missing learned it inside `wdi-build`
35
- with a spec already open. `--skip-engines-check` is the escape for the two cases that earn it: CI, and a
36
- repo that will never reach G5.
37
-
38
- **1. BMad Method** — in the product repo, picking the same agents you will give this installer:
39
-
40
- ```bash
41
- cd /path/to/your/product-repo
42
- npx bmad-method install
43
- ```
44
-
45
- **2. mattpocock/skills** — one of the two paths, not both (both leaves every skill twice):
46
-
47
- ```bash
48
- # Claude Code — a managed bundle that updates when its author ships
49
- claude plugins install mattpocock-skills # or, inside a session: /plugin install mattpocock-skills
50
-
51
- # Codex, Cursor, OpenCode, other agents — copies the skills into this repo; keep setup-matt-pocock-skills selected
52
- npx skills@latest add mattpocock/skills
53
- ```
54
-
55
- **You do not need to run `/setup-matt-pocock-skills` to get started.** Step 3 seeds `docs/agents/` with
56
- the two answers WDI Method actually has a requirement on, so the engines are aligned from the first
57
- install. Run the setup skill only to *change* something — to point at GitHub or Jira instead of local
58
- markdown — and keep the three invariants the seeded `issue-tracker.md` names.
59
-
60
- The seeding exists because the interview's own defaults are wrong here in one specific way: they send every
61
- engineering skill looking for a root `CONTEXT.md` and `docs/adr/`, and Article 3 says this method has no
62
- `docs/` layer for corpus or rules — `wdi-reconcile` reports both as findings. A repo that ran the setup
63
- before installing this package keeps its own file, and the installer names the contradiction rather than
64
- overwriting it.
65
-
66
- **3. WDI Method:**
67
-
68
- ```bash
69
- npx wdi-method
70
- ```
71
-
72
- This opens a TUI: it checks BMad, reports whether it found the ticket engines, detects install versus
73
- update, asks the product name and the document language, lets you pick agents, shows what it will
74
- write, and prints what to do next.
75
-
76
- **Every field arrives with an answer already in it, and Enter accepts it.** On an update that answer is
77
- what the repo already says; on a first install the product name is the folder name made readable —
78
- `acme-billing-portal` offers `Acme Billing Portal`. Nothing is validated as required: a prompt that
79
- refuses an empty submission while already holding a sensible default is asking you to retype something
80
- the installer knows.
81
-
82
- A value only changes when you actually answer. A run that does not mention language keeps the language the
83
- repo already chose, and says so.
84
-
85
- ```bash
86
- npx wdi-method@latest update # later, to take a newer method — @latest, or npx may reuse a cached one
87
- npx wdi-method verify # check the method files are all present
88
- ```
89
-
90
- **Upgrading from 0.5.x to 0.6** is two halves. `update` does the mechanical one — overwrites the kit,
91
- renames files whose content needs no judgment, seeds what is new — and then prints an `upgrade` line
92
- naming what is still in the old shape: a single `requirements.yaml`, a 14-section brief, a PRD carrying
93
- its FR text. The second half is a decision about content, so it belongs to a skill:
94
-
95
- ```bash
96
- npx wdi-method@latest update --yes # 1 — mechanical; read the `upgrade` line it prints
97
- # 2 — in your agent, run the wdi-upgrade skill: it moves every sentence into its new home, word for
98
- # word, invents nothing, reports what it could not place, and ends in one commit.
99
- ```
100
-
101
- Run the skill before any other skill. `wdi-help` and the validators read the new shape; a corpus half
102
- in the old one answers them wrongly.
103
-
104
- Non-interactive, for CI:
105
-
106
- ```bash
107
- npx wdi-method install --yes --agents claude,codex --product "Your Product" \
108
- --doc-language "Bahasa Indonesia"
109
- ```
110
-
111
- Then invoke the **`wdi-help`** skill and ask what to do next. It reads where the project actually is and
112
- answers with the gate you are at, not with a menu.
113
-
114
- ---
115
-
116
- ## What to do right after install, and right after update
117
-
118
- Two questions, and the honest answer to most of them is *nothing*. `wdi-help` answers them from the
119
- registry at any time; this table is the same answer written down.
120
-
121
- ### After `install`
122
-
123
- | | |
124
- |---|---|
125
- | Engines missing | You never get here — `install` refuses, and names both install paths. Install them, run it again |
126
- | `/setup-matt-pocock-skills`? | **No.** The installer seeded `docs/agents/` already answered for this method. Run that interview only to *change* tracker |
127
- | So what is first? | **`wdi-init` intent `setup`** — it sets the global `mode`, and nothing has started until it is |
128
- | Then? | `wdi-problem` for G1. Or ask `wdi-help`, which reads the registry rather than this table |
129
-
130
- ### After `update`
131
-
132
- | The summary said | Do |
133
- |---|---|
134
- | an **`upgrade`** line, naming content still in the old shape | **`wdi-upgrade`, before any other skill.** It moves every sentence into its new home, invents nothing, reports what it could not place, and ends in one commit. `wdi-help` and the validators read the new shape; a corpus half in the old one answers them wrongly |
135
- | **no** `upgrade` line | Nothing. The update was mechanical and complete — carry on from wherever the gates say you are |
136
- | `seeded docs/agents/` | Nothing. An older repo just received the engines' config, pre-answered. Read it if you like; do not run the setup interview to redo it |
137
- | a warning that `domain.md` still points at a root `CONTEXT.md` | Add the correction that warning names to the top of that file. It was written by the setup interview before this package was installed, and it sends every engineering skill at two paths Article 3 forbids |
138
- | a warning naming a **mandate** and `ad-n` | Only if you run `wdi-autopilot`. Decide whether that mandate should now park `AD-N` contradictions, and edit its `parked` list yourself — `update` never edits an authority you granted |
139
-
140
- **`wdi-upgrade` is only ever about corpus content** — a brief, a PRD, an SRS, registry rows in the old
141
- shape. It is not the answer to a missing engine, a missing tracker config, or anything under
142
- `.control/memlog/`; each of those is handled by the installer itself or by the skill that owns it.
143
-
144
- ---
145
-
146
- ## How to use it — the walk
147
-
148
- A gate is a moment where a human reads **one page** and decides. Between gates the AI works in a
149
- pointer-heavy working set it does not need you to read. So the walk is: run a skill, read the page it
150
- renders, decide — advance or refine.
151
-
152
- | # | You run | You read | You decide |
153
- |---|---|---|---|
154
- | 0 | `wdi-init` intent `setup` | — | the global `mode`: how deep this product goes by default |
155
- | 1 | `wdi-problem` | `.what-rendered/_product-brief/brief.md` | **G1** — is this the problem, whose is it, and does it earn the work? |
156
- | 2 | `wdi-product` intent `prd` — `wdi-ux` first when the interface *is* the promise | `.what-rendered/_prd/<slug>/prd.md` | **G2** — is this what we build, and how does it feel? |
157
- | 3 | `wdi-init` intent `component` | the rows it adds to `components.yaml` | each component's `mode` and `risk_accepted` |
158
- | 4 | `wdi-blueprint` — `catalog`, then `platform` | `.how-rendered/blueprint.md` | **G3** — does the whole hold together? **Once per product** |
159
- | 5 | `wdi-component` — one component | `.how-rendered/<pc>/SDD-<pc>.md` | **G4** — is this how we build it? **Skipped at `mode: catalog`** |
160
- | 6 | `wdi-report` intent `estimate` | `.control/generated/estimate.md` | which candidate row becomes the next spec |
161
- | 7 | `wdi-build` — for that row | nothing: tickets are machine contracts. You answer `to-tickets`' quiz on granularity and blocking edges | **G5** — is it done and proven? Once per spec |
162
- | 8 | `wdi-report` intent `progress` | the report it writes | what has moved, what is late, what is proven |
163
- | 9 | `wdi-autopilot` — when you would rather review the result than walk steps 6–8 yourself | its preflight page, then its final report and ledger | one **mandate**: scope, what stays parked for you, smoke test by the agent or by you, loop interval, expiry |
164
-
165
- **Unattended, on request.** `wdi-autopilot` moves owner time from the gates to two points: the mandate before,
166
- the review after. From the gate you name it runs the same skills, answers what they would have asked, records
167
- every answer in `.control/memlog/autopilot-<mandate-id>.md`, and returns at one of three stops — done,
168
- at capacity, or blocked. It finishes when every `FR` in scope is closed, when nothing left is runnable, or
169
- when the mandate expires. It needs three things from the session: permission prompts bypassed (one prompt halts the
170
- loop), a loop to fire it — `/loop 5m /wdi-autopilot` in Claude Code — and a way past the ticket engines'
171
- `disable-model-invocation`, which the preflight names: a builder that reads and follows the engine's `SKILL.md`,
172
- or a copy of the engines inside the repo. The validator `mandate-accept` keeps the one thing the method never
173
- gives up: a person, dated, at the root of every delegated acceptance.
174
-
175
- **Refine, do not advance.** When a page does not convince you, run the same skill again and say what is
176
- wrong — it updates the document it owns. Nothing downstream exists yet, so nothing breaks. Advancing past a
177
- page you did not believe is how every later page inherits the doubt.
178
-
179
- **After the first pass**, steps 0–4 never run again for that product. The next component enters at step 5
180
- (or 6, at `catalog`); a new initiative enters at step 2; a small fix touching no `FR`, `UC`, `AD-N`, or
181
- domain model skips every gate and runs `/implement` directly — and **stops to become a spec `S`** the
182
- moment it touches an `FR`. `wdi-help` tells you which of these you are in; it reads the registry, not you.
183
-
184
- ---
185
-
186
- ## Why the steps are in this order
187
-
188
- - **One question per gate.** The brief answers *why*, the PRD *what*, the blueprint *the whole*, the SDD
189
- *how one part*, the spec *is it done*. Every document that grew unreadable did so by answering a
190
- neighbour's question too. A gate that asks one question can be passed in ten minutes.
191
- - **The page you read is rendered; the page the AI edits points.** A goal lives once, in
192
- `goals.yaml`; the working brief says `Goals — see goals.yaml`; the rendered brief shows the goals in
193
- full. So the human gets a complete document and the corpus has no copies — and the validators check
194
- **drift against the code**, never whether two copies agree, because there are none to compare.
195
- - **Cost follows the unit of change.** G3 is once per product because the portrait is one thing. G4 is per
196
- component because that is what changes when you build. G5 is per spec because that is what ships.
197
- Repeating the blueprint per component was the single largest waste the earlier shape carried.
198
- - **Two knobs that never merge.** `mode` decides which gates *exist* for a component (`catalog` skips G4
199
- outright); `risk_accepted` decides how much *proof* a gate demands. Merged into one "rigor" dial, a
200
- low-risk component either drowns in ceremony or a high-risk one escapes it.
201
- - **Estimate before build.** Step 6 derives the candidate tasks from the promises already made —
202
- `CAP` and `FR` — so nobody invents a backlog. One candidate row becomes one spec, three neighbours
203
- may merge into one, and the estimate page says so about itself: it is forward-looking, never a record.
204
- - **The engine cuts; the wrapper frames.** `to-spec` and `to-tickets` are the best ticket-cutting
205
- engine we found: vertical tracer-bullet slices, blocking edges, a quiz with the owner. What a cutter
206
- cannot know, `wdi-build` supplies: that every component the spec touches passed G4; that every ticket
207
- names the `UC` it `satisfies`, so `FR → UC → ticket → test` stays one chain; that a spec restates
208
- promises and never makes new ones; that code is judged by the test suite going red then green, from a
209
- fresh context per step, never by a builder's report; and that a closed spec leaves the registry caught
210
- up and the inventories re-derived from code.
211
- - **Documents follow the code.** At spec close the inventories are regenerated from what was built and
212
- the difference is *reported*, never patched into agreement. A record that contradicts the code is
213
- corrected; code is never changed to match a record.
214
-
215
- ---
216
-
217
- ## The file tree, and why
218
-
219
- ```
220
- .constitution/
221
- method/ the method — overwritten by every update; never edit here
222
- project/ your own rules and readers — kept by every update
223
- .control/
224
- registry/ SSOT for every ROW: goals.yaml · requirements-<slug>.yaml · components.yaml
225
- usecases.yaml · specs.yaml · risks.yaml · defects.yaml · index.yaml
226
- questions/ open questions, assumptions, external prerequisites — one row each
227
- decisions/ DEC-N files; frozen once applied
228
- generated/ machine tables: rtm · dag · status · estimate · timeline — regenerated, never edited
229
- .what/ what is PROMISED — the AI's working set, pointer-heavy, few files
230
- _product-brief/brief.md
231
- _prd/<slug>/prd.md · addendum.md
232
- <pc>/SRS-<pc>.md + 02-rules · 03-domain · 04-usecases · 05-scenarios
233
- .how/ how it is BUILT — same discipline
234
- _platform/ ARCHITECTURE-SPINE.md · c4-l2-containers.md · inventories
235
- <pc>/SDD-<pc>.md + 01-ux · 02-contracts · 04-components · 05-model · 06-flows
236
- .what-rendered/ the human's tree: brief · _prd/<slug>/prd.md · <pc>/SRS-<pc>.md — one complete page each
237
- .how-rendered/ blueprint.md (root — it spans every component) · <pc>/SDD-<pc>.md
238
- _bmad-output/ a skill run's working output; empties as its spec closes
239
- .work/ scratch; empties when the task closes
240
- <spec_folder>/issues/ one file per ticket — the tracker's payload, not yours to read
241
- ```
242
-
243
- Three layers, and the rule that keeps them honest:
244
-
245
- | Layer | Holds | Who writes | Who reads |
246
- |---|---|---|---|
247
- | **Registry** | every row — a goal, a requirement, a component, a ticket index | the skill that owns the gate | validators, renderers, every other skill |
248
- | **Working documents** (`.what/`, `.how/`) | the prose that reasons — why, boundaries, what makes it different — and **pointers** at the rows | the owning skill | the AI |
249
- | **Rendered pages** (`*-rendered/`) | one complete page per gate, rows filled in from their homes | `validate.py --generate`, never a hand | the human, and the client |
250
-
251
- Why split the human's tree from the AI's: a document that is both the AI's working surface and the
252
- human's deliverable ends up serving neither — too long to point, too gappy to hand over. Why the
253
- registry is per initiative (`requirements-<slug>.yaml`) but goals are per product: a capability is
254
- declared by one feature in one PRD; a goal belongs to the product before any PRD exists. Why
255
- `blueprint.md` sits at the root of `.how-rendered/` and not under `_platform/`: `_platform` means
256
- "belongs to no component"; the blueprint spans all of them. Why rendered pages are never a skill's
257
- input: a skill that read a projection would be reading a copy, and the copy would start to drift the
258
- day someone edited it. A test in this package fails if any `SKILL.md` lists a `-rendered` path as an
259
- Input.
260
-
261
- ---
262
-
263
- ## Why WDI Method?
264
-
265
- - **Depth separate from scrutiny.** `mode` sets how much gets written; `risk_accepted` sets how hard it
266
- gets reviewed. Neither is derived from the other, so a component MAY be thin on purpose and reviewed the
267
- hardest.
268
- - **Ground truth over plan.** Once code exists, the tables, endpoints, and screens are **derived from it**
269
- — the gap between plan and reality is a finding to resolve, not an argument to have.
270
- - **Containers that match what actually ships.** C4's containers follow deployability, not folders, and a
271
- component view is drawn for every container that carries more than one Product Component.
272
- - **A gate that can be skipped honestly.** `mode: catalog` skips the component gate entirely — a fast
273
- default is fast because the work is genuinely gone, not nominally trimmed.
274
- - **Decisions that don't rot.** A `DEC-` is recorded only when the reason would not survive reading the
275
- code, and it freezes the moment it is applied — a change of mind writes a new one rather than editing
276
- the old.
277
- - **Wraps BMad, never forks it.** Every `wdi-*` skill is a wrapper around a BMad skill. Upgrading BMad
278
- does not strand you, and no BMad skill is meant to be invoked directly.
279
-
280
- ---
281
-
282
- ## The gap this fills
283
-
284
- A gate is only as good as the artifact it reads. Between *"the architecture is decided"* and *"the code
285
- is written"* there is a set of questions that decide whether a build goes straight or crooked, and they
286
- are all **list-shaped**:
287
-
288
- - Which use cases exist, and which of them touch money, personal data, or something irreversible?
289
- - Which tables exist, and which component is allowed to **write** each one?
290
- - Which endpoints exist, on which host, and which promise does each serve?
291
- - Which screens exist, in which application?
292
- - When a boundary fails halfway — the other side slow, absent, or lying — what does the user see?
293
-
294
- Those questions have answers inside an architecture document and a build spec. What they usually do not
295
- have is a **place where a person can read all of one kind at once** and notice the row that is missing,
296
- the table with two owners, or the endpoint nobody promised.
297
-
298
- WDI Method's whole contribution is that place, plus the discipline that keeps it honest:
299
-
300
- | | |
301
- |---|---|
302
- | **Inventories** | Tables, endpoints, and screens as three flat lists — **derived from the code**, not hand-written, so the difference between plan and reality is a finding rather than an argument |
303
- | **Use case catalogue** | One line per use case with its actor, the requirement it satisfies, and whether it is `critical` |
304
- | **SRS / SDD** | What a component promises, and how it is built — one pair per component, in human language |
305
- | **C4** | Context, containers, and one component view per container that carries more than one domain slice |
306
- | **Robustness** | For the deepest mode: boundary, control, and entity objects per critical use case, before code |
307
- | **Invariants** | A spine of `AD-N` rules that constrain every component, separate from the decisions that produced them |
308
-
309
- ---
310
-
311
- ## Two knobs, never merged
312
-
313
- The reason a method like this usually fails is that it asks for the same depth everywhere, so people
314
- either drown in it or abandon it. WDI splits depth from scrutiny into **two independent fields**:
315
-
316
- | Field | Controls | Values |
317
- |---|---|---|
318
- | `mode` | **Document depth**, and nothing else | `catalog` · `outline` · `guarded` · `deep` |
319
- | `risk_accepted` | **Review intensity**, and nothing else | `low` · `medium` · `high` |
320
-
321
- | `mode` | What is written per component | G4 |
322
- |---|---|---|
323
- | `catalog` | Nothing. Code is written from the use case catalogue, the three inventories, and C4 | **skipped** |
324
- | `outline` | + a decision summary and the component list in the SDD, full flows for at most 3 use cases, local rules | 20 min |
325
- | `guarded` | + **failure behaviour for every boundary**, inherited invariants quoted verbatim, integration documents | 20 min |
326
- | `deep` | + robustness analysis, a contract per endpoint, data dictionary, flow diagrams, state machines | 30 min |
327
-
328
- Neither field is derived from the other, and that is the point: **a component MAY be thin on purpose and
329
- reviewed the hardest.** A component at `catalog` skips the component gate entirely — which is what makes
330
- a shallow default genuinely fast rather than nominally fast.
331
-
332
- Depth is a preference and needs no defence. Accepting risk on something that touches money, personal
333
- data, or an irreversible action is **not** free: it requires a recorded decision, and a validator checks
334
- that the decision exists.
335
-
336
- All twelve combinations are legal. The installed kit carries
337
- `.constitution/method/why/mode-risk-map.md`, which puts them side by side — what each cell costs at G4,
338
- which review lenses run, and which review traces a validator will demand.
339
-
340
- ---
341
-
342
- ## Five gates, eighteen skills
343
-
344
- | Gate | Decides | Skill |
345
- |---|---|---|
346
- | **G1 Problem** | What the problem is, whose it is, why it earns work | `wdi-problem` |
347
- | **G2 Product** | What is built, and how it feels to use | `wdi-product` · optional `wdi-ux` |
348
- | **G3 Blueprint** | The whole portrait, once per product | `wdi-blueprint` |
349
- | **G4 Component** | How one component is built — **skipped at `catalog`** | `wdi-component` |
350
- | **G5 Release** | Whether it is done and proven | `wdi-build` |
351
-
352
- Around them: `wdi-init` (scaffold, component birth, depth and risk settings, structure maps),
353
- `wdi-decision`, `wdi-question`, `wdi-log`, `wdi-help`, `wdi-explain-to-me`, `wdi-autopilot`, `wdi-reconcile`, `wdi-review`, `wdi-report`,
354
- `wdi-systematic-debugging`, and `wdi-upgrade` (moves a corpus written under an older kit into the current
355
- shape — content moves, nothing is invented).
356
-
357
- **No BMad skill is invoked directly.** Each has a wrapper, and the wrapper is what checks position,
358
- verifies the result, and records what happened.
359
-
360
- ### Decisions, not ADRs
361
-
362
- A decision is a `DEC-`, and **recording one is not mandatory.** The test is one sentence: *if somebody
363
- asks in three months why it is like this, is the answer readable from the code?* If yes, it MUST NOT be
364
- recorded — a register nobody trusts is worse than no register. One case is mandatory: contradicting an
365
- invariant on the spine.
366
-
367
- A `DEC-` freezes when it is applied. A change of mind produces a new one; it never edits the old.
368
-
369
- ---
370
-
371
- ## The mechanical half
372
-
373
- `validate.py` runs twenty-six named validators — `goal-has-fr`, `cites-resolve`, `no-cycles`,
374
- `id-allocated-once`, and the rest, each named for the thing it checks — over the registries and the
375
- corpus, and `inventory.py` derives the three inventories from code and reports the difference against the
376
- plan without patching either side. There is no validator that compares two copies of one fact, because
377
- the corpus keeps no copies.
378
-
379
- The validators exist because prose that nothing checks is prose that gets contradicted by the first
380
- person in a hurry. Every one of them also states **the state in which it does not apply** — a rule that
381
- demands a trace before the trace can exist is a rule that gets switched off, and a validator nobody
382
- reads guards nothing.
383
-
384
- ---
385
-
386
- ## What is generic, and where your own rules live
387
-
388
- `.constitution/` holds **exactly two folders**, and the folder is the whole answer to who owns a file:
389
-
390
- | Folder | Owner | `update` | `promote` |
391
- |---|---|---|---|
392
- | `.constitution/method/` | the method | **overwritten** in full | carries it into the package |
393
- | **`.constitution/project/`** | you | **never touched** — seeded once when absent | never carries it, so your rules cannot be published |
394
-
395
- Everything in the room is yours: `project/constitution.md` (Articles 1, 2, 5 — scope, repo checklist,
396
- method ownership), `project/codebase-*-guide.md` (stack, conventions, brownfield, protected at **any**
397
- `status:` — `Draft` is when they actually get written), and any rule file you add.
398
-
399
- **The seam is a folder, never a marked region inside a generic file.** Prose has no merge algebra: you
400
- cannot "merge" your paragraph with the method's, so only a path can say unambiguously whose a file is.
401
- `AGENTS.md` is the one exception, and only because it is a single file with nowhere else to go.
402
-
403
- Two more things are yours, outside `.constitution/`:
404
-
405
- | Yours | Because |
406
- |---|---|
407
- | `.control/registry/index.yaml` → `product:` | The product and client name live in exactly one place |
408
- | `_bmad/custom/*.user.toml` | Your BMad overrides — TOML, so these genuinely merge: a string replaces, a list appends, a table merges per key |
409
-
410
- `.control/` `.what/` `.how/` are never touched by an update at all — they are your state, your promises,
411
- and your design.
412
-
413
- The custom room takes whole files, not marked blocks inside generic ones: `AGENTS.md` can use a marked
414
- block because it is *one* file, while `.constitution/` has fifty-odd, and blocks inside them would make
415
- an update perform surgery in every file. A file there declares `scope: project` and a one-line
416
- `purpose:`; to **contradict** a generic rule it must name that rule and carry the decision that allowed
417
- it. **An empty room is a valid state** — filling it so that it gets used is the failure the rule prevents.
418
-
419
- ### Language
420
-
421
- Two settings, both free text, both defaulting to English:
422
-
423
- ```yaml
424
- policy:
425
- doc_language: "English" # prose of working documents
426
- doc_filename_language: "English" # the slug part of a document filename
427
- ```
428
-
429
- Write whatever names the language — `English`, `Bahasa Indonesia`, `id`. What reads the value is a model,
430
- and a model does not need a lookup table.
431
-
432
- Always English, and never asked: method terminology, document code prefixes (`UC-`, `DEC-`), machine
433
- markers (`[NEEDS CONFIRMATION]`, `[MISSING]`), and code identifiers. `.constitution/` itself is always
434
- English, whatever the settings say — it travels to every repo through this package.
435
-
436
- ---
437
-
438
- ## What update does
439
-
440
- | | |
441
- |---|---|
442
- | Overwrites | everything in `.constitution/method/` · the eighteen wrappers · `_bmad/custom/*.toml` · the marked block in `AGENTS.md` |
443
- | Renames | a file whose content needs no judgment to move — `waves.yaml` → `specs.yaml`, the pre-0.5 registry names, and a pre-0.6.2 autopilot ledger to `autopilot-<mandate-id>.md`. Content is never rewritten |
444
- | Seeds | `docs/agents/` — the ticket engines' own config, already answered for this method, so `/setup-matt-pocock-skills` is not part of getting started. Seeded once; a file you already wrote is never touched |
445
- | Removes | Wrappers the method has retired — a `wdi-*` folder with a `SKILL.md` that is no longer one of the eighteen. Each removal is printed |
446
- | Reports | what is still in the OLD shape, as an `upgrade` line — and names `wdi-upgrade` as the next step. The installer does not move content; that is a decision, and the skill's |
447
- | Keeps | All of `.constitution/project/`, plus your initiative slug and your language choice. A setting somebody already chose is not the installer's to change behind their back |
448
- | Never resurrects | A folder you retired. On update, absence is treated as a decision |
449
- | Warns, never edits | An open `wdi-autopilot` mandate written before `ad-n` was parked by default, and a `docs/agents/domain.md` still pointing at a root `CONTEXT.md`. Both are values you chose; the installer names them and leaves them alone |
450
-
451
- It prints the version it replaced, what it wrote, what it kept, and what to do next.
452
-
453
- ---
454
-
455
- ## Changing the method
456
-
457
- **This repository is where a method change is authored** — a guide, a template, a skill wrapper, a
458
- validator. It is proven here before publishing, against a fixture corpus the three registry scripts
459
- actually run against:
460
-
461
- ```bash
462
- npm test # includes validate.py, timeline.py and inventory.py over tests/fixture/
463
- ```
464
-
465
- The fixture is small but complete, and kept **green**, so a new finding is a regression rather than
466
- noise. One test plants a defect in a copy and requires the matching validator to name it — a green
467
- baseline is worthless if it is green because every check is broken.
468
-
469
- A consuming repo then takes the change with `npx wdi-method update`, and that is where the judgement
470
- half gets tested: whether a guide actually helps a person at G3 is only provable in use.
471
-
472
- `promote` — pulling the method back out of a consumer — is a **rescue tool**, not the workflow. It
473
- overwrites the whole kit from one copy, so it refuses to run without `--rescue`.
474
- [`CONTRIBUTING.md`](CONTRIBUTING.md) records why the direction was reversed and what it cost.
475
-
476
- **Patch releases are routine; minor and major are the maintainer's call.** This package overwrites files
477
- in repos that already hold months of work, and the version is the only signal a reader has for how
478
- carefully to read the diff. [`CONTRIBUTING.md`](CONTRIBUTING.md) has the detail, and
479
- [`AGENTS.md`](AGENTS.md) states it for agents working on the package.
480
-
481
- ---
482
-
483
- ## Support and Contributing
484
-
485
- Open an [issue](https://github.com/wiradigitalid/wdi-method/issues) for a bug or a proposal. Read
486
- [`CONTRIBUTING.md`](CONTRIBUTING.md) before sending a pull request — it explains where a change belongs,
487
- how versioning works here, and what to check before publishing.
488
-
489
- ## License
490
-
491
- MIT — see [LICENSE](LICENSE). Requires Node 20+ and [uv](https://docs.astral.sh/uv/) for the Python
492
- scripts.
493
-
494
- [![Version](https://img.shields.io/npm/v/wdi-method?color=blue&label=version)](https://www.npmjs.com/package/wdi-method)
495
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
1
+ # WDI Method
2
+
3
+ **The review layer BMad leaves thin — documents a human reads to check a decision before code gets written, sized to what the change actually deserves.**
4
+
5
+ [BMad](https://github.com/bmad-code-org/BMAD-METHOD) decides *what* to build and *how* to build it well. WDI Method wraps it — it does not replace it — and adds the part between those two decisions and the code: inventories, a use case catalogue, a component design record, and a way to choose how much of that a given change actually needs.
6
+
7
+ > This repository is **public and generic**. It MUST NOT carry a client name, a product name, or a
8
+ > link to a private repository — product identity lives entirely in the repo that installs it.
9
+
10
+ ---
11
+
12
+ ## Prerequisites — two engines, and both are required
13
+
14
+ | Engine | What it does here | Source |
15
+ |---|---|---|
16
+ | **BMad Method** | Writes the documents behind G1–G4 — brief, PRD, architecture, UX | [github.com/bmad-code-org/BMAD-METHOD](https://github.com/bmad-code-org/BMAD-METHOD) |
17
+ | **mattpocock/skills** | Cuts the work at G5 — `to-spec`, `to-tickets`; runs the Fast Path and every `wdi-autopilot` iteration — `implement` | [github.com/mattpocock/skills](https://github.com/mattpocock/skills) |
18
+
19
+ **The installer refuses without either.** BMad has always been checked. The ticket engines are checked
20
+ too, since 0.6.4: G1–G4 genuinely run without them, and every repo that relied on that learned they were
21
+ missing inside `wdi-build` with a spec already open. `--skip-engines-check` is the escape for the two
22
+ cases that earn it — CI, and a repo that will never reach G5.
23
+
24
+ No engine skill is invoked on its own. Each has a wrapper (`wdi-*`) that checks where the project is,
25
+ runs the engine, verifies what came back, and records it. The engine is the pen; the wrapper knows what
26
+ page it is on.
27
+
28
+ ---
29
+
30
+ ## Install
31
+
32
+ Three steps, in this order. The first is required before step 3 will run; the second can wait until
33
+ **Both are required, and the installer refuses without either.** BMad has always been checked; the ticket
34
+ engines are checked too, because every repo that learned they were missing learned it inside `wdi-build`
35
+ with a spec already open. `--skip-engines-check` is the escape for the two cases that earn it: CI, and a
36
+ repo that will never reach G5.
37
+
38
+ **1. BMad Method** — in the product repo, picking the same agents you will give this installer:
39
+
40
+ ```bash
41
+ cd /path/to/your/product-repo
42
+ npx bmad-method install
43
+ ```
44
+
45
+ **2. mattpocock/skills** — one of the two paths, not both (both leaves every skill twice):
46
+
47
+ ```bash
48
+ # Claude Code — a managed bundle that updates when its author ships
49
+ claude plugins install mattpocock-skills # or, inside a session: /plugin install mattpocock-skills
50
+
51
+ # Codex, Cursor, OpenCode, other agents — copies the skills into this repo; keep setup-matt-pocock-skills selected
52
+ npx skills@latest add mattpocock/skills
53
+ ```
54
+
55
+ **You do not need to run `/setup-matt-pocock-skills` to get started.** Step 3 seeds `docs/agents/` with
56
+ the two answers WDI Method actually has a requirement on, so the engines are aligned from the first
57
+ install. Run the setup skill only to *change* something — to point at GitHub or Jira instead of local
58
+ markdown — and keep the three invariants the seeded `issue-tracker.md` names.
59
+
60
+ The seeding exists because the interview's own defaults are wrong here in one specific way: they send every
61
+ engineering skill looking for a root `CONTEXT.md` and `docs/adr/`, and Article 3 says this method has no
62
+ `docs/` layer for corpus or rules — `wdi-reconcile` reports both as findings. A repo that ran the setup
63
+ before installing this package keeps its own file, and the installer names the contradiction rather than
64
+ overwriting it.
65
+
66
+ **3. WDI Method:**
67
+
68
+ ```bash
69
+ npx wdi-method
70
+ ```
71
+
72
+ This opens a TUI: it checks BMad, reports whether it found the ticket engines, detects install versus
73
+ update, asks the product name and the document language, lets you pick agents, shows what it will
74
+ write, and prints what to do next.
75
+
76
+ **Every field arrives with an answer already in it, and Enter accepts it.** On an update that answer is
77
+ what the repo already says; on a first install the product name is the folder name made readable —
78
+ `acme-billing-portal` offers `Acme Billing Portal`. Nothing is validated as required: a prompt that
79
+ refuses an empty submission while already holding a sensible default is asking you to retype something
80
+ the installer knows.
81
+
82
+ A value only changes when you actually answer. A run that does not mention language keeps the language the
83
+ repo already chose, and says so.
84
+
85
+ ```bash
86
+ npx wdi-method@latest update # later, to take a newer method — @latest, or npx may reuse a cached one
87
+ npx wdi-method verify # check the method files are all present
88
+ ```
89
+
90
+ **Upgrading from 0.5.x to 0.6** is two halves. `update` does the mechanical one — overwrites the kit,
91
+ renames files whose content needs no judgment, seeds what is new — and then prints an `upgrade` line
92
+ naming what is still in the old shape: a single `requirements.yaml`, a 14-section brief, a PRD carrying
93
+ its FR text. The second half is a decision about content, so it belongs to a skill:
94
+
95
+ ```bash
96
+ npx wdi-method@latest update --yes # 1 — mechanical; read the `upgrade` line it prints
97
+ # 2 — in your agent, run the wdi-upgrade skill: it moves every sentence into its new home, word for
98
+ # word, invents nothing, reports what it could not place, and ends in one commit.
99
+ ```
100
+
101
+ Run the skill before any other skill. `wdi-help` and the validators read the new shape; a corpus half
102
+ in the old one answers them wrongly.
103
+
104
+ Non-interactive, for CI:
105
+
106
+ ```bash
107
+ npx wdi-method install --yes --agents claude,codex --product "Your Product" \
108
+ --doc-language "Bahasa Indonesia"
109
+ ```
110
+
111
+ Then invoke the **`wdi-help`** skill and ask what to do next. It reads where the project actually is and
112
+ answers with the gate you are at, not with a menu.
113
+
114
+ ---
115
+
116
+ ## What to do right after install, and right after update
117
+
118
+ Two questions, and the honest answer to most of them is *nothing*. `wdi-help` answers them from the
119
+ registry at any time; this table is the same answer written down.
120
+
121
+ ### After `install`
122
+
123
+ | | |
124
+ |---|---|
125
+ | Engines missing | You never get here — `install` refuses, and names both install paths. Install them, run it again |
126
+ | `/setup-matt-pocock-skills`? | **No.** The installer seeded `docs/agents/` already answered for this method. Run that interview only to *change* tracker |
127
+ | So what is first? | **`wdi-init` intent `setup`** — it sets the global `mode`, and nothing has started until it is |
128
+ | Then? | `wdi-problem` for G1. Or ask `wdi-help`, which reads the registry rather than this table |
129
+
130
+ ### After `update`
131
+
132
+ | The summary said | Do |
133
+ |---|---|
134
+ | an **`upgrade`** line, naming content still in the old shape | **`wdi-upgrade`, before any other skill.** It moves every sentence into its new home, invents nothing, reports what it could not place, and ends in one commit. `wdi-help` and the validators read the new shape; a corpus half in the old one answers them wrongly |
135
+ | **no** `upgrade` line | Nothing. The update was mechanical and complete — carry on from wherever the gates say you are |
136
+ | `seeded docs/agents/` | Nothing. An older repo just received the engines' config, pre-answered. Read it if you like; do not run the setup interview to redo it |
137
+ | a warning that `domain.md` still points at a root `CONTEXT.md` | Add the correction that warning names to the top of that file. It was written by the setup interview before this package was installed, and it sends every engineering skill at two paths Article 3 forbids |
138
+ | a warning naming a **mandate** and `ad-n` | Only if you run `wdi-autopilot`. Decide whether that mandate should now park `AD-N` contradictions, and edit its `parked` list yourself — `update` never edits an authority you granted |
139
+
140
+ **`wdi-upgrade` is only ever about corpus content** — a brief, a PRD, an SRS, registry rows in the old
141
+ shape. It is not the answer to a missing engine, a missing tracker config, or anything under
142
+ `.control/memlog/`; each of those is handled by the installer itself or by the skill that owns it.
143
+
144
+ ---
145
+
146
+ ## How to use it — the walk
147
+
148
+ A gate is a moment where a human reads **one page** and decides. Between gates the AI works in a
149
+ pointer-heavy working set it does not need you to read. So the walk is: run a skill, read the page it
150
+ renders, decide — advance or refine.
151
+
152
+ | # | You run | You read | You decide |
153
+ |---|---|---|---|
154
+ | 0 | `wdi-init` intent `setup` | — | the global `mode`: how deep this product goes by default |
155
+ | 1 | `wdi-problem` | `.what-rendered/_product-brief/brief.md` | **G1** — is this the problem, whose is it, and does it earn the work? |
156
+ | 2 | `wdi-product` intent `prd` — `wdi-ux` first when the interface *is* the promise | `.what-rendered/_prd/<slug>/prd.md` | **G2** — is this what we build, and how does it feel? |
157
+ | 3 | `wdi-init` intent `component` | the rows it adds to `components.yaml` | each component's `mode` and `risk_accepted` |
158
+ | 4 | `wdi-blueprint` — `catalog`, then `platform` | `.how-rendered/blueprint.md` | **G3** — does the whole hold together? **Once per product** |
159
+ | 5 | `wdi-component` — one component | `.how-rendered/<pc>/SDD-<pc>.md` | **G4** — is this how we build it? **Skipped at `mode: catalog`** |
160
+ | 6 | `wdi-report` intent `estimate` | `.control/generated/estimate.md` | which candidate row becomes the next spec |
161
+ | 7 | `wdi-build` — for that row | nothing: tickets are machine contracts. You answer `to-tickets`' quiz on granularity and blocking edges | **G5** — is it done and proven? Once per spec |
162
+ | 8 | `wdi-report` intent `progress` | the report it writes | what has moved, what is late, what is proven |
163
+ | 9 | `wdi-autopilot` — when you would rather review the result than walk steps 6–8 yourself | its preflight page, then its final report and ledger | one **mandate**: scope, what stays parked for you, smoke test by the agent or by you, loop interval, expiry |
164
+
165
+ **Unattended, on request.** `wdi-autopilot` moves owner time from the gates to two points: the mandate before,
166
+ the review after. From the gate you name it runs the same skills, answers what they would have asked, records
167
+ every answer in `.control/memlog/autopilot-<mandate-id>.md`, and returns at one of three stops — done,
168
+ at capacity, or blocked. It finishes when every `FR` in scope is closed, when nothing left is runnable, or
169
+ when the mandate expires. It needs three things from the session: permission prompts bypassed (one prompt halts the
170
+ loop), a loop to fire it — `/loop 5m /wdi-autopilot` in Claude Code — and a way past the ticket engines'
171
+ `disable-model-invocation`, which the preflight names: a builder that reads and follows the engine's `SKILL.md`,
172
+ or a copy of the engines inside the repo. The validator `mandate-accept` keeps the one thing the method never
173
+ gives up: a person, dated, at the root of every delegated acceptance.
174
+
175
+ **Refine, do not advance.** When a page does not convince you, run the same skill again and say what is
176
+ wrong — it updates the document it owns. Nothing downstream exists yet, so nothing breaks. Advancing past a
177
+ page you did not believe is how every later page inherits the doubt.
178
+
179
+ **After the first pass**, steps 0–4 never run again for that product. The next component enters at step 5
180
+ (or 6, at `catalog`); a new initiative enters at step 2; a small fix touching no `FR`, `UC`, `AD-N`, or
181
+ domain model skips every gate and runs `/implement` directly — and **stops to become a spec `S`** the
182
+ moment it touches an `FR`. `wdi-help` tells you which of these you are in; it reads the registry, not you.
183
+
184
+ ---
185
+
186
+ ## Why the steps are in this order
187
+
188
+ - **One question per gate.** The brief answers *why*, the PRD *what*, the blueprint *the whole*, the SDD
189
+ *how one part*, the spec *is it done*. Every document that grew unreadable did so by answering a
190
+ neighbour's question too. A gate that asks one question can be passed in ten minutes.
191
+ - **The page you read is rendered; the page the AI edits points.** A goal lives once, in
192
+ `goals.yaml`; the working brief says `Goals — see goals.yaml`; the rendered brief shows the goals in
193
+ full. So the human gets a complete document and the corpus has no copies — and the validators check
194
+ **drift against the code**, never whether two copies agree, because there are none to compare.
195
+ - **Cost follows the unit of change.** G3 is once per product because the portrait is one thing. G4 is per
196
+ component because that is what changes when you build. G5 is per spec because that is what ships.
197
+ Repeating the blueprint per component was the single largest waste the earlier shape carried.
198
+ - **Two knobs that never merge.** `mode` decides which gates *exist* for a component (`catalog` skips G4
199
+ outright); `risk_accepted` decides how much *proof* a gate demands. Merged into one "rigor" dial, a
200
+ low-risk component either drowns in ceremony or a high-risk one escapes it.
201
+ - **Estimate before build.** Step 6 derives the candidate tasks from the promises already made —
202
+ `CAP` and `FR` — so nobody invents a backlog. One candidate row becomes one spec, three neighbours
203
+ may merge into one, and the estimate page says so about itself: it is forward-looking, never a record.
204
+ - **The engine cuts; the wrapper frames.** `to-spec` and `to-tickets` are the best ticket-cutting
205
+ engine we found: vertical tracer-bullet slices, blocking edges, a quiz with the owner. What a cutter
206
+ cannot know, `wdi-build` supplies: that every component the spec touches passed G4; that every ticket
207
+ names the `UC` it `satisfies`, so `FR → UC → ticket → test` stays one chain; that a spec restates
208
+ promises and never makes new ones; that code is judged by the test suite going red then green, from a
209
+ fresh context per step, never by a builder's report; and that a closed spec leaves the registry caught
210
+ up and the inventories re-derived from code.
211
+ - **Documents follow the code.** At spec close the inventories are regenerated from what was built and
212
+ the difference is *reported*, never patched into agreement. A record that contradicts the code is
213
+ corrected; code is never changed to match a record.
214
+
215
+ ---
216
+
217
+ ## The file tree, and why
218
+
219
+ ```
220
+ .constitution/
221
+ method/ the method — overwritten by every update; never edit here
222
+ project/ your own rules and readers — kept by every update
223
+ .control/
224
+ registry/ SSOT for every ROW: goals.yaml · requirements-<slug>.yaml · components.yaml
225
+ usecases.yaml · specs.yaml · risks.yaml · defects.yaml · index.yaml
226
+ questions/ open questions, assumptions, external prerequisites — one row each
227
+ decisions/ DEC-N files; frozen once applied
228
+ generated/ machine tables: rtm · dag · status · estimate · timeline — regenerated, never edited
229
+ .what/ what is PROMISED — the AI's working set, pointer-heavy, few files
230
+ _product-brief/brief.md
231
+ _prd/<slug>/prd.md · addendum.md
232
+ <pc>/SRS-<pc>.md + 02-rules · 03-domain · 04-usecases · 05-scenarios
233
+ .how/ how it is BUILT — same discipline
234
+ _platform/ ARCHITECTURE-SPINE.md · c4-l2-containers.md · inventories
235
+ <pc>/SDD-<pc>.md + 01-ux · 02-contracts · 04-components · 05-model · 06-flows
236
+ .what-rendered/ the human's tree: brief · _prd/<slug>/prd.md · <pc>/SRS-<pc>.md — one complete page each
237
+ .how-rendered/ blueprint.md (root — it spans every component) · <pc>/SDD-<pc>.md
238
+ _bmad-output/ a skill run's working output; empties as its spec closes
239
+ .work/ scratch; empties when the task closes
240
+ <spec_folder>/issues/ one file per ticket — the tracker's payload, not yours to read
241
+ ```
242
+
243
+ Three layers, and the rule that keeps them honest:
244
+
245
+ | Layer | Holds | Who writes | Who reads |
246
+ |---|---|---|---|
247
+ | **Registry** | every row — a goal, a requirement, a component, a ticket index | the skill that owns the gate | validators, renderers, every other skill |
248
+ | **Working documents** (`.what/`, `.how/`) | the prose that reasons — why, boundaries, what makes it different — and **pointers** at the rows | the owning skill | the AI |
249
+ | **Rendered pages** (`*-rendered/`) | one complete page per gate, rows filled in from their homes | `validate.py --generate`, never a hand | the human, and the client |
250
+
251
+ Why split the human's tree from the AI's: a document that is both the AI's working surface and the
252
+ human's deliverable ends up serving neither — too long to point, too gappy to hand over. Why the
253
+ registry is per initiative (`requirements-<slug>.yaml`) but goals are per product: a capability is
254
+ declared by one feature in one PRD; a goal belongs to the product before any PRD exists. Why
255
+ `blueprint.md` sits at the root of `.how-rendered/` and not under `_platform/`: `_platform` means
256
+ "belongs to no component"; the blueprint spans all of them. Why rendered pages are never a skill's
257
+ input: a skill that read a projection would be reading a copy, and the copy would start to drift the
258
+ day someone edited it. A test in this package fails if any `SKILL.md` lists a `-rendered` path as an
259
+ Input.
260
+
261
+ ---
262
+
263
+ ## Why WDI Method?
264
+
265
+ - **Depth separate from scrutiny.** `mode` sets how much gets written; `risk_accepted` sets how hard it
266
+ gets reviewed. Neither is derived from the other, so a component MAY be thin on purpose and reviewed the
267
+ hardest.
268
+ - **Ground truth over plan.** Once code exists, the tables, endpoints, and screens are **derived from it**
269
+ — the gap between plan and reality is a finding to resolve, not an argument to have.
270
+ - **Containers that match what actually ships.** C4's containers follow deployability, not folders, and a
271
+ component view is drawn for every container that carries more than one Product Component.
272
+ - **A gate that can be skipped honestly.** `mode: catalog` skips the component gate entirely — a fast
273
+ default is fast because the work is genuinely gone, not nominally trimmed.
274
+ - **Decisions that don't rot.** A `DEC-` is recorded only when the reason would not survive reading the
275
+ code, and it freezes the moment it is applied — a change of mind writes a new one rather than editing
276
+ the old.
277
+ - **Wraps BMad, never forks it.** Every `wdi-*` skill is a wrapper around a BMad skill. Upgrading BMad
278
+ does not strand you, and no BMad skill is meant to be invoked directly.
279
+
280
+ ---
281
+
282
+ ## The gap this fills
283
+
284
+ A gate is only as good as the artifact it reads. Between *"the architecture is decided"* and *"the code
285
+ is written"* there is a set of questions that decide whether a build goes straight or crooked, and they
286
+ are all **list-shaped**:
287
+
288
+ - Which use cases exist, and which of them touch money, personal data, or something irreversible?
289
+ - Which tables exist, and which component is allowed to **write** each one?
290
+ - Which endpoints exist, on which host, and which promise does each serve?
291
+ - Which screens exist, in which application?
292
+ - When a boundary fails halfway — the other side slow, absent, or lying — what does the user see?
293
+
294
+ Those questions have answers inside an architecture document and a build spec. What they usually do not
295
+ have is a **place where a person can read all of one kind at once** and notice the row that is missing,
296
+ the table with two owners, or the endpoint nobody promised.
297
+
298
+ WDI Method's whole contribution is that place, plus the discipline that keeps it honest:
299
+
300
+ | | |
301
+ |---|---|
302
+ | **Inventories** | Tables, endpoints, and screens as three flat lists — **derived from the code**, not hand-written, so the difference between plan and reality is a finding rather than an argument |
303
+ | **Use case catalogue** | One line per use case with its actor, the requirement it satisfies, and whether it is `critical` |
304
+ | **SRS / SDD** | What a component promises, and how it is built — one pair per component, in human language |
305
+ | **C4** | Context, containers, and one component view per container that carries more than one domain slice |
306
+ | **Robustness** | For the deepest mode: boundary, control, and entity objects per critical use case, before code |
307
+ | **Invariants** | A spine of `AD-N` rules that constrain every component, separate from the decisions that produced them |
308
+
309
+ ---
310
+
311
+ ## Two knobs, never merged
312
+
313
+ The reason a method like this usually fails is that it asks for the same depth everywhere, so people
314
+ either drown in it or abandon it. WDI splits depth from scrutiny into **two independent fields**:
315
+
316
+ | Field | Controls | Values |
317
+ |---|---|---|
318
+ | `mode` | **Document depth**, and nothing else | `catalog` · `outline` · `guarded` · `deep` |
319
+ | `risk_accepted` | **Review intensity**, and nothing else | `low` · `medium` · `high` |
320
+
321
+ | `mode` | What is written per component | G4 |
322
+ |---|---|---|
323
+ | `catalog` | Nothing. Code is written from the use case catalogue, the three inventories, and C4 | **skipped** |
324
+ | `outline` | + a decision summary and the component list in the SDD, full flows for at most 3 use cases, local rules | 20 min |
325
+ | `guarded` | + **failure behaviour for every boundary**, inherited invariants quoted verbatim, integration documents | 20 min |
326
+ | `deep` | + robustness analysis, a contract per endpoint, data dictionary, flow diagrams, state machines | 30 min |
327
+
328
+ Neither field is derived from the other, and that is the point: **a component MAY be thin on purpose and
329
+ reviewed the hardest.** A component at `catalog` skips the component gate entirely — which is what makes
330
+ a shallow default genuinely fast rather than nominally fast.
331
+
332
+ Depth is a preference and needs no defence. Accepting risk on something that touches money, personal
333
+ data, or an irreversible action is **not** free: it requires a recorded decision, and a validator checks
334
+ that the decision exists.
335
+
336
+ All twelve combinations are legal. The installed kit carries
337
+ `.constitution/method/why/mode-risk-map.md`, which puts them side by side — what each cell costs at G4,
338
+ which review lenses run, and which review traces a validator will demand.
339
+
340
+ ---
341
+
342
+ ## Five gates, eighteen skills
343
+
344
+ | Gate | Decides | Skill |
345
+ |---|---|---|
346
+ | **G1 Problem** | What the problem is, whose it is, why it earns work | `wdi-problem` |
347
+ | **G2 Product** | What is built, and how it feels to use | `wdi-product` · optional `wdi-ux` |
348
+ | **G3 Blueprint** | The whole portrait, once per product | `wdi-blueprint` |
349
+ | **G4 Component** | How one component is built — **skipped at `catalog`** | `wdi-component` |
350
+ | **G5 Release** | Whether it is done and proven | `wdi-build` |
351
+
352
+ Around them: `wdi-init` (scaffold, component birth, depth and risk settings, structure maps),
353
+ `wdi-decision`, `wdi-question`, `wdi-log`, `wdi-help`, `wdi-explain-to-me`, `wdi-autopilot`, `wdi-reconcile`, `wdi-review`, `wdi-report`,
354
+ `wdi-systematic-debugging`, and `wdi-upgrade` (moves a corpus written under an older kit into the current
355
+ shape — content moves, nothing is invented).
356
+
357
+ **No BMad skill is invoked directly.** Each has a wrapper, and the wrapper is what checks position,
358
+ verifies the result, and records what happened.
359
+
360
+ ### Decisions, not ADRs
361
+
362
+ A decision is a `DEC-`, and **recording one is not mandatory.** The test is one sentence: *if somebody
363
+ asks in three months why it is like this, is the answer readable from the code?* If yes, it MUST NOT be
364
+ recorded — a register nobody trusts is worse than no register. One case is mandatory: contradicting an
365
+ invariant on the spine.
366
+
367
+ A `DEC-` freezes when it is applied. A change of mind produces a new one; it never edits the old.
368
+
369
+ ---
370
+
371
+ ## The mechanical half
372
+
373
+ `validate.py` runs twenty-seven named validators — `goal-has-fr`, `cites-resolve`, `no-cycles`,
374
+ `id-allocated-once`, and the rest, each named for the thing it checks — over the registries and the
375
+ corpus, and `inventory.py` derives the three inventories from code and reports the difference against the
376
+ plan without patching either side. There is no validator that compares two copies of one fact, because
377
+ the corpus keeps no copies.
378
+
379
+ The validators exist because prose that nothing checks is prose that gets contradicted by the first
380
+ person in a hurry. Every one of them also states **the state in which it does not apply** — a rule that
381
+ demands a trace before the trace can exist is a rule that gets switched off, and a validator nobody
382
+ reads guards nothing.
383
+
384
+ ---
385
+
386
+ ## What is generic, and where your own rules live
387
+
388
+ `.constitution/` holds **exactly two folders**, and the folder is the whole answer to who owns a file:
389
+
390
+ | Folder | Owner | `update` | `promote` |
391
+ |---|---|---|---|
392
+ | `.constitution/method/` | the method | **overwritten** in full | carries it into the package |
393
+ | **`.constitution/project/`** | you | **never touched** — seeded once when absent | never carries it, so your rules cannot be published |
394
+
395
+ Everything in the room is yours: `project/constitution.md` (Articles 1, 2, 5 — scope, repo checklist,
396
+ method ownership), `project/codebase-*-guide.md` (stack, conventions, brownfield, protected at **any**
397
+ `status:` — `Draft` is when they actually get written), and any rule file you add.
398
+
399
+ **The seam is a folder, never a marked region inside a generic file.** Prose has no merge algebra: you
400
+ cannot "merge" your paragraph with the method's, so only a path can say unambiguously whose a file is.
401
+ `AGENTS.md` is the one exception, and only because it is a single file with nowhere else to go.
402
+
403
+ Two more things are yours, outside `.constitution/`:
404
+
405
+ | Yours | Because |
406
+ |---|---|
407
+ | `.control/registry/index.yaml` → `product:` | The product and client name live in exactly one place |
408
+ | `_bmad/custom/*.user.toml` | Your BMad overrides — TOML, so these genuinely merge: a string replaces, a list appends, a table merges per key |
409
+
410
+ `.control/` `.what/` `.how/` are never touched by an update at all — they are your state, your promises,
411
+ and your design.
412
+
413
+ The custom room takes whole files, not marked blocks inside generic ones: `AGENTS.md` can use a marked
414
+ block because it is *one* file, while `.constitution/` has fifty-odd, and blocks inside them would make
415
+ an update perform surgery in every file. A file there declares `scope: project` and a one-line
416
+ `purpose:`; to **contradict** a generic rule it must name that rule and carry the decision that allowed
417
+ it. **An empty room is a valid state** — filling it so that it gets used is the failure the rule prevents.
418
+
419
+ ### Language
420
+
421
+ Two settings, both free text, both defaulting to English:
422
+
423
+ ```yaml
424
+ policy:
425
+ doc_language: "English" # prose of working documents
426
+ doc_filename_language: "English" # the slug part of a document filename
427
+ ```
428
+
429
+ Write whatever names the language — `English`, `Bahasa Indonesia`, `id`. What reads the value is a model,
430
+ and a model does not need a lookup table.
431
+
432
+ Always English, and never asked: method terminology, document code prefixes (`UC-`, `DEC-`), machine
433
+ markers (`[NEEDS CONFIRMATION]`, `[MISSING]`), and code identifiers. `.constitution/` itself is always
434
+ English, whatever the settings say — it travels to every repo through this package.
435
+
436
+ ---
437
+
438
+ ## What update does
439
+
440
+ | | |
441
+ |---|---|
442
+ | Overwrites | everything in `.constitution/method/` · the eighteen wrappers · `_bmad/custom/*.toml` · the marked block in `AGENTS.md` |
443
+ | Renames | a file whose content needs no judgment to move — `waves.yaml` → `specs.yaml`, the pre-0.5 registry names, and a pre-0.6.2 autopilot ledger to `autopilot-<mandate-id>.md`. Content is never rewritten |
444
+ | Seeds | `docs/agents/` — the ticket engines' own config, already answered for this method, so `/setup-matt-pocock-skills` is not part of getting started. Seeded once; a file you already wrote is never touched |
445
+ | Removes | Wrappers the method has retired — a `wdi-*` folder with a `SKILL.md` that is no longer one of the eighteen. Each removal is printed |
446
+ | Reports | what is still in the OLD shape, as an `upgrade` line — and names `wdi-upgrade` as the next step. The installer does not move content; that is a decision, and the skill's |
447
+ | Keeps | All of `.constitution/project/`, plus your initiative slug and your language choice. A setting somebody already chose is not the installer's to change behind their back |
448
+ | Never resurrects | A folder you retired. On update, absence is treated as a decision |
449
+ | Warns, never edits | An open `wdi-autopilot` mandate written before `ad-n` was parked by default, and a `docs/agents/domain.md` still pointing at a root `CONTEXT.md`. Both are values you chose; the installer names them and leaves them alone |
450
+
451
+ It prints the version it replaced, what it wrote, what it kept, and what to do next.
452
+
453
+ ---
454
+
455
+ ## Changing the method
456
+
457
+ **This repository is where a method change is authored** — a guide, a template, a skill wrapper, a
458
+ validator. It is proven here before publishing, against a fixture corpus the three registry scripts
459
+ actually run against:
460
+
461
+ ```bash
462
+ npm test # includes validate.py, timeline.py and inventory.py over tests/fixture/
463
+ ```
464
+
465
+ The fixture is small but complete, and kept **green**, so a new finding is a regression rather than
466
+ noise. One test plants a defect in a copy and requires the matching validator to name it — a green
467
+ baseline is worthless if it is green because every check is broken.
468
+
469
+ A consuming repo then takes the change with `npx wdi-method update`, and that is where the judgement
470
+ half gets tested: whether a guide actually helps a person at G3 is only provable in use.
471
+
472
+ `promote` — pulling the method back out of a consumer — is a **rescue tool**, not the workflow. It
473
+ overwrites the whole kit from one copy, so it refuses to run without `--rescue`.
474
+ [`CONTRIBUTING.md`](CONTRIBUTING.md) records why the direction was reversed and what it cost.
475
+
476
+ **Patch releases are routine; minor and major are the maintainer's call.** This package overwrites files
477
+ in repos that already hold months of work, and the version is the only signal a reader has for how
478
+ carefully to read the diff. [`CONTRIBUTING.md`](CONTRIBUTING.md) has the detail, and
479
+ [`AGENTS.md`](AGENTS.md) states it for agents working on the package.
480
+
481
+ ---
482
+
483
+ ## Support and Contributing
484
+
485
+ Open an [issue](https://github.com/wiradigitalid/wdi-method/issues) for a bug or a proposal. Read
486
+ [`CONTRIBUTING.md`](CONTRIBUTING.md) before sending a pull request — it explains where a change belongs,
487
+ how versioning works here, and what to check before publishing.
488
+
489
+ ## License
490
+
491
+ MIT — see [LICENSE](LICENSE). Requires Node 20+ and [uv](https://docs.astral.sh/uv/) for the Python
492
+ scripts.
493
+
494
+ [![Version](https://img.shields.io/npm/v/wdi-method?color=blue&label=version)](https://www.npmjs.com/package/wdi-method)
495
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)