dflow-sdd-ddd 0.10.0 → 0.12.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 (42) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.en.md +57 -43
  3. package/README.md +36 -33
  4. package/TEMPLATE-LANGUAGE-GLOSSARY.md +1 -0
  5. package/bin/dflow.js +4 -8
  6. package/docs/why-dflow.en.md +72 -0
  7. package/docs/why-dflow.md +72 -0
  8. package/lib/init.js +114 -77
  9. package/package.json +2 -2
  10. package/templates/brownfield/references/drift-verification.md +40 -6
  11. package/templates/brownfield/references/finish-feature-flow.md +85 -29
  12. package/templates/brownfield/references/git-integration.md +29 -9
  13. package/templates/brownfield/references/modify-existing-flow.md +61 -0
  14. package/templates/brownfield/references/new-feature-flow.md +62 -1
  15. package/templates/brownfield/references/new-phase-flow.md +19 -1
  16. package/templates/brownfield/references/pr-review-checklist.md +7 -1
  17. package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +46 -33
  18. package/templates/brownfield/scaffolding/Git-principles-gitflow.md +1 -1
  19. package/templates/brownfield/scaffolding/Git-principles-trunk.md +2 -2
  20. package/templates/brownfield/templates/_index.md +23 -4
  21. package/templates/brownfield/templates/context-map.md +12 -4
  22. package/templates/brownfield/templates/lightweight-spec.md +3 -3
  23. package/templates/brownfield/templates/phase-spec.md +3 -3
  24. package/templates/common/references/ddd-modeling-guide.md +837 -0
  25. package/templates/greenfield/references/drift-verification.md +60 -12
  26. package/templates/greenfield/references/finish-feature-flow.md +86 -29
  27. package/templates/greenfield/references/git-integration.md +29 -9
  28. package/templates/greenfield/references/modify-existing-flow.md +23 -0
  29. package/templates/greenfield/references/new-feature-flow.md +70 -8
  30. package/templates/greenfield/references/new-phase-flow.md +15 -1
  31. package/templates/greenfield/references/pr-review-checklist.md +9 -1
  32. package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +40 -33
  33. package/templates/greenfield/scaffolding/Git-principles-gitflow.md +1 -1
  34. package/templates/greenfield/scaffolding/Git-principles-trunk.md +4 -2
  35. package/templates/greenfield/templates/_index.md +23 -4
  36. package/templates/greenfield/templates/aggregate-design.md +8 -1
  37. package/templates/greenfield/templates/context-map.md +13 -4
  38. package/templates/greenfield/templates/events.md +5 -1
  39. package/templates/greenfield/templates/lightweight-spec.md +3 -3
  40. package/templates/greenfield/templates/phase-spec.md +3 -3
  41. package/docs/migrating-to-dflow-v1.md +0 -234
  42. package/templates/greenfield/references/ddd-modeling-guide.md +0 -351
@@ -74,10 +74,43 @@ input like this (supporting files live in the workflow bundle at
74
74
 
75
75
  ## Status / Control Commands
76
76
 
77
- `/dflow:status` reports active workflow state. Include these fields: workflow,
78
- step, completed, in-progress, remaining, pending decision, and next valid action.
79
- If no workflow is active, say that no workflow is active and list valid flow-entry
80
- or standalone commands.
77
+ `/dflow:status` reports in two parts.
78
+
79
+ **Part 1 — in-flight overview (always shown, workflow active or not).**
80
+ Aggregate every in-flight feature so unfinished work surfaces without anyone
81
+ remembering to look:
82
+
83
+ - Scan this branch's `dflow/specs/features/active/*/_index.md` and print one
84
+ line per feature: SPEC-ID / Active Workflow / Current Step / Awaiting / last
85
+ Checkpoint Log row (read from each Resume Pointer cursor).
86
+ - Cross-branch: run `git fetch` when the network allows (skip gracefully
87
+ offline), then `git branch --all --list '*feature/*' --list '*bugfix/*'`,
88
+ deduplicating local and remote refs of the same branch (prefer local). For
89
+ each branch, classify in order: (1) its feature directory exists in this
90
+ branch's `active/` → already covered above; (2) exists in this branch's
91
+ `completed/` → a stale undeleted branch — list as "completed; branch can be
92
+ deleted", **not** in-flight; (3)
93
+ `git show {branch}:dflow/specs/features/active/{dir}/_index.md` is readable
94
+ → in flight on that branch, print its cursor line (no branch switching);
95
+ (4) the `completed/` path is readable on that branch → closed out there,
96
+ awaiting integration; (5) nothing readable → list the branch as unknown
97
+ state.
98
+ - If `features/backlog/` is non-empty, append one count line.
99
+ - Inherent limit: work never committed anywhere is invisible to any git scan.
100
+
101
+ **Part 2 — current feature detail (when a workflow is active).** Read the
102
+ Resume Pointer cursor as the **declared** state, then cross-check it against
103
+ derived evidence (Checkpoint Log, phase-spec statuses, recent git log). On
104
+ mismatch, report both sides explicitly and ask the developer to correct the
105
+ cursor — the cursor is a claim; evidence wins. If the cursor fields are absent
106
+ (an older `_index.md`), fall back to pure derivation. For readability you may
107
+ expand the cursor into a step checklist (done / in progress / not started)
108
+ derived live from the flow file — display only, never stored.
109
+
110
+ Include these fields: workflow, step, completed, in-progress, remaining,
111
+ pending decision, and next valid action. If no workflow is active, say so and
112
+ list valid flow-entry or standalone commands (Part 1 still shows the
113
+ in-flight overview).
81
114
 
82
115
  `/dflow:next` is valid only at a step gate in an active workflow. Treat it as
83
116
  developer confirmation equivalent to "OK" or "continue", then move to the next
@@ -85,7 +118,9 @@ workflow step.
85
118
 
86
119
  `/dflow:cancel` aborts the current workflow and returns to free conversation.
87
120
  Do not rollback changes, delete artifacts, or rewrite specs merely because the
88
- workflow was cancelled.
121
+ workflow was cancelled. If the feature directory exists, set the Resume
122
+ Pointer cursor's Active Workflow to `none` (keep Current Progress as a trace
123
+ of where the cancellation happened).
89
124
 
90
125
  When no workflow is active, `/dflow:next` and `/dflow:cancel` must report that
91
126
  there is no active workflow to advance or cancel.
@@ -313,34 +348,6 @@ are verified against the phase-spec before Step 7 completion.
313
348
  - Application tests: command / query handler behavior
314
349
  - Integration tests: repository, external services
315
350
 
316
- ## Pre-V1 Artifacts Detection
317
-
318
- When working in a project that adopted Dflow before `dflow-sdd-ddd@0.1.0`,
319
- you may encounter layout or naming patterns that predate the V1 baseline.
320
- If any of the following appear, surface the observation to the developer
321
- and recommend manual migration; do not rewrite anything silently.
322
-
323
- Signals:
324
-
325
- - Top-level `specs/` directory containing Dflow-shaped content (V1 layout
326
- uses `dflow/specs/`).
327
- - `_共用/` directory under `specs/` or `dflow/specs/` (V1 uses `shared/`).
328
- - Section headings in Traditional Chinese where V1 templates render
329
- canonical English; compare against `TEMPLATE-LANGUAGE-GLOSSARY.md` if
330
- available.
331
- - References to a runtime `/dflow:init-project` slash command (V1
332
- replaced it with the Dflow CLI init command (`dflow init`, or
333
- `npx dflow-sdd-ddd init` when using the no-install path)).
334
- - A root `CLAUDE.md`, `AGENTS.md`, or equivalent that holds the full
335
- Dflow workflow text instead of being a thin shim pointing to this
336
- file.
337
- - `dflow/specs/shared/_conventions.md` is missing the `> Dflow Version:`
338
- front-matter line (V1 init writes it automatically).
339
-
340
- Recommend `docs/migrating-to-dflow-v1.md` for the manual migration
341
- checklist. Migration affects every spec the team has written; manual
342
- review is required.
343
-
344
351
  ## Workflow Steps
345
352
 
346
353
  This guide is the **command registry, routing rules, and project context**.
@@ -141,7 +141,7 @@ When applicable, prefix with a type (conventional commits-style):
141
141
  | test | tests only |
142
142
  | chore | build / tooling |
143
143
 
144
- Example: `[EXP-001] feat: introduce ExpenseReport Aggregate with submission invariants`
144
+ Example: `[SPEC-20260424-002] feat: introduce ExpenseReport Aggregate with submission invariants`
145
145
 
146
146
  ---
147
147
 
@@ -305,8 +305,10 @@ assistant's documented line (e.g. `Co-Authored-By: Claude
305
305
  There is no separate `hotfix/*` branch. A hotfix is:
306
306
 
307
307
  1. A (small) feature branch cut from `main`
308
- 2. Named `feature/{SPEC-ID}-{slug}` where SPEC-ID is a lightweight spec
309
- or a full-ceremony spec depending on severity
308
+ 2. Named by the normal Dflow branch scheme, chosen by severity: a
309
+ bug-type hotfix (T2 lightweight) uses `bugfix/{BUG-ID}-{slug}`; a
310
+ hotfix that warrants full ceremony uses `feature/{SPEC-ID}-{slug}`
311
+ (see `references/git-integration.md` § Branch Naming Convention)
310
312
  3. Merged back to `main` via the team's chosen merge strategy
311
313
  4. Deployed via the same pipeline as any other change
312
314
 
@@ -105,23 +105,42 @@ Template note (for AI):
105
105
  > T3 單一 commit。
106
106
  >
107
107
  > commit hash 只在 commit 實際成功後填入;pre-commit hook reject 或 commit
108
- > 失敗記 `failed`、不寫假 hash。
108
+ > 失敗記 `failed`、不寫假 hash。**例外:closeout 列不填 hash**——closeout
109
+ > commit 無法自含自身 hash,該列於 commit 前寫入、隨歸檔目錄一起進 commit;
110
+ > 溯源用 `git log -1 -- completed/{SPEC-ID}-{slug}` 或選配的
111
+ > `Dflow-Checkpoint` trailer(見 references/git-integration.md)。
109
112
 
110
113
  | Timestamp | Checkpoint | Result |
111
114
  |---|---|---|
112
115
  | {YYYY-MM-DD HH:MM} | spec-baseline | committed ({hash}) / skipped / failed |
113
116
  | {YYYY-MM-DD HH:MM} | implementation | committed ({hash}) / skipped / failed |
114
- | {YYYY-MM-DD HH:MM} | closeout | committed ({hash}) / skipped / failed |
117
+ | {YYYY-MM-DD HH:MM} | closeout | committed / skipped / failed |
115
118
 
116
119
  ## Resume Pointer
117
120
 
118
- > 一句話:目前進展到哪?下一個動作是什麼?
119
- > 開新對話接續工作時,從這裡讀起。
121
+ > 目前進展到哪?下一個動作是什麼?開新對話接續工作時,從這裡讀起。
122
+ >
123
+ > 下方四個 cursor 欄位是 workflow 進度的**存放層(宣告,claim)**:
124
+ > 進入 flow 時設 Active Workflow;**每過一個 step gate** 更新 Current Step /
125
+ > Gates Passed / Awaiting(與該 gate 既有的 `_index.md` 更新合併,不另加儀式);
126
+ > closeout / `/dflow:cancel` 時 Active Workflow 設回 `none`。
127
+ > `/dflow:status` 讀 cursor 後會與推導證據(Checkpoint Log、phase-spec
128
+ > status、git log)交叉,不一致會明確報 mismatch——cursor 是宣告、證據優先。
129
+ > Phase 粒度進度由上方 Phase Specs 表承載;cursor 只補 workflow step / gate
130
+ > 粒度,不展開成 per-step 全表(步驟線性,游標可推導每一步的完成/未做)。
120
131
 
121
132
  **Current Progress**: {one-line summary}
122
133
 
123
134
  **Next Action**: {suggested next action}
124
135
 
136
+ **Active Workflow**: {new-feature | modify-existing | bug-fix | new-phase | finish-feature | none}
137
+
138
+ **Current Step**: {Step N — short step name | n/a}
139
+
140
+ **Gates Passed**: {e.g. "3→3.5, 4→5" | n/a}
141
+
142
+ **Awaiting**: {step-gate description | none}
143
+
125
144
  <!--
126
145
  ## Follow-up Tracking
127
146
  >(選用段;只有當本 feature 衍生出 follow-up feature 時才填)
@@ -13,6 +13,12 @@ created: {YYYY-MM-DD}
13
13
  ## Invariants
14
14
 
15
15
  > 必須永遠為真的規則。這是 Aggregate 存在的理由。
16
+ > 主體列 **boundary invariants**(需同時看到 Aggregate 內多個物件的狀態才能判的規則)。
17
+ > 單一物件可判的 local constraint 不列這裡 — 純格式/必填走 Validator、有 domain
18
+ > 語意走 VO / Entity constructor。跨 instance 的規則(唯一性、僅一筆 active)可列,
19
+ > 但標 `set-based` 並在 Behavior on Violation 寫明 store-level guard(unique /
20
+ > partial index、concurrency token;見 ddd-modeling-guide 的 Invariant
21
+ > Classification 與 Set-Based 段)。
16
22
 
17
23
  | ID | Invariant | Behavior on Violation |
18
24
  |---|---|---|
@@ -55,4 +61,5 @@ created: {YYYY-MM-DD}
55
61
 
56
62
  ## Design Decisions
57
63
 
58
- > 為什麼 Aggregate 的邊界劃在這裡?有沒有考慮過其他方案?
64
+ > 為什麼 Aggregate 的邊界劃在這裡?有沒有考慮過其他方案?每個決策附
65
+ > **再評估條件**:什麼情況出現時,這個決策應該被重看?(「revisit when …」)
@@ -6,15 +6,24 @@
6
6
 
7
7
  ## Contexts
8
8
 
9
- | Bounded Context | Responsibility | Owner / Team | Primary Module | Notes |
10
- |---|---|---|---|---|
11
- | {Context name} | {業務責任} | {owner} | `{module/project}` | {optional notes} |
9
+ | Bounded Context | Responsibility | Subdomain Type | Owner / Team | Primary Module | Notes |
10
+ |---|---|---|---|---|---|
11
+ | {Context name} | {業務責任} | core / supporting / generic | {owner} | `{module/project}` | {optional notes} |
12
+
13
+ > **Subdomain Type** — 判別問句:「這塊功能換成現成 SaaS / 套件,系統的差異化會消失嗎?」
14
+ > (差異化不限商業競爭優勢;內部系統指獨特的營運優勢 / 任務成果。)會 → `core`;
15
+ > 不會、但需要為自家流程客製 → `supporting`(必要、常需客製、非差異化);
16
+ > 不會、且現成方案存在 → `generic`。多數 BC 是 supporting,`core` 通常只有 1–2 個;
17
+ > 全標 core = 沒分類。分類是可修訂的初判,改判時更新本欄並在 Notes 留一行理由。
18
+ > 它決定建模深度(見 `references/ddd-modeling-guide.md`
19
+ > § Subdomain-Aware Modeling Depth),但**不**降低 BR 紀錄、Tier ceremony、
20
+ > 或安全 / 測試 / 可靠性要求。
12
21
 
13
22
  ## Relationships
14
23
 
15
24
  | Upstream | Downstream | Relationship Type | Published Language | ACL | Events |
16
25
  |---|---|---|---|---|---|
17
- | {Upstream context} | {Downstream context} | {Customer/Supplier, Conformist, ACL, Shared Kernel, etc.} | {shared terms / contract} | {Yes/No + location} | {event names or n/a} |
26
+ | {Upstream context} | {Downstream context} | {Customer/Supplier, Conformist, ACL, Shared Kernel, Separate Ways, Big Ball of Mud (BBoM), OHS, etc.} | {shared terms / contract} | {Yes/No + location} | {event names or n/a} |
18
27
 
19
28
  ## Integration Notes
20
29
 
@@ -12,7 +12,11 @@
12
12
 
13
13
  ## Event Flow Notes
14
14
 
15
- - {事件發生時序、交易邊界、重試或一致性注意事項}
15
+ - {事件發生時序、交易邊界、重試或一致性注意事項;跨 aggregate 的 async(eventual
16
+ consistency)event chain,handler 重試耗盡的最終失敗若造成 business-visible 後果
17
+ (補償/權益/金流/庫存/合規/人工對帳)→ 升級為 BR/EC 寫進 behavior.md 與 spec,
18
+ best-effort 副作用(通知/logging)記這裡或 tech-debt 即可;多步驟且失敗需補償
19
+ → 見 ddd-modeling-guide 的 Long-Running Processes 段(process 判準與階梯)}
16
20
 
17
21
  ## Open Questions
18
22
 
@@ -1,10 +1,10 @@
1
1
  ---
2
- id: BUG-{NUMBER}
2
+ id: BUG-{NUMBER} # bug-type T2 only; a non-bug T2 (lightweight-{date}-{slug}.md) carries no id — the filename identifies it
3
3
  title: {簡述問題}
4
- status: in-progress
4
+ status: in-progress # in-progress | completed
5
5
  bounded-context: {ContextName}
6
6
  created: {YYYY-MM-DD}
7
- branch: bugfix/BUG-{NUMBER}-{short-description}
7
+ branch: bugfix/BUG-{NUMBER}-{slug}
8
8
  ---
9
9
 
10
10
  <!--
@@ -1,11 +1,11 @@
1
1
  ---
2
- id: {CONTEXT}-{NUMBER}
2
+ spec-id: SPEC-{YYYYMMDD}-{NNN} # the owning feature's SPEC-ID (matches the feature directory name)
3
3
  title: 功能標題
4
- status: draft | in-progress | completed
4
+ status: in-progress # in-progress | completed
5
5
  bounded-context: {ContextName}
6
6
  created: {YYYY-MM-DD}
7
7
  author: {developer-name}
8
- branch: feature/{CONTEXT}-{NUMBER}-{short-description}
8
+ branch: feature/{SPEC-ID}-{slug}
9
9
  ---
10
10
 
11
11
  # {功能標題}
@@ -1,234 +0,0 @@
1
- # Migrating to Dflow V1
2
-
3
- > **Audience**: maintainers of an existing project that adopted an early
4
- > Dflow form (pre-`dflow-sdd-ddd@0.1.0`) and want to align it with the
5
- > V1 baseline that ships from npm.
6
- >
7
- > **Stance**: V1 took a clean cut. Dflow does not perform automatic
8
- > migration. This guide is a manual checklist. The CLI only warns when
9
- > it detects legacy paths; it does not modify existing files.
10
-
11
- > **Audience reality (2026-05-15)**: To date, the only known user of
12
- > this guide has been the **OBTS** migration (a single, completed
13
- > one-off). Dflow has not had broad pre-V1 adoption; this guide is
14
- > maintained as a contingency endpoint for `dflow doctor` and
15
- > `dflow init` warning messages, not as documentation of an active
16
- > migration program. If you reach this page via those tool outputs
17
- > and your case isn't covered below, please open a docs feedback issue
18
- > so the guide can be extended.
19
-
20
- ## When You Need This Guide
21
-
22
- Skip this guide if you started using Dflow at `dflow-sdd-ddd@0.1.0`
23
- or later. Your project is already on the V1 baseline.
24
-
25
- Read this guide if any of the following are true:
26
-
27
- - Your project has a top-level `specs/` directory that holds Dflow
28
- spec material (not the V1 `dflow/specs/`).
29
- - Your project has `specs/_共用/` instead of `dflow/specs/shared/`.
30
- - Your spec headings are in Traditional Chinese rather than the
31
- canonical English vocabulary documented in
32
- `TEMPLATE-LANGUAGE-GLOSSARY.md`.
33
- - Your AI instructions point teammates to `/dflow:init-project`
34
- instead of the Dflow CLI init command (`dflow init`, or
35
- `npx dflow-sdd-ddd init` on the no-install path).
36
- - Your `CLAUDE.md` (or equivalent root instruction file) was generated
37
- by an early Dflow variant that wrote a full Claude-only file rather
38
- than the V1 multi-AI thin shim that points to
39
- `dflow/specs/shared/AI-AGENT-GUIDE.md`.
40
-
41
- You may need only some of these steps; the five sections below are
42
- independent.
43
-
44
- ## Before You Start
45
-
46
- - Work on a dedicated branch or a disposable copy. None of the steps
47
- are destructive, but move-and-rename mistakes are easier to recover
48
- from a clean branch.
49
- - Make sure the working tree is clean (`git status`).
50
- - Note your current Dflow version if you can identify it. Older
51
- internal Dflow forms may not have been versioned at all.
52
- - Open these V1 reference files for cross-checking:
53
- - `TEMPLATE-LANGUAGE-GLOSSARY.md` — canonical English headings.
54
- - `TEMPLATE-COVERAGE.md` — V1 file layout and parity matrix.
55
- - `docs/evaluating-dflow.en.md` — what a fresh V1 `init` produces, if
56
- you want to spin up a sample project to compare against.
57
- - For an on-demand read-only summary of legacy artifacts in your
58
- project, run `dflow doctor` (or `npx dflow-sdd-ddd doctor` on the
59
- no-install path). The command lists detected legacy paths and missing
60
- V1 fields; it never modifies files.
61
-
62
- ## Migration Steps
63
-
64
- ### 1. Move root `specs/` to `dflow/specs/`
65
-
66
- V1 puts every Dflow-managed spec under `dflow/specs/`, so the `dflow/`
67
- directory becomes a single Dflow namespace separate from any
68
- unrelated `specs/` directory another tool may own (PROPOSAL-014).
69
-
70
- If your project has top-level `specs/` containing Dflow content:
71
-
72
- ```bash
73
- mkdir -p dflow
74
- git mv specs dflow/specs
75
- git status
76
- ```
77
-
78
- Commit the rename in a single commit. Avoid mixing the rename with
79
- content edits in the same commit so reviewers can read the diff
80
- cleanly.
81
-
82
- If you also have an unrelated `specs/` directory used by another
83
- tool, move only the Dflow material into `dflow/specs/`. The CLI will
84
- warn when it sees a non-Dflow `specs/` directory but will not modify
85
- it.
86
-
87
- ### 2. Rename `_共用/` to `shared/`
88
-
89
- V1 uses canonical English directory names (PROPOSAL-012). If your
90
- project has `dflow/specs/_共用/`:
91
-
92
- ```bash
93
- git mv dflow/specs/_共用 dflow/specs/shared
94
- git status
95
- ```
96
-
97
- Update any cross-references in spec files or AI instructions. A
98
- project-wide grep after the rename catches leftover references:
99
-
100
- ```bash
101
- grep -rn "_共用" .
102
- ```
103
-
104
- ### 3. Translate Chinese headings to canonical English
105
-
106
- V1 templates use canonical English structure for section headings,
107
- field labels, anchors, and placeholders (PROPOSAL-013). Free prose
108
- inside those sections may stay in your team language.
109
-
110
- This is the most labor-intensive step. Recommended approach:
111
-
112
- 1. Open `TEMPLATE-LANGUAGE-GLOSSARY.md` for the heading-by-heading
113
- mapping.
114
- 2. For each generated spec file, replace Chinese H2 / H3 headings,
115
- table column labels, and bold inline labels with their canonical
116
- English form.
117
- 3. Leave free prose (descriptions, decision rationale, task text) in
118
- the team language. The Prose Language convention recorded in
119
- `dflow/specs/shared/_conventions.md` applies here — see also
120
- step 6 below.
121
-
122
- An AI assistant can walk through each spec file heading-by-heading
123
- faster than a global search-and-replace, because earlier Dflow
124
- adoption may have used slightly different wording per team. After
125
- translation, run a project-wide search for the most common Chinese
126
- headings to catch missed files. Adjust the search list to match the
127
- templates your team actually used:
128
-
129
- ```bash
130
- grep -rn "## 業務規則\|## 行為情境\|## 領域模型" dflow/specs/
131
- ```
132
-
133
- ### 4. Switch the init entry point
134
-
135
- Pre-V1 documentation may have instructed teammates to start a Dflow
136
- project by running `/dflow:init-project` from inside an AI agent. V1
137
- removed that runtime slash command (PROPOSAL-014). The init flow now
138
- runs as a shell command. Install Dflow globally and run:
139
-
140
- ```bash
141
- npm install -g dflow-sdd-ddd
142
- dflow init
143
- ```
144
-
145
- If you cannot or do not want to install globally, use the no-install path:
146
-
147
- ```bash
148
- npx dflow-sdd-ddd init
149
- ```
150
-
151
- If you already have an initialized project, you do not need to re-run
152
- `init`. The other `/dflow:*` workflow commands (`/dflow:new-feature`,
153
- `/dflow:modify-existing`, `/dflow:bug-fix`, `/dflow:new-phase`,
154
- `/dflow:finish-feature`, `/dflow:verify`, `/dflow:pr-review`) are
155
- unchanged and continue to work.
156
-
157
- Update any team documentation, runbooks, or onboarding notes that
158
- still reference `/dflow:init-project` so new project setups use the
159
- shell command instead.
160
-
161
- ### 5. Adopt multi-AI thin shims
162
-
163
- V1 separates the canonical project guide from each per-tool
164
- instruction file (PROPOSAL-020). The canonical guide lives at
165
- `dflow/specs/shared/AI-AGENT-GUIDE.md`. Per-tool files (`AGENTS.md`,
166
- `CLAUDE.md`, `.github/copilot-instructions.md`) are thin
167
- shims pointing at the canonical guide.
168
-
169
- If your project's `CLAUDE.md` (or equivalent) was generated by an
170
- early Dflow form that wrote a full file rather than a thin shim:
171
-
172
- ```bash
173
- dflow configure-agents
174
- ```
175
-
176
- This command adds shims for any AI tools you select. `dflow configure-agents`
177
- does not overwrite custom content in an existing root instruction file. If it
178
- recognizes an older Dflow-generated shim, it refreshes that file to the current
179
- thin shim in place; a file that already points to the guide is left as-is;
180
- otherwise it shows the change in the preview and appends a marked Dflow block to
181
- the existing file. It writes a manual-merge snippet under
182
- `dflow/specs/shared/<tool>-md-snippet.md` only when the file contains
183
- conflicting or malformed Dflow markers.
184
-
185
- If you prefer a fully clean V1 layout, archive the existing root
186
- instruction file under another name first, then run
187
- `dflow configure-agents` so it can write the new shim from scratch.
188
-
189
- ## After Migration
190
-
191
- Verify the migrated project:
192
-
193
- - Ask the AI agent to run `/dflow:status` and confirm it can locate
194
- Dflow flow material and report the project's current state.
195
- - Open `dflow/specs/shared/_conventions.md` and confirm a `## Prose
196
- Language` section exists. If your project predates the
197
- prose-language convention (PROPOSAL-015), add the section manually
198
- with the correct BCP-47 language tag, for example `zh-TW` or `en`.
199
- - Run a final grep to confirm no legacy paths or terms remain inside
200
- `dflow/specs/`. Adjust the term list to match your earlier Dflow
201
- adoption:
202
-
203
- ```bash
204
- grep -rn "_共用\|/dflow:init-project" dflow/specs/
205
- ```
206
-
207
- ## Out of Scope
208
-
209
- This guide stays manual on purpose. The items below are not part of
210
- V1 and may or may not arrive in a later release; do not rely on them
211
- when planning a migration today.
212
-
213
- - Automatic migration of legacy paths or headings.
214
- - A `dflow doctor` health check command.
215
- - A `dflow migrate` subcommand that edits files.
216
- - Automated translation of free prose between languages.
217
-
218
- If any of these would help your team, open a docs feedback issue so
219
- the request is recorded. The maintainer position is not to refuse
220
- them, only to keep V1 a clean cut.
221
-
222
- ## Where To Go Next
223
-
224
- - `docs/evaluating-dflow.en.md` for what a fresh V1 `init` produces, in
225
- case you want to compare against your migrated project.
226
- - Per-tool walkthroughs under `docs/` for the AI tool you use:
227
- - `docs/using-with-claude-code.en.md`
228
- - `docs/using-with-codex.en.md`
229
- - `TEMPLATE-COVERAGE.md` for the V1 logical / generated file parity
230
- between Greenfield and Brownfield tracks.
231
-
232
- If something in this guide does not match your project's actual
233
- pre-V1 state, open a docs feedback issue. The guide can be extended
234
- as new edge cases come in.