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