dflow-sdd-ddd 0.5.0 → 0.7.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.
@@ -73,16 +73,18 @@ source-of-truth 檔案路徑,以及核心 SDD/DDD 規則。`CLAUDE.md` shim
73
73
 
74
74
  ## 在 Claude Code 中使用 Dflow Slash Commands
75
75
 
76
- 預設情況下,Dflow 的 canonical `/dflow:*` slash commands 是 AI 透過
77
- `AI-AGENT-GUIDE.md` 中的 workflow 表識別的 workflow 名稱,不是 Claude Code
78
- 內建的 slash command 系統。你以普通對話方式輸入它們:
76
+ Dflow 的 canonical `/dflow:*` 名稱是跨工具共用的 workflow 詞彙;各工具的
77
+ `/` parser 行為不同,Claude Code 需要註冊過的 slash command 才能接受
78
+ `/dflow:<id>` 形式。建議先安裝下方的 command adapters,然後以 Claude Code
79
+ 實際註冊的名稱輸入:
79
80
 
80
81
  ```text
81
82
  /dflow:new-feature
82
83
  ```
83
84
 
84
- Claude Code 將此視為輸入。由於它已透過 `CLAUDE.md` import 載入了 workflow 表,
85
- 它會識別這個前綴並進入對應的 workflow。一次典型的對話如下:
85
+ 安裝 adapter 後,Claude Code 會把 `.claude/commands/dflow/<id>.md` 註冊成
86
+ `/dflow:<id>`。Wrapper 會指回 `AI-AGENT-GUIDE.md` 中的 canonical workflow。
87
+ 一次典型的對話如下:
86
88
 
87
89
  ```text
88
90
  You: /dflow:new-feature
@@ -120,6 +122,10 @@ skill 檔案來執行它們。
120
122
  如果你忘了指令名稱,問 Claude Code「what dflow workflows are available?」
121
123
  即可 —— 答案會從它已載入的 workflow 表中給出。
122
124
 
125
+ 若尚未安裝 command adapters,或 Claude Code 將 slash-prefixed 輸入判定為
126
+ Unknown command,請改用普通文字,例如 `dflow:new-feature` 或
127
+ `Run the Dflow /dflow:new-feature workflow.`,讓模型依 canonical guide 執行。
128
+
123
129
  ### 選配 Command Adapters
124
130
 
125
131
  如果想讓 Claude Code 看到工具原生的命令入口,可在已初始化的專案中執行:
@@ -131,13 +137,93 @@ dflow configure-agents --command-adapters
131
137
  選擇 Claude Code 後,Dflow 會從 canonical guide 內的 command registry
132
138
  投影產生薄 wrapper:
133
139
 
134
- - `.claude/commands/dflow/dflow-<id>.md`
140
+ - `.claude/commands/dflow/<id>.md`
141
+
142
+ 這些 wrapper 使用 Claude Code 的目錄 namespace 命名,例如
143
+ `/dflow:new-feature`。Wrapper 內容只指向 canonical `/dflow:new-feature`
144
+ workflow 與 `dflow/specs/shared/AI-AGENT-GUIDE.md`,不複製 workflow 步驟。
145
+ 從 Dflow 0.5.0 升級的專案可能仍保留舊檔
146
+ `.claude/commands/dflow/dflow-*.md`,會讓 Claude Code 同時顯示舊的
147
+ `/dflow:dflow-<id>` 與新的 `/dflow:<id>`。重跑
148
+ `dflow configure-agents --command-adapters` 時,Dflow 會**自動偵測並清除**這些
149
+ 0.5.0 產生的 stale wrapper:待刪檔會列在確認 preview 中(標為 `remove`),由你
150
+ 確認後才刪除。Dflow 只會刪除**內容與 0.5.0 產生物完全相符**的檔;若該檔被你改過、
151
+ 或是你自己放在同 namespace 的檔,Dflow 不會刪除,只會印出 warning 提示你自行確認。
152
+
153
+ ### 產生物的版控政策與升級
154
+
155
+ `.claude/commands/dflow/<id>.md` 是從 canonical guide 投影出來的**衍生物**。Dflow 的
156
+ **建議預設**是不版控、由 clone 後重跑 `dflow configure-agents --command-adapters` 重生成;
157
+ 團隊若想 clone 後立即有原生命令選單,也可改為**版控**。重點是同一專案對所有工具採一致策略
158
+ (政策總覽與 ignore-vs-track 取捨見 [README「Init 產生的檔案」](../README.md#init-產生的檔案))。
159
+
160
+ 採 gitignore 預設時,在專案 `.gitignore` 加入(**僅在你保留 `.claude/commands/dflow/`
161
+ namespace 給 Dflow 時**):
162
+
163
+ ```gitignore
164
+ .claude/commands/dflow/
165
+ ```
166
+
167
+ 注意:此規則會一併 ignore 你放在同一目錄下的自訂 command。若該目錄**已被版控**,新增 ignore
168
+ 規則不會自動把它移出版控,需先:
169
+
170
+ ```bash
171
+ git rm --cached -r .claude/commands/dflow/
172
+ ```
173
+
174
+ (`--cached` 只移出版控、保留工作目錄檔案。)
135
175
 
136
- 這些 wrapper 使用 adapter-native 命名,例如 `/dflow-new-feature`。Wrapper
137
- 內容只指向 canonical `/dflow:new-feature` workflow 與
138
- `dflow/specs/shared/AI-AGENT-GUIDE.md`,不複製 workflow 步驟。Dflow v1 不承諾
139
- Claude Code 選單中一定會出現 exact `/dflow:new-feature` colon 形式;canonical
140
- 名稱仍保留在 guide 與 wrapper body 中。
176
+ 升級 dflow 後重跑 `dflow configure-agents --command-adapters`,adapter 會用**新版 registry**
177
+ 重投影;但既有 `dflow/specs/shared/AI-AGENT-GUIDE.md` **不會**被覆寫——「重投影 adapter」不等於
178
+ 「升級 canonical guide」。請以**相同的 dflow CLI 版本**重投影,避免 registry 與 guide 版本錯位。
179
+
180
+ ### 選配 Skill Adapter(找回自然語言自動觸發)
181
+
182
+ Command adapter 提供 `/` 選單入口,但**不會自動觸發**——你得主動打命令。若想找回
183
+ 「講『我要加一個功能』就自動現身」的體驗,可在已初始化的專案中執行:
184
+
185
+ ```bash
186
+ dflow configure-agents --skills
187
+ ```
188
+
189
+ 選擇 Claude Code 後,Dflow 會產生一份薄 skill:
190
+
191
+ - `.claude/skills/dflow/SKILL.md`
192
+
193
+ 這份 skill 不複製 workflow 步驟,body 只指向 canonical
194
+ `dflow/specs/shared/AI-AGENT-GUIDE.md`,由 guide 承載真正的 workflow 內容。
195
+ 它的行為:
196
+
197
+ - **自動觸發於** feature / bug-fix workflow、product/domain behavior 變更、新需求、
198
+ spec-impacting 的 architecture / domain-model 決策。
199
+ - **不會觸發於** 純 refactor、infra chore、formatting、一般 code 問題。
200
+ - 由自然語言觸發時,**不會直接進 workflow**:它會判斷意圖、**建議對應的 `/dflow:`
201
+ 命令並等待你確認**,再進入流程。
202
+
203
+ **四種組合**(command adapter 與 skill 各自獨立 opt-in):
204
+
205
+ | 安裝組合 | 入口行為 |
206
+ |---|---|
207
+ | 都不裝 | 只有根目錄 shim(CLAUDE.md 指向 guide);無 `/` 選單、無自動觸發 |
208
+ | 只裝 command adapters | `/dflow:*` 出現在 `/` 選單;無自然語言自動觸發 |
209
+ | 只裝 skill | 自然語言自動觸發(suggest-and-wait);無 `/` 選單 |
210
+ | 兩者都裝 | `/` 選單 + 自然語言 safety net **可共存** |
211
+
212
+ **兩者可共存、無需互斥**(已在真實 Claude Code 環境驗證):skill 名稱 `dflow` 與
213
+ command adapter 的 `dflow:<id>` 不撞名,明確命令各自精準載入、不會雙觸發;skill 當
214
+ 自然語言 safety net,command adapters 當 `/` 選單。
215
+
216
+ 安裝後用 `/skills` 或詢問「What skills are available?」確認 skill 已被探索到。注意:
217
+ 新增頂層 skills 目錄可能需**重啟 Claude Code** 才會被 watch 到。另外,位於
218
+ `~/.claude/skills/dflow` 的 personal / enterprise skill 可能會 **override** 專案層級
219
+ skill(依 Claude 官方文件),用 `/skills` 可檢查目前生效的是哪一份。
220
+
221
+ **版控政策**:`.claude/skills/dflow/SKILL.md` 與 command adapter 一樣是**衍生物**,
222
+ 沿用相同預設——不版控、由 clone 後重跑 `dflow configure-agents --skills` 重生成
223
+ (`.claude/skills/dflow/` 已列入建議的 gitignore 集合);clone-ready 團隊也可選擇版控。
224
+ 重跑 `--skills` 是 idempotent 的:帶 marker 的既有 skill 會被乾淨重寫;若 `.claude/skills/dflow/SKILL.md`
225
+ **不是** Dflow 產生的(無 `<!-- dflow-generated: skill-adapter -->` marker),Dflow 不會覆蓋它,
226
+ 只會印出 warning 提示你移除或改名。
141
227
 
142
228
  ## 與其他 AI 工具的差異
143
229
 
@@ -164,10 +250,10 @@ SDD 約束加入 `CLAUDE.md`,這些內容應該放到
164
250
  `dflow/specs/shared/AI-AGENT-GUIDE.md`。shim 保持精簡,其他工具的 shim 才不會
165
251
  與它產生漂移(drift)。
166
252
 
167
- **預設 `/dflow:*` 不是安裝 Claude Code Skill。** `init` 不會在 Claude Code 的
168
- skill 系統中安裝任何東西。Slash commands 是 AI 從 workflow 表識別的純文字模式。
169
- 若你之後執行 `dflow configure-agents --command-adapters`,新增的是薄 command
170
- wrapper,不是 workflow 的第二份定義。
253
+ **`/dflow:*` 不是安裝 Claude Code Skill。** `init` 不會在 Claude Code 的
254
+ skill 系統中安裝任何東西。未安裝 command adapters 時,Dflow 名稱只是 AI 從
255
+ workflow 表識別的文字 trigger;安裝 `dflow configure-agents --command-adapters`
256
+ 後,新增的是薄 command wrapper,不是 workflow 的第二份定義。
171
257
 
172
258
  **legacy Claude skill 與 installed adapter 擇一。** 如果專案仍保留舊的
173
259
  `.claude/skills/sdd-ddd-*` skill,請在 legacy skill 與 `--command-adapters`
@@ -84,40 +84,41 @@ it. If the existing file does not already point to
84
84
  `dflow/specs/shared/AGENTS-md-snippet.md` that you can merge manually. This
85
85
  avoids destroying custom project instructions you already had.
86
86
 
87
+ In the `dflow configure-agents --command-adapters` case, the corresponding
88
+ snippet path is `dflow/specs/shared/AGENTS-md-command-adapters-snippet.md`.
89
+
87
90
  ## Using Dflow Workflow Commands in Codex CLI
88
91
 
89
92
  Codex CLI has its own built-in slash command layer for controlling the CLI
90
93
  session. Commands such as `/permissions`, `/model`, `/status`, `/diff`,
91
94
  `/review`, and `/init` are Codex CLI controls, not Dflow workflows.
92
95
 
93
- Dflow's `/dflow:*` entries are workflow names recognized by the AI through
94
- `AI-AGENT-GUIDE.md`, not registered Codex CLI commands. Raw
95
- `/dflow:new-feature` passthrough behavior in Codex CLI should be verified
96
- with the maintainer for the supported Codex version. The reliable form is to
97
- name the workflow as a plain chat instruction:
96
+ Dflow's canonical `/dflow:*` entries are workflow names recognized by the AI
97
+ through `AI-AGENT-GUIDE.md`, not registered Codex CLI commands. Codex handles
98
+ the leading `/` first, so the reliable form is to remove the leading slash and
99
+ send the same name as plain text:
98
100
 
99
101
  ```text
100
- Run the Dflow /dflow:new-feature workflow.
102
+ dflow:new-feature
101
103
  ```
102
104
 
103
- If your Codex CLI version passes unknown slash-prefixed input through to the
104
- model, this shorter form may also work (verify with maintainer):
105
+ Or use a plain chat instruction:
105
106
 
106
107
  ```text
107
- /dflow:new-feature
108
+ Run the Dflow dflow:new-feature workflow.
108
109
  ```
109
110
 
110
- If Codex reports an unknown slash command, re-send the request in prose:
111
+ If Codex reports an unknown slash command, re-send it without the slash:
111
112
 
112
113
  ```text
113
- Treat /dflow:new-feature as a Dflow workflow name, not as a Codex CLI
114
- command. Read dflow/specs/shared/AI-AGENT-GUIDE.md and start that workflow.
114
+ Treat dflow:new-feature as the canonical /dflow:new-feature Dflow workflow
115
+ name. Read dflow/specs/shared/AI-AGENT-GUIDE.md and start that workflow.
115
116
  ```
116
117
 
117
118
  A typical conversation looks like:
118
119
 
119
120
  ```text
120
- You: Run the Dflow /dflow:new-feature workflow.
121
+ You: dflow:new-feature
121
122
 
122
123
  Codex CLI: I'll read dflow/specs/shared/AI-AGENT-GUIDE.md first, then use the
123
124
  new-feature workflow. Please describe the user-visible capability or business
@@ -132,21 +133,22 @@ dflow/specs/features/active/. Before I do, I have a few clarifying questions.
132
133
 
133
134
  The workflow then walks you through spec drafting, behavior examples,
134
135
  implementation planning, and finish-feature drift checks. The exact
135
- sequence depends on which workflow you entered (`/dflow:new-feature`,
136
- `/dflow:modify-existing`, `/dflow:bug-fix`, etc.).
136
+ sequence depends on which workflow you entered (`dflow:new-feature`,
137
+ `dflow:modify-existing`, `dflow:bug-fix`, etc.; the canonical guide records
138
+ these as `/dflow:*`).
137
139
 
138
140
  Available workflow entry points:
139
141
 
140
- | Workflow | Use when |
142
+ | Codex input | Use when |
141
143
  |---|---|
142
- | `/dflow:new-feature` | A new user-visible capability or business behavior is requested. |
143
- | `/dflow:modify-existing` | Existing behavior needs to change. |
144
- | `/dflow:bug-fix` | A defect can be described with expected vs actual behavior. |
145
- | `/dflow:new-phase` | An active feature needs another implementation slice. |
146
- | `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
147
- | `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
148
- | `/dflow:pr-review` | A change is ready for SDD/DDD review. |
149
- | `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
144
+ | `dflow:new-feature` | A new user-visible capability or business behavior is requested. |
145
+ | `dflow:modify-existing` | Existing behavior needs to change. |
146
+ | `dflow:bug-fix` | A defect can be described with expected vs actual behavior. |
147
+ | `dflow:new-phase` | An active feature needs another implementation slice. |
148
+ | `dflow:finish-feature` | Implementation is complete and needs drift closure. |
149
+ | `dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
150
+ | `dflow:pr-review` | A change is ready for SDD/DDD review. |
151
+ | `dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
150
152
 
151
153
  If you forget a workflow name, ask Codex to read
152
154
  `dflow/specs/shared/AI-AGENT-GUIDE.md` and list the available Dflow
@@ -165,13 +167,30 @@ shim includes a trigger list generated from the canonical command registry.
165
167
  Those triggers are still plain text prompts, for example:
166
168
 
167
169
  ```text
168
- Run the Dflow /dflow:new-feature workflow.
170
+ dflow:new-feature
169
171
  ```
170
172
 
171
173
  If the project already has a custom `AGENTS.md`, Dflow still preserves that
172
174
  file; merge the Dflow pointer manually from the generated snippet or the
173
175
  documentation guidance.
174
176
 
177
+ In this mode, the Codex-target merge snippet filename is
178
+ `dflow/specs/shared/AGENTS-md-command-adapters-snippet.md`.
179
+
180
+ ### Version-Control Policy for Generated Artifacts (Codex)
181
+
182
+ Codex does not generate command files, so there is **no derived adapter to
183
+ gitignore**. On the Codex side, what you version-control is the `AGENTS.md`
184
+ shim and `dflow/` (the canonical guide and specs); the merge helper
185
+ `dflow/specs/shared/AGENTS-md-command-adapters-snippet.md` is part of `dflow/`
186
+ and is **version-controlled along with `dflow/`**. `--command-adapters` only
187
+ strengthens the text triggers in `AGENTS.md` for Codex; it adds no `.claude/`,
188
+ `.github/`, or `.agents/` command files, so the Claude / Copilot
189
+ "version-control the generated adapter or not" trade-off does not apply on the
190
+ Codex side. The adapter version-control policy for other tools is covered in
191
+ [README "Files Created by Init"](../README.en.md#files-created-by-init) and the
192
+ per-tool guides.
193
+
175
194
  ## Differences vs Other AI Tools
176
195
 
177
196
  The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is identical
@@ -211,11 +230,11 @@ Codex shim has a normal Markdown bullet pointing to the canonical guide, not
211
230
  an `@...` import. Ask Codex to read `AI-AGENT-GUIDE.md` if it appears to be
212
231
  working from the shim alone.
213
232
 
214
- **`/dflow:*` is not a Codex CLI built-in slash command.** Codex slash
215
- commands control the Codex session itself. Use Dflow workflow names as plain
216
- chat instructions when raw slash input is intercepted or rejected. Raw
217
- `/dflow:*` passthrough behavior should be verified with the maintainer for
218
- the supported Codex version.
233
+ **`/dflow:*` is not a Codex CLI built-in slash command.** Codex slash commands
234
+ control the Codex session itself. When raw slash input is intercepted or
235
+ rejected, use the no-slash text form `dflow:<id>`, for example
236
+ `dflow:status`. The model should treat it as the canonical `/dflow:<id>`
237
+ workflow by reading `AI-AGENT-GUIDE.md`.
219
238
 
220
239
  **Codex does not generate command files.** Even with `--command-adapters`,
221
240
  Codex only strengthens text-trigger guidance in `AGENTS.md` / merge
@@ -74,39 +74,40 @@ Claude Code、GitHub Copilot 與其他工具。
74
74
  `dflow/specs/shared/AGENTS-md-snippet.md` 下寫入 merge snippet,
75
75
  讓你手動合併。這樣可以避免破壞你已有的自訂專案指示。
76
76
 
77
+ 若是 `dflow configure-agents --command-adapters` 情境,對應檔名為
78
+ `dflow/specs/shared/AGENTS-md-command-adapters-snippet.md`。
79
+
77
80
  ## 在 Codex CLI 中使用 Dflow Workflow 指令
78
81
 
79
82
  Codex CLI 有自己的內建 slash command 層,用來控制 CLI session。
80
83
  `/permissions`、`/model`、`/status`、`/diff`、`/review`、`/init` 等指令
81
84
  都是 Codex CLI 控制項,不是 Dflow workflow。
82
85
 
83
- Dflow 的 `/dflow:*` 項目是 AI 透過 `AI-AGENT-GUIDE.md` 識別的 workflow
84
- 名稱,不是已註冊的 Codex CLI 指令。`/dflow:new-feature` 在 Codex CLI 中
85
- 能否直接傳遞到模型,需依所用的 Codex 版本向 maintainer 確認。
86
- 最可靠的方式是以普通對話指示輸入 workflow 名稱:
86
+ Dflow 的 canonical `/dflow:*` 項目是 AI 透過 `AI-AGENT-GUIDE.md` 識別的
87
+ workflow 名稱,不是已註冊的 Codex CLI 指令。Codex 會先處理 `/` 前綴,因此
88
+ 最可靠的方式是移除開頭斜線,把同一個名稱當普通文字輸入:
87
89
 
88
90
  ```text
89
- Run the Dflow /dflow:new-feature workflow.
91
+ dflow:new-feature
90
92
  ```
91
93
 
92
- 若你的 Codex CLI 版本會將未知的 slash 前綴輸入傳遞到模型,也可嘗試以下
93
- 較短形式(請先向 maintainer 確認):
94
+ 或用一句普通對話指示:
94
95
 
95
96
  ```text
96
- /dflow:new-feature
97
+ Run the Dflow dflow:new-feature workflow.
97
98
  ```
98
99
 
99
- 若 Codex 回報未知 slash command,改以純文字重新送出:
100
+ 若 Codex 回報未知 slash command,改以不帶斜線的純文字重新送出:
100
101
 
101
102
  ```text
102
- Treat /dflow:new-feature as a Dflow workflow name, not as a Codex CLI
103
- command. Read dflow/specs/shared/AI-AGENT-GUIDE.md and start that workflow.
103
+ Treat dflow:new-feature as the canonical /dflow:new-feature Dflow workflow
104
+ name. Read dflow/specs/shared/AI-AGENT-GUIDE.md and start that workflow.
104
105
  ```
105
106
 
106
107
  典型的對話如下:
107
108
 
108
109
  ```text
109
- You: Run the Dflow /dflow:new-feature workflow.
110
+ You: dflow:new-feature
110
111
 
111
112
  Codex CLI: I'll read dflow/specs/shared/AI-AGENT-GUIDE.md first, then use the
112
113
  new-feature workflow. Please describe the user-visible capability or business
@@ -121,20 +122,21 @@ dflow/specs/features/active/. Before I do, I have a few clarifying questions.
121
122
 
122
123
  接著這個 workflow 會引導你完成 spec 起草、行為範例、實作計畫,以及
123
124
  finish-feature 漂移(drift)檢查。確切的流程取決於你進入的是哪個 workflow
124
- (`/dflow:new-feature`、`/dflow:modify-existing`、`/dflow:bug-fix` 等)。
125
+ (`dflow:new-feature`、`dflow:modify-existing`、`dflow:bug-fix` 等;canonical
126
+ guide 中記為 `/dflow:*`)。
125
127
 
126
128
  可用的 workflow 入口:
127
129
 
128
- | 指令 | 適用情境 |
130
+ | Codex 輸入 | 適用情境 |
129
131
  |---|---|
130
- | `/dflow:new-feature` | 需要新增一個使用者可見的功能或業務行為。 |
131
- | `/dflow:modify-existing` | 需要修改現有行為。 |
132
- | `/dflow:bug-fix` | 可以用預期行為 vs 實際行為描述的缺陷。 |
133
- | `/dflow:new-phase` | 進行中的 feature 需要另一個實作 slice。 |
134
- | `/dflow:finish-feature` | 實作完成後需要進行漂移(drift)收尾。 |
135
- | `/dflow:verify` | 需要對 spec、領域文件、實作與測試進行一致性檢查。 |
136
- | `/dflow:pr-review` | 變更已準備好進行 SDD/DDD review。 |
137
- | `/dflow:report-dflow-feedback` | 你發現了 Dflow 的問題或改進點,想要一份清理過的上游回饋草稿。 |
132
+ | `dflow:new-feature` | 需要新增一個使用者可見的功能或業務行為。 |
133
+ | `dflow:modify-existing` | 需要修改現有行為。 |
134
+ | `dflow:bug-fix` | 可以用預期行為 vs 實際行為描述的缺陷。 |
135
+ | `dflow:new-phase` | 進行中的 feature 需要另一個實作 slice。 |
136
+ | `dflow:finish-feature` | 實作完成後需要進行漂移(drift)收尾。 |
137
+ | `dflow:verify` | 需要對 spec、領域文件、實作與測試進行一致性檢查。 |
138
+ | `dflow:pr-review` | 變更已準備好進行 SDD/DDD review。 |
139
+ | `dflow:report-dflow-feedback` | 你發現了 Dflow 的問題或改進點,想要一份清理過的上游回饋草稿。 |
138
140
 
139
141
  如果你忘了 workflow 名稱,請 Codex 讀取 `dflow/specs/shared/AI-AGENT-GUIDE.md`
140
142
  並列出可用的 Dflow workflow 即可。
@@ -151,12 +153,25 @@ adapter。
151
153
  registry 產生的 trigger 清單。這些 trigger 仍是文字提示,例如:
152
154
 
153
155
  ```text
154
- Run the Dflow /dflow:new-feature workflow.
156
+ dflow:new-feature
155
157
  ```
156
158
 
157
159
  如果專案已有自訂 `AGENTS.md`,Dflow 仍會保留既有檔案;請依產生的 merge snippet
158
160
  或文件指引手動合併 Dflow 指標。
159
161
 
162
+ 在這個模式下,Codex 目標的 merge snippet 檔名是
163
+ `dflow/specs/shared/AGENTS-md-command-adapters-snippet.md`。
164
+
165
+ ### 產生物的版控政策(Codex)
166
+
167
+ Codex 不產生 command 檔,所以**沒有需要 gitignore 的衍生 adapter**。Codex 端要版控的是
168
+ `AGENTS.md` shim 與 `dflow/`(canonical guide + 規格);其中
169
+ `dflow/specs/shared/AGENTS-md-command-adapters-snippet.md` 這個 merge helper 屬 `dflow/` 的一部分,
170
+ **隨 `dflow/` 一起版控**。`--command-adapters` 對 Codex 只強化 `AGENTS.md` 的文字 trigger,
171
+ 不新增任何 `.claude/`、`.github/`、`.agents/` 命令檔,因此 Claude / Copilot 那套「衍生 adapter
172
+ 要不要版控」的取捨在 Codex 端不適用。其他工具的 adapter 版控政策見
173
+ [README「Init 產生的檔案」](../README.md#init-產生的檔案) 與各 per-tool 指南。
174
+
160
175
  ## 與其他 AI 工具的差異
161
176
 
162
177
  canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)在各工具之間是相同的。
@@ -194,9 +209,9 @@ SDD 約束加入 `AGENTS.md`,這些內容應該放到
194
209
  若 Codex 看起來只從 shim 工作,請要求它讀取 `AI-AGENT-GUIDE.md`。
195
210
 
196
211
  **`/dflow:*` 不是 Codex CLI 的內建 slash command。** Codex slash command 控制
197
- 的是 Codex session 本身。當 slash 輸入被攔截或拒絕時,改用普通對話指示
198
- 輸入 Dflow workflow 名稱。`/dflow:*` 的直通行為需依所用的 Codex 版本向
199
- maintainer 確認。
212
+ 的是 Codex session 本身。當 slash 輸入被攔截或拒絕時,改用不帶斜線的普通文字
213
+ `dflow:<id>`,例如 `dflow:status`。模型會依 `AI-AGENT-GUIDE.md` 把它視為
214
+ canonical `/dflow:<id>` workflow。
200
215
 
201
216
  **Codex 不產生命令檔。** 即使使用 `--command-adapters`,Codex 也只強化
202
217
  `AGENTS.md` / merge snippet 中的文字 trigger 說明。不要期待 `.claude/commands`、
@@ -76,13 +76,48 @@ command registry inside the canonical guide:
76
76
 
77
77
  - `.github/prompts/dflow-<id>.prompt.md`
78
78
 
79
- These prompts use adapter-native names, for example `/dflow-new-feature` or
80
- the matching IDE Quick Pick prompt name. Their body only points to the
81
- canonical `/dflow:new-feature` workflow and
82
- `dflow/specs/shared/AI-AGENT-GUIDE.md`; it does not copy workflow steps.
83
- Dflow v1 does not promise that Copilot chat supports the exact colon form
84
- `/dflow:new-feature`. The canonical name remains in the guide and prompt
85
- body.
79
+ These prompts use `/dflow-<id>` in the Copilot / VS Code prompt menu, for
80
+ example `/dflow-new-feature`. Their body only points to the canonical
81
+ `/dflow:new-feature` workflow and `dflow/specs/shared/AI-AGENT-GUIDE.md`; it
82
+ does not copy workflow steps. Copilot's `/` parser behavior differs from
83
+ Claude and Codex: the prompt menu entry is `/dflow-<id>`, while chat text may
84
+ still name the canonical `/dflow:<id>` workflow.
85
+
86
+ ### Version Control and Upgrades for Generated Adapters
87
+
88
+ `.github/prompts/dflow-<id>.prompt.md` is a **generated artifact** projected
89
+ from the canonical guide. Dflow's **recommended default** is to not
90
+ version-control it and regenerate it after clone with `dflow configure-agents
91
+ --command-adapters`; teams that want a native prompt menu immediately after
92
+ clone may instead **version-control** it. Use one consistent policy across all
93
+ tools in a project (policy overview in
94
+ [README "Files Created by Init"](../README.en.md#files-created-by-init)).
95
+
96
+ When using the gitignore default, add this to the project `.gitignore` (**mind
97
+ the glob side effect**):
98
+
99
+ ```gitignore
100
+ .github/prompts/dflow-*.prompt.md
101
+ ```
102
+
103
+ This glob also ignores any of your own prompt files named with a `dflow-`
104
+ prefix. If you have custom prompts with the same prefix, use a more specific
105
+ rule or rename your custom files. If these prompts are **already
106
+ version-controlled**, adding the ignore rule does not remove them
107
+ automatically; first run:
108
+
109
+ ```bash
110
+ git rm --cached .github/prompts/dflow-*.prompt.md
111
+ ```
112
+
113
+ (`--cached` removes them from version control while keeping the working-tree
114
+ files.)
115
+
116
+ After upgrading Dflow, re-running `dflow configure-agents --command-adapters`
117
+ re-projects prompt adapters from the **new registry**, but an existing
118
+ `dflow/specs/shared/AI-AGENT-GUIDE.md` is **not** overwritten — "re-projecting
119
+ adapters" is not the same as "migrating the canonical guide." Re-project with
120
+ the **same dflow CLI version**.
86
121
 
87
122
  ### Sample Conversation Flow
88
123
 
@@ -136,7 +171,7 @@ The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is the same across
136
171
  - Shim path: Copilot uses `.github/copilot-instructions.md` (not `AGENTS.md` or `CLAUDE.md`).
137
172
  - Markdown import: Copilot shim has NO `@dflow/specs/shared/AI-AGENT-GUIDE.md` import. This contrasts with the Claude Code shim, which inlines via an `@` import.
138
173
  - Tool model: Copilot is IDE-based (chat panel + inline completions); Codex/Claude Code are CLI-based agents. Copilot interacts through the editor UI rather than a command-line session.
139
- - Workflow invocation: With CLI agents you may type `/dflow:*` to the agent process; with Copilot prefer plain-chat phrasing in the Copilot Chat or editor comments by default. If you opt in to `--command-adapters`, use adapter-native prompt names such as `/dflow-new-feature`.
174
+ - Workflow invocation: canonical `/dflow:*` is shared vocabulary, but each tool's `/` parser behaves differently. In Copilot chat text, name `/dflow:<id>`; if you opt in to `--command-adapters`, the VS Code prompt menu name is `/dflow-<id>`, such as `/dflow-new-feature`.
140
175
  - Permission model: Copilot relies on the IDE's permission and extension sandbox. It may prompt for or be governed by editor-level approvals; CLI tools often have explicit sandbox flags and separate permission gates.
141
176
 
142
177
  ## Common Patterns and Gotchas
@@ -145,7 +180,7 @@ The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is the same across
145
180
  - If Copilot appears to be working only from the shim text, ask it to open or read `dflow/specs/shared/AI-AGENT-GUIDE.md` before continuing.
146
181
  - Copilot's inline completions may suggest code without following Dflow workflows; explicitly request the workflow when you need spec-driven output.
147
182
  - Copilot chat context may not automatically include repository instruction files from `.github/` in all IDE versions; behavior varies by Copilot / IDE version (see footer note).
148
- - Use plain prose to name workflows when slash-prefixed forms are rejected by the IDE.
183
+ - Use plain prose to name the canonical `/dflow:<id>` workflow when slash-prefixed forms are rejected by the IDE.
149
184
  - Prompt adapters are thin wrappers generated from the canonical command registry; do not hand-write or copy Dflow workflow steps under `.github/prompts/`.
150
185
 
151
186
  ## Where to Go Next
@@ -84,11 +84,37 @@ dflow configure-agents --command-adapters
84
84
 
85
85
  - `.github/prompts/dflow-<id>.prompt.md`
86
86
 
87
- 這些 prompt 使用 adapter-native 命名,例如 `/dflow-new-feature` 或 IDE 的
88
- Quick Pick prompt 名稱。Prompt 內容只指向 canonical `/dflow:new-feature`
87
+ 這些 prompt 在 Copilot / VS Code prompt 選單中使用 `/dflow-<id>` 形式,例如
88
+ `/dflow-new-feature`。Prompt 內容只指向 canonical `/dflow:new-feature`
89
89
  workflow 與 `dflow/specs/shared/AI-AGENT-GUIDE.md`,不複製 workflow 步驟。
90
- Dflow v1 不承諾 Copilot chat 一定支援 exact `/dflow:new-feature` colon 形式;
91
- canonical 名稱仍保留在 guide 與 prompt body 中。
90
+ Copilot 的 `/` parser 行為與 Claude / Codex 不同:選單入口是 `/dflow-<id>`,
91
+ 但在 chat 文字中也可以直接說 canonical `/dflow:<id>`。
92
+
93
+ ### 產生物的版控政策與升級
94
+
95
+ `.github/prompts/dflow-<id>.prompt.md` 是從 canonical guide 投影出來的**衍生物**。Dflow 的
96
+ **建議預設**是不版控、由 clone 後重跑 `dflow configure-agents --command-adapters` 重生成;團隊若
97
+ 想 clone 後立即有原生 prompt 選單,也可改為**版控**。請對同專案的所有工具採一致策略(政策總覽見
98
+ [README「Init 產生的檔案」](../README.md#init-產生的檔案))。
99
+
100
+ 採 gitignore 預設時,在專案 `.gitignore` 加入(**注意 glob 副作用**):
101
+
102
+ ```gitignore
103
+ .github/prompts/dflow-*.prompt.md
104
+ ```
105
+
106
+ 此 glob 會一併 ignore 你自己以 `dflow-` 開頭命名的 prompt 檔。若你有同前綴的自訂 prompt,請改用
107
+ 更精確的規則或替自訂檔改名。若這些 prompt **已被版控**,新增 ignore 不會自動移出版控,需先:
108
+
109
+ ```bash
110
+ git rm --cached .github/prompts/dflow-*.prompt.md
111
+ ```
112
+
113
+ (`--cached` 只移出版控、保留工作目錄檔案。)
114
+
115
+ 升級 dflow 後重跑 `dflow configure-agents --command-adapters`,prompt adapter 會用**新版 registry**
116
+ 重投影;但既有 `dflow/specs/shared/AI-AGENT-GUIDE.md` **不會**被覆寫——「重投影 adapter」不等於
117
+ 「升級 canonical guide」。請以**相同的 dflow CLI 版本**重投影。
92
118
 
93
119
  ### 對話範例
94
120
 
@@ -152,9 +178,9 @@ canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)在各工具之間
152
178
  - 工具模型:Copilot 是 IDE-based(chat panel + inline completions);
153
179
  Codex / Claude Code 是 CLI-based agent。Copilot 透過編輯器 UI 互動,而非
154
180
  command-line session。
155
- - Workflow 呼叫:使用 CLI agent 時可對 agent process 輸入 `/dflow:*`;使用
156
- Copilot 時,預設建議在 Copilot Chat 或 editor comment 中使用普通文字描述。
157
- 若已 opt in `--command-adapters`,則使用 adapter-native prompt 名稱,例如
181
+ - Workflow 呼叫:canonical `/dflow:*` 是共同詞彙,但各工具 `/` parser 行為不同。
182
+ Copilot 可在 chat 文字中使用 `/dflow:<id>`,若已 opt in
183
+ `--command-adapters`,VS Code prompt 選單名則是 `/dflow-<id>`,例如
158
184
  `/dflow-new-feature`。
159
185
  - Permission 模型:Copilot 依賴 IDE 的 permission 與 extension sandbox。它可能
160
186
  受 editor-level approvals 管理;CLI 工具通常有明確的 sandbox flags 與獨立的
@@ -170,7 +196,8 @@ canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)在各工具之間
170
196
  需要 spec-driven 輸出時,請明確要求執行 workflow。
171
197
  - Copilot Chat context 不一定會在所有 IDE 版本中自動包含 `.github/` 目錄下的
172
198
  repository 指示檔;行為因 Copilot / IDE 版本而異(見頁尾說明)。
173
- - 當 slash-prefixed forms 被 IDE 拒絕時,改用普通文字描述 workflow 名稱。
199
+ - 當 slash-prefixed forms 被 IDE 拒絕時,改用普通文字描述 canonical
200
+ `/dflow:<id>` workflow 名稱。
174
201
  - Prompt adapter 是從 canonical command registry 產生的薄 wrapper;不要在
175
202
  `.github/prompts/` 中手寫或複製 Dflow workflow 步驟。
176
203