dflow-sdd-ddd 0.2.0 → 0.3.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.
@@ -0,0 +1,177 @@
1
+ # 在 GitHub Copilot 中使用 Dflow
2
+
3
+ > **繁體中文** | [English](using-with-github-copilot.en.md)
4
+
5
+ 當你的 AI 程式設計助理是 GitHub Copilot(IDE chat + inline completions)時,Dflow 的使用體驗 walk-through。閱讀約需 10 分鐘。
6
+
7
+ 本指南專注於 GitHub Copilot 的具體使用體驗。工具中立的評估流程請見
8
+ [`docs/evaluating-dflow.md`](evaluating-dflow.md)。完整的 Get Started
9
+ 與功能列表請見 [`README.md`](../README.md)。
10
+
11
+ ## 本指南的適用對象
12
+
13
+ 你正在使用或評估以 GitHub Copilot 作為 AI 程式設計助理的 Dflow。
14
+ 本指南說明 `init` 之後 Copilot 看到了什麼、repository shim 的位置、
15
+ 如何從 IDE 呼叫 Dflow workflow,以及幾個值得了解的 Copilot 專屬使用模式
16
+ 與 permission 行為。
17
+
18
+ ## 前置條件
19
+
20
+ - 在你的 IDE(VS Code、JetBrains 或 GitHub.dev)中已啟用 GitHub Copilot。
21
+ - 已具備 Node.js / npm 環境(Dflow 透過 npm 發佈)。以
22
+ `npm install -g dflow-sdd-ddd` 全域安裝,或用 `npx dflow-sdd-ddd init`
23
+ 走免安裝路徑,確保 repository shim 存在。
24
+ - 已具備 Dflow canonical 指南的基本認識:`dflow/specs/shared/AI-AGENT-GUIDE.md`。
25
+
26
+ ## `init` 之後 GitHub Copilot 看到了什麼
27
+
28
+ `init` 為 Copilot 在以下路徑寫入一個小型的工具專屬薄 shim:
29
+
30
+ - `.github/copilot-instructions.md`(注意:位於 `.github/` 目錄內,非專案根目錄)
31
+
32
+ 生成的 shim 範例:
33
+
34
+ ```markdown
35
+ # GitHub Copilot Repository Instructions
36
+
37
+ This project uses Dflow for spec-first AI-assisted development.
38
+
39
+ Before planning or editing code, read and follow:
40
+
41
+ - `dflow/specs/shared/AI-AGENT-GUIDE.md`
42
+ ```
43
+
44
+ 重點說明:
45
+
46
+ - Copilot shim 位於 `.github/copilot-instructions.md`(見 `lib/init.js` mapping)。
47
+ - Copilot shim 不含 Markdown `@` import。它只透過路徑指向 canonical 指南,讀取
48
+ `dflow/specs/shared/AI-AGENT-GUIDE.md` 時需明確開啟該檔案。
49
+
50
+ ## 在 GitHub Copilot 中使用 Dflow Workflow 指令
51
+
52
+ Copilot 是 IDE 優先的助理(chat panel + inline completions),不是 CLI 工具。
53
+ 請把 Dflow workflow 名稱當成普通的對話指示,而非 CLI slash command:
54
+
55
+ - 在 Copilot Chat 中:「Run the Dflow /dflow:new-feature workflow」—— Copilot
56
+ 應讀取 canonical 指南並繼續執行。
57
+ - 在程式碼 comment 或 editor chat 中,以普通文字描述 workflow:
58
+ `Run the Dflow /dflow:new-feature workflow.`
59
+
60
+ 可用的 workflow 入口:
61
+
62
+ | 指令 | 適用情境 |
63
+ |---|---|
64
+ | `/dflow:new-feature` | 需要新增一個使用者可見的功能或業務行為。 |
65
+ | `/dflow:modify-existing` | 需要修改現有行為。 |
66
+ | `/dflow:bug-fix` | 可以用預期行為 vs 實際行為描述的缺陷。 |
67
+ | `/dflow:new-phase` | 進行中的 feature 需要另一個實作 slice。 |
68
+ | `/dflow:finish-feature` | 實作完成後需要進行漂移(drift)收尾。 |
69
+ | `/dflow:verify` | 需要對 spec、領域文件、實作與測試進行一致性檢查。 |
70
+ | `/dflow:pr-review` | 變更已準備好進行 SDD/DDD review。 |
71
+ | `/dflow:report-dflow-feedback` | 你發現了 Dflow 的問題或改進點,想要一份清理過的上游回饋草稿。 |
72
+
73
+ ### 對話範例
74
+
75
+ 典型的 Copilot Chat workflow 如下:
76
+
77
+ ```text
78
+ You: I'd like to use the /dflow:new-feature workflow. We need to add the
79
+ ability for users to export their data as CSV.
80
+
81
+ Copilot: I'll help you structure this as a new feature. Let me start by
82
+ reviewing the AI-AGENT-GUIDE to understand the spec format.
83
+
84
+ Before drafting the feature spec, I need to understand the scope:
85
+
86
+ 1. Should the CSV include all user data fields or a selected subset?
87
+ 2. Which user roles should be able to trigger the export?
88
+ 3. Are there any compliance or performance constraints I should know?
89
+
90
+ You: All fields, only admin users, and exports should complete within 30 seconds
91
+ for datasets up to 1 million rows.
92
+
93
+ Copilot: Got it. I'll create the feature spec at dflow/specs/features/active/
94
+ with these constraints. Let me also outline the implementation phases...
95
+ ```
96
+
97
+ ### 既有的 Repository 指示
98
+
99
+ 如果你的專案中已有 `.github/copilot-instructions.md`,`init` 不會覆蓋它。
100
+ 它改為在 `dflow/specs/shared/` 下寫入 merge snippet,讓你手動審閱後貼入
101
+ 既有檔案。這樣可以避免破壞你已有的自訂 Copilot 指示。
102
+
103
+ 到 `dflow/specs/shared/COPILOT-INSTRUCTIONS-MERGE-SNIPPET.md` 找到 merge
104
+ snippet,再把相關段落貼入你現有的 `.github/copilot-instructions.md`。
105
+
106
+ ### Slash Command Passthrough 說明
107
+
108
+ Copilot 是否會直通(passthrough)原始的 `/dflow:*` slash command,取決於
109
+ IDE 整合方式與 Copilot 版本。若 Copilot 無法識別以 slash 為前綴的 workflow
110
+ 名稱,以普通文字重新送出請求:
111
+
112
+ ```text
113
+ You: Instead of /dflow:new-feature, try: "Please help me start a new Dflow
114
+ feature workflow. Read dflow/specs/shared/AI-AGENT-GUIDE.md first."
115
+ ```
116
+
117
+ ## 與其他 AI 工具的差異
118
+
119
+ canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)在各工具之間是相同的。
120
+ 只有根目錄層的 shim 有所不同:
121
+
122
+ | 工具 | 產生的 shim | 載入 canonical 指南的方式 |
123
+ |---|---|---|
124
+ | GitHub Copilot | `.github/copilot-instructions.md` | 直接讀取 repository 指示 |
125
+ | Claude Code | `CLAUDE.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
126
+ | Gemini CLI | `GEMINI.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
127
+ | Codex / Copilot coding agent | `AGENTS.md` | 啟動時直接讀取檔案內容 |
128
+
129
+ - Shim 路徑:Copilot 使用 `.github/copilot-instructions.md`(不是 `AGENTS.md`
130
+ 或 `CLAUDE.md`)。
131
+ - Markdown import:Copilot shim 不含 `@dflow/specs/shared/AI-AGENT-GUIDE.md`
132
+ import。這點與 Claude Code / Gemini CLI 的 shim 透過 `@` import inline 嵌入不同。
133
+ - 工具模型:Copilot 是 IDE-based(chat panel + inline completions);
134
+ Codex / Claude Code 是 CLI-based agent。Copilot 透過編輯器 UI 互動,而非
135
+ command-line session。
136
+ - Workflow 呼叫:使用 CLI agent 時可對 agent process 輸入 `/dflow:*`;使用
137
+ Copilot 時,建議在 Copilot Chat 或 editor comment 中使用普通文字描述。
138
+ - Permission 模型:Copilot 依賴 IDE 的 permission 與 extension sandbox。它可能
139
+ 受 editor-level approvals 管理;CLI 工具通常有明確的 sandbox flags 與獨立的
140
+ permission gates。
141
+
142
+ ## 常見模式與注意事項
143
+
144
+ - 保持 `.github/copilot-instructions.md` 精簡。Canonical Dflow 指南
145
+ (`dflow/specs/shared/AI-AGENT-GUIDE.md`)才是 source of truth。
146
+ - 若 Copilot 看起來只從 shim 文字工作,請明確要求它開啟或讀取
147
+ `dflow/specs/shared/AI-AGENT-GUIDE.md` 後再繼續。
148
+ - Copilot 的 inline completions 可能在未走 Dflow workflow 的情況下直接建議程式碼;
149
+ 需要 spec-driven 輸出時,請明確要求執行 workflow。
150
+ - Copilot Chat context 不一定會在所有 IDE 版本中自動包含 `.github/` 目錄下的
151
+ repository 指示檔;行為因 Copilot / IDE 版本而異(見頁尾說明)。
152
+ - 當 slash-prefixed forms 被 IDE 拒絕時,改用普通文字描述 workflow 名稱。
153
+
154
+ ## 下一步
155
+
156
+ 如果你還沒有執行 `init`:
157
+
158
+ - 執行 `dflow init`(安裝後)或 `npx dflow-sdd-ddd init`,選擇 Copilot 目標
159
+ 以建立 `.github/copilot-instructions.md`。參考
160
+ [評估者指南 Playbook](evaluating-dflow.md#30-分鐘評估-playbook) 在可拋棄的
161
+ 範例專案中試用。
162
+
163
+ 如果你已執行 `init` 且想查看端到端的 workflow 範例:
164
+
165
+ - 閱讀 [`dflow/specs/shared/AI-AGENT-GUIDE.md`](../sdd-ddd-greenfield-skill/scaffolding/AI-AGENT-GUIDE.md)
166
+ (或 brownfield 等效版本)後再開始 workflow。
167
+ - 閱讀 [`tutorial/01-greenfield/`](../tutorial/01-greenfield/walkthrough-00-setup.md),
168
+ 其中有展示 Copilot chat flow 的對話範例。
169
+
170
+ 如果你想了解設計理念:
171
+
172
+ - 閱讀[為什麼 AI 時代 DDD 更重要](why-ddd-for-ai.md)。
173
+
174
+ ---
175
+
176
+ IDE 行為說明:Slash command passthrough 與 `.github/` 指示檔的自動包含行為,
177
+ 會因 Copilot / IDE 版本而異。依賴確切語意前請向 maintainer 確認。
@@ -0,0 +1,37 @@
1
+ # Why DDD Matters More with AI
2
+
3
+ > [繁體中文](why-ddd-for-ai.md) | **English**
4
+
5
+ AI-assisted development changes the failure mode of software design. The team can produce more code faster, but unclear domain meaning is also amplified faster.
6
+
7
+ When a project lacks shared language and explicit boundaries, small inconsistencies spread:
8
+
9
+ - the same concept appears as `Order`, `Booking`, and `Transaction`
10
+ - APIs encode different meanings for similar actions
11
+ - business rules live in handlers, UI code, scripts, and tests
12
+ - nobody can confidently say which behavior is authoritative
13
+
14
+ An AI coding agent does not know the business domain by default. When the prompt is incomplete, it fills the missing parts with plausible logic. That logic may compile, pass superficial tests, and still be wrong. The most dangerous AI mistakes are often not syntax errors; they are reasonable-looking domain mistakes.
15
+
16
+ DDD gives the spec a semantic backbone:
17
+
18
+ | DDD idea | AI-era value |
19
+ |---|---|
20
+ | **Ubiquitous Language** | Keeps names and meanings stable across prompts, specs, code, and reviews. |
21
+ | **Bounded Context** | Defines where a term or rule is valid, and prevents accidental meaning leaks. |
22
+ | **Domain Model** | Gives behavior a clear owner instead of scattering rules across technical layers. |
23
+ | **Domain Rules** | States what is correct, allowed, forbidden, and exceptional before code generation. |
24
+
25
+ The important shift is where design lives. In older workflows, much of the real design could remain implicit in code. With AI, that is too late. The model needs constraints before it generates code.
26
+
27
+ ```text
28
+ Without DDD:
29
+ Prompt -> AI fills gaps -> Code -> Hidden domain drift
30
+
31
+ With DDD:
32
+ Domain meaning -> Structured spec -> AI implementation -> Reviewable code
33
+ ```
34
+
35
+ Code still matters, but it is no longer the first place where meaning should be discovered. For AI collaboration, specs become the pre-generation contract, and DDD supplies the language, boundaries, and rules that make the contract precise.
36
+
37
+ Dflow is built around that idea: spec first, domain meaning explicit, AI constrained before implementation, and drift checked before the work is considered done.
@@ -1,26 +1,28 @@
1
- # Why DDD Matters More with AI
1
+ # 為什麼 AI 時代 DDD 更重要
2
2
 
3
- AI-assisted development changes the failure mode of software design. The team can produce more code faster, but unclear domain meaning is also amplified faster.
3
+ > **繁體中文** | [English](why-ddd-for-ai.en.md)
4
4
 
5
- When a project lacks shared language and explicit boundaries, small inconsistencies spread:
5
+ AI 輔助開發改變了軟體設計的失敗模式。團隊能更快產出更多程式碼,但不清晰的領域語義也會以同樣的速度擴散。
6
6
 
7
- - the same concept appears as `Order`, `Booking`, and `Transaction`
8
- - APIs encode different meanings for similar actions
9
- - business rules live in handlers, UI code, scripts, and tests
10
- - nobody can confidently say which behavior is authoritative
7
+ 當專案缺乏共同語言與明確邊界時,細小的不一致便會蔓延:
11
8
 
12
- An AI coding agent does not know the business domain by default. When the prompt is incomplete, it fills the missing parts with plausible logic. That logic may compile, pass superficial tests, and still be wrong. The most dangerous AI mistakes are often not syntax errors; they are reasonable-looking domain mistakes.
9
+ - 同一個概念以 `Order`、`Booking`、`Transaction` 三種名稱出現
10
+ - API 對相似動作賦予不同語義
11
+ - 業務規則分散在 handler、UI 程式碼、腳本與測試之中
12
+ - 沒有人能確定哪一個行為才是權威的
13
13
 
14
- DDD gives the spec a semantic backbone:
14
+ AI 程式碼代理預設不了解業務領域。當 prompt 資訊不完整時,它會以看似合理的邏輯填補缺漏。這些邏輯可能通過編譯、通過表面測試,卻依然是錯的。AI 最危險的錯誤往往不是語法錯誤,而是外觀合理的領域錯誤。
15
15
 
16
- | DDD idea | AI-era value |
16
+ DDD 為規格提供語義骨幹:
17
+
18
+ | DDD 概念 | AI 時代的價值 |
17
19
  |---|---|
18
- | **Ubiquitous Language** | Keeps names and meanings stable across prompts, specs, code, and reviews. |
19
- | **Bounded Context** | Defines where a term or rule is valid, and prevents accidental meaning leaks. |
20
- | **Domain Model** | Gives behavior a clear owner instead of scattering rules across technical layers. |
21
- | **Domain Rules** | States what is correct, allowed, forbidden, and exceptional before code generation. |
20
+ | **Ubiquitous Language(通用語言)** | 讓名稱與語義在 prompt、規格、程式碼與 review 之間保持穩定。 |
21
+ | **Bounded Context** | 定義術語或規則的有效範圍,防止語義意外洩漏。 |
22
+ | **領域模型(Domain Model)** | 讓行為有明確的所有者,而不是將規則分散在技術層之間。 |
23
+ | **領域規則(Domain Rules)** | 在程式碼生成之前,先明確指出什麼是正確的、允許的、禁止的,以及例外情況。 |
22
24
 
23
- The important shift is where design lives. In older workflows, much of the real design could remain implicit in code. With AI, that is too late. The model needs constraints before it generates code.
25
+ 關鍵的轉變在於設計的位置。舊有的工作流程中,大量真正的設計可以隱含在程式碼裡。引入 AI 之後,這樣做已經太遲。模型需要在生成程式碼之前就取得約束條件。
24
26
 
25
27
  ```text
26
28
  Without DDD:
@@ -30,6 +32,6 @@ With DDD:
30
32
  Domain meaning -> Structured spec -> AI implementation -> Reviewable code
31
33
  ```
32
34
 
33
- Code still matters, but it is no longer the first place where meaning should be discovered. For AI collaboration, specs become the pre-generation contract, and DDD supplies the language, boundaries, and rules that make the contract precise.
35
+ 程式碼仍然重要,但不再是發現語義的第一現場。在 AI 協作模式下,規格成為生成前的契約,DDD 提供語言、邊界與規則,使契約具備精確性。
34
36
 
35
- Dflow is built around that idea: spec first, domain meaning explicit, AI constrained before implementation, and drift checked before the work is considered done.
37
+ Dflow 正是圍繞這個理念建構:規格優先、領域語義顯式化、在實作前約束 AI,並在工作完成前驗證漂移(drift)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dflow-sdd-ddd",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Spec-first SDD/DDD workflow kit for AI-assisted development",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -70,7 +70,8 @@ Signals:
70
70
  canonical English; compare against `TEMPLATE-LANGUAGE-GLOSSARY.md` if
71
71
  available.
72
72
  - References to a runtime `/dflow:init-project` slash command (V1
73
- replaced it with the shell command `npx dflow-sdd-ddd init`).
73
+ replaced it with the Dflow CLI init command (`dflow init`, or
74
+ `npx dflow-sdd-ddd init` when using the no-install path)).
74
75
  - A root `CLAUDE.md`, `AGENTS.md`, or equivalent that holds the full
75
76
  Dflow workflow text instead of being a thin shim pointing to this
76
77
  file.
@@ -5,9 +5,9 @@
5
5
  > This file is a **snippet**, not a standalone `CLAUDE.md`. Its purpose
6
6
  > is to be merged into your project's root `CLAUDE.md`:
7
7
  >
8
- > - New `npx dflow-sdd-ddd init` output uses
9
- > `dflow/specs/shared/AI-AGENT-GUIDE.md` as the canonical guide and
10
- > creates a thin `CLAUDE.md` shim that points back to it.
8
+ > - New Dflow CLI init output (`dflow init`, or `npx dflow-sdd-ddd init` when
9
+ > using the no-install path) uses `dflow/specs/shared/AI-AGENT-GUIDE.md` as
10
+ > the canonical guide and creates a thin `CLAUDE.md` shim that points back to it.
11
11
  > - Use this legacy snippet only if you intentionally want the older
12
12
  > Claude-specific two-H2 layout in your project's root `CLAUDE.md`.
13
13
 
@@ -45,7 +45,7 @@ ASP.NET Core 做準備。
45
45
 
46
46
  ```
47
47
  dflow/specs/
48
- ├── shared/ # 專案級治理文件(由 npx dflow-sdd-ddd init 寫入)
48
+ ├── shared/ # 專案級治理文件(由 Dflow CLI init 寫入)
49
49
  │ ├── _overview.md # 系統現況與遷移策略
50
50
  │ ├── _conventions.md # 規格撰寫慣例
51
51
  │ └── Git-principles-*.md # Git 規範(gitflow 或 trunk 版)
@@ -97,7 +97,7 @@ AI 的完整決策樹、Workflow Transparency、Ceremony Scaling 三層判準
97
97
  當你作為 AI assistant 被呼叫時,若偵測到使用者需要 SDD/DDD 工作流
98
98
  引導,請參考 Dflow entry points:
99
99
 
100
- - `npx dflow-sdd-ddd init` — 專案初始化(建立 `dflow/specs/` 結構)
100
+ - Dflow CLI init command (`dflow init`, or `npx dflow-sdd-ddd init` when using the no-install path) — 專案初始化(建立 `dflow/specs/` 結構)
101
101
  - `/dflow:new-feature` — 新功能開發
102
102
  - `/dflow:new-phase` — 在 active feature 內新增階段
103
103
  - `/dflow:modify-existing` — 修改既有功能
@@ -162,5 +162,5 @@ When merging this snippet into an existing `CLAUDE.md`:
162
162
  duplicate it.
163
163
 
164
164
  If you are starting from scratch (no existing `CLAUDE.md`), the
165
- `npx dflow-sdd-ddd init` flow will install this snippet as-is and you
166
- can refine from there.
165
+ the Dflow CLI init flow (`dflow init`, or `npx dflow-sdd-ddd init` when using
166
+ the no-install path) will install this snippet as-is and you can refine from there.
@@ -17,7 +17,7 @@
17
17
 
18
18
  ```
19
19
  dflow/specs/
20
- ├── shared/ # 專案級治理文件(由 npx dflow-sdd-ddd init 寫入)
20
+ ├── shared/ # 專案級治理文件(由 dflow init 寫入)
21
21
  │ ├── _overview.md # 系統現況與遷移策略
22
22
  │ └── _conventions.md # 規格撰寫慣例與模板
23
23
  ├── domain/ # 領域知識
@@ -19,30 +19,33 @@ Template note (for AI):
19
19
  `phase-spec-YYYY-MM-DD-{slug}.md` placed at
20
20
  `dflow/specs/features/active/{SPEC-ID}-{slug}/`.
21
21
 
22
- Each section below carries an HTML comment indicating its fill-in phase (Phase 1-4).
23
- These phase markers let /dflow:status and the completion checklist track progress.
24
- Phases correspond to SKILL.md § Guiding Questions by Phase:
25
- Phase 1 - Understanding (What & Why)
26
- Phase 2 - Domain Analysis (Where does it live?)
27
- Phase 3 - Spec Writing (Behavior + Rules + Edge Cases)
28
- Phase 4 - Implementation Planning
29
- The "Implementation Tasks" section at the end is generated by AI after Phase 4 planning is done
22
+ Each section below carries an HTML comment indicating its fill-in activity (Activity 1-4).
23
+ These activity markers let /dflow:status and the completion checklist track progress.
24
+ Activities correspond to SKILL.md § Guiding Questions by Activity:
25
+ Activity 1: Understanding (What & Why)
26
+ Activity 2: Domain Analysis (Where does it live?)
27
+ Activity 3: Spec Writing (Behavior + Rules + Edge Cases)
28
+ Activity 4: Implementation Planning
29
+ The "Implementation Tasks" section at the end is generated by AI after Activity 4 (Implementation Planning) is done
30
30
  (see new-feature-flow.md Step 5 end / new-phase-flow.md Step 4 end /
31
31
  modify-existing-flow.md Step 4 end).
32
32
 
33
+ Note: "phase 2+ specs" / "Phase 2+" in the BR and Delta sections below refers to
34
+ the N-th phase-spec of this feature (i.e. iteration unit), NOT an activity number.
35
+
33
36
  For phase 2+ specs in the same feature: only list BRs that are NEW or
34
37
  MODIFIED in this phase under "Business Rules"; do not re-copy unchanged BRs from
35
38
  prior phases. The cumulative state lives in the feature's `_index.md`
36
39
  Current BR Snapshot table.
37
40
  -->
38
41
 
39
- ## Problem Description <!-- Fill timing: Phase 1 -->
42
+ ## Problem Description <!-- Fill timing: Activity 1: Understanding -->
40
43
 
41
44
  這個功能要解決什麼問題?誰需要它?
42
45
 
43
46
  > 用使用者的角度描述,避免技術用語。
44
47
 
45
- ## Domain Concepts <!-- Fill timing: Phase 2 -->
48
+ ## Domain Concepts <!-- Fill timing: Activity 2: Domain Analysis -->
46
49
 
47
50
  涉及的 Domain 概念(引用 `dflow/specs/domain/{context}/models.md`):
48
51
 
@@ -55,7 +58,7 @@ Template note (for AI):
55
58
  - [ ] `dflow/specs/domain/{context}/models.md` — 新增模型定義
56
59
 
57
60
  <!-- dflow:section behavior-scenarios -->
58
- ## Behavior Scenarios <!-- Fill timing: Phase 3 -->
61
+ ## Behavior Scenarios <!-- Fill timing: Activity 3: Spec Writing -->
59
62
 
60
63
  ### Main Success Scenario
61
64
 
@@ -75,7 +78,7 @@ Scenario: {替代情境}
75
78
  Then {不同的預期結果}
76
79
  ```
77
80
 
78
- ## Business Rules <!-- Fill timing: Phase 3 -->
81
+ ## Business Rules <!-- Fill timing: Activity 3: Spec Writing -->
79
82
 
80
83
  > Phase 2+ 注意:本段僅列**本 phase 新增 / 修改到的 BR**;未變動的 BR 不重抄
81
84
  > (它們的當前狀態見 feature 的 `_index.md` Current BR Snapshot 表)。
@@ -85,7 +88,7 @@ Scenario: {替代情境}
85
88
  | BR-01 | {規則描述} | |
86
89
  | BR-02 | {規則描述} | |
87
90
 
88
- ## Delta from prior phases <!-- Fill timing: Phase 3; skip for the first phase -->
91
+ ## Delta from prior phases <!-- Fill timing: Activity 3: Spec Writing; skip for the first phase -->
89
92
 
90
93
  > 本段僅記**本 phase 相對前一 phase 的變化**,不累積歷史。歷史由 feature 目錄下
91
94
  > 各 phase-spec 的本段串接閱讀;feature 層的當前累積狀態見 `_index.md` 的
@@ -119,14 +122,14 @@ Then {新的預期結果}
119
122
  - BR-003 金額上限
120
123
  - BR-005 提交後不可修改
121
124
 
122
- ## Edge Cases <!-- Fill timing: Phase 3 -->
125
+ ## Edge Cases <!-- Fill timing: Activity 3: Spec Writing -->
123
126
 
124
127
  | ID | Case | Expected Handling |
125
128
  |---|---|---|
126
129
  | EC-01 | {邊界描述} | {處理方式} |
127
130
  | EC-02 | {邊界描述} | {處理方式} |
128
131
 
129
- ## Implementation Notes <!-- Fill timing: Phase 4 -->
132
+ ## Implementation Notes <!-- Fill timing: Activity 4: Implementation Planning -->
130
133
 
131
134
  ### Current WebForms Implementation
132
135
 
@@ -148,7 +151,7 @@ Then {新的預期結果}
148
151
 
149
152
  > 遷移時需要注意的事項,或者現在的設計如何幫助未來遷移。
150
153
 
151
- ## Data Structure Changes <!-- Fill timing: Phase 4 -->
154
+ ## Data Structure Changes <!-- Fill timing: Activity 4: Implementation Planning -->
152
155
 
153
156
  > 涉及的資料表與欄位變更(如有)
154
157
 
@@ -156,7 +159,7 @@ Then {新的預期結果}
156
159
  |---|---|---|---|
157
160
  | {Table} | {Column} | 新增/修改/刪除 | |
158
161
 
159
- ## Test Strategy <!-- Fill timing: Phase 4 -->
162
+ ## Test Strategy <!-- Fill timing: Activity 4: Implementation Planning -->
160
163
 
161
164
  > Domain 層的單元測試應驗證哪些行為?
162
165
 
@@ -164,14 +167,14 @@ Then {新的預期結果}
164
167
  - [ ] {測試案例 2}
165
168
 
166
169
  <!-- dflow:section open-questions -->
167
- ## Open Questions <!-- Fill timing: Phase 1-4 -->
170
+ ## Open Questions <!-- Fill timing: Activity 1-4; any time during planning -->
168
171
 
169
172
  - {尚未釐清的需求、規則、資料或實作問題}
170
173
 
171
174
  <!-- dflow:section implementation-tasks -->
172
- ## Implementation Tasks <!-- Fill timing: generated by AI after Phase 4; all items should be checked at completion -->
175
+ ## Implementation Tasks <!-- Fill timing: generated by AI after Activity 4: Implementation Planning; all items should be checked at completion -->
173
176
 
174
- > AI 在 Phase 4 實作規劃完成後,根據「Implementation Notes」產生的具體任務清單。
177
+ > AI 在 Activity 4 (Implementation Planning) 完成後,根據「Implementation Notes」產生的具體任務清單。
175
178
  > 格式:`[LAYER]-[NUMBER]: 任務描述`
176
179
  > 分類標籤(Brownfield track):
177
180
  > - `DOMAIN` — Domain 層類別、VO、Service、Interface
@@ -70,7 +70,8 @@ Signals:
70
70
  canonical English; compare against `TEMPLATE-LANGUAGE-GLOSSARY.md` if
71
71
  available.
72
72
  - References to a runtime `/dflow:init-project` slash command (V1
73
- replaced it with the shell command `npx dflow-sdd-ddd init`).
73
+ replaced it with the Dflow CLI init command (`dflow init`, or
74
+ `npx dflow-sdd-ddd init` when using the no-install path)).
74
75
  - A root `CLAUDE.md`, `AGENTS.md`, or equivalent that holds the full
75
76
  Dflow workflow text instead of being a thin shim pointing to this
76
77
  file.
@@ -14,9 +14,9 @@
14
14
 
15
15
  ## How to use this snippet
16
16
 
17
- - New `npx dflow-sdd-ddd init` output uses
18
- `dflow/specs/shared/AI-AGENT-GUIDE.md` as the canonical guide and creates
19
- a thin `CLAUDE.md` shim that points back to it.
17
+ - New Dflow CLI init output (`dflow init`, or `npx dflow-sdd-ddd init` when
18
+ using the no-install path) uses `dflow/specs/shared/AI-AGENT-GUIDE.md` as
19
+ the canonical guide and creates a thin `CLAUDE.md` shim that points back to it.
20
20
  - Use this legacy snippet only if you intentionally want the older
21
21
  Claude-specific two-H2 layout in your project's root `CLAUDE.md`.
22
22
 
@@ -66,7 +66,7 @@ Presentation → Application → Domain ← Infrastructure
66
66
  ### Project Structure
67
67
 
68
68
  完整 specs 目錄結構見 Dflow skill `SKILL.md` § "Project Structure"。
69
- 以下只列本專案當前狀態(`npx dflow-sdd-ddd init` 建立後可能還未全填):
69
+ 以下只列本專案當前狀態(Dflow CLI init 建立後可能還未全填):
70
70
 
71
71
  ```
72
72
  dflow/specs/
@@ -101,7 +101,7 @@ AI 的完整決策樹、Workflow Transparency、Ceremony Scaling 三層判準
101
101
  - `sdd-ddd-greenfield-skill/references/` 內各 flow 文件
102
102
 
103
103
  本專案採用的 Dflow entry points:
104
- - `npx dflow-sdd-ddd init` — 專案初始化(一次性,已執行過)
104
+ - Dflow CLI init command (`dflow init`, or `npx dflow-sdd-ddd init` when using the no-install path) — 專案初始化(一次性,已執行過)
105
105
  - `/dflow:new-feature` — 新功能
106
106
  - `/dflow:new-phase` — 既有 active feature 加新 phase
107
107
  - `/dflow:modify-existing` — 修改既有行為
@@ -165,5 +165,6 @@ AI 的完整決策樹、Workflow Transparency、Ceremony Scaling 三層判準
165
165
  - The snippet does NOT re-copy the Dflow decision tree, Ceremony
166
166
  Scaling criteria, or per-flow step details — those live in the
167
167
  skill and change when the skill evolves
168
- - Re-run `npx dflow-sdd-ddd init` will NOT overwrite an existing
169
- `CLAUDE.md`; if you want to re-sync, merge manually
168
+ - Re-running the Dflow CLI init command (`dflow init`, or `npx dflow-sdd-ddd init`
169
+ when using the no-install path) will NOT overwrite an existing `CLAUDE.md`;
170
+ if you want to re-sync, merge manually
@@ -101,7 +101,7 @@ Project-specific guidance when filling these templates:
101
101
  descriptions (Mermaid state diagram or Given / When / Then + "And
102
102
  the Aggregate is in state X").
103
103
  - **CQRS split**: commands (write) vs queries (read) should be
104
- identified during Phase 4 (Implementation Planning). Commands
104
+ identified during Activity 4 (Implementation Planning). Commands
105
105
  generally map 1:1 to an Aggregate method; queries bypass the
106
106
  Domain layer and read projections.
107
107
 
@@ -34,7 +34,7 @@ Presentation → Application → Domain ← Infrastructure
34
34
 
35
35
  ```
36
36
  dflow/specs/
37
- ├── shared/ # 專案級治理文件(由 npx dflow-sdd-ddd init 寫入)
37
+ ├── shared/ # 專案級治理文件(由 dflow init 寫入)
38
38
  │ ├── _overview.md # 系統現況與遷移策略
39
39
  │ └── _conventions.md # 規格撰寫慣例
40
40
  ├── domain/