dflow-sdd-ddd 0.4.0 → 0.6.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.
@@ -1,200 +0,0 @@
1
- # Using Dflow with Gemini CLI
2
-
3
- > [繁體中文](using-with-gemini-cli.md) | **English**
4
-
5
- A walk-through of what Dflow looks like when your AI coding agent is
6
- [Gemini CLI](https://github.com/google/gemini-cli). About 10 minutes to read.
7
-
8
- This guide focuses on the Gemini CLI experience specifically. For the
9
- tool-neutral evaluation flow, see
10
- [`docs/evaluating-dflow.en.md`](evaluating-dflow.en.md). For the full Get Started
11
- and feature list, see [`README.md`](../README.en.md).
12
-
13
- ## Who This Guide Is For
14
-
15
- You are using or evaluating Dflow with Gemini CLI as your AI coding agent.
16
- This guide covers what Gemini CLI sees after `init`, how Dflow's slash
17
- commands are recognized, and the Gemini-CLI-specific patterns worth knowing.
18
-
19
- You do not need to read this before running `init`. It is most useful after
20
- you have run `init` once and want to understand what Gemini CLI is actually
21
- loading.
22
-
23
- ## Prerequisites
24
-
25
- - Gemini CLI installed (see [github.com/google/gemini-cli](https://github.com/google/gemini-cli)).
26
- - Node.js / npm available (Dflow ships through npm). Install globally with
27
- `npm install -g dflow-sdd-ddd`, or use `npx dflow-sdd-ddd` for the no-install path.
28
- - A project directory you are comfortable initializing in. A branch or a
29
- disposable sample project is recommended for first contact; see the
30
- [evaluator guide playbook](evaluating-dflow.en.md#a-30-minute-evaluation-playbook).
31
-
32
- You do not need a separate Dflow service or API key. The workflows are
33
- text-based and use Gemini CLI's existing capabilities.
34
-
35
- ## What Gemini CLI Sees After `init`
36
-
37
- Running `dflow init` (or `npx dflow-sdd-ddd init` on the no-install path) and
38
- selecting Gemini CLI as a target tool creates a thin shim at the project root:
39
-
40
- ```markdown
41
- # GEMINI.md - Dflow Project Instructions
42
-
43
- This project uses Dflow for spec-first AI-assisted development.
44
-
45
- Before planning or editing code, read and follow:
46
-
47
- - `dflow/specs/shared/AI-AGENT-GUIDE.md`
48
-
49
- Keep tool-specific instruction files small. The Dflow guide above is the
50
- single source of truth for project workflow rules, slash-command behavior,
51
- spec locations, and SDD/DDD constraints.
52
-
53
- If your tool supports Markdown imports, the canonical guide is imported below:
54
-
55
- @dflow/specs/shared/AI-AGENT-GUIDE.md
56
- ```
57
-
58
- Two things happen when Gemini CLI starts in this project:
59
-
60
- 1. Gemini CLI automatically loads `GEMINI.md` from the project root into
61
- its context. This is Gemini CLI's standard project instructions
62
- mechanism.
63
- 2. The trailing `@dflow/specs/shared/AI-AGENT-GUIDE.md` line uses Gemini
64
- CLI's Markdown import syntax to inline the canonical Dflow guide. So
65
- Gemini CLI effectively reads both files as one set of instructions.
66
-
67
- The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is where the
68
- real workflow rules live: project context (track, tech stack, prose
69
- language), the `/dflow:*` workflow table, source-of-truth file paths, and
70
- core SDD/DDD rules. The `GEMINI.md` shim stays small precisely so the
71
- canonical guide can evolve without Gemini-CLI-specific edits.
72
-
73
- If a `GEMINI.md` already existed in the project, `init` does not overwrite
74
- it. Instead it writes a merge snippet under `dflow/specs/shared/` that you
75
- can paste into your existing `GEMINI.md` manually.
76
-
77
- ## Using Dflow Workflow Commands in Gemini CLI
78
-
79
- Dflow's `/dflow:*` slash commands are workflow names recognized by the AI
80
- through the workflow table in `AI-AGENT-GUIDE.md`, not Gemini CLI's
81
- built-in tool commands. You type them as plain chat:
82
-
83
- ```text
84
- /dflow:new-feature
85
- ```
86
-
87
- Gemini CLI treats this as input. Because it has the workflow table loaded
88
- via `GEMINI.md` import, it recognizes the prefix and enters the matching
89
- workflow. A typical conversation looks like:
90
-
91
- ```text
92
- User: /dflow:new-feature
93
-
94
- Gemini CLI: Entering new-feature workflow. Please describe the user-facing
95
- capability or business behavior you want to add.
96
-
97
- User: Allow expense submitters to attach a receipt image when filing an
98
- expense.
99
-
100
- Gemini CLI: I'll start by drafting a feature spec under
101
- dflow/specs/features/active/. Before I do, I need a short answer on:
102
- [clarifying questions about scope, owner, priority]
103
- ```
104
-
105
- The workflow then walks you through spec drafting, behavior examples,
106
- implementation planning, and finish-feature drift checks. The exact
107
- sequence depends on which workflow you entered (`/dflow:new-feature`,
108
- `/dflow:modify-existing`, `/dflow:bug-fix`, etc.). All workflow definitions
109
- live under the Dflow skill source; Gemini CLI follows them by reading the
110
- skill files when needed.
111
-
112
- Available workflow entry points:
113
-
114
- | Command | Use when |
115
- |---|---|
116
- | `/dflow:new-feature` | A new user-visible capability or business behavior is requested. |
117
- | `/dflow:modify-existing` | Existing behavior needs to change. |
118
- | `/dflow:bug-fix` | A defect can be described with expected vs actual behavior. |
119
- | `/dflow:new-phase` | An active feature needs another implementation slice. |
120
- | `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
121
- | `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
122
- | `/dflow:pr-review` | A change is ready for SDD/DDD review. |
123
- | `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
124
-
125
- If you forget a command name, ask Gemini CLI "what dflow workflows are
126
- available?" — the answer comes from the workflow table it already has
127
- loaded.
128
-
129
- ## Differences vs Other AI Tools
130
-
131
- The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is identical
132
- across tools. Only the root-level shim differs:
133
-
134
- | Tool | Generated shim | Loads canonical guide via |
135
- |---|---|---|
136
- | Gemini CLI | `GEMINI.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
137
- | Claude Code | `CLAUDE.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
138
- | Codex / Copilot coding agent | `AGENTS.md` | Reads file content directly when starting |
139
- | GitHub Copilot | `.github/copilot-instructions.md` | Reads file content directly |
140
-
141
- You can run `dflow configure-agents` later to add another tool's shim
142
- without re-running `init`. Multiple tools can be active in the same project
143
- and stay synchronized via the canonical guide.
144
-
145
- ## Common Patterns and Gotchas
146
-
147
- **Keep `GEMINI.md` thin.** If you find yourself adding workflow rules,
148
- spec locations, or SDD constraints to `GEMINI.md`, those belong in
149
- `dflow/specs/shared/AI-AGENT-GUIDE.md` instead. The shim stays small so
150
- that other tools' shims don't drift away from it.
151
-
152
- **`/dflow:*` is not a Gemini CLI tool.** The slash commands are plain text
153
- patterns the AI recognizes from the workflow table. You can use them
154
- immediately after `init` without any Gemini CLI configuration.
155
-
156
- **Permission gates and Dflow workflow gates are separate.** Gemini CLI may
157
- ask for confirmation before executing a shell command or modifying a file.
158
- Dflow's workflows have their own approval gates (e.g., "I drafted the spec —
159
- do you want me to proceed to implementation?"). Both can fire on the same
160
- action; this is expected and not a sign of misconfiguration.
161
-
162
- **The `@` import is not recursive.** `GEMINI.md` imports
163
- `AI-AGENT-GUIDE.md`, but if `AI-AGENT-GUIDE.md` references other files
164
- (e.g., feature specs), those are not auto-loaded — Gemini CLI reads them
165
- on demand when entering the relevant workflow. This keeps context usage
166
- proportional to active work.
167
-
168
- **A pre-existing `GEMINI.md` is preserved.** `init` will not overwrite your
169
- existing project instructions. Look under `dflow/specs/shared/` for the
170
- merge snippet `init` wrote and paste the relevant sections into your
171
- existing `GEMINI.md` manually.
172
-
173
- **Cross-machine projects work.** `dflow/specs/` is plain Markdown checked
174
- into your repo. Anyone cloning the repo and using Gemini CLI in it will
175
- see the same Dflow setup automatically through the committed `GEMINI.md`
176
- shim and the canonical guide.
177
-
178
- ## Where to Go Next
179
-
180
- If you have not run `init` yet:
181
-
182
- - Follow the [evaluator guide playbook](evaluating-dflow.en.md#a-30-minute-evaluation-playbook)
183
- to try it on a disposable sample project.
184
-
185
- If you have run `init` and want to see end-to-end workflow examples:
186
-
187
- - Read [`tutorial/01-greenfield/`](../tutorial/01-greenfield/walkthrough-00-setup.md) or
188
- [`tutorial/02-brownfield/`](../tutorial/02-brownfield/walkthrough-00-setup.md). The
189
- tutorial walk-throughs show conversation flows and the resulting
190
- `dflow/specs/` outputs.
191
-
192
- If you want to understand the design rationale:
193
-
194
- - Read [`docs/why-ddd-for-ai.en.md`](why-ddd-for-ai.en.md).
195
-
196
- If something does not work as described:
197
-
198
- - File a docs feedback issue (see [`CONTRIBUTING.md`](../CONTRIBUTING.md)).
199
- Per-tool documentation is new and feedback specifically about Gemini CLI
200
- behavior is valuable.
@@ -1,184 +0,0 @@
1
- # 在 Gemini CLI 中使用 Dflow
2
-
3
- > **繁體中文** | [English](using-with-gemini-cli.en.md)
4
-
5
- 當你的 AI 程式設計助理是 [Gemini CLI](https://github.com/google/gemini-cli) 時,Dflow 的使用體驗 walk-through。閱讀約需 10 分鐘。
6
-
7
- 本指南專注於 Gemini CLI 的具體使用體驗。工具中立的評估流程請見
8
- [`docs/evaluating-dflow.md`](evaluating-dflow.md)。完整的 Get Started
9
- 與功能列表請見 [`README.md`](../README.md)。
10
-
11
- ## 本指南的適用對象
12
-
13
- 你正在使用或評估以 Gemini CLI 作為 AI 程式設計助理的 Dflow。
14
- 本指南說明 `init` 之後 Gemini CLI 看到了什麼、Dflow 的 slash
15
- commands 是如何被識別的,以及幾個值得了解的 Gemini CLI 專屬使用模式。
16
-
17
- 你不需要在執行 `init` 之前先讀本指南。它最適合在你執行過一次 `init` 之後、
18
- 想了解 Gemini CLI 實際載入什麼內容時閱讀。
19
-
20
- ## 前置條件
21
-
22
- - 已安裝 Gemini CLI(見 [github.com/google/gemini-cli](https://github.com/google/gemini-cli))。
23
- - 已具備 Node.js / npm 環境(Dflow 透過 npm 發佈)。以
24
- `npm install -g dflow-sdd-ddd` 全域安裝,或用 `npx dflow-sdd-ddd` 走免安裝路徑。
25
- - 有一個你願意在其中執行 init 的專案目錄。首次嘗試建議先用 branch 或
26
- 可拋棄的範例專案;見
27
- [評估者指南 Playbook](evaluating-dflow.md#30-分鐘評估-playbook)。
28
-
29
- 你不需要獨立的 Dflow 服務或 API 金鑰。這些 workflow 是文字形式,使用
30
- Gemini CLI 本身既有的功能。
31
-
32
- ## `init` 之後 Gemini CLI 看到了什麼
33
-
34
- 執行 `dflow init`(或免安裝路徑的 `npx dflow-sdd-ddd init`)並選擇 Gemini CLI
35
- 作為目標工具後,會在專案根目錄建立一個薄 shim:
36
-
37
- ```markdown
38
- # GEMINI.md - Dflow Project Instructions
39
-
40
- This project uses Dflow for spec-first AI-assisted development.
41
-
42
- Before planning or editing code, read and follow:
43
-
44
- - `dflow/specs/shared/AI-AGENT-GUIDE.md`
45
-
46
- Keep tool-specific instruction files small. The Dflow guide above is the
47
- single source of truth for project workflow rules, slash-command behavior,
48
- spec locations, and SDD/DDD constraints.
49
-
50
- If your tool supports Markdown imports, the canonical guide is imported below:
51
-
52
- @dflow/specs/shared/AI-AGENT-GUIDE.md
53
- ```
54
-
55
- Gemini CLI 在這個專案中啟動時,會發生兩件事:
56
-
57
- 1. Gemini CLI 自動從專案根目錄載入 `GEMINI.md` 到它的 context 中。
58
- 這是 Gemini CLI 的標準專案指示機制。
59
- 2. 末尾的 `@dflow/specs/shared/AI-AGENT-GUIDE.md` 這行使用 Gemini
60
- CLI 的 Markdown import 語法,將 canonical Dflow 指南 inline 嵌入。因此 Gemini CLI
61
- 等效於把兩個檔案當成一組指示來讀取。
62
-
63
- canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)是實際 workflow
64
- 規則的所在:專案上下文(track、技術棧、文章語言)、`/dflow:*` workflow 表、
65
- source-of-truth 檔案路徑,以及核心 SDD/DDD 規則。`GEMINI.md` shim 刻意保持精簡,
66
- 這樣 canonical 指南就能在不需要 Gemini CLI 專屬修改的情況下持續演進。
67
-
68
- 如果專案中已有 `GEMINI.md`,`init` 不會覆蓋它。它改為在
69
- `dflow/specs/shared/` 下寫入 merge snippet,讓你手動貼入現有的 `GEMINI.md`。
70
-
71
- ## 在 Gemini CLI 中使用 Dflow Workflow 指令
72
-
73
- Dflow 的 `/dflow:*` slash commands 是 AI 透過 `AI-AGENT-GUIDE.md` 中的
74
- workflow 表識別的 workflow 名稱,不是 Gemini CLI 的內建工具指令。
75
- 你以普通對話方式輸入它們:
76
-
77
- ```text
78
- /dflow:new-feature
79
- ```
80
-
81
- Gemini CLI 將此視為輸入。由於它已透過 `GEMINI.md` import 載入了 workflow 表,
82
- 它會識別這個前綴並進入對應的 workflow。一次典型的對話如下:
83
-
84
- ```text
85
- User: /dflow:new-feature
86
-
87
- Gemini CLI: Entering new-feature workflow. Please describe the user-facing
88
- capability or business behavior you want to add.
89
-
90
- User: Allow expense submitters to attach a receipt image when filing an
91
- expense.
92
-
93
- Gemini CLI: I'll start by drafting a feature spec under
94
- dflow/specs/features/active/. Before I do, I need a short answer on:
95
- [clarifying questions about scope, owner, priority]
96
- ```
97
-
98
- 接著這個 workflow 會引導你完成 spec 起草、行為範例、實作計畫,以及
99
- finish-feature 漂移(drift)檢查。確切的流程取決於你進入的是哪個 workflow
100
- (`/dflow:new-feature`、`/dflow:modify-existing`、`/dflow:bug-fix` 等)。
101
- 所有 workflow 定義都存放在 Dflow skill source 中;Gemini CLI 在需要時讀取
102
- skill 檔案來執行它們。
103
-
104
- 可用的 workflow 入口:
105
-
106
- | 指令 | 適用情境 |
107
- |---|---|
108
- | `/dflow:new-feature` | 需要新增一個使用者可見的功能或業務行為。 |
109
- | `/dflow:modify-existing` | 需要修改現有行為。 |
110
- | `/dflow:bug-fix` | 可以用預期行為 vs 實際行為描述的缺陷。 |
111
- | `/dflow:new-phase` | 進行中的 feature 需要另一個實作 slice。 |
112
- | `/dflow:finish-feature` | 實作完成後需要進行漂移(drift)收尾。 |
113
- | `/dflow:verify` | 需要對 spec、領域文件、實作與測試進行一致性檢查。 |
114
- | `/dflow:pr-review` | 變更已準備好進行 SDD/DDD review。 |
115
- | `/dflow:report-dflow-feedback` | 你發現了 Dflow 的問題或改進點,想要一份清理過的上游回饋草稿。 |
116
-
117
- 如果你忘了指令名稱,問 Gemini CLI「what dflow workflows are available?」
118
- 即可 —— 答案會從它已載入的 workflow 表中給出。
119
-
120
- ## 與其他 AI 工具的差異
121
-
122
- canonical 指南(`dflow/specs/shared/AI-AGENT-GUIDE.md`)在各工具之間是相同的。
123
- 只有根目錄層的 shim 有所不同:
124
-
125
- | 工具 | 產生的 shim | 載入 canonical 指南的方式 |
126
- |---|---|---|
127
- | Gemini CLI | `GEMINI.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
128
- | Claude Code | `CLAUDE.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
129
- | Codex / Copilot coding agent | `AGENTS.md` | 啟動時直接讀取檔案內容 |
130
- | GitHub Copilot | `.github/copilot-instructions.md` | 直接讀取檔案內容 |
131
-
132
- 你可以之後執行 `dflow configure-agents` 來新增另一個工具的 shim,而不需要重跑
133
- `init`。同一個專案可以同時啟用多個工具,並透過 canonical 指南保持同步。
134
-
135
- ## 常見模式與注意事項
136
-
137
- **保持 `GEMINI.md` 精簡。** 如果你發現自己在把 workflow 規則、spec 路徑或
138
- SDD 約束加入 `GEMINI.md`,這些內容應該放到
139
- `dflow/specs/shared/AI-AGENT-GUIDE.md`。shim 保持精簡,其他工具的 shim 才不會
140
- 與它產生漂移(drift)。
141
-
142
- **`/dflow:*` 不是 Gemini CLI 的工具指令。** Slash commands 是 AI 從 workflow
143
- 表識別的純文字模式。你在 `init` 之後就可以立即使用它們,不需要任何 Gemini CLI
144
- 設定。
145
-
146
- **Permission gates 與 Dflow workflow gates 是分開的。** Gemini CLI 可能會在執行
147
- shell 指令或修改檔案前要求確認。Dflow 的 workflow 有自己的審核關卡(例如「我已起草
148
- spec —— 你要我繼續進入實作嗎?」)。兩者可能在同一個動作上同時觸發;這是預期行為,
149
- 不代表設定有誤。
150
-
151
- **`@` import 不是遞迴的。** `GEMINI.md` import 了 `AI-AGENT-GUIDE.md`,但如果
152
- `AI-AGENT-GUIDE.md` 引用了其他檔案(例如 feature spec),那些檔案不會被自動
153
- 載入 —— Gemini CLI 會在進入對應 workflow 時按需讀取它們。這樣可以讓 context
154
- 用量與正在進行的工作保持比例。
155
-
156
- **既有的 `GEMINI.md` 會被保留。** `init` 不會覆蓋你現有的專案指示。請到
157
- `dflow/specs/shared/` 下找 `init` 寫入的 merge snippet,並手動將相關段落貼入
158
- 你現有的 `GEMINI.md`。
159
-
160
- **跨機器專案可正常運作。** `dflow/specs/` 是純 Markdown,已 check in 到你的
161
- repo。任何人 clone 該 repo 並在其中使用 Gemini CLI,都會透過已 commit 的
162
- `GEMINI.md` shim 與 canonical 指南自動看到相同的 Dflow 設定。
163
-
164
- ## 下一步
165
-
166
- 如果你還沒有執行 `init`:
167
-
168
- - 按照[評估者指南 Playbook](evaluating-dflow.md#30-分鐘評估-playbook)
169
- 在可拋棄的範例專案中試用。
170
-
171
- 如果你已執行 `init` 且想查看端到端的 workflow 範例:
172
-
173
- - 閱讀 [`tutorial/01-greenfield/`](../tutorial/01-greenfield/walkthrough-00-setup.md) 或
174
- [`tutorial/02-brownfield/`](../tutorial/02-brownfield/walkthrough-00-setup.md)。
175
- tutorial walk-through 展示了對話流程與產生的 `dflow/specs/` 輸出。
176
-
177
- 如果你想了解設計理念:
178
-
179
- - 閱讀[為什麼 AI 時代 DDD 更重要](why-ddd-for-ai.md)。
180
-
181
- 如果有任何行為與描述不符:
182
-
183
- - 開一個 docs feedback issue(見 [`CONTRIBUTING.md`](../CONTRIBUTING.md))。
184
- Per-tool 文件是新內容,有關 Gemini CLI 行為的具體回饋非常有價值。