wdi-method 0.4.6 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +271 -252
  2. package/bin/wdi-method.js +1221 -1030
  3. package/kit/.constitution/method/README.md +73 -169
  4. package/kit/.constitution/{constitution.md → method/constitution.md} +10 -56
  5. package/kit/.constitution/{document → method/document}/architecture-guide.md +209 -209
  6. package/kit/.constitution/{document → method/document}/corpus-guide.md +4 -4
  7. package/kit/.constitution/{document → method/document}/delivery-flow-guide.md +338 -338
  8. package/kit/.constitution/{document → method/document}/sdd-guide.md +1 -1
  9. package/kit/.constitution/{document → method/document}/templates/cross-cutting.md +2 -2
  10. package/kit/.constitution/{document → method/document}/templates/design-system.md +67 -67
  11. package/kit/.constitution/{document → method/document}/templates/inventory.md +69 -69
  12. package/kit/.constitution/{document → method/document}/templates/sdd.md +1 -1
  13. package/kit/.constitution/{document → method/document}/templates/structure-codebase.md +129 -129
  14. package/kit/.constitution/{document → method/document}/templates/structure-document.md +90 -90
  15. package/kit/.constitution/{language-guide.md → method/language-guide.md} +2 -2
  16. package/kit/.constitution/{method-glossary.md → method/method-glossary.md} +169 -169
  17. package/kit/.constitution/{repo-guide.md → method/repo-guide.md} +120 -97
  18. package/kit/.constitution/method/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  19. package/kit/.constitution/{scripts → method/scripts}/timeline.py +2 -2
  20. package/kit/.constitution/{scripts → method/scripts}/validate.py +1648 -1581
  21. package/kit/.constitution/{structure-guide.md → method/structure-guide.md} +3 -3
  22. package/kit/.constitution/method/why/README.md +169 -0
  23. package/kit/.constitution/method/{artifact-map.md → why/artifact-map.md} +5 -5
  24. package/kit/.constitution/method/{portability.md → why/portability.md} +6 -6
  25. package/kit/.constitution/method/{rationale.md → why/rationale.md} +5 -5
  26. package/kit/.constitution/project/README.md +68 -68
  27. package/kit/.constitution/project/constitution.md +64 -0
  28. package/kit/assets/bmad-custom/bmad-advanced-elicitation.toml +15 -15
  29. package/kit/assets/bmad-custom/bmad-architecture.toml +33 -33
  30. package/kit/assets/bmad-custom/bmad-code-review.toml +13 -13
  31. package/kit/assets/bmad-custom/bmad-correct-course.toml +28 -28
  32. package/kit/assets/bmad-custom/bmad-prd.toml +42 -42
  33. package/kit/assets/bmad-custom/bmad-product-brief.toml +34 -34
  34. package/kit/assets/bmad-custom/bmad-retrospective.toml +9 -9
  35. package/kit/assets/bmad-custom/bmad-spec.toml +16 -16
  36. package/kit/assets/bmad-custom/bmad-ux.toml +19 -19
  37. package/kit/skills/wdi-blueprint/SKILL.md +203 -203
  38. package/kit/skills/wdi-build/SKILL.md +244 -244
  39. package/kit/skills/wdi-component/SKILL.md +1 -1
  40. package/kit/skills/wdi-help/SKILL.md +98 -98
  41. package/kit/skills/wdi-init/SKILL.md +1 -1
  42. package/kit/skills/wdi-problem/SKILL.md +90 -90
  43. package/kit/skills/wdi-product/SKILL.md +127 -127
  44. package/kit/skills/wdi-reconcile/SKILL.md +2 -2
  45. package/kit/skills/wdi-report/SKILL.md +205 -205
  46. package/kit/skills/wdi-systematic-debugging/SKILL.md +193 -193
  47. package/kit/skills/wdi-ux/SKILL.md +145 -145
  48. package/kit-overlay/AGENTS.md +215 -212
  49. package/kit-overlay/README.md +24 -17
  50. package/kit-overlay/constitution.md +10 -56
  51. package/kit-overlay/portability.md +6 -6
  52. package/kit-overlay/repo-guide.md +120 -97
  53. package/package.json +4 -2
  54. package/scaffold/.control/questions/blocking.md +1 -1
  55. package/kit/.constitution/README.md +0 -66
  56. /package/kit/.constitution/{document → method/document}/bmad-guide.md +0 -0
  57. /package/kit/.constitution/{document → method/document}/bmad-skill-register.md +0 -0
  58. /package/kit/.constitution/{document → method/document}/brief-guide.md +0 -0
  59. /package/kit/.constitution/{document → method/document}/decision-guide.md +0 -0
  60. /package/kit/.constitution/{document → method/document}/prd-guide.md +0 -0
  61. /package/kit/.constitution/{document → method/document}/srs-guide.md +0 -0
  62. /package/kit/.constitution/{document → method/document}/templates/addendum.md +0 -0
  63. /package/kit/.constitution/{document → method/document}/templates/architecture-spine.md +0 -0
  64. /package/kit/.constitution/{document → method/document}/templates/brief.md +0 -0
  65. /package/kit/.constitution/{document → method/document}/templates/c4.md +0 -0
  66. /package/kit/.constitution/{document → method/document}/templates/contract.md +0 -0
  67. /package/kit/.constitution/{document → method/document}/templates/decision.md +0 -0
  68. /package/kit/.constitution/{document → method/document}/templates/flow.md +0 -0
  69. /package/kit/.constitution/{document → method/document}/templates/integration.md +0 -0
  70. /package/kit/.constitution/{document → method/document}/templates/lc.md +0 -0
  71. /package/kit/.constitution/{document → method/document}/templates/lifecycle.md +0 -0
  72. /package/kit/.constitution/{document → method/document}/templates/meeting.md +0 -0
  73. /package/kit/.constitution/{document → method/document}/templates/model.md +0 -0
  74. /package/kit/.constitution/{document → method/document}/templates/oq.md +0 -0
  75. /package/kit/.constitution/{document → method/document}/templates/prd.md +0 -0
  76. /package/kit/.constitution/{document → method/document}/templates/questions.md +0 -0
  77. /package/kit/.constitution/{document → method/document}/templates/rtr.md +0 -0
  78. /package/kit/.constitution/{document → method/document}/templates/rules.md +0 -0
  79. /package/kit/.constitution/{document → method/document}/templates/scn.md +0 -0
  80. /package/kit/.constitution/{document → method/document}/templates/srs.md +0 -0
  81. /package/kit/.constitution/{document → method/document}/templates/uc.md +0 -0
  82. /package/kit/.constitution/{document → method/document}/templates/ux.md +0 -0
  83. /package/kit/.constitution/{document → method/document}/ux-guide.md +0 -0
  84. /package/kit/.constitution/{scripts → method/scripts}/inventory.py +0 -0
  85. /package/kit/.constitution/{codebase/brownfield-guide.md → project/codebase-brownfield-guide.md} +0 -0
  86. /package/kit/.constitution/{codebase/conventions-guide.md → project/codebase-conventions-guide.md} +0 -0
  87. /package/kit/.constitution/{codebase/stack-guide.md → project/codebase-stack-guide.md} +0 -0
package/README.md CHANGED
@@ -1,252 +1,271 @@
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/` belongs to the method and is **overwritten** on every update. Four rooms are yours:
169
-
170
- | Room | Yours because |
171
- |---|---|
172
- | `.control/registry/index.yaml` `product:` | The product and client name live in exactly one place |
173
- | `constitution.md` Articles 1, 2, 5 | Scope, repo checklist, method ownership |
174
- | `.constitution/codebase/*-guide.md` | Your stack and conventions, protected once `Accepted` |
175
- | **`.constitution/project/`** | Any rule that binds **only this product** |
176
- | `_bmad/custom/*.user.toml` | Your BMad overrides |
177
-
178
- `.control/` `.what/` `.how/` are never touched by an update at all — they are your state, your promises,
179
- and your design.
180
-
181
- The custom room takes whole files, not marked blocks inside generic ones: `AGENTS.md` can use a marked
182
- block because it is *one* file, while `.constitution/` has fifty-odd, and blocks inside them would make
183
- an update perform surgery in every file. A file there declares `scope: project` and a one-line
184
- `purpose:`; to **contradict** a generic rule it must name that rule and carry the decision that allowed
185
- it. **An empty room is a valid state** — filling it so that it gets used is the failure the rule prevents.
186
-
187
- ### Language
188
-
189
- Two settings, both free text, both defaulting to English:
190
-
191
- ```yaml
192
- policy:
193
- doc_language: "English" # prose of working documents
194
- doc_filename_language: "English" # the slug part of a document filename
195
- ```
196
-
197
- Write whatever names the language`English`, `Bahasa Indonesia`, `id`. What reads the value is a model,
198
- and a model does not need a lookup table.
199
-
200
- Always English, and never asked: method terminology, document code prefixes (`UC-`, `DEC-`), machine
201
- markers (`[NEEDS CONFIRMATION]`, `[MISSING]`), and code identifiers. `.constitution/` itself is always
202
- English, whatever the settings say — it travels to every repo through this package.
203
-
204
- ---
205
-
206
- ## What update does
207
-
208
- | | |
209
- |---|---|
210
- | Overwrites | `.constitution/` guides, templates and scripts · the fifteen wrappers · `_bmad/custom/*.toml` · the marked block in `AGENTS.md` |
211
- | 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 |
212
- | Keeps | Everything in the table above, plus your initiative slug and your language choice. A setting somebody already chose is not the installer's to change behind their back |
213
- | Never resurrects | A folder you retired. On update, absence is treated as a decision |
214
-
215
- It prints the version it replaced, what it wrote, what it kept, and what to do next.
216
-
217
- ---
218
-
219
- ## Carrying a change back into this package
220
-
221
- The published source is this repository. A product repo that holds a newer working copy of the method
222
- promotes it here before the change counts as published:
223
-
224
- ```bash
225
- npx wdi-method promote /path/to/the/product-repo
226
- npm test
227
- git commit && git push
228
- ```
229
-
230
- `promote` copies the portable method, replaces product-named files with their generic versions, scrubs
231
- initiative slugs, and **skips `.constitution/project/`** so a product's own rules can never be published.
232
-
233
- **Patch releases are routine; minor and major are the maintainer's call.** This package overwrites files
234
- in repos that already hold months of work, and the version is the only signal a reader has for how
235
- carefully to read the diff. [`CONTRIBUTING.md`](CONTRIBUTING.md) has the detail, and
236
- [`AGENTS.md`](AGENTS.md) states it for agents working on the package.
237
-
238
- ---
239
-
240
- ## Support and Contributing
241
-
242
- Open an [issue](https://github.com/wiradigitalid/wdi-method/issues) for a bug or a proposal. Read
243
- [`CONTRIBUTING.md`](CONTRIBUTING.md) before sending a pull request it explains where a change belongs,
244
- how versioning works here, and what to check before publishing.
245
-
246
- ## License
247
-
248
- MITsee [LICENSE](LICENSE). Requires Node 20+ and [uv](https://docs.astral.sh/uv/) for the Python
249
- scripts.
250
-
251
- [![Version](https://img.shields.io/npm/v/wdi-method?color=blue&label=version)](https://www.npmjs.com/package/wdi-method)
252
- [![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
+ ## 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)