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.
- package/CHANGELOG.md +879 -0
- package/README.en.md +345 -0
- package/README.md +213 -159
- package/docs/evaluating-dflow.en.md +238 -0
- package/docs/evaluating-dflow.md +94 -151
- package/docs/migrating-to-dflow-v1.md +28 -10
- package/docs/using-with-claude-code.en.md +210 -0
- package/docs/using-with-claude-code.md +108 -124
- package/docs/using-with-codex.en.md +248 -0
- package/docs/using-with-codex.md +137 -157
- package/docs/using-with-gemini-cli.en.md +200 -0
- package/docs/using-with-gemini-cli.md +184 -0
- package/docs/using-with-github-copilot.en.md +136 -0
- package/docs/using-with-github-copilot.md +177 -0
- package/docs/why-ddd-for-ai.en.md +37 -0
- package/docs/why-ddd-for-ai.md +19 -17
- package/package.json +1 -1
- package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +2 -1
- package/templates/brownfield/scaffolding/CLAUDE-md-snippet.md +7 -7
- package/templates/brownfield/templates/CLAUDE.md +1 -1
- package/templates/brownfield/templates/phase-spec.md +23 -20
- package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +2 -1
- package/templates/greenfield/scaffolding/CLAUDE-md-snippet.md +8 -7
- package/templates/greenfield/scaffolding/_conventions.md +1 -1
- package/templates/greenfield/templates/CLAUDE.md +1 -1
- package/templates/greenfield/templates/phase-spec.md +24 -21
|
@@ -0,0 +1,200 @@
|
|
|
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.
|
|
@@ -0,0 +1,184 @@
|
|
|
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 行為的具體回饋非常有價值。
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Using Dflow with GitHub Copilot
|
|
2
|
+
|
|
3
|
+
> [繁體中文](using-with-github-copilot.md) | **English**
|
|
4
|
+
|
|
5
|
+
A walk-through of what Dflow looks like when your AI coding agent is GitHub Copilot (IDE chat + inline completions). About 10 minutes to read.
|
|
6
|
+
|
|
7
|
+
This guide focuses on the Copilot experience specifically. For the tool-neutral evaluation flow, see [`docs/evaluating-dflow.en.md`](evaluating-dflow.en.md). For the full Get Started and feature list, see [`README.md`](../README.en.md).
|
|
8
|
+
|
|
9
|
+
## Who This Guide Is For
|
|
10
|
+
|
|
11
|
+
You are using or evaluating Dflow with GitHub Copilot in an IDE (e.g., VS Code). This guide covers what Copilot sees after `init`, the repository shim location, how to invoke Dflow workflows from the IDE, and Copilot-specific UX and permission patterns worth knowing.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- GitHub Copilot enabled in your IDE (VS Code, JetBrains, or GitHub.dev).
|
|
16
|
+
- A project initialized with `dflow init` (or `npx dflow-sdd-ddd init` on the
|
|
17
|
+
no-install path) so the repository shim exists.
|
|
18
|
+
- Basic familiarity with the Dflow canonical guide: `dflow/specs/shared/AI-AGENT-GUIDE.md`.
|
|
19
|
+
|
|
20
|
+
## What GitHub Copilot Sees After `init`
|
|
21
|
+
|
|
22
|
+
`init` writes a small tool-specific shim for Copilot at:
|
|
23
|
+
|
|
24
|
+
- `.github/copilot-instructions.md` (note: this is inside `.github/`, not the project root)
|
|
25
|
+
|
|
26
|
+
Example generated shim:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
# GitHub Copilot Repository Instructions
|
|
30
|
+
|
|
31
|
+
This project uses Dflow for spec-first AI-assisted development.
|
|
32
|
+
|
|
33
|
+
Before planning or editing code, read and follow:
|
|
34
|
+
|
|
35
|
+
- `dflow/specs/shared/AI-AGENT-GUIDE.md`
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Key points:
|
|
39
|
+
|
|
40
|
+
- The Copilot shim is located at `.github/copilot-instructions.md` (see `lib/init.js` mapping).
|
|
41
|
+
- The Copilot shim does NOT include a Markdown `@` import. It points to the canonical guide by path only. Readers must open `dflow/specs/shared/AI-AGENT-GUIDE.md` explicitly.
|
|
42
|
+
|
|
43
|
+
## Using Dflow Workflow Commands with GitHub Copilot
|
|
44
|
+
|
|
45
|
+
Copilot is an IDE-first assistant (chat panel + inline completions), not a CLI tool. Treat Dflow workflow names as plain chat instructions rather than CLI slash commands:
|
|
46
|
+
|
|
47
|
+
- In the Copilot Chat: "Run the Dflow /dflow:new-feature workflow" — Copilot should read the canonical guide and proceed.
|
|
48
|
+
- In code comments or editor chat, describe the workflow as plain text: `Run the Dflow /dflow:new-feature workflow.`
|
|
49
|
+
|
|
50
|
+
Available workflow entry points:
|
|
51
|
+
|
|
52
|
+
| Command | Use when |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `/dflow:new-feature` | A new user-visible capability or business behavior is requested. |
|
|
55
|
+
| `/dflow:modify-existing` | Existing behavior needs to change. |
|
|
56
|
+
| `/dflow:bug-fix` | A defect can be described with expected vs actual behavior. |
|
|
57
|
+
| `/dflow:new-phase` | An active feature needs another implementation slice. |
|
|
58
|
+
| `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
|
|
59
|
+
| `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
|
|
60
|
+
| `/dflow:pr-review` | A change is ready for SDD/DDD review. |
|
|
61
|
+
| `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
|
|
62
|
+
|
|
63
|
+
### Sample Conversation Flow
|
|
64
|
+
|
|
65
|
+
A typical Copilot Chat workflow looks like this:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
You: I'd like to use the /dflow:new-feature workflow. We need to add the
|
|
69
|
+
ability for users to export their data as CSV.
|
|
70
|
+
|
|
71
|
+
Copilot: I'll help you structure this as a new feature. Let me start by
|
|
72
|
+
reviewing the AI-AGENT-GUIDE to understand the spec format.
|
|
73
|
+
|
|
74
|
+
Before drafting the feature spec, I need to understand the scope:
|
|
75
|
+
|
|
76
|
+
1. Should the CSV include all user data fields or a selected subset?
|
|
77
|
+
2. Which user roles should be able to trigger the export?
|
|
78
|
+
3. Are there any compliance or performance constraints I should know?
|
|
79
|
+
|
|
80
|
+
You: All fields, only admin users, and exports should complete within 30 seconds
|
|
81
|
+
for datasets up to 1 million rows.
|
|
82
|
+
|
|
83
|
+
Copilot: Got it. I'll create the feature spec at dflow/specs/features/active/
|
|
84
|
+
with these constraints. Let me also outline the implementation phases...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Pre-Existing Repository Instructions
|
|
88
|
+
|
|
89
|
+
If a `.github/copilot-instructions.md` file already exists in your project, `init` does not overwrite it. Instead, it writes a merge snippet under `dflow/specs/shared/` that you can review and paste into your existing file manually. This avoids destroying custom Copilot instructions you already had.
|
|
90
|
+
|
|
91
|
+
Look for a file named `dflow/specs/shared/COPILOT-INSTRUCTIONS-MERGE-SNIPPET.md` and paste the relevant sections into your existing `.github/copilot-instructions.md`.
|
|
92
|
+
|
|
93
|
+
### Notes on Slash-Command Passthrough
|
|
94
|
+
|
|
95
|
+
Copilot may or may not passthrough raw `/dflow:*` slash commands depending on the IDE integration and Copilot version. If Copilot does not recognize a slash-prefixed workflow name, re-send the request as plain prose:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
You: Instead of /dflow:new-feature, try: "Please help me start a new Dflow
|
|
99
|
+
feature workflow. Read dflow/specs/shared/AI-AGENT-GUIDE.md first."
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Differences vs Other AI Tools
|
|
103
|
+
|
|
104
|
+
The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is the same across tools. Only the root-level shim differs:
|
|
105
|
+
|
|
106
|
+
| Tool | Generated shim | Loads canonical guide via |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| GitHub Copilot | `.github/copilot-instructions.md` | Reads repository instructions directly |
|
|
109
|
+
| Claude Code | `CLAUDE.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
|
|
110
|
+
| Gemini CLI | `GEMINI.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
|
|
111
|
+
| Codex / Copilot coding agent | `AGENTS.md` | Reads file content directly when starting |
|
|
112
|
+
|
|
113
|
+
- Shim path: Copilot uses `.github/copilot-instructions.md` (not `AGENTS.md` or `CLAUDE.md`).
|
|
114
|
+
- Markdown import: Copilot shim has NO `@dflow/specs/shared/AI-AGENT-GUIDE.md` import. This contrasts with Claude/Gemini CLI shims which inline via `@` imports.
|
|
115
|
+
- 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.
|
|
116
|
+
- 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.
|
|
117
|
+
- 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.
|
|
118
|
+
|
|
119
|
+
## Common Patterns and Gotchas
|
|
120
|
+
|
|
121
|
+
- Keep `.github/copilot-instructions.md` thin. The canonical Dflow guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is the source of truth.
|
|
122
|
+
- 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.
|
|
123
|
+
- Copilot's inline completions may suggest code without following Dflow workflows; explicitly request the workflow when you need spec-driven output.
|
|
124
|
+
- 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).
|
|
125
|
+
- Use plain prose to name workflows when slash-prefixed forms are rejected by the IDE.
|
|
126
|
+
|
|
127
|
+
## Where to Go Next
|
|
128
|
+
|
|
129
|
+
- If you have not run `init`: run `dflow init` (after `npm install -g dflow-sdd-ddd`) or `npx dflow-sdd-ddd init` and choose the Copilot target to create `.github/copilot-instructions.md`.
|
|
130
|
+
- Read [`dflow/specs/shared/AI-AGENT-GUIDE.md`](../sdd-ddd-greenfield-skill/scaffolding/AI-AGENT-GUIDE.md) (or the brownfield equivalent) before starting a workflow.
|
|
131
|
+
- See [`tutorial/01-greenfield/`](../tutorial/01-greenfield/walkthrough-00-setup.md) for conversation examples that demonstrate Copilot chat flows.
|
|
132
|
+
- Read [`docs/why-ddd-for-ai.en.md`](why-ddd-for-ai.en.md) for the design rationale behind spec-first plus DDD.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
Note on IDE behavior: Slash-command passthrough and automatic inclusion of `.github/` instruction files vary by Copilot / IDE version. Confirm with a maintainer before relying on exact semantics.
|