dflow-sdd-ddd 0.13.0 → 0.15.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 (96) hide show
  1. package/CHANGELOG.md +824 -1
  2. package/CONTRIBUTING.md +16 -10
  3. package/README.en.md +156 -200
  4. package/README.md +89 -144
  5. package/TEMPLATE-COVERAGE.md +15 -8
  6. package/TEMPLATE-LANGUAGE-GLOSSARY.md +15 -1
  7. package/bin/dflow.js +36 -4
  8. package/docs/commands.en.md +110 -0
  9. package/docs/commands.md +101 -0
  10. package/docs/doctor-uncertainty.en.md +212 -0
  11. package/docs/doctor-uncertainty.md +212 -0
  12. package/docs/evaluating-dflow.en.md +29 -11
  13. package/docs/evaluating-dflow.md +8 -6
  14. package/docs/npm-publish-checklist.md +3 -1
  15. package/docs/release-versioning-policy.md +8 -2
  16. package/docs/upgrading.en.md +196 -0
  17. package/docs/upgrading.md +197 -0
  18. package/docs/using-with-claude-code.en.md +25 -10
  19. package/docs/using-with-claude-code.md +20 -7
  20. package/docs/using-with-codex.en.md +18 -6
  21. package/docs/using-with-codex.md +16 -5
  22. package/docs/using-with-github-copilot.en.md +25 -10
  23. package/docs/using-with-github-copilot.md +21 -8
  24. package/lib/doc-shapes.json +997 -0
  25. package/lib/doctor-checks.js +2654 -0
  26. package/lib/init.js +3583 -107
  27. package/lib/render-diagrams.js +1474 -0
  28. package/lib/render.js +865 -49
  29. package/package.json +2 -2
  30. package/templates/brownfield/references/drift-verification.md +4 -0
  31. package/templates/brownfield/references/finish-feature-flow.md +635 -88
  32. package/templates/brownfield/references/finish-feature-follow-up.md +60 -0
  33. package/templates/brownfield/references/finish-feature-minimal-host.md +406 -0
  34. package/templates/brownfield/references/finish-feature-post-hoc-hotfix.md +95 -0
  35. package/templates/brownfield/references/git-integration.md +160 -15
  36. package/templates/brownfield/references/init-project-flow.md +26 -4
  37. package/templates/brownfield/references/modify-existing-flow.md +412 -87
  38. package/templates/brownfield/references/modify-existing-follow-up.md +121 -0
  39. package/templates/brownfield/references/modify-existing-post-hoc-hotfix.md +82 -0
  40. package/templates/brownfield/references/new-feature-flow.md +61 -6
  41. package/templates/brownfield/references/new-phase-flow.md +57 -7
  42. package/templates/brownfield/references/pr-review-checklist.md +303 -10
  43. package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +158 -34
  44. package/templates/brownfield/scaffolding/CLAUDE-md-snippet.md +1 -1
  45. package/templates/brownfield/scaffolding/Git-principles-gitflow.md +75 -6
  46. package/templates/brownfield/scaffolding/Git-principles-trunk.md +82 -8
  47. package/templates/brownfield/scaffolding/_conventions.md +50 -28
  48. package/templates/brownfield/scaffolding/_overview.md +1 -0
  49. package/templates/brownfield/templates/_index.md +151 -7
  50. package/templates/brownfield/templates/analysis.md +79 -0
  51. package/templates/brownfield/templates/behavior.md +1 -0
  52. package/templates/brownfield/templates/context-definition.md +1 -0
  53. package/templates/brownfield/templates/context-map.md +2 -1
  54. package/templates/brownfield/templates/glossary.md +1 -0
  55. package/templates/brownfield/templates/lightweight-spec.md +154 -11
  56. package/templates/brownfield/templates/models.md +1 -0
  57. package/templates/brownfield/templates/phase-spec.md +9 -1
  58. package/templates/brownfield/templates/rules.md +1 -0
  59. package/templates/brownfield/templates/tech-debt.md +1 -0
  60. package/templates/common/references/ddd-modeling-guide.md +33 -16
  61. package/templates/{greenfield → common}/references/dflow-feedback-flow.md +2 -1
  62. package/templates/common/references/flow-rationale-registry.md +130 -0
  63. package/templates/common/skill/SKILL.md +13 -11
  64. package/templates/greenfield/references/drift-verification.md +4 -0
  65. package/templates/greenfield/references/finish-feature-flow.md +625 -89
  66. package/templates/greenfield/references/finish-feature-follow-up.md +60 -0
  67. package/templates/greenfield/references/finish-feature-minimal-host.md +363 -0
  68. package/templates/greenfield/references/finish-feature-post-hoc-hotfix.md +95 -0
  69. package/templates/greenfield/references/git-integration.md +148 -15
  70. package/templates/greenfield/references/init-project-flow.md +28 -8
  71. package/templates/greenfield/references/modify-existing-flow.md +378 -85
  72. package/templates/greenfield/references/modify-existing-follow-up.md +103 -0
  73. package/templates/greenfield/references/modify-existing-post-hoc-hotfix.md +82 -0
  74. package/templates/greenfield/references/new-feature-flow.md +67 -4
  75. package/templates/greenfield/references/new-phase-flow.md +56 -7
  76. package/templates/greenfield/references/pr-review-checklist.md +287 -8
  77. package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +153 -32
  78. package/templates/greenfield/scaffolding/CLAUDE-md-snippet.md +5 -2
  79. package/templates/greenfield/scaffolding/Git-principles-gitflow.md +74 -6
  80. package/templates/greenfield/scaffolding/Git-principles-trunk.md +88 -12
  81. package/templates/greenfield/scaffolding/_conventions.md +50 -28
  82. package/templates/greenfield/scaffolding/_overview.md +6 -2
  83. package/templates/greenfield/templates/_index.md +137 -7
  84. package/templates/greenfield/templates/aggregate-design.md +1 -0
  85. package/templates/greenfield/templates/analysis.md +79 -0
  86. package/templates/greenfield/templates/behavior.md +1 -0
  87. package/templates/greenfield/templates/context-definition.md +1 -0
  88. package/templates/greenfield/templates/context-map.md +2 -1
  89. package/templates/greenfield/templates/events.md +4 -1
  90. package/templates/greenfield/templates/glossary.md +1 -0
  91. package/templates/greenfield/templates/lightweight-spec.md +154 -11
  92. package/templates/greenfield/templates/models.md +1 -0
  93. package/templates/greenfield/templates/phase-spec.md +9 -1
  94. package/templates/greenfield/templates/rules.md +1 -0
  95. package/templates/greenfield/templates/tech-debt.md +1 -0
  96. package/templates/brownfield/references/dflow-feedback-flow.md +0 -251
@@ -14,8 +14,12 @@ that SDD traceability depends on.
14
14
 
15
15
  ## Branch-to-Workflow Mapping
16
16
 
17
- Dflow only requires that every SDD feature / bug-fix lives on its own branch
18
- that links back to a spec. The *base branch* that feature branches are cut
17
+ Dflow only requires that SDD work is traceable from the branch it lands on. A
18
+ feature, and a defect that owns its own branch, each get a branch that links
19
+ back to what was recorded. Work picked up by a feature that is still in
20
+ progress stays on that host's branch — the host `_index.md` `branch:` field is
21
+ authoritative — and a T3 change is traced by its `_index.md` row, not by a spec
22
+ file of its own. The *base branch* that feature branches are cut
19
23
  from (e.g. `main`, `develop`, `trunk`) is a project-level decision that Dflow
20
24
  does not mandate.
21
25
 
@@ -25,8 +29,12 @@ main (or your project's base branch)
25
29
  ├─ feature/{SPEC-ID}-{slug} ← Full SDD + DDD workflow
26
30
  │ Gate: spec + Aggregate design before first commit
27
31
  │
28
- └─ bugfix/{BUG-ID}-{slug} ← Lightweight SDD workflow
29
- Gate: lightweight spec with layer identification
32
+ └─ bugfix/{BUG-ID}-{slug} ← a defect that owns its own branch
33
+ (a defect with no feature to host it opens a minimal zero-phase host
34
+ of its own — see references/modify-existing-flow.md Step 1.7)
35
+ Gate: whatever the cascade's tier calls for (T2: a lightweight
36
+ spec with layer identification; T3: the host _index.md row only;
37
+ T1: escalate — it belongs on a feature/ branch)
30
38
  ```
31
39
 
32
40
  > If your project adopts Git Flow / GitHub Flow / trunk-based, the choice of
@@ -61,7 +69,9 @@ The branch slug follows the language the developer / AI discuss the
61
69
  feature in. **Both Chinese and English slugs are valid**; Dflow does not
62
70
  force translation in either direction. The same slug is reused for the
63
71
  feature directory name and the first phase-spec filename, so consistency
64
- across branch / dir / phase-spec is automatic.
72
+ across branch / dir / phase-spec is automatic. A **minimal (zero-phase)
73
+ host** has no phase-spec, so its slug is shared by the branch and the
74
+ directory only — the absent third name is the host's shape, not drift.
65
75
 
66
76
  Examples:
67
77
 
@@ -95,8 +105,13 @@ This is the one non-negotiable Git coupling Dflow enforces:
95
105
  - **Every SDD feature must have its own feature branch.** Branch name must
96
106
  match its SPEC-ID so that `git log`, PR titles, and spec documents can be
97
107
  traced back to one another.
98
- - **Every bug-fix (SDD-tracked) must have its own bugfix branch** following
99
- the same pattern.
108
+ - **A defect that owns its own branch uses a `bugfix/` branch** following the
109
+ same pattern — including a standalone defect whose own minimal host is what
110
+ owns it, and whose branch therefore carries a BUG-NUMBER rather than that
111
+ host's SPEC-ID. A defect picked up by a feature that is still in progress is
112
+ hosted work instead: it stays on that host's branch. Either way the host
113
+ `_index.md` `branch:` field is authoritative — every spec inside that host,
114
+ and every branch gate applied to it, takes its value.
100
115
  - Commits that span multiple specs (accidentally or deliberately) are
101
116
  discouraged; if you notice work on a new spec emerging mid-branch, stop
102
117
  and create a new branch off the correct base.
@@ -125,9 +140,34 @@ Both Git policies (`gitflow` / `trunk`, per `dflow/specs/shared/_conventions.md`
125
140
  project cuts features from — `main` / `develop` / `trunk`, or whatever your
126
141
  policy uses — or on an unrelated branch) — the AI offers to create and switch
127
142
  to the correct branch, switch to an existing matching one, or override and
128
- stay (recorded in the feature `_index.md` Checkpoint Log; three consecutive
129
- overrides → the AI suggests re-running `dflow init`, never changing the
130
- setting on its own).
143
+ stay (three consecutive overrides → the AI suggests re-running `dflow init`,
144
+ never changing the setting on its own).
145
+
146
+ **How "override and stay" is recorded, so closeout can honour it.** Write one
147
+ row in the feature `_index.md` Checkpoint Log:
148
+
149
+ | Timestamp | Checkpoint | Result |
150
+ |---|---|---|
151
+ | {YYYY-MM-DD HH:MM} | `branch-override` | `override ({branch-you-stayed-on})` |
152
+
153
+ The Result **names the branch you stayed on** — not the value of `branch:`,
154
+ which stays exactly as the host opened it. That name is what makes the record
155
+ usable, and it is exactly what closeout reads: **its branch check passes when
156
+ *any* `branch-override` row on this host names the branch `HEAD` is on** — not
157
+ only the most recent one, because a host may override onto different branches
158
+ in different phases and closeout fires no branch gate of its own, so it never
159
+ writes a newer row. A record that does not say *where* you stayed excuses
160
+ nothing.
161
+ ⚠ **This row is a record, not a lifecycle checkpoint.** It is not a commit and
162
+ it does not count toward the tier's checkpoint count.
163
+ ⚠ **Where it can appear at all: only on a phase-bearing host.**
164
+ `references/modify-existing-flow.md` withholds this override from every
165
+ **minimal host** (Step 1.6's follow-up variant, Step 1.7 standalone, Step 1.8
166
+ post-hoc), because those hosts assert branch equality against a `branch:` they
167
+ cut by change class. So `references/finish-feature-flow.md`'s closeout branch
168
+ check reads this row and honours it, while its minimal-host checkpoint count
169
+ is never looking at one — that count says so at the site rather than carrying
170
+ an exclusion for a row that cannot reach it.
131
171
 
132
172
  Dflow does not need to identify your base branch to evaluate the gate — it only
133
173
  checks whether you are on the right feature branch. The base branch matters only
@@ -148,11 +188,34 @@ existing Step Gate prompt (it does not add a separate question):
148
188
 
149
189
  Tier sets how many checkpoints a change has: T1 three (spec / implementation /
150
190
  closeout), T2 two (spec+implementation merged / closeout), T3 a single commit.
191
+ "T3 = a single commit" means a single **implementation** commit — its hash is
192
+ only knowable afterwards, so the `_index.md` inline row and checkpoint row are
193
+ swept up by the host's **next** commit (more work, or closeout). If the host has
194
+ no next commit scheduled, one ledger-only tracking commit that references the T3
195
+ hash is allowed. It is bookkeeping, not a lifecycle milestone: it adds no
196
+ Checkpoint Log row of its own (unlike closeout, which is a checkpoint and does get
197
+ a row).
198
+ **Minimal host (zero-phase) exception — there, tier does not set the count.**
199
+ On a minimal host (`references/modify-existing-flow.md` Step 1.7 standalone, or
200
+ its Step 1.6 follow-up minimal variant) there is no later host commit for a row
201
+ to ride, so the count is **two for every tier** — implementation, then closeout
202
+ — and a T3's `_index.md` row is written into checkpoint 1 itself instead of
203
+ sweeping into a later commit. Everything above about "T3 = a single commit"
204
+ describes a **hosted** T3, the case where a later host commit exists.
151
205
  Whether you choose Y or N, the AI records one row in the feature `_index.md`
152
206
  Checkpoint Log — every checkpoint is accounted for (`committed` / `skipped` /
153
207
  `failed`), even when no commit happens. A commit hash is written only after the
154
208
  commit succeeds; a hook rejection or failed commit is recorded as `failed`
155
- (never a fake hash). **Exception — the closeout row**: the closeout commit
209
+ (never a fake hash).
210
+ **One further Result value — `reconciled ({merged-hotfix-hash})`.** It records
211
+ that this checkpoint documents a change that was **already merged** before any
212
+ ceremony ran, and it is written only on a post-hoc hotfix host's implementation
213
+ row (`references/modify-existing-flow.md` Step 1.8). The hash in the parentheses
214
+ belongs to the **merged hotfix**, not to this host's own documentation commit —
215
+ that one goes in the Lightweight Changes row's `Commit` cell, and the two have
216
+ different provenance and must never be swapped. On every other host the three
217
+ values above are the whole vocabulary.
218
+ **Exception — the closeout row**: the closeout commit
156
219
  cannot contain its own hash, so the closeout row is written before the commit
157
220
  as `closeout | committed` with **no hash** (see
158
221
  `references/finish-feature-flow.md` Step 4); trace that commit via
@@ -286,6 +349,12 @@ with the rule.
286
349
  ## Gate Checks by Branch Type
287
350
 
288
351
  ### feature/ — Before Creating
352
+
353
+ This is the **phase-bearing** (T1) list. A **minimal (zero-phase) host** cuts a
354
+ `feature/{SPEC-ID}-{slug}` branch too and takes the short list under it: it has
355
+ no phase-spec *by definition*, so every item that reads one is not merely unmet
356
+ but unmeetable, and demanding them would block the change the branch exists for.
357
+
289
358
  - [ ] Feature directory exists at `dflow/specs/features/active/{SPEC-ID}-{slug}/`
290
359
  with `_index.md` and at least one phase-spec inside
291
360
  - [ ] `_index.md` status: `in-progress`
@@ -294,6 +363,21 @@ with the rule.
294
363
  - [ ] Domain Events identified
295
364
  - [ ] At least one Given/When/Then scenario in the first phase-spec
296
365
 
366
+ **Minimal (zero-phase) host — this list instead**
367
+ (any route in `references/modify-existing-flow.md` that opens a zero-phase host
368
+ — Step 1.7 standalone, Step 1.6's follow-up variant, Step 1.8's post-hoc
369
+ hotfix, or one added later):
370
+ - [ ] Feature directory exists at `dflow/specs/features/active/{SPEC-ID}-{slug}/`
371
+ with a minimal `_index.md` — all seven sections, Phase Specs table
372
+ **empty**, and no `phase-spec-*` file
373
+ - [ ] `_index.md` status: `in-progress`, and its `branch:` equals the branch
374
+ being cut — that field is authoritative for everything in this host
375
+ - [ ] The tier's artifact is ready to be written into the first commit: a
376
+ lightweight-spec for a **T2**, a Lightweight Changes row for a **T3** —
377
+ in both cases with its implementation paths declared
378
+ - [ ] Bounded Context identified **only if this change has one**; a no-BC host
379
+ records `none` and must not acquire a context to pass this gate
380
+
297
381
  ### feature/ — Before Merging (Pre-PR / Pre-Integration)
298
382
  - [ ] `_index.md` status: completed
299
383
  - [ ] All `phase-spec-*.md` in the feature directory have `status: completed`
@@ -309,13 +393,62 @@ with the rule.
309
393
  - [ ] Domain unit tests pass
310
394
  - [ ] No ORM/serialization attributes on Domain entities
311
395
 
396
+ > **On a minimal (zero-phase) host**, split this list by what each item reads.
397
+ > Items about **this host's own record** — `_index.md` status, archival
398
+ > readiness, and the phase-spec check, which passes vacuously on an empty
399
+ > table — apply **unchanged**: they are what stops a host merging with its
400
+ > record still open. Every item that names a **Domain or bounded-context
401
+ > artifact**, the BR-Snapshot sync included, applies only to what this change
402
+ > **actually touched**: a **no-BC** host has no bounded context to sync or
403
+ > document, and a **T3** does no Domain work at all, so for those they read
404
+ > N/A. **Bounded-context-scoped only** — `glossary.md` and the tech-debt file
405
+ > belong to no bounded context, stay in a no-BC host's sweep, and are **not**
406
+ > N/A for it (closeout draws the same line). **Code invariants are not
407
+ > artifacts** — the items here that state a rule about the **source** rather
408
+ > than name a document to update are **never N/A**: they hold for any change
409
+ > that touches code at all, and a host wrongly claiming to be no-BC is exactly
410
+ > what they catch. Record the N/A — do not invent a context, a Domain document,
411
+ > an event, or a BR row to tick one.
412
+
312
413
  ### bugfix/ — Before Creating
313
- - [ ] Lightweight spec exists or is created during this session
314
- - [ ] Root cause is documented
414
+
415
+ > **A `bugfix/` branch is always a minimal (zero-phase) host**, so the
416
+ > minimal-host list above applies here **in full** — the `_index.md` shape, the
417
+ > authoritative `branch:` field, and the artifact's declaration of the paths it
418
+ > touches, which is what closeout blocks on. Every route that cuts one opens the
419
+ > host through `references/modify-existing-flow.md` **Step 1.7's mechanics** —
420
+ > its own numbered **step 4**, "Branch gate — by change class". The known routes
421
+ > are Step 1.7 directly, Step 1.6's minimal follow-up variant, and Step 1.8's
422
+ > post-hoc hotfix; the latter two delegate to that same step (steps 2–4), and a
423
+ > route added later reaches it the same way.
424
+ > Not the top-level `## Step 4`, which cuts no branch. A **T1**
425
+ > escalates to `feature/`, and a defect hosted under a phase-bearing feature
426
+ > never gets a branch of its own. This matters because a functional bug walks
427
+ > **this** gate and never the `feature/` one. The items below are what
428
+ > `bugfix/` adds on top.
429
+
430
+ - [ ] **The tier's artifact** exists or is created during this session — a
431
+ **lightweight spec** for a T2; for a **T3**, the host `_index.md`
432
+ Lightweight Changes row and *no* spec file, exactly as the branch map
433
+ above says. A T3 spec file does not exist in Dflow, so asking for one
434
+ blocks the change instead of documenting it. A **T1** does not belong on
435
+ a `bugfix/` branch — escalate it to `feature/`.
436
+ - [ ] Root cause is documented — a T2's `## Root Cause`, or the evidence
437
+ section its no-BR family substitutes for it; for a **T3** the row
438
+ Description is the whole record and there is no separate root-cause
439
+ artifact
315
440
  - [ ] Fix approach is noted (which layer the fix belongs in)
316
441
 
317
442
  ### bugfix/ — Before Merging (Pre-PR / Pre-Integration)
318
- - [ ] Spec has the fix documented
443
+ - [ ] `_index.md` status: `completed`, and the whole feature directory ready to
444
+ `git mv` to `dflow/specs/features/completed/` (or already moved if
445
+ `/dflow:finish-feature` ran). A `bugfix/` host closes out exactly like a
446
+ `feature/` one; an un-closed-out host must not merge.
447
+ - [ ] **The tier's artifact** has the fix documented — a **T2**'s lightweight
448
+ spec, or for a **T3** the host `_index.md` Lightweight Changes row, which
449
+ is its whole record. Do not ask a T3 for a spec file here either: the
450
+ Before-Creating item above says why, and this gate is the last place that
451
+ mistake can still block the merge.
319
452
  - [ ] Tech debt recorded if the underlying issue is broader (record in
320
453
  `dflow/specs/architecture/tech-debt.md` if the bug reveals a systemic issue)
321
454
  - [ ] Fix is in the correct architectural layer (Domain / Application /
@@ -354,7 +487,7 @@ with the rule.
354
487
  These checks could eventually be automated in CI:
355
488
  - Verify Domain project has zero external package-manager dependencies (beyond allowed list)
356
489
  - Verify no ORM/serialization attributes on Domain entities
357
- - Verify spec file exists for any branch with feature/ or bugfix/ prefix
490
+ - Verify a spec file exists for any branch with feature/ or bugfix/ prefix — except a host whose entire record is inline in its `_index.md` and therefore has no spec file by design (a T3-only host today, and any later shape with that same property); check for the row instead
358
491
  - Verify glossary.md / rules.md / events.md updated when Domain/ files change
359
492
  - Lint commit messages for spec ID format
360
493
 
@@ -110,12 +110,12 @@ Used to substitute `{Framework version}` / `{ORM version}` /
110
110
 
111
111
  > "Was this project ported / migrated from a prior stack (e.g. legacy
112
112
  > presentation framework, monolith), or is it new-build on the chosen
113
- > framework? If migrated, is there any legacy concern you'd like the
114
- > overview to flag?"
113
+ > framework? If migrated, is there any legacy concern you'd like noted?"
115
114
 
116
- If migrated → `_overview.md` can carry a short migration-context note.
117
- Otherwise skip. In the Greenfield track, migration is not the first-class
118
- concern, but noting origin is still useful.
115
+ If migrated → the answer is recorded in the `Migration / legacy context` row
116
+ of the AI agent guide's `## Project Context` table. If not migrated, skip —
117
+ the row records `none`. In the Greenfield track, migration is not the
118
+ first-class concern, but noting origin is still useful.
119
119
 
120
120
  ### Q4. Project prose language
121
121
 
@@ -256,8 +256,18 @@ Key Greenfield-track notes:
256
256
  - **`behavior.md` is NOT generated here.** Per F-05, per-context
257
257
  `behavior.md` files are created by `/dflow:new-feature` Step 8.3
258
258
  (completion flow) or by the P007a baseline-capture flow at the
259
- moment the first bounded context is established. Creating empty
260
- `behavior.md` files here would create stale placeholders.
259
+ moment the first bounded context is established.
260
+ - **`analysis.md` is NOT generated here**, at either of its paths. It holds
261
+ the system-level knowledge no single context document owns — an ordered flow
262
+ that crosses contexts (always the domain-root copy), the lifecycle a status
263
+ field moves through, a figure computed rather than stored, the mechanism
264
+ behind a behavior no single rule explains, which roles reach which function
265
+ (always the domain-root copy), and the spots in them this project keeps
266
+ working around until a domain decision settles them (each in the copy that
267
+ holds the knowledge it is stuck on). What one context owns is recorded in
268
+ `domain/{context}/analysis.md` and the rest in `domain/analysis.md`, each
269
+ created from `templates/analysis.md` the first time a session records
270
+ something that belongs there.
261
271
 
262
272
  ### 3.2 Optional files (from Step 2 Q7)
263
273
 
@@ -306,12 +316,19 @@ skip, and wait for developer confirmation:
306
316
  > |---|---|
307
317
  > | `dflow/specs/domain/glossary.md` | already exists (47 lines) |
308
318
  >
309
- > **Not creating** (per F-05 decision):
319
+ > **Not creating**:
310
320
  > - No `dflow/specs/domain/{context}/behavior.md` files. These are created
311
321
  > later by `/dflow:new-feature` Step 8.3 or P007a when the first
312
322
  > bounded context is established.
313
323
  > - No pre-seeded ADR files in `dflow/specs/architecture/decisions/`. Write
314
324
  > ADRs as architecture decisions come up; Day-0 is too early.
325
+ > - No `dflow/specs/domain/analysis.md` and no
326
+ > `dflow/specs/domain/{context}/analysis.md`. Each is created the first time
327
+ > one of these turns up and belongs there — an ordered cross-context flow
328
+ > (always the domain-root copy), the lifecycle of a status field, a derived
329
+ > figure, a mechanism no single rule explains, which roles reach which
330
+ > function (always the domain-root copy), or a spot in one of them this
331
+ > project keeps working around until a domain decision settles it.
315
332
  >
316
333
  > Looks good? Reply 'yes' to proceed with the writes, or tell me what to
317
334
  > adjust."
@@ -456,6 +473,9 @@ Init complete. Summary:
456
473
  Deferred (not created here by design):
457
474
  - dflow/specs/domain/{context}/behavior.md — created by /dflow:new-feature
458
475
  Step 8.3 or P007a baseline capture
476
+ - dflow/specs/domain/{context}/analysis.md — needs a real bounded context
477
+ - dflow/specs/domain/analysis.md — created the first time a session records a
478
+ cross-context flow, role reach, or other knowledge no single context owns
459
479
  - dflow/specs/architecture/decisions/ADR-*.md — write ADRs as
460
480
  architecture decisions come up, not speculatively
461
481
  ```