dflow-sdd-ddd 0.1.1 → 0.2.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 +1176 -0
- package/CONTRIBUTING.md +123 -0
- package/README.md +68 -2
- package/TEMPLATE-COVERAGE.md +46 -0
- package/TEMPLATE-LANGUAGE-GLOSSARY.md +52 -0
- package/bin/dflow.js +37 -1
- package/docs/evaluating-dflow.md +226 -0
- package/docs/migrating-to-dflow-v1.md +212 -0
- package/docs/npm-publish-checklist.md +93 -0
- package/docs/release-versioning-policy.md +99 -0
- package/docs/using-with-claude-code.md +207 -0
- package/docs/using-with-codex.md +244 -0
- package/lib/init.js +97 -1
- package/package.json +5 -1
- package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +28 -0
- package/templates/brownfield/scaffolding/CLAUDE-md-snippet.md +1 -0
- package/templates/brownfield/scaffolding/_conventions.md +1 -0
- package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +28 -0
- package/templates/greenfield/scaffolding/CLAUDE-md-snippet.md +1 -0
- package/templates/greenfield/scaffolding/_conventions.md +1 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Using Dflow with Codex CLI
|
|
2
|
+
|
|
3
|
+
A walk-through of what Dflow looks like when your AI coding agent is
|
|
4
|
+
[Codex CLI](https://developers.openai.com/codex/cli). About 10 minutes to
|
|
5
|
+
read.
|
|
6
|
+
|
|
7
|
+
This guide focuses on the Codex CLI experience specifically. For the
|
|
8
|
+
tool-neutral evaluation flow, see
|
|
9
|
+
[`docs/evaluating-dflow.md`](evaluating-dflow.md). For the full Get Started
|
|
10
|
+
and feature list, see [`README.md`](../README.md).
|
|
11
|
+
|
|
12
|
+
## Who This Guide Is For
|
|
13
|
+
|
|
14
|
+
You are using or evaluating Dflow with Codex CLI as your AI coding agent.
|
|
15
|
+
This guide covers what Codex sees after `init`, how the `AGENTS.md` shim
|
|
16
|
+
points to the canonical Dflow guide, and the Codex-specific command and
|
|
17
|
+
permission 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 Codex CLI is actually
|
|
21
|
+
loading.
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
- Codex CLI installed and authenticated (see
|
|
26
|
+
[developers.openai.com/codex/cli](https://developers.openai.com/codex/cli)).
|
|
27
|
+
- Node.js / npx available (Dflow ships through npm).
|
|
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.md#a-30-minute-evaluation-playbook).
|
|
31
|
+
- Codex started from the initialized project root, or with `codex --cd` set
|
|
32
|
+
to that root, so Codex's `AGENTS.md` discovery includes the Dflow shim.
|
|
33
|
+
|
|
34
|
+
Running Dflow workflows does not require a separate Dflow service or API key.
|
|
35
|
+
The workflows are Markdown-based instructions and project files.
|
|
36
|
+
|
|
37
|
+
## What Codex CLI Sees After `init`
|
|
38
|
+
|
|
39
|
+
Running `npx dflow-sdd-ddd init` and selecting
|
|
40
|
+
`AGENTS.md - Codex / Copilot coding agent` as a target tool creates a thin
|
|
41
|
+
shim at the project root:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
# AGENTS.md - Dflow Project Instructions
|
|
45
|
+
|
|
46
|
+
This project uses Dflow for spec-first AI-assisted development.
|
|
47
|
+
|
|
48
|
+
Before planning or editing code, read and follow:
|
|
49
|
+
|
|
50
|
+
- `dflow/specs/shared/AI-AGENT-GUIDE.md`
|
|
51
|
+
|
|
52
|
+
Keep tool-specific instruction files small. The Dflow guide above is the
|
|
53
|
+
single source of truth for project workflow rules, slash-command behavior,
|
|
54
|
+
spec locations, and SDD/DDD constraints.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Two things matter when Codex starts in this project:
|
|
58
|
+
|
|
59
|
+
1. Codex CLI reads `AGENTS.md` as project instructions. This is Codex's
|
|
60
|
+
standard repository-instruction mechanism.
|
|
61
|
+
2. The Dflow shim does not include a Markdown import line. Unlike the
|
|
62
|
+
Claude Code and Gemini shims, generated `AGENTS.md` does not contain
|
|
63
|
+
`@dflow/specs/shared/AI-AGENT-GUIDE.md`.
|
|
64
|
+
|
|
65
|
+
That means Codex sees the pointer immediately, but the canonical Dflow guide
|
|
66
|
+
is not auto-inlined by the shim. Before planning or editing, Codex should
|
|
67
|
+
follow the pointer and read `dflow/specs/shared/AI-AGENT-GUIDE.md`. If Codex
|
|
68
|
+
starts answering a Dflow request without mentioning that file, steer it
|
|
69
|
+
explicitly: "Before continuing, read and follow
|
|
70
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md`."
|
|
71
|
+
|
|
72
|
+
The canonical guide is where the real workflow rules live: project context
|
|
73
|
+
(track, tech stack, prose language), the Dflow workflow table,
|
|
74
|
+
source-of-truth file paths, and core SDD/DDD rules. The `AGENTS.md` shim
|
|
75
|
+
stays small so the same canonical guide can serve Codex CLI, Claude Code,
|
|
76
|
+
Gemini CLI, GitHub Copilot, and other tools.
|
|
77
|
+
|
|
78
|
+
If an `AGENTS.md` already existed in the project, `init` does not overwrite
|
|
79
|
+
it. If the existing file does not already point to
|
|
80
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md`, `init` writes a merge snippet under
|
|
81
|
+
`dflow/specs/shared/AGENTS-md-snippet.md` that you can merge manually. This
|
|
82
|
+
avoids destroying custom project instructions you already had.
|
|
83
|
+
|
|
84
|
+
## Using Dflow Workflow Commands in Codex CLI
|
|
85
|
+
|
|
86
|
+
Codex CLI has its own built-in slash command layer for controlling the CLI
|
|
87
|
+
session. Commands such as `/permissions`, `/model`, `/status`, `/diff`,
|
|
88
|
+
`/review`, and `/init` are Codex CLI controls, not Dflow workflows.
|
|
89
|
+
|
|
90
|
+
Dflow's `/dflow:*` entries are workflow names recognized by the AI through
|
|
91
|
+
`AI-AGENT-GUIDE.md`, not registered Codex CLI commands. Raw
|
|
92
|
+
`/dflow:new-feature` passthrough behavior in Codex CLI should be verified
|
|
93
|
+
with the maintainer for the supported Codex version. The reliable form is to
|
|
94
|
+
name the workflow as a plain chat instruction:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
Run the Dflow /dflow:new-feature workflow.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If your Codex CLI version passes unknown slash-prefixed input through to the
|
|
101
|
+
model, this shorter form may also work (verify with maintainer):
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
/dflow:new-feature
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
If Codex reports an unknown slash command, re-send the request in prose:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
Treat /dflow:new-feature as a Dflow workflow name, not as a Codex CLI
|
|
111
|
+
command. Read dflow/specs/shared/AI-AGENT-GUIDE.md and start that workflow.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
A typical conversation looks like:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
You: Run the Dflow /dflow:new-feature workflow.
|
|
118
|
+
|
|
119
|
+
Codex CLI: I'll read dflow/specs/shared/AI-AGENT-GUIDE.md first, then use the
|
|
120
|
+
new-feature workflow. Please describe the user-visible capability or business
|
|
121
|
+
behavior you want to add.
|
|
122
|
+
|
|
123
|
+
You: Allow expense submitters to attach a receipt image when filing an
|
|
124
|
+
expense.
|
|
125
|
+
|
|
126
|
+
Codex CLI: I'll start by drafting a feature spec under
|
|
127
|
+
dflow/specs/features/active/. Before I do, I have a few clarifying questions.
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The workflow then walks you through spec drafting, behavior examples,
|
|
131
|
+
implementation planning, and finish-feature drift checks. The exact
|
|
132
|
+
sequence depends on which workflow you entered (`/dflow:new-feature`,
|
|
133
|
+
`/dflow:modify-existing`, `/dflow:bug-fix`, etc.).
|
|
134
|
+
|
|
135
|
+
Available workflow entry points:
|
|
136
|
+
|
|
137
|
+
| Workflow | Use when |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `/dflow:new-feature` | A new user-visible capability or business behavior is requested. |
|
|
140
|
+
| `/dflow:modify-existing` | Existing behavior needs to change. |
|
|
141
|
+
| `/dflow:bug-fix` | A defect can be described with expected vs actual behavior. |
|
|
142
|
+
| `/dflow:new-phase` | An active feature needs another implementation slice. |
|
|
143
|
+
| `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
|
|
144
|
+
| `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
|
|
145
|
+
| `/dflow:pr-review` | A change is ready for SDD/DDD review. |
|
|
146
|
+
| `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
|
|
147
|
+
|
|
148
|
+
If you forget a workflow name, ask Codex to read
|
|
149
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md` and list the available Dflow
|
|
150
|
+
workflows.
|
|
151
|
+
|
|
152
|
+
## Differences vs Other AI Tools
|
|
153
|
+
|
|
154
|
+
The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is identical
|
|
155
|
+
across tools. Only the root-level shim differs:
|
|
156
|
+
|
|
157
|
+
| Tool | Generated shim | Loads canonical guide via |
|
|
158
|
+
|---|---|---|
|
|
159
|
+
| Claude Code | `CLAUDE.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
|
|
160
|
+
| Codex / Copilot coding agent | `AGENTS.md` | Project instructions load the shim; Codex must follow the pointer and read the guide |
|
|
161
|
+
| Gemini CLI | `GEMINI.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
|
|
162
|
+
| GitHub Copilot | `.github/copilot-instructions.md` | Reads repository instructions directly |
|
|
163
|
+
|
|
164
|
+
You can run `dflow configure-agents` later to add another tool's shim
|
|
165
|
+
without re-running `init`. Multiple tools can be active in the same project
|
|
166
|
+
and stay synchronized via the canonical guide.
|
|
167
|
+
|
|
168
|
+
Codex also has its own project-instruction layering. It can read global
|
|
169
|
+
instructions from Codex home and project instructions from `AGENTS.md` files
|
|
170
|
+
between the project root and the current working directory. For Dflow, the
|
|
171
|
+
important practical rule is simple: start Codex at the initialized project
|
|
172
|
+
root, and keep the Dflow pointer in the nearest relevant `AGENTS.md`.
|
|
173
|
+
|
|
174
|
+
If your team uses both Claude Code and Codex CLI on the same project, no
|
|
175
|
+
extra Dflow coordination is needed. Both tools use the same canonical guide;
|
|
176
|
+
only the shim file and loading mechanism differ.
|
|
177
|
+
|
|
178
|
+
## Common Patterns and Gotchas
|
|
179
|
+
|
|
180
|
+
**Keep `AGENTS.md` thin.** If you find yourself adding workflow rules, spec
|
|
181
|
+
locations, or SDD constraints to `AGENTS.md`, those belong in
|
|
182
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md` instead. The shim stays small so that
|
|
183
|
+
other tools' shims do not drift away from it.
|
|
184
|
+
|
|
185
|
+
**Codex does not inline the Dflow guide from `AGENTS.md`.** The generated
|
|
186
|
+
Codex shim has a normal Markdown bullet pointing to the canonical guide, not
|
|
187
|
+
an `@...` import. Ask Codex to read `AI-AGENT-GUIDE.md` if it appears to be
|
|
188
|
+
working from the shim alone.
|
|
189
|
+
|
|
190
|
+
**`/dflow:*` is not a Codex CLI built-in slash command.** Codex slash
|
|
191
|
+
commands control the Codex session itself. Use Dflow workflow names as plain
|
|
192
|
+
chat instructions when raw slash input is intercepted or rejected. Raw
|
|
193
|
+
`/dflow:*` passthrough behavior should be verified with the maintainer for
|
|
194
|
+
the supported Codex version.
|
|
195
|
+
|
|
196
|
+
**Do not confuse Codex `/init` with Dflow `init`.** Codex `/init` creates a
|
|
197
|
+
generic `AGENTS.md` scaffold for Codex. Dflow setup is `npx dflow-sdd-ddd
|
|
198
|
+
init`, and adding later tool shims is `dflow configure-agents`.
|
|
199
|
+
|
|
200
|
+
**Permission gates and Dflow workflow gates are separate.** Codex may ask
|
|
201
|
+
permission to run a command, edit outside the workspace, or access network
|
|
202
|
+
depending on its sandbox and approval settings. Dflow workflows have their
|
|
203
|
+
own approval gates, such as confirming a spec before implementation. Both
|
|
204
|
+
can appear in the same session; this is expected.
|
|
205
|
+
|
|
206
|
+
**The common Codex local-work preset is workspace write plus on-request
|
|
207
|
+
approvals.** In current Codex CLI terminology this is
|
|
208
|
+
`--sandbox workspace-write --ask-for-approval on-request`. In that mode,
|
|
209
|
+
Codex can work inside the project and asks before going beyond the sandbox,
|
|
210
|
+
such as writing outside the workspace or accessing network.
|
|
211
|
+
|
|
212
|
+
**Existing `AGENTS.md` files are preserved.** If Dflow cannot safely write
|
|
213
|
+
the root shim because the file already exists, look under
|
|
214
|
+
`dflow/specs/shared/` for the merge snippet and merge the Dflow pointer into
|
|
215
|
+
your existing project instructions manually.
|
|
216
|
+
|
|
217
|
+
**Nested `AGENTS.md` files can change what Codex sees.** Codex layers project
|
|
218
|
+
instructions along the path to the current working directory. If a subfolder
|
|
219
|
+
has its own `AGENTS.md` or `AGENTS.override.md`, make sure it does not hide
|
|
220
|
+
or contradict the Dflow pointer you expect Codex to follow.
|
|
221
|
+
|
|
222
|
+
## Where to Go Next
|
|
223
|
+
|
|
224
|
+
If you have not run `init` yet:
|
|
225
|
+
|
|
226
|
+
- Follow the [evaluator guide playbook](evaluating-dflow.md#a-30-minute-evaluation-playbook)
|
|
227
|
+
to try it on a disposable sample project.
|
|
228
|
+
|
|
229
|
+
If you have run `init` and want to see end-to-end workflow examples:
|
|
230
|
+
|
|
231
|
+
- Read [`tutorial/01-greenfield/`](../tutorial/01-greenfield/00-setup.md) or
|
|
232
|
+
[`tutorial/02-brownfield/`](../tutorial/02-brownfield/00-setup.md). The
|
|
233
|
+
tutorial walk-throughs show conversation flows and the resulting
|
|
234
|
+
`dflow/specs/` outputs.
|
|
235
|
+
|
|
236
|
+
If you want to understand the design rationale:
|
|
237
|
+
|
|
238
|
+
- Read [`docs/why-ddd-for-ai.md`](why-ddd-for-ai.md).
|
|
239
|
+
|
|
240
|
+
If something does not work as described:
|
|
241
|
+
|
|
242
|
+
- File a docs feedback issue (see [`CONTRIBUTING.md`](../CONTRIBUTING.md)).
|
|
243
|
+
Per-tool documentation is new and feedback specifically about Codex CLI
|
|
244
|
+
behavior is valuable.
|
package/lib/init.js
CHANGED
|
@@ -3,6 +3,8 @@ const path = require('node:path');
|
|
|
3
3
|
const readline = require('node:readline');
|
|
4
4
|
const { TextDecoder } = require('node:util');
|
|
5
5
|
|
|
6
|
+
const pkg = require('../package.json');
|
|
7
|
+
|
|
6
8
|
const MIN_NODE_VERSION = '22.0.0';
|
|
7
9
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
8
10
|
const TEMPLATE_ROOT = path.join(PACKAGE_ROOT, 'templates');
|
|
@@ -320,7 +322,7 @@ async function runPreflight(cwd) {
|
|
|
320
322
|
const legacySpecsPath = path.join(cwd, 'specs');
|
|
321
323
|
if ((await pathExists(legacySpecsPath)) && (await containsInitializedContent(legacySpecsPath))) {
|
|
322
324
|
warnings.push(
|
|
323
|
-
'Detected legacy specs/. Dflow V1 will not migrate or modify it; new files will be created under dflow/specs/.'
|
|
325
|
+
'Detected legacy specs/. Dflow V1 will not migrate or modify it; new files will be created under dflow/specs/. See docs/migrating-to-dflow-v1.md for the manual migration checklist.'
|
|
324
326
|
);
|
|
325
327
|
}
|
|
326
328
|
|
|
@@ -1117,6 +1119,7 @@ function buildSubstitutionMap(cwd, answers) {
|
|
|
1117
1119
|
['{tech-stack-summary}', answers.techStackSummary],
|
|
1118
1120
|
['{migration-context}', answers.migrationContext],
|
|
1119
1121
|
['{prose-language}', answers.proseLanguage],
|
|
1122
|
+
['{dflow-version}', pkg.version],
|
|
1120
1123
|
['{ASP.NET Core version}', extracted.aspNetCoreVersion || '{ASP.NET Core version}'],
|
|
1121
1124
|
['{EF Core version}', extracted.efCoreVersion || '{EF Core version}'],
|
|
1122
1125
|
['{MediatR version}', extracted.mediatRVersion || '{MediatR version}'],
|
|
@@ -1479,8 +1482,101 @@ function dedupe(values) {
|
|
|
1479
1482
|
return Array.from(new Set(values));
|
|
1480
1483
|
}
|
|
1481
1484
|
|
|
1485
|
+
async function runDoctor(options = {}) {
|
|
1486
|
+
const cwd = path.resolve(options.cwd || process.cwd());
|
|
1487
|
+
const stdout = options.stdout || process.stdout;
|
|
1488
|
+
const stderr = options.stderr || process.stderr;
|
|
1489
|
+
|
|
1490
|
+
try {
|
|
1491
|
+
if (compareVersions(process.versions.node, MIN_NODE_VERSION) < 0) {
|
|
1492
|
+
throw new InitError(`Dflow doctor requires Node.js ${MIN_NODE_VERSION}+.`, 1);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
const findings = [];
|
|
1496
|
+
await checkLegacyRootSpecsDir(cwd, findings);
|
|
1497
|
+
await checkLegacySharedDir(cwd, findings);
|
|
1498
|
+
await checkConventionsDflowVersion(cwd, findings);
|
|
1499
|
+
|
|
1500
|
+
printDoctorReport(stdout, cwd, findings);
|
|
1501
|
+
return 0;
|
|
1502
|
+
} catch (error) {
|
|
1503
|
+
if (error instanceof InitError) {
|
|
1504
|
+
stderr.write(`${error.message}\n`);
|
|
1505
|
+
return error.exitCode;
|
|
1506
|
+
}
|
|
1507
|
+
stderr.write(`${error && error.message ? error.message : error}\n`);
|
|
1508
|
+
return 1;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
async function checkLegacyRootSpecsDir(cwd, findings) {
|
|
1513
|
+
const legacyPath = path.join(cwd, 'specs');
|
|
1514
|
+
if ((await pathExists(legacyPath)) && (await containsInitializedContent(legacyPath))) {
|
|
1515
|
+
findings.push({
|
|
1516
|
+
level: 'warn',
|
|
1517
|
+
title: 'Legacy specs/ directory at project root',
|
|
1518
|
+
detail: 'V1 layout uses dflow/specs/ instead. The CLI does not modify root specs/.',
|
|
1519
|
+
action: 'See docs/migrating-to-dflow-v1.md (Step 1) for the manual migration steps.'
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
async function checkLegacySharedDir(cwd, findings) {
|
|
1525
|
+
const candidates = [
|
|
1526
|
+
path.join(cwd, 'dflow', 'specs', '_共用'),
|
|
1527
|
+
path.join(cwd, 'specs', '_共用')
|
|
1528
|
+
];
|
|
1529
|
+
for (const candidate of candidates) {
|
|
1530
|
+
if (await pathExists(candidate)) {
|
|
1531
|
+
const rel = normalizePath(path.relative(cwd, candidate));
|
|
1532
|
+
findings.push({
|
|
1533
|
+
level: 'warn',
|
|
1534
|
+
title: `Legacy ${rel}/ directory`,
|
|
1535
|
+
detail: 'V1 layout uses shared/ (canonical English directory name).',
|
|
1536
|
+
action: 'See docs/migrating-to-dflow-v1.md (Step 2) for the rename steps.'
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
async function checkConventionsDflowVersion(cwd, findings) {
|
|
1543
|
+
const conventionsPath = path.join(cwd, 'dflow', 'specs', 'shared', '_conventions.md');
|
|
1544
|
+
if (!(await pathExists(conventionsPath))) return;
|
|
1545
|
+
const content = await fs.readFile(conventionsPath, 'utf8').catch(() => '');
|
|
1546
|
+
if (!/^> Dflow Version:/m.test(content)) {
|
|
1547
|
+
findings.push({
|
|
1548
|
+
level: 'info',
|
|
1549
|
+
title: 'dflow/specs/shared/_conventions.md missing Dflow Version line',
|
|
1550
|
+
detail: 'V1 init writes a `> Dflow Version: <x.y.z>` line in the front matter automatically. This project predates that convention.',
|
|
1551
|
+
action: 'Optionally add the line manually so future migration / review can identify the spec convention version.'
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
function printDoctorReport(stdout, cwd, findings) {
|
|
1557
|
+
stdout.write(`Dflow Doctor ${pkg.version}\n`);
|
|
1558
|
+
stdout.write(`Project: ${cwd}\n\n`);
|
|
1559
|
+
|
|
1560
|
+
if (findings.length === 0) {
|
|
1561
|
+
stdout.write('All checks passed. No legacy artifacts detected.\n');
|
|
1562
|
+
return;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
for (const finding of findings) {
|
|
1566
|
+
stdout.write(`[${finding.level}] ${finding.title}\n`);
|
|
1567
|
+
stdout.write(` ${finding.detail}\n`);
|
|
1568
|
+
stdout.write(` ${finding.action}\n\n`);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
const counts = { warn: 0, info: 0 };
|
|
1572
|
+
for (const f of findings) counts[f.level] = (counts[f.level] || 0) + 1;
|
|
1573
|
+
stdout.write(`${findings.length} finding(s): ${counts.warn} warn, ${counts.info} info.\n`);
|
|
1574
|
+
stdout.write('Doctor is read-only and does not modify any files.\n');
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1482
1577
|
module.exports = {
|
|
1483
1578
|
runConfigureAgents,
|
|
1579
|
+
runDoctor,
|
|
1484
1580
|
runInit,
|
|
1485
1581
|
validateProseLanguage,
|
|
1486
1582
|
ensureProseLanguageSection,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dflow-sdd-ddd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Spec-first SDD/DDD workflow kit for AI-assisted development",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -12,8 +12,12 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"bin/",
|
|
15
|
+
"CHANGELOG.md",
|
|
16
|
+
"CONTRIBUTING.md",
|
|
15
17
|
"docs/",
|
|
16
18
|
"lib/",
|
|
19
|
+
"TEMPLATE-COVERAGE.md",
|
|
20
|
+
"TEMPLATE-LANGUAGE-GLOSSARY.md",
|
|
17
21
|
"templates/",
|
|
18
22
|
"README.md"
|
|
19
23
|
],
|
|
@@ -30,6 +30,7 @@ are not available in the current AI tool:
|
|
|
30
30
|
| `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
|
|
31
31
|
| `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
|
|
32
32
|
| `/dflow:pr-review` | A change is ready for SDD/DDD review. |
|
|
33
|
+
| `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
|
|
33
34
|
|
|
34
35
|
## Source of Truth
|
|
35
36
|
|
|
@@ -53,6 +54,33 @@ Dflow-owned project documents live under `dflow/specs/`.
|
|
|
53
54
|
4. Check drift before calling work complete.
|
|
54
55
|
5. Follow `dflow/specs/shared/_conventions.md`, especially `## Prose Language`.
|
|
55
56
|
|
|
57
|
+
## Pre-V1 Artifacts Detection
|
|
58
|
+
|
|
59
|
+
When working in a project that adopted Dflow before `dflow-sdd-ddd@0.1.0`,
|
|
60
|
+
you may encounter layout or naming patterns that predate the V1 baseline.
|
|
61
|
+
If any of the following appear, surface the observation to the developer
|
|
62
|
+
and recommend manual migration; do not rewrite anything silently.
|
|
63
|
+
|
|
64
|
+
Signals:
|
|
65
|
+
|
|
66
|
+
- Top-level `specs/` directory containing Dflow-shaped content (V1 layout
|
|
67
|
+
uses `dflow/specs/`).
|
|
68
|
+
- `_共用/` directory under `specs/` or `dflow/specs/` (V1 uses `shared/`).
|
|
69
|
+
- Section headings in Traditional Chinese where V1 templates render
|
|
70
|
+
canonical English; compare against `TEMPLATE-LANGUAGE-GLOSSARY.md` if
|
|
71
|
+
available.
|
|
72
|
+
- References to a runtime `/dflow:init-project` slash command (V1
|
|
73
|
+
replaced it with the shell command `npx dflow-sdd-ddd init`).
|
|
74
|
+
- A root `CLAUDE.md`, `AGENTS.md`, or equivalent that holds the full
|
|
75
|
+
Dflow workflow text instead of being a thin shim pointing to this
|
|
76
|
+
file.
|
|
77
|
+
- `dflow/specs/shared/_conventions.md` is missing the `> Dflow Version:`
|
|
78
|
+
front-matter line (V1 init writes it automatically).
|
|
79
|
+
|
|
80
|
+
Recommend `docs/migrating-to-dflow-v1.md` for the manual migration
|
|
81
|
+
checklist. Migration affects every spec the team has written; manual
|
|
82
|
+
review is required.
|
|
83
|
+
|
|
56
84
|
## Tool-Specific Notes
|
|
57
85
|
|
|
58
86
|
This file is the canonical Dflow guide. Root-level files such as
|
|
@@ -105,6 +105,7 @@ AI 的完整決策樹、Workflow Transparency、Ceremony Scaling 三層判準
|
|
|
105
105
|
- `/dflow:finish-feature` — feature 收尾
|
|
106
106
|
- `/dflow:pr-review` — PR 審查
|
|
107
107
|
- `/dflow:verify` — rules.md ↔ behavior.md 漂移檢查
|
|
108
|
+
- `/dflow:report-dflow-feedback` — 草擬給 Dflow upstream 的已清理回饋,不自動送出
|
|
108
109
|
- `/dflow:status` / `/dflow:next` / `/dflow:cancel` — 狀態管理
|
|
109
110
|
|
|
110
111
|
### Project-Level Supplemental Rules
|
|
@@ -30,6 +30,7 @@ are not available in the current AI tool:
|
|
|
30
30
|
| `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
|
|
31
31
|
| `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
|
|
32
32
|
| `/dflow:pr-review` | A change is ready for SDD/DDD review. |
|
|
33
|
+
| `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
|
|
33
34
|
|
|
34
35
|
## Source of Truth
|
|
35
36
|
|
|
@@ -53,6 +54,33 @@ Dflow-owned project documents live under `dflow/specs/`.
|
|
|
53
54
|
4. Check drift before calling work complete.
|
|
54
55
|
5. Follow `dflow/specs/shared/_conventions.md`, especially `## Prose Language`.
|
|
55
56
|
|
|
57
|
+
## Pre-V1 Artifacts Detection
|
|
58
|
+
|
|
59
|
+
When working in a project that adopted Dflow before `dflow-sdd-ddd@0.1.0`,
|
|
60
|
+
you may encounter layout or naming patterns that predate the V1 baseline.
|
|
61
|
+
If any of the following appear, surface the observation to the developer
|
|
62
|
+
and recommend manual migration; do not rewrite anything silently.
|
|
63
|
+
|
|
64
|
+
Signals:
|
|
65
|
+
|
|
66
|
+
- Top-level `specs/` directory containing Dflow-shaped content (V1 layout
|
|
67
|
+
uses `dflow/specs/`).
|
|
68
|
+
- `_共用/` directory under `specs/` or `dflow/specs/` (V1 uses `shared/`).
|
|
69
|
+
- Section headings in Traditional Chinese where V1 templates render
|
|
70
|
+
canonical English; compare against `TEMPLATE-LANGUAGE-GLOSSARY.md` if
|
|
71
|
+
available.
|
|
72
|
+
- References to a runtime `/dflow:init-project` slash command (V1
|
|
73
|
+
replaced it with the shell command `npx dflow-sdd-ddd init`).
|
|
74
|
+
- A root `CLAUDE.md`, `AGENTS.md`, or equivalent that holds the full
|
|
75
|
+
Dflow workflow text instead of being a thin shim pointing to this
|
|
76
|
+
file.
|
|
77
|
+
- `dflow/specs/shared/_conventions.md` is missing the `> Dflow Version:`
|
|
78
|
+
front-matter line (V1 init writes it automatically).
|
|
79
|
+
|
|
80
|
+
Recommend `docs/migrating-to-dflow-v1.md` for the manual migration
|
|
81
|
+
checklist. Migration affects every spec the team has written; manual
|
|
82
|
+
review is required.
|
|
83
|
+
|
|
56
84
|
## Tool-Specific Notes
|
|
57
85
|
|
|
58
86
|
This file is the canonical Dflow guide. Root-level files such as
|
|
@@ -108,6 +108,7 @@ AI 的完整決策樹、Workflow Transparency、Ceremony Scaling 三層判準
|
|
|
108
108
|
- `/dflow:bug-fix` — Bug 修復
|
|
109
109
|
- `/dflow:finish-feature` — Feature 收尾 + 整合摘要
|
|
110
110
|
- `/dflow:pr-review` — PR 審查檢查點
|
|
111
|
+
- `/dflow:report-dflow-feedback` — 草擬給 Dflow upstream 的已清理回饋,不自動送出
|
|
111
112
|
|
|
112
113
|
### Core Principles (Project Reaffirmed)
|
|
113
114
|
|