dflow-sdd-ddd 0.9.0 → 0.10.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.
- package/CHANGELOG.md +53 -0
- package/README.en.md +19 -8
- package/README.md +12 -5
- package/TEMPLATE-COVERAGE.md +0 -1
- package/bin/dflow.js +4 -4
- package/docs/evaluating-dflow.en.md +11 -7
- package/docs/evaluating-dflow.md +9 -4
- package/docs/migrating-to-dflow-v1.md +7 -3
- package/docs/using-with-claude-code.en.md +40 -23
- package/docs/using-with-claude-code.md +34 -23
- package/docs/using-with-codex.en.md +125 -42
- package/docs/using-with-codex.md +93 -34
- package/docs/using-with-github-copilot.en.md +135 -34
- package/docs/using-with-github-copilot.md +120 -43
- package/lib/init.js +761 -145
- package/package.json +2 -2
- package/templates/brownfield/references/drift-verification.md +1 -4
- package/templates/brownfield/references/finish-feature-flow.md +3 -2
- package/templates/brownfield/references/git-integration.md +0 -1
- package/templates/brownfield/references/init-project-flow.md +31 -17
- package/templates/brownfield/references/modify-existing-flow.md +6 -38
- package/templates/brownfield/references/new-feature-flow.md +13 -11
- package/templates/brownfield/references/new-phase-flow.md +1 -1
- package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +253 -2
- package/templates/brownfield/scaffolding/CLAUDE-md-snippet.md +5 -8
- package/templates/brownfield/scaffolding/_conventions.md +10 -9
- package/templates/brownfield/templates/_index.md +1 -1
- package/templates/brownfield/templates/lightweight-spec.md +1 -1
- package/templates/brownfield/templates/phase-spec.md +1 -1
- package/templates/common/skill/SKILL.md +9 -6
- package/templates/greenfield/references/drift-verification.md +1 -4
- package/templates/greenfield/references/finish-feature-flow.md +3 -2
- package/templates/greenfield/references/git-integration.md +0 -1
- package/templates/greenfield/references/init-project-flow.md +31 -17
- package/templates/greenfield/references/modify-existing-flow.md +5 -7
- package/templates/greenfield/references/new-feature-flow.md +14 -12
- package/templates/greenfield/references/new-phase-flow.md +1 -1
- package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +222 -2
- package/templates/greenfield/scaffolding/CLAUDE-md-snippet.md +10 -15
- package/templates/greenfield/scaffolding/Git-principles-trunk.md +1 -1
- package/templates/greenfield/scaffolding/_conventions.md +9 -8
- package/templates/greenfield/templates/_index.md +1 -1
- package/templates/greenfield/templates/lightweight-spec.md +1 -1
- package/templates/greenfield/templates/phase-spec.md +1 -1
- package/templates/brownfield/templates/CLAUDE.md +0 -165
- package/templates/greenfield/templates/CLAUDE.md +0 -172
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,59 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## 0.10.0 — 2026-06-06 — agentskills 標準三家觸發 parity、既有 agent 檔自動注入、投影內容保全與清理
|
|
10
|
+
|
|
11
|
+
**Proposals**:PROPOSAL-049(feature-slice 使用面語意體檢)、PROPOSAL-050(還原 041 雙軌合一丟失的 skill 內容進 AI-AGENT-GUIDE)、PROPOSAL-051(退役 `templates/CLAUDE.md`)、PROPOSAL-052(bundle stale-removal 推廣到同-edition)、PROPOSAL-054(既有 agent 檔 Dflow 墊片 auto-inject)、PROPOSAL-056(Codex 專案層 skill `--skills` parity)、PROPOSAL-057(以 agentskills.io 標準為三家共同自動觸發層;Phase 2)
|
|
12
|
+
|
|
13
|
+
本版兩條主線:
|
|
14
|
+
|
|
15
|
+
1. **入口層標準化 + 降低採用摩擦**(054 / 056 / 057 + Copilot 指南)—— 三家(Claude / Codex / Copilot)以 agentskills.io 開放標準取得 project-level skill 投影 parity(自然語言觸發;Copilot CLI 仍需 `/dflow` 喚起)、既有 agent 檔零手動合併即接上、Claude shim 瘦身、Copilot 跨介面用法講清楚。
|
|
16
|
+
2. **投影內容保全與清理**(049 / 050 / 051 / 052)—— 一輪 feature-by-feature 語意體檢補回 041 雙軌合一時孤兒化的 canonical 內容、退役 legacy 範本、把 bundle 退役檔清除推廣到最常見的同-edition 升級。
|
|
17
|
+
|
|
18
|
+
### 新功能 / 行為改善
|
|
19
|
+
|
|
20
|
+
- **`dflow configure-agents --skills` 三家專案層 skill parity(Codex 補自動觸發、Copilot 補原生 skill)**(PROPOSAL-056 + #4 un-defer):`--skills` 從「只投 Claude、寫死單一路徑」一般化為「把同一份工具中立 thin skill(`templates/common/skill/SKILL.md`)投影到每個被選工具各自的 project-level skill 路徑」。Claude 維持 `.claude/skills/dflow/SKILL.md`;**Codex 新增 `.agents/skills/dflow/SKILL.md`**,找回 Codex 的自然語言自動觸發(先前只有手動命令 / 文字 trigger);**GitHub Copilot 新增 `.github/skills/dflow/SKILL.md`**(#4 un-defer:spike 確認 Copilot 從自己原生 `.github/skills/` 探索成立、即使移除 `.claude`/`.agents` 跨讀路徑也成立——**VS Code Chat 自然語言自動觸發、Copilot CLI 仍需 `/dflow` 手動喚起**)。Copilot 也會跨讀 `.claude`/`.agents`;Dflow 產生的各份逐字相同,但若該路徑已有非 Dflow 的同名 skill,Dflow 會保留不覆寫、可能內容不同(移除或改名即可避免同名重複)。依據:Claude / Codex / Copilot 已收斂於 agentskills.io 開放標準(皆以 `SKILL.md` 為入口、`name`/`description` frontmatter、project-level 探索、description 驅動自動觸發)。
|
|
21
|
+
|
|
22
|
+
- **既有 agent 檔的 Dflow 墊片 auto-inject(三工具統一)**(PROPOSAL-054):當使用者已有自己的根 agent 檔(Claude `CLAUDE.md`、Codex `AGENTS.md`、Copilot `.github/copilot-instructions.md`)且尚未引用 guide,`init` / `configure-agents` 不再預設「丟一個 snippet 檔、Notes 一行請你手動合併」,改為**附加一塊帶 `<!-- dflow-generated: agent-shim START/END -->` 標記的 Dflow 區塊**(呈現為確認預覽裡的一般項目),重跑時**原地抽換**該區塊(idempotent)。snippet + 警告降為 fallback,只在標記殘缺 / 重複 / 顛倒等無法安全注入時才用;並補上先前缺的對稱警告(最常見路徑反而 signpost 最弱的洞)。指令只能以文字寫進 `AGENTS.md` 的 Codex 受惠最大。
|
|
23
|
+
|
|
24
|
+
- **bundle 退役檔在同-edition 升級也自動清除**(PROPOSAL-052):`configure-agents` 的 bundle stale-removal 原本只在 **edition 改變**時觸發;現在推廣為「依 manifest diff 清除『舊 manifest 有、當前 bundle 已無』的退役檔」,涵蓋最常見的**同-edition 重跑升級**。一併補三道 projection-cleanup 硬化:current-bundle 非空 guard(防 bundle 掃出空集合時誤刪整包、砍掉 `/dflow:*` 可達性)、壞 manifest 區分 ENOENT vs parse/IO error(後者至少 warn,不再靜默跳過)、待刪檔措辭從硬編「stale adapter / edition changed」修正為通用。**直接受惠**:051 退役 `templates/CLAUDE.md` 後既有同-edition 專案殘留的 vendored copy,重跑 `dflow configure-agents` 即被清掉。
|
|
25
|
+
|
|
26
|
+
- **Claude shim 瘦身為薄指標**(PROPOSAL-057 Phase 2):`init` 生成的根 `CLAUDE.md` 墊片不再用 `@import` 把整份 `AI-AGENT-GUIDE.md`(~5k tokens)每個 session 強制載入,改為路徑無關的薄 awareness,並把「讀 guide」scoping 到 spec-impacting work(對齊 progressive disclosure;workflow 步驟本就按需載入)。
|
|
27
|
+
|
|
28
|
+
- **skill 自動觸發 recall 強化**(PROPOSAL-057 Phase 2):`templates/common/skill/SKILL.md` 的 `description` 補上間接觸發語(不點命令名的自然語句也能觸發),修掉先前「最間接語句 recall 較弱」的弱點;同時收斂在 **Codex 的 1024 字元上限**內(986 chars),並加 `test/registry-parity.mjs` 護欄斷言 folded description ≤ 1024 防回歸。觸發契約維持 suggest-and-wait(建議命令、等確認,不自動跑完整個 workflow)。
|
|
29
|
+
|
|
30
|
+
### 文件
|
|
31
|
+
|
|
32
|
+
- **GitHub Copilot 指南分介面重寫**(copilot-cmd-surface,2026-06-05 實測):`docs/using-with-github-copilot.md` + `.en.md` 把 Copilot 用法分為 **VS Code Copilot Chat** 與 **GitHub Copilot CLI** 兩節,各自講自動觸發有無、命令能不能用、正確語法 —— VS Code Chat 自然語言自動觸發 + `/dflow-<id>`(連字號,需 `--command-adapters`);Copilot CLI 無自動觸發、先打 `/dflow` 手動喚起 skill、無 per-id 命令(`.github/prompts/` CLI 不讀取)。冒號形式 `/dflow:<id>` 釐清為 canonical / Claude·Codex 命令語法,在 Copilot 只能當文字稱呼。移除舊的「chat 文字可直接說 canonical `/dflow:<id>`」易誤導措辭。雙語 parity。
|
|
33
|
+
|
|
34
|
+
### 投影內容保全(PROPOSAL-049 / 050)
|
|
35
|
+
|
|
36
|
+
- **feature-slice 使用面語意體檢**(PROPOSAL-049):對「使用 Dflow 時實際會碰到的範圍」(CLI runtime + init 投影的 bundle / adapter + 雙軌 skill source)做一輪 feature-by-feature 人讀語意體檢,補 047(首次 implementation-stage cross-model review)之前 ship、未過該層 review 的盲區。修掉的 drift 含:`modify-existing-flow` 等殘留「the developer commits」的 pre-047 行為者口吻、Greenfield context-definition 路徑兩軌 parity、`/dflow:verify` scope over-claim、`last-updated` 權威歸 `rules.md` 等。純語意 / 結構修正,grep 擋不住。
|
|
37
|
+
|
|
38
|
+
- **還原 041 合一丟失的 canonical 內容**(PROPOSAL-050):041 把兩份 per-edition `SKILL.md` 合一成 35 行薄殼時,數個被各 flow 以 `see SKILL.md § …` 指向的 workflow-protocol 段變成**懸空 ref**。本版把這些段(Workflow Transparency〔Auto-Trigger Safety Net / Three-Tier Transparency / Confirmation Signals NL↔Command / Completion Checklist〕、Ceremony Scaling 完整 T1/T2/T3 表、Guiding Questions by Activity、Project Structure)還原進**兩軌 `AI-AGENT-GUIDE.md`**(runtime 面),並 repoint ~15 處 ref;另還原 conservation audit 抓到的 silent-drop(Brownfield 不適用排除條款、三項可攜資產立論、非指令 decision routing、完成清單 skip-detection guard)。使用者專案的 canonical 指南因此恢復完整、ref 不再撲空。
|
|
39
|
+
|
|
40
|
+
### Migration / 升級提醒
|
|
41
|
+
|
|
42
|
+
- **`templates/CLAUDE.md` 退役(移除一個 vendored generated 檔)**(PROPOSAL-051):刪除 Greenfield / Brownfield 各一份 source + mirror 共 4 檔(legacy full-layout 範例)。它**不是** `init` 來源(根 `CLAUDE.md` 由 `lib/init.js` 程式化生成薄殼),canonical 內容(decision routing / Ceremony 表 / per-flow steps)已於 050 全數移進 `AI-AGENT-GUIDE.md` + bundle。**對既有專案的影響**:先前以同-edition 跑過的專案,其 vendored copy `dflow/specs/shared/dflow-workflows/templates/CLAUDE.md` 會留為**無害殘檔**(帶 generated marker、不被任何 flow 消費);**重跑 `dflow configure-agents` 即自動清除**(PROPOSAL-052 的同-edition stale-removal)。npm tarball 因此縮減一個 generated file。
|
|
43
|
+
|
|
44
|
+
- **Claude shim 形狀改變**(PROPOSAL-057):既有專案的根 `CLAUDE.md` 仍可用;若要拿到瘦身後的薄指標版,重跑 `dflow init` / `dflow configure-agents` 即原地刷新該 Dflow 區塊。
|
|
45
|
+
|
|
46
|
+
### 維護者工具 / 測試(不影響套件使用者)
|
|
47
|
+
|
|
48
|
+
- **cross-ref resolver guard**(PROPOSAL-055,dev-only):新增 `scripts/check-cross-refs.mjs`(納入 `check-repo-consistency.sh`),把「文件 `§` / 檔名 / 路徑 ref 解不解得開」從一次性人工 grep 固化為常駐檢查;namespace-aware(限 public source + governance 範圍、跳過 history 與 `{token}` 佔位、§/anchor longest-prefix)。`scripts/` 不投影 dist、不進 tarball。
|
|
49
|
+
- **registry-parity 測試**(PROPOSAL-053,dev-only):新增 `test/registry-parity.mjs`,斷言 11 個 `/dflow:*` 指令表跨 surface / 雙軌一致(F-02 安全網);後並加 057 的 folded description ≤ 1024 斷言。
|
|
50
|
+
- **`test/agent-inject.mjs`**(PROPOSAL-054):新增既有 agent 檔 auto-inject 的注入 / idempotent 抽換 / fallback 矩陣覆蓋。
|
|
51
|
+
- `test/smoke.mjs`:擴充 054 auto-inject、056 `--skills` 各家路徑、052 同-edition stale-removal 等斷言。
|
|
52
|
+
|
|
53
|
+
### 驗證
|
|
54
|
+
|
|
55
|
+
- `npm test`(`smoke.mjs` + `registry-parity.mjs` + `agent-inject.mjs` 全綠)
|
|
56
|
+
- `scripts/check-repo-consistency.sh`(含 `check-cross-refs.mjs` + registry parity + source↔mirror diff + `npm pack --dry-run` + `git diff --check`)pass、0 error
|
|
57
|
+
- `scripts/export-dist.sh --dry-run`:dev / dist 已同步、無 drift
|
|
58
|
+
- 049–057 各 proposal 實作均經 implementation-stage cross-model review 收斂 approve(見各 closeout 紀錄)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
9
62
|
## 0.9.0 — 2026-05-28 — 執行當下對齊:feedback 逐欄產出、Codex trigger 注入、commit checkpoints + branch gate(含 breaking changes)
|
|
10
63
|
|
|
11
64
|
**Proposals**:PROPOSAL-048(feedback 輸出對齊目標 issue 表單)、PROPOSAL-046(Codex command-trigger 注入既有 AGENTS.md shim)、PROPOSAL-047(commit checkpoints、branch lifecycle 強制、AI commit 政策翻轉、init Git policy 升必選)
|
package/README.en.md
CHANGED
|
@@ -216,7 +216,9 @@ dflow/
|
|
|
216
216
|
└── completed/
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
Dflow also creates or
|
|
219
|
+
Dflow also creates or updates a project instruction file for your AI coding
|
|
220
|
+
agent. The exact file depends on the target tool and existing project setup;
|
|
221
|
+
Dflow avoids overwriting custom content in existing project instructions.
|
|
220
222
|
|
|
221
223
|
When you select AI agent setup during init, Dflow writes
|
|
222
224
|
`dflow/specs/shared/AI-AGENT-GUIDE.md` as the canonical project guide, then
|
|
@@ -229,14 +231,22 @@ files whose only job is to redirect the tool to the canonical guide):
|
|
|
229
231
|
| Claude Code | `CLAUDE.md` |
|
|
230
232
|
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
231
233
|
|
|
232
|
-
If one of those files already exists, Dflow
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
If one of those files already exists, Dflow preserves custom content. A
|
|
235
|
+
Dflow-generated shim is refreshed in place; another file that already points to
|
|
236
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md` is skipped. If the file does not yet
|
|
237
|
+
point to the guide, Dflow shows the change in the confirmation preview and
|
|
238
|
+
appends a marked `<!-- dflow-generated: agent-shim START/END -->` block at the
|
|
239
|
+
end of the file; re-running refreshes that same block in place without
|
|
240
|
+
duplicating it. A fallback merge snippet under `dflow/specs/shared/` is written
|
|
241
|
+
only when the file contains conflicting or malformed Dflow markers. The project
|
|
242
|
+
guide stays the single source of truth, so teams can use multiple AI tools
|
|
243
|
+
without maintaining multiple copies of the workflow rules.
|
|
236
244
|
|
|
237
245
|
You can run `dflow configure-agents` later to add more tool shims as the team
|
|
238
246
|
adopts additional AI coding agents. If you need Claude / Copilot tool-native
|
|
239
|
-
command entries, use `dflow configure-agents --command-adapters`.
|
|
247
|
+
command entries, use `dflow configure-agents --command-adapters`. For
|
|
248
|
+
natural-language auto-trigger (a project-level skill for Claude Code and Codex),
|
|
249
|
+
use `dflow configure-agents --skills`.
|
|
240
250
|
|
|
241
251
|
### Version-Control Policy for Generated Artifacts (recommended default)
|
|
242
252
|
|
|
@@ -247,9 +257,10 @@ version-control the source, not the generated artifacts.
|
|
|
247
257
|
|
|
248
258
|
| File | Role | Recommended default |
|
|
249
259
|
|---|---|---|
|
|
250
|
-
| `dflow/` (canonical guide, specs, merge
|
|
251
|
-
| Thin shims (`CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md`) | source | **version-control** |
|
|
260
|
+
| `dflow/` (canonical guide, specs, fallback merge snippets) | source | **version-control** |
|
|
261
|
+
| Thin shims or marked Dflow blocks in existing root agent files (`CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md`) | source | **version-control** |
|
|
252
262
|
| `.claude/commands/dflow/`, `.github/prompts/dflow-*.prompt.md` | generated | **recommended: do not version-control (gitignore)**; regenerate after clone with `configure-agents --command-adapters` |
|
|
263
|
+
| `.claude/skills/dflow/`, `.agents/skills/dflow/` | generated | **recommended: do not version-control (gitignore)**; regenerate after clone with `configure-agents --skills` |
|
|
253
264
|
|
|
254
265
|
This is a **recommendation**, not the only valid policy. If your team wants a
|
|
255
266
|
native `/` menu immediately after clone, or your CI / dev environment does not
|
package/README.md
CHANGED
|
@@ -190,7 +190,7 @@ dflow/
|
|
|
190
190
|
└── completed/
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
Dflow 也會為你的 AI
|
|
193
|
+
Dflow 也會為你的 AI 程式設計助理建立或更新專案指示檔;確切檔名取決於目標工具與既有專案設定。Dflow 不覆寫既有專案指示中的自訂內容。
|
|
194
194
|
|
|
195
195
|
選擇 AI agent 設定時,Dflow 把 `dflow/specs/shared/AI-AGENT-GUIDE.md` 作為 canonical 專案指南,並為每個 AI 工具建立**小型的指向檔**(俗稱 shim,內容很短,只是把該工具引導去讀 canonical 指南):
|
|
196
196
|
|
|
@@ -200,9 +200,15 @@ Dflow 也會為你的 AI 程式設計助理建立或提供可合併的專案指
|
|
|
200
200
|
| Claude Code | `CLAUDE.md` |
|
|
201
201
|
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
202
202
|
|
|
203
|
-
若這些檔案已存在,Dflow
|
|
203
|
+
若這些檔案已存在,Dflow 不會覆蓋自訂內容;已是 Dflow-generated shim 的檔案
|
|
204
|
+
會原地刷新,其他已指向 `dflow/specs/shared/AI-AGENT-GUIDE.md` 的檔案會略過。
|
|
205
|
+
若檔案尚未指向 guide,預設會在確認 preview 顯示並於檔案末尾附加帶有
|
|
206
|
+
`<!-- dflow-generated: agent-shim START/END -->` markers 的 Dflow block,重跑會
|
|
207
|
+
原地更新同一段且不重複。只有檔案內有衝突或 malformed Dflow markers 時,
|
|
208
|
+
才會改寫 fallback merge snippet 到 `dflow/specs/shared/`。專案指南保持單一
|
|
209
|
+
source of truth,團隊就能用多個 AI 工具而不必維護多份 workflow 規則。
|
|
204
210
|
|
|
205
|
-
之後團隊採用新 AI 程式設計助理時,可隨時跑 `dflow configure-agents` 新增 shim;若需要 Claude / Copilot 的工具原生命令入口,改用 `dflow configure-agents --command-adapters`。
|
|
211
|
+
之後團隊採用新 AI 程式設計助理時,可隨時跑 `dflow configure-agents` 新增 shim;若需要 Claude / Copilot 的工具原生命令入口,改用 `dflow configure-agents --command-adapters`;若要自然語言自動觸發(為 Claude Code 與 Codex 投影專案層 skill),改用 `dflow configure-agents --skills`。
|
|
206
212
|
|
|
207
213
|
### 產生物的版控政策(建議預設)
|
|
208
214
|
|
|
@@ -210,9 +216,10 @@ Dflow 也會為你的 AI 程式設計助理建立或提供可合併的專案指
|
|
|
210
216
|
|
|
211
217
|
| 檔案 | 角色 | 建議預設 |
|
|
212
218
|
|---|---|---|
|
|
213
|
-
| `dflow/`(canonical guide、規格、merge snippet) | source | **版控** |
|
|
214
|
-
| 薄 shim(`CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md`) | source | **版控** |
|
|
219
|
+
| `dflow/`(canonical guide、規格、fallback merge snippet) | source | **版控** |
|
|
220
|
+
| 薄 shim 或既有 root agent 檔案中的 marked Dflow block(`CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md`) | source | **版控** |
|
|
215
221
|
| `.claude/commands/dflow/`、`.github/prompts/dflow-*.prompt.md` | 衍生物 | **建議不版控(gitignore)**,clone 後重跑 `configure-agents --command-adapters` 重生成 |
|
|
222
|
+
| `.claude/skills/dflow/`、`.agents/skills/dflow/` | 衍生物 | **建議不版控(gitignore)**,clone 後重跑 `configure-agents --skills` 重生成 |
|
|
216
223
|
|
|
217
224
|
這是**建議**,不是唯一正解。若團隊希望 clone 後立即有原生 `/` 選單、或 CI / 開發環境不裝 npm,**版控 adapter** 也是合理選擇——代價是升級若改了命名,要重投影並 commit 刪除舊檔。關鍵原則:**同一專案對所有工具採一致策略**,別像常見的踩雷一樣一邊 ignore、一邊版控。
|
|
218
225
|
|
package/TEMPLATE-COVERAGE.md
CHANGED
|
@@ -25,7 +25,6 @@ The matrix lists Brownfield / Greenfield logical template parity so reviewers ca
|
|
|
25
25
|
| ADR guide | `dflow/specs/architecture/decisions/README.md` | n/a | `scaffolding/architecture-decisions-README.md` | Greenfield only | Brownfield not applicable | - |
|
|
26
26
|
| Project AI guide | `dflow/specs/shared/AI-AGENT-GUIDE.md` when at least one AI agent is selected during init | `scaffolding/AI-AGENT-GUIDE.md` | `scaffolding/AI-AGENT-GUIDE.md` | Same canonical tool-neutral workflow guide and source-of-truth pointers | Track-specific seeded values and available source-of-truth paths may differ | - |
|
|
27
27
|
| AI tool shims | `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, or merge snippets under `dflow/specs/shared/` | generated by CLI | generated by CLI | Thin files must point back to `dflow/specs/shared/AI-AGENT-GUIDE.md`; existing files are not overwritten | Tool-specific import hints differ | - |
|
|
28
|
-
| Legacy Claude guide template | `<project root>/CLAUDE.md` | `templates/CLAUDE.md` | `templates/CLAUDE.md` | H2 navigation and H3 structural headings aligned (canonical English, per F-01 Path A) | Greenfield includes Aggregate / Architecture Decisions and other Greenfield-specific H3 sections | - |
|
|
29
28
|
|
|
30
29
|
## Reference Flow Parity
|
|
31
30
|
|
package/bin/dflow.js
CHANGED
|
@@ -22,9 +22,9 @@ function printInitHelp() {
|
|
|
22
22
|
dflow init
|
|
23
23
|
|
|
24
24
|
Initializes Dflow project specs under dflow/specs/.
|
|
25
|
-
The command prompts for project type, tech stack,
|
|
26
|
-
AI commit marker, optional starter files, and AI coding
|
|
27
|
-
full file preview.
|
|
25
|
+
The command prompts for project type, tech stack, migration context, prose
|
|
26
|
+
language, Git policy, AI commit marker, optional starter files, and AI coding
|
|
27
|
+
agents before showing a full file preview.
|
|
28
28
|
`);
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -39,7 +39,7 @@ dflow/specs/shared/AI-AGENT-GUIDE.md file.
|
|
|
39
39
|
|
|
40
40
|
Options:
|
|
41
41
|
--command-adapters Also generate tool-native thin wrappers for supported tools.
|
|
42
|
-
--skills Also generate
|
|
42
|
+
--skills Also generate project-level skill adapters for supported tools (Claude Code and Codex), restoring natural-language auto-trigger.
|
|
43
43
|
`);
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -42,15 +42,18 @@ in your project's `dflow/specs/` directory and AI instruction files.
|
|
|
42
42
|
completion checklists, templates). This bundle is projected from the npm
|
|
43
43
|
package at init time so workflows are reachable from any clone without
|
|
44
44
|
needing the Dflow source or package installed locally.
|
|
45
|
-
-
|
|
46
|
-
`CLAUDE.md`, `AGENTS.md`,
|
|
47
|
-
|
|
45
|
+
- AI agent instruction files, or marked Dflow blocks inside existing files, for
|
|
46
|
+
the tools you select (e.g., `CLAUDE.md`, `AGENTS.md`,
|
|
47
|
+
`.github/copilot-instructions.md`). Each points the tool to the canonical
|
|
48
|
+
guide and workflow bundle.
|
|
48
49
|
|
|
49
50
|
`init` does **not**:
|
|
50
51
|
|
|
51
52
|
- Inspect, refactor, or migrate your application code.
|
|
52
|
-
- Overwrite existing AI agent instruction files; if one
|
|
53
|
-
|
|
53
|
+
- Overwrite custom content in existing AI agent instruction files; if one
|
|
54
|
+
exists, Dflow refreshes Dflow-generated shims, leaves a file that already
|
|
55
|
+
points to the guide as-is, shows and appends a marked Dflow block by default
|
|
56
|
+
otherwise, and writes a fallback merge snippet only on marker conflicts.
|
|
54
57
|
- Modify your build system, package manager, or dependencies.
|
|
55
58
|
- Send any data anywhere; it is a local scaffolding command.
|
|
56
59
|
|
|
@@ -177,8 +180,9 @@ Dflow is designed for low cost to try and low cost to leave:
|
|
|
177
180
|
- Nothing depends on the `dflow-sdd-ddd` CLI being installed after `init`.
|
|
178
181
|
- The generated files are plain Markdown; remove Dflow from a project with
|
|
179
182
|
`rm -rf dflow/` plus deleting the AI agent shim files you no longer want.
|
|
180
|
-
-
|
|
181
|
-
|
|
183
|
+
- If an existing project instruction file (e.g., a pre-existing `CLAUDE.md`)
|
|
184
|
+
received a marked Dflow block, remove that block to revert it; later
|
|
185
|
+
`init` / `configure-agents` runs will append it again.
|
|
182
186
|
|
|
183
187
|
This means an evaluation pass leaves no permanent footprint if you decide
|
|
184
188
|
not to adopt.
|
package/docs/evaluating-dflow.md
CHANGED
|
@@ -31,13 +31,16 @@ Dflow 是 Markdown-based 的 workflow 材料加上一個 scaffolding CLI。它
|
|
|
31
31
|
各 `/dflow:*` workflow 的可執行步驟定義(step gates、completion checklists、模板)。
|
|
32
32
|
這個 bundle 在 init 時從 npm 套件投影進專案,因此 workflow 步驟是 self-contained
|
|
33
33
|
且可達的,任何 clone 都不需要 Dflow source 或 package 在本機安裝。
|
|
34
|
-
-
|
|
35
|
-
|
|
34
|
+
- 你所選工具的 AI 指示檔或既有檔案中的 marked Dflow block(例如 `CLAUDE.md`、`AGENTS.md`、`.github/copilot-instructions.md`)。
|
|
35
|
+
每個都把工具指向 canonical 指南與 workflow bundle。
|
|
36
36
|
|
|
37
37
|
`init` **不會**:
|
|
38
38
|
|
|
39
39
|
- 檢查、重構、或遷移你的應用程式碼。
|
|
40
|
-
-
|
|
40
|
+
- 覆寫既有 AI 指示檔中的自訂內容;若檔案已存在,Dflow 會刷新
|
|
41
|
+
Dflow-generated shim,已指向 guide 的檔案則保持原樣,其他情況預設在確認
|
|
42
|
+
preview 顯示並附加 marked Dflow block,只有 marker conflict 才寫 fallback
|
|
43
|
+
merge snippet。
|
|
41
44
|
- 修改你的建構系統、套件管理工具、或相依套件。
|
|
42
45
|
- 傳送任何資料到外部;它是本機的 scaffolding 指令。
|
|
43
46
|
|
|
@@ -136,7 +139,9 @@ Dflow 的設計讓試用成本低、退出成本也低:
|
|
|
136
139
|
|
|
137
140
|
- `init` 完成後,你的專案不依賴已安裝的 `dflow-sdd-ddd` CLI。
|
|
138
141
|
- 產生的檔案都是純 Markdown;用 `rm -rf dflow/` 加上刪除你不再需要的 AI 指示 shim 檔案,即可從專案中移除 Dflow。
|
|
139
|
-
- 既有的專案指示檔(例如原本就存在的 `CLAUDE.md
|
|
142
|
+
- 既有的專案指示檔(例如原本就存在的 `CLAUDE.md`)若被加入 marked Dflow
|
|
143
|
+
block,刪除該 block 即可復原;但之後再跑 `init` / `configure-agents`
|
|
144
|
+
會再附加它。
|
|
140
145
|
|
|
141
146
|
這表示評估一輪後,若你決定不採用,不會留下任何永久痕跡。
|
|
142
147
|
|
|
@@ -174,9 +174,13 @@ dflow configure-agents
|
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
This command adds shims for any AI tools you select. `dflow configure-agents`
|
|
177
|
-
does not overwrite an existing
|
|
178
|
-
|
|
179
|
-
|
|
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.
|
|
180
184
|
|
|
181
185
|
If you prefer a fully clean V1 layout, archive the existing root
|
|
182
186
|
instruction file under another name first, then run
|
|
@@ -45,18 +45,18 @@ selecting Claude Code as a target tool creates a thin shim at the project root:
|
|
|
45
45
|
|
|
46
46
|
This project uses Dflow for spec-first AI-assisted development.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
For spec-impacting work — a new feature, a change to product, user-facing, or
|
|
49
|
+
domain behavior, a new requirement, or a bug-fix workflow — read and follow:
|
|
49
50
|
|
|
50
|
-
- `dflow/specs/shared/AI-AGENT-GUIDE.md`
|
|
51
|
+
- `dflow/specs/shared/AI-AGENT-GUIDE.md` — command registry, routing rules, and project context.
|
|
52
|
+
- `dflow/specs/shared/dflow-workflows/` — vendored workflow bundle with executable step definitions.
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
spec locations, and SDD/DDD constraints.
|
|
55
|
-
|
|
56
|
-
If your tool supports Markdown imports, the canonical guide is imported
|
|
57
|
-
below:
|
|
54
|
+
For routine work (refactors, renames, chores, formatting, dependency bumps, or
|
|
55
|
+
general code questions), proceed normally; you need not read the guide first.
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
Keep tool-specific instruction files small. The guide and workflow bundle are
|
|
58
|
+
the authoritative sources for Dflow workflow rules, slash-command behavior,
|
|
59
|
+
spec locations, and SDD/DDD constraints.
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Two things happen when Claude Code starts in this project:
|
|
@@ -64,9 +64,11 @@ Two things happen when Claude Code starts in this project:
|
|
|
64
64
|
1. Claude Code automatically loads `CLAUDE.md` from the project root into
|
|
65
65
|
its context. This is Claude Code's standard project instructions
|
|
66
66
|
mechanism.
|
|
67
|
-
2.
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
2. `CLAUDE.md` is a thin pointer: it names the canonical guide but does not
|
|
68
|
+
inline it. The guide is loaded on demand — the `dflow` skill pulls it in
|
|
69
|
+
when relevant work auto-triggers the skill, or the agent follows the
|
|
70
|
+
pointer for spec-impacting work. This keeps the guide out of every
|
|
71
|
+
session's context (progressive disclosure) instead of force-loading it.
|
|
70
72
|
|
|
71
73
|
The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is the
|
|
72
74
|
**command registry and router**: project context (track, tech stack, prose
|
|
@@ -79,9 +81,14 @@ checked into your repo, so they travel with the project when cloned. The
|
|
|
79
81
|
without Claude-Code-specific edits.
|
|
80
82
|
|
|
81
83
|
If a `CLAUDE.md` already existed in the project, `init` does not overwrite
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
custom content. A Dflow-generated shim is refreshed in place; another file
|
|
85
|
+
that already points to `dflow/specs/shared/AI-AGENT-GUIDE.md` is skipped
|
|
86
|
+
without adding a second pointer. Otherwise Dflow shows the change in the
|
|
87
|
+
confirmation preview and appends a marked
|
|
88
|
+
`<!-- dflow-generated: agent-shim START/END -->` block at the end of the file;
|
|
89
|
+
re-running refreshes that same block in place without duplicating it. Dflow
|
|
90
|
+
writes the fallback merge snippet `dflow/specs/shared/CLAUDE-md-snippet.md` only
|
|
91
|
+
when the file contains conflicting or malformed Dflow markers.
|
|
85
92
|
|
|
86
93
|
## Using Dflow Slash Commands in Claude Code
|
|
87
94
|
|
|
@@ -225,6 +232,12 @@ This skill does not copy workflow steps; its body points to the canonical
|
|
|
225
232
|
`dflow/specs/shared/AI-AGENT-GUIDE.md` (command registry and routing rules) and
|
|
226
233
|
`dflow/specs/shared/dflow-workflows/` (vendored bundle with executable step
|
|
227
234
|
definitions).
|
|
235
|
+
|
|
236
|
+
The same edition-neutral skill source is now also projected by `--skills` as a
|
|
237
|
+
project-level skill for Codex (`.agents/skills/dflow/SKILL.md`) and GitHub Copilot
|
|
238
|
+
(`.github/skills/dflow/SKILL.md`); all three follow the same cross-tool
|
|
239
|
+
agentskills.io standard.
|
|
240
|
+
|
|
228
241
|
Its behavior:
|
|
229
242
|
|
|
230
243
|
- **Auto-triggers on** feature / bug-fix workflows, product/domain behavior
|
|
@@ -275,7 +288,7 @@ across tools. Only the root-level shim differs:
|
|
|
275
288
|
|
|
276
289
|
| Tool | Generated shim | Loads canonical guide via |
|
|
277
290
|
|---|---|---|
|
|
278
|
-
| Claude Code | `CLAUDE.md` |
|
|
291
|
+
| Claude Code | `CLAUDE.md` | Reads file content directly when starting |
|
|
279
292
|
| Codex / Copilot coding agent | `AGENTS.md` | Reads file content directly when starting |
|
|
280
293
|
| GitHub Copilot | `.github/copilot-instructions.md` | Reads file content directly |
|
|
281
294
|
|
|
@@ -315,16 +328,20 @@ their own approval gates (e.g., "I drafted the spec — do you want me to
|
|
|
315
328
|
proceed to implementation?"). Both can fire on the same action; this is
|
|
316
329
|
expected and not a sign of misconfiguration.
|
|
317
330
|
|
|
318
|
-
**
|
|
319
|
-
`AI-AGENT-GUIDE.md`,
|
|
320
|
-
(e.g., feature specs)
|
|
321
|
-
|
|
331
|
+
**Guide references are not all loaded at once.** `CLAUDE.md` points to
|
|
332
|
+
`AI-AGENT-GUIDE.md`, and the other files `AI-AGENT-GUIDE.md` references
|
|
333
|
+
(e.g., feature specs) are also read on demand — Claude Code reads them
|
|
334
|
+
when entering the relevant workflow. This keeps context usage
|
|
322
335
|
proportional to active work.
|
|
323
336
|
|
|
324
337
|
**A pre-existing `CLAUDE.md` is preserved.** `init` will not overwrite your
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
338
|
+
custom project instructions. Dflow-generated shims are refreshed in place; it
|
|
339
|
+
skips other files that already point to `AI-AGENT-GUIDE.md`. Otherwise it shows
|
|
340
|
+
the marked Dflow block in the confirmation preview, then refreshes that same
|
|
341
|
+
block in place on later runs.
|
|
342
|
+
If you delete the block, the next `init` / `configure-agents` run appends it
|
|
343
|
+
again. Look under `dflow/specs/shared/` for a fallback merge snippet only when
|
|
344
|
+
there is a marker conflict to resolve manually.
|
|
328
345
|
|
|
329
346
|
**Cross-machine projects work.** `dflow/specs/` is plain Markdown checked
|
|
330
347
|
into your repo. Anyone cloning the repo and using Claude Code in it will
|
|
@@ -40,27 +40,28 @@ commands 是如何被識別的,以及幾個值得了解的 Claude Code 專屬
|
|
|
40
40
|
|
|
41
41
|
This project uses Dflow for spec-first AI-assisted development.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
For spec-impacting work — a new feature, a change to product, user-facing, or
|
|
44
|
+
domain behavior, a new requirement, or a bug-fix workflow — read and follow:
|
|
44
45
|
|
|
45
|
-
- `dflow/specs/shared/AI-AGENT-GUIDE.md`
|
|
46
|
+
- `dflow/specs/shared/AI-AGENT-GUIDE.md` — command registry, routing rules, and project context.
|
|
47
|
+
- `dflow/specs/shared/dflow-workflows/` — vendored workflow bundle with executable step definitions.
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
spec locations, and SDD/DDD constraints.
|
|
50
|
-
|
|
51
|
-
If your tool supports Markdown imports, the canonical guide is imported
|
|
52
|
-
below:
|
|
49
|
+
For routine work (refactors, renames, chores, formatting, dependency bumps, or
|
|
50
|
+
general code questions), proceed normally; you need not read the guide first.
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
Keep tool-specific instruction files small. The guide and workflow bundle are
|
|
53
|
+
the authoritative sources for Dflow workflow rules, slash-command behavior,
|
|
54
|
+
spec locations, and SDD/DDD constraints.
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
Claude Code 在這個專案中啟動時,會發生兩件事:
|
|
58
58
|
|
|
59
59
|
1. Claude Code 自動從專案根目錄載入 `CLAUDE.md` 到它的 context 中。
|
|
60
60
|
這是 Claude Code 的標準專案指示機制。
|
|
61
|
-
2.
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
2. `CLAUDE.md` 是一份薄指標,只指向 canonical 指南、不把它 inline 進來。
|
|
62
|
+
指南改為按需載入——`dflow` skill 在相關工作自動觸發時把它讀進來,或由
|
|
63
|
+
AI 在做 spec-impacting 工作時跟著指標讀取。指南因此不會被塞進每個 session 的
|
|
64
|
+
context(progressive disclosure),而非每次強制載入。
|
|
64
65
|
|
|
65
66
|
canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)是**命令登錄表與路由器**:
|
|
66
67
|
專案上下文(track、技術棧、文章語言)、`/dflow:*` workflow 表、source-of-truth
|
|
@@ -71,9 +72,12 @@ completion checklists)則放在 `init` 投影進專案的 **vendored workflow
|
|
|
71
72
|
`CLAUDE.md` shim 刻意保持精簡,這樣 canonical 指南就能在不需要 Claude Code
|
|
72
73
|
專屬修改的情況下持續演進。
|
|
73
74
|
|
|
74
|
-
如果專案中已有 `CLAUDE.md`,`init`
|
|
75
|
-
`dflow/specs/shared
|
|
76
|
-
|
|
75
|
+
如果專案中已有 `CLAUDE.md`,`init` 不會覆蓋自訂內容。已是 Dflow-generated shim
|
|
76
|
+
的檔案會原地刷新;其他已指向 `dflow/specs/shared/AI-AGENT-GUIDE.md` 的檔案會
|
|
77
|
+
略過,不會新增第二個指標。否則 Dflow 會在確認 preview 顯示並於檔案末尾附加帶有
|
|
78
|
+
`<!-- dflow-generated: agent-shim START/END -->` markers 的 Dflow block;重跑
|
|
79
|
+
會原地更新同一段,不會重複。只有遇到衝突或 malformed Dflow markers 時,
|
|
80
|
+
才會改寫 `dflow/specs/shared/CLAUDE-md-snippet.md` fallback merge snippet 讓你手動處理。
|
|
77
81
|
|
|
78
82
|
## 在 Claude Code 中使用 Dflow Slash Commands
|
|
79
83
|
|
|
@@ -199,6 +203,11 @@ dflow configure-agents --skills
|
|
|
199
203
|
這份 skill 不複製 workflow 步驟,body 指向 canonical
|
|
200
204
|
`dflow/specs/shared/AI-AGENT-GUIDE.md`(命令登錄表與路由規則)以及
|
|
201
205
|
`dflow/specs/shared/dflow-workflows/`(含可執行步驟定義的 vendored bundle)。
|
|
206
|
+
|
|
207
|
+
同一份 edition-neutral skill source,現在也會由 `--skills` 為 Codex
|
|
208
|
+
(`.agents/skills/dflow/SKILL.md`)與 GitHub Copilot(`.github/skills/dflow/SKILL.md`)
|
|
209
|
+
投影 project-level skill,三家沿用相同的跨工具 agentskills.io 標準。
|
|
210
|
+
|
|
202
211
|
它的行為:
|
|
203
212
|
|
|
204
213
|
- **自動觸發於** feature / bug-fix workflow、product/domain behavior 變更、新需求、
|
|
@@ -239,7 +248,7 @@ canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)在各工具之間
|
|
|
239
248
|
|
|
240
249
|
| 工具 | 產生的 shim | 載入 canonical 指南的方式 |
|
|
241
250
|
|---|---|---|
|
|
242
|
-
| Claude Code | `CLAUDE.md` |
|
|
251
|
+
| Claude Code | `CLAUDE.md` | 啟動時直接讀取檔案內容 |
|
|
243
252
|
| Codex / Copilot coding agent | `AGENTS.md` | 啟動時直接讀取檔案內容 |
|
|
244
253
|
| GitHub Copilot | `.github/copilot-instructions.md` | 直接讀取檔案內容 |
|
|
245
254
|
|
|
@@ -274,14 +283,16 @@ adapter wrapper 必須保持薄指標,不應複製 workflow 語義。
|
|
|
274
283
|
「我已起草 spec —— 你要我繼續進入實作嗎?」)。兩者可能在同一個動作上同時觸發;
|
|
275
284
|
這是預期行為,不代表設定有誤。
|
|
276
285
|
|
|
277
|
-
|
|
278
|
-
`AI-AGENT-GUIDE.md`
|
|
279
|
-
|
|
280
|
-
|
|
286
|
+
**指南的引用不會被一次全部載入。** `CLAUDE.md` 指向 `AI-AGENT-GUIDE.md`;而
|
|
287
|
+
`AI-AGENT-GUIDE.md` 引用的其他檔案(例如 feature spec)也是按需載入 —— Claude
|
|
288
|
+
Code 會在進入對應 workflow 時才讀取它們。這樣可以讓 context 用量與正在進行的
|
|
289
|
+
工作保持比例。
|
|
281
290
|
|
|
282
|
-
**既有的 `CLAUDE.md` 會被保留。** `init`
|
|
283
|
-
|
|
284
|
-
|
|
291
|
+
**既有的 `CLAUDE.md` 會被保留。** `init` 不會覆蓋你現有的自訂專案指示;已是
|
|
292
|
+
Dflow-generated shim 會原地刷新,其他已指向 `AI-AGENT-GUIDE.md` 的檔案會略過,
|
|
293
|
+
否則會在確認 preview 顯示要附加的 marked Dflow block,寫入後重跑會原地更新同一段。
|
|
294
|
+
若你刪除該 block,下一次 `init` / `configure-agents` 會再附加它;只有 marker
|
|
295
|
+
conflict 時才需要到 `dflow/specs/shared/` 找 fallback merge snippet 手動處理。
|
|
285
296
|
|
|
286
297
|
**跨機器專案可正常運作。** `dflow/specs/` 是純 Markdown,已 check in 到你的
|
|
287
298
|
repo。任何人 clone 該 repo 並在其中使用 Claude Code,都會透過已 commit 的
|