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,212 @@
|
|
|
1
|
+
# Migrating to Dflow V1
|
|
2
|
+
|
|
3
|
+
> **Audience**: maintainers of an existing project that adopted an early
|
|
4
|
+
> Dflow form (pre-`dflow-sdd-ddd@0.1.0`) and want to align it with the
|
|
5
|
+
> V1 baseline that ships from npm.
|
|
6
|
+
>
|
|
7
|
+
> **Stance**: V1 took a clean cut. Dflow does not perform automatic
|
|
8
|
+
> migration. This guide is a manual checklist. The CLI only warns when
|
|
9
|
+
> it detects legacy paths; it does not modify existing files.
|
|
10
|
+
|
|
11
|
+
## When You Need This Guide
|
|
12
|
+
|
|
13
|
+
Skip this guide if you started using Dflow at `dflow-sdd-ddd@0.1.0`
|
|
14
|
+
or later. Your project is already on the V1 baseline.
|
|
15
|
+
|
|
16
|
+
Read this guide if any of the following are true:
|
|
17
|
+
|
|
18
|
+
- Your project has a top-level `specs/` directory that holds Dflow
|
|
19
|
+
spec material (not the V1 `dflow/specs/`).
|
|
20
|
+
- Your project has `specs/_共用/` instead of `dflow/specs/shared/`.
|
|
21
|
+
- Your spec headings are in Traditional Chinese rather than the
|
|
22
|
+
canonical English vocabulary documented in
|
|
23
|
+
`TEMPLATE-LANGUAGE-GLOSSARY.md`.
|
|
24
|
+
- Your AI instructions point teammates to `/dflow:init-project`
|
|
25
|
+
instead of `npx dflow-sdd-ddd init`.
|
|
26
|
+
- Your `CLAUDE.md` (or equivalent root instruction file) was generated
|
|
27
|
+
by an early Dflow variant that wrote a full Claude-only file rather
|
|
28
|
+
than the V1 multi-AI thin shim that points to
|
|
29
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md`.
|
|
30
|
+
|
|
31
|
+
You may need only some of these steps; the five sections below are
|
|
32
|
+
independent.
|
|
33
|
+
|
|
34
|
+
## Before You Start
|
|
35
|
+
|
|
36
|
+
- Work on a dedicated branch or a disposable copy. None of the steps
|
|
37
|
+
are destructive, but move-and-rename mistakes are easier to recover
|
|
38
|
+
from a clean branch.
|
|
39
|
+
- Make sure the working tree is clean (`git status`).
|
|
40
|
+
- Note your current Dflow version if you can identify it. Older
|
|
41
|
+
internal Dflow forms may not have been versioned at all.
|
|
42
|
+
- Open these V1 reference files for cross-checking:
|
|
43
|
+
- `TEMPLATE-LANGUAGE-GLOSSARY.md` — canonical English headings.
|
|
44
|
+
- `TEMPLATE-COVERAGE.md` — V1 file layout and parity matrix.
|
|
45
|
+
- `docs/evaluating-dflow.md` — what a fresh V1 `init` produces, if
|
|
46
|
+
you want to spin up a sample project to compare against.
|
|
47
|
+
- For an on-demand read-only summary of legacy artifacts in your
|
|
48
|
+
project, run `dflow doctor`. The command lists detected legacy
|
|
49
|
+
paths and missing V1 fields; it never modifies files.
|
|
50
|
+
|
|
51
|
+
## Migration Steps
|
|
52
|
+
|
|
53
|
+
### 1. Move root `specs/` to `dflow/specs/`
|
|
54
|
+
|
|
55
|
+
V1 puts every Dflow-managed spec under `dflow/specs/`, so the `dflow/`
|
|
56
|
+
directory becomes a single Dflow namespace separate from any
|
|
57
|
+
unrelated `specs/` directory another tool may own (PROPOSAL-014).
|
|
58
|
+
|
|
59
|
+
If your project has top-level `specs/` containing Dflow content:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
mkdir -p dflow
|
|
63
|
+
git mv specs dflow/specs
|
|
64
|
+
git status
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Commit the rename in a single commit. Avoid mixing the rename with
|
|
68
|
+
content edits in the same commit so reviewers can read the diff
|
|
69
|
+
cleanly.
|
|
70
|
+
|
|
71
|
+
If you also have an unrelated `specs/` directory used by another
|
|
72
|
+
tool, move only the Dflow material into `dflow/specs/`. The CLI will
|
|
73
|
+
warn when it sees a non-Dflow `specs/` directory but will not modify
|
|
74
|
+
it.
|
|
75
|
+
|
|
76
|
+
### 2. Rename `_共用/` to `shared/`
|
|
77
|
+
|
|
78
|
+
V1 uses canonical English directory names (PROPOSAL-012). If your
|
|
79
|
+
project has `dflow/specs/_共用/`:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git mv dflow/specs/_共用 dflow/specs/shared
|
|
83
|
+
git status
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Update any cross-references in spec files or AI instructions. A
|
|
87
|
+
project-wide grep after the rename catches leftover references:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
grep -rn "_共用" .
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3. Translate Chinese headings to canonical English
|
|
94
|
+
|
|
95
|
+
V1 templates use canonical English structure for section headings,
|
|
96
|
+
field labels, anchors, and placeholders (PROPOSAL-013). Free prose
|
|
97
|
+
inside those sections may stay in your team language.
|
|
98
|
+
|
|
99
|
+
This is the most labor-intensive step. Recommended approach:
|
|
100
|
+
|
|
101
|
+
1. Open `TEMPLATE-LANGUAGE-GLOSSARY.md` for the heading-by-heading
|
|
102
|
+
mapping.
|
|
103
|
+
2. For each generated spec file, replace Chinese H2 / H3 headings,
|
|
104
|
+
table column labels, and bold inline labels with their canonical
|
|
105
|
+
English form.
|
|
106
|
+
3. Leave free prose (descriptions, decision rationale, task text) in
|
|
107
|
+
the team language. The Prose Language convention recorded in
|
|
108
|
+
`dflow/specs/shared/_conventions.md` applies here — see also
|
|
109
|
+
step 6 below.
|
|
110
|
+
|
|
111
|
+
An AI assistant can walk through each spec file heading-by-heading
|
|
112
|
+
faster than a global search-and-replace, because earlier Dflow
|
|
113
|
+
adoption may have used slightly different wording per team. After
|
|
114
|
+
translation, run a project-wide search for the most common Chinese
|
|
115
|
+
headings to catch missed files. Adjust the search list to match the
|
|
116
|
+
templates your team actually used:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
grep -rn "## 業務規則\|## 行為情境\|## 領域模型" dflow/specs/
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 4. Switch the init entry point
|
|
123
|
+
|
|
124
|
+
Pre-V1 documentation may have instructed teammates to start a Dflow
|
|
125
|
+
project by running `/dflow:init-project` from inside an AI agent. V1
|
|
126
|
+
removed that runtime slash command (PROPOSAL-014). The init flow now
|
|
127
|
+
runs as a shell command:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npx dflow-sdd-ddd init
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
If you already have an initialized project, you do not need to re-run
|
|
134
|
+
`init`. The other `/dflow:*` workflow commands (`/dflow:new-feature`,
|
|
135
|
+
`/dflow:modify-existing`, `/dflow:bug-fix`, `/dflow:new-phase`,
|
|
136
|
+
`/dflow:finish-feature`, `/dflow:verify`, `/dflow:pr-review`) are
|
|
137
|
+
unchanged and continue to work.
|
|
138
|
+
|
|
139
|
+
Update any team documentation, runbooks, or onboarding notes that
|
|
140
|
+
still reference `/dflow:init-project` so new project setups use the
|
|
141
|
+
shell command instead.
|
|
142
|
+
|
|
143
|
+
### 5. Adopt multi-AI thin shims
|
|
144
|
+
|
|
145
|
+
V1 separates the canonical project guide from each per-tool
|
|
146
|
+
instruction file (PROPOSAL-020). The canonical guide lives at
|
|
147
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md`. Per-tool files (`AGENTS.md`,
|
|
148
|
+
`CLAUDE.md`, `GEMINI.md`, `.github/copilot-instructions.md`) are thin
|
|
149
|
+
shims pointing at the canonical guide.
|
|
150
|
+
|
|
151
|
+
If your project's `CLAUDE.md` (or equivalent) was generated by an
|
|
152
|
+
early Dflow form that wrote a full file rather than a thin shim:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
dflow configure-agents
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This command adds shims for any AI tools you select. It does not
|
|
159
|
+
overwrite an existing `CLAUDE.md`; instead, it writes a
|
|
160
|
+
`dflow/specs/shared/<tool>-md-snippet.md` that you can merge into the
|
|
161
|
+
existing file at your own pace.
|
|
162
|
+
|
|
163
|
+
If you prefer a fully clean V1 layout, archive the existing root
|
|
164
|
+
instruction file under another name first, then run
|
|
165
|
+
`dflow configure-agents` so it can write the new shim from scratch.
|
|
166
|
+
|
|
167
|
+
## After Migration
|
|
168
|
+
|
|
169
|
+
Verify the migrated project:
|
|
170
|
+
|
|
171
|
+
- Ask the AI agent to run `/dflow:status` and confirm it can locate
|
|
172
|
+
Dflow flow material and report the project's current state.
|
|
173
|
+
- Open `dflow/specs/shared/_conventions.md` and confirm a `## Prose
|
|
174
|
+
Language` section exists. If your project predates the
|
|
175
|
+
prose-language convention (PROPOSAL-015), add the section manually
|
|
176
|
+
with the correct BCP-47 language tag, for example `zh-TW` or `en`.
|
|
177
|
+
- Run a final grep to confirm no legacy paths or terms remain inside
|
|
178
|
+
`dflow/specs/`. Adjust the term list to match your earlier Dflow
|
|
179
|
+
adoption:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
grep -rn "_共用\|/dflow:init-project" dflow/specs/
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Out of Scope
|
|
186
|
+
|
|
187
|
+
This guide stays manual on purpose. The items below are not part of
|
|
188
|
+
V1 and may or may not arrive in a later release; do not rely on them
|
|
189
|
+
when planning a migration today.
|
|
190
|
+
|
|
191
|
+
- Automatic migration of legacy paths or headings.
|
|
192
|
+
- A `dflow doctor` health check command.
|
|
193
|
+
- A `dflow migrate` subcommand that edits files.
|
|
194
|
+
- Automated translation of free prose between languages.
|
|
195
|
+
|
|
196
|
+
If any of these would help your team, open a docs feedback issue so
|
|
197
|
+
the request is recorded. The maintainer position is not to refuse
|
|
198
|
+
them, only to keep V1 a clean cut.
|
|
199
|
+
|
|
200
|
+
## Where To Go Next
|
|
201
|
+
|
|
202
|
+
- `docs/evaluating-dflow.md` for what a fresh V1 `init` produces, in
|
|
203
|
+
case you want to compare against your migrated project.
|
|
204
|
+
- Per-tool walkthroughs under `docs/` for the AI tool you use:
|
|
205
|
+
- `docs/using-with-claude-code.md`
|
|
206
|
+
- `docs/using-with-codex.md`
|
|
207
|
+
- `TEMPLATE-COVERAGE.md` for the V1 logical / generated file parity
|
|
208
|
+
between Greenfield and Brownfield tracks.
|
|
209
|
+
|
|
210
|
+
If something in this guide does not match your project's actual
|
|
211
|
+
pre-V1 state, open a docs feedback issue. The guide can be extended
|
|
212
|
+
as new edge cases come in.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# npm Publish Checklist
|
|
2
|
+
|
|
3
|
+
This checklist is for maintainers preparing a manual Dflow npm release.
|
|
4
|
+
Contributors do not need to run these steps for ordinary pull requests.
|
|
5
|
+
|
|
6
|
+
Replace `<version>` with the version being published, for example `0.1.2`.
|
|
7
|
+
|
|
8
|
+
## Pre-Publish
|
|
9
|
+
|
|
10
|
+
- [ ] Confirm the release scope and expected version impact.
|
|
11
|
+
- [ ] Update `package.json` version.
|
|
12
|
+
- [ ] Update `CHANGELOG.md`.
|
|
13
|
+
- [ ] Confirm `README.md` installation instructions match the release.
|
|
14
|
+
- [ ] Confirm Greenfield and Brownfield common flow changes are synchronized.
|
|
15
|
+
- [ ] Confirm generated templates match skill source where applicable.
|
|
16
|
+
- [ ] Run:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm test
|
|
20
|
+
npm pack --dry-run
|
|
21
|
+
git diff --check
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- [ ] Inspect `npm pack --dry-run` output for unexpected files or missing files.
|
|
25
|
+
- [ ] Commit the release preparation changes.
|
|
26
|
+
|
|
27
|
+
## Publish
|
|
28
|
+
|
|
29
|
+
- [ ] Confirm npm authentication:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm whoami
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- [ ] Publish:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm publish
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use npm Security Key / WebAuthn 2FA when prompted. Do not assume a TOTP
|
|
42
|
+
`--otp` flow is available for maintainer accounts.
|
|
43
|
+
|
|
44
|
+
## Post-Publish Smoke
|
|
45
|
+
|
|
46
|
+
Run the smoke checks against the public registry package:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx dflow-sdd-ddd@<version> --version
|
|
50
|
+
npx dflow-sdd-ddd@<version> --help
|
|
51
|
+
npx dflow-sdd-ddd@<version> init
|
|
52
|
+
npx dflow-sdd-ddd@<version> configure-agents
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Verify:
|
|
56
|
+
|
|
57
|
+
- [ ] `--version` prints `<version>`.
|
|
58
|
+
- [ ] `--help` lists the expected commands.
|
|
59
|
+
- [ ] `init` creates the expected `dflow/specs/` workspace.
|
|
60
|
+
- [ ] `init` creates or preserves selected AI-agent instruction files correctly.
|
|
61
|
+
- [ ] `configure-agents` adds later selected AI-agent shims in an initialized
|
|
62
|
+
project.
|
|
63
|
+
|
|
64
|
+
## Tags and GitHub Release
|
|
65
|
+
|
|
66
|
+
- [ ] Tag the development repo:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git tag v<version>
|
|
70
|
+
git push origin v<version>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- [ ] Export or sync the dist repo if this release includes public source
|
|
74
|
+
changes.
|
|
75
|
+
- [ ] Run release verification in the dist repo.
|
|
76
|
+
- [ ] Tag the dist repo:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git tag v<version>
|
|
80
|
+
git push origin v<version>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- [ ] Create the GitHub Release for `v<version>`.
|
|
84
|
+
- [ ] Include user-facing changes, verification summary, and migration notes if
|
|
85
|
+
any.
|
|
86
|
+
|
|
87
|
+
## Closeout
|
|
88
|
+
|
|
89
|
+
- [ ] Verify the npm registry shows `<version>` as `latest` when intended.
|
|
90
|
+
- [ ] Record post-publish smoke results in the release handoff or closeout note.
|
|
91
|
+
- [ ] Move implemented or rejected proposals out of the active proposal
|
|
92
|
+
workspace.
|
|
93
|
+
- [ ] Leave the development repo clean except for intentional next-work notes.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Release and Versioning Policy
|
|
2
|
+
|
|
3
|
+
This document defines the lightweight release policy for Dflow while the project
|
|
4
|
+
is in the `0.x` series. It is maintainer-facing; contributors can use it to
|
|
5
|
+
describe expected version impact in a PR, but only maintainers publish releases.
|
|
6
|
+
|
|
7
|
+
## Versioning During 0.x
|
|
8
|
+
|
|
9
|
+
Dflow uses SemVer-style version numbers, with extra care in `0.x` because the
|
|
10
|
+
workflow contract is still evolving.
|
|
11
|
+
|
|
12
|
+
Use a patch release for:
|
|
13
|
+
|
|
14
|
+
- Bug fixes.
|
|
15
|
+
- Documentation corrections or clarifications.
|
|
16
|
+
- Non-breaking template wording changes.
|
|
17
|
+
- Release metadata fixes.
|
|
18
|
+
- Internal cleanup that does not change generated output or workflow contracts.
|
|
19
|
+
|
|
20
|
+
Use a minor release for:
|
|
21
|
+
|
|
22
|
+
- A new CLI command.
|
|
23
|
+
- A new generated file.
|
|
24
|
+
- A materially changed generated file shape.
|
|
25
|
+
- A new or expanded `/dflow:*` workflow contract.
|
|
26
|
+
- A change that affects how Greenfield or Brownfield projects are initialized.
|
|
27
|
+
- A migration-relevant template, scaffolding, or skill behavior change.
|
|
28
|
+
|
|
29
|
+
Major versions are reserved for `1.0` and later. Before `1.0`, breaking changes
|
|
30
|
+
may still appear in minor releases, but release notes must call them out clearly
|
|
31
|
+
and describe the expected user action.
|
|
32
|
+
|
|
33
|
+
## What Counts as Breaking
|
|
34
|
+
|
|
35
|
+
A change is breaking when an existing Dflow user may need to adjust project
|
|
36
|
+
files, scripts, AI-agent instructions, or workflow habits after upgrading.
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
|
|
40
|
+
- Renaming generated paths.
|
|
41
|
+
- Removing a generated file.
|
|
42
|
+
- Changing required init prompts.
|
|
43
|
+
- Changing the meaning of a template section.
|
|
44
|
+
- Changing command behavior in a way that invalidates existing docs.
|
|
45
|
+
- Replacing a workflow contract that AI agents rely on.
|
|
46
|
+
|
|
47
|
+
## Release Ownership
|
|
48
|
+
|
|
49
|
+
Dflow currently has four release surfaces:
|
|
50
|
+
|
|
51
|
+
- Development repo: source of truth for design work, implementation, planning,
|
|
52
|
+
and release preparation.
|
|
53
|
+
- Dist repo: clean public projection of selected source files.
|
|
54
|
+
- npm package: executable CLI and packaged templates selected by
|
|
55
|
+
`package.json#files`.
|
|
56
|
+
- GitHub Release: public release note and tag record.
|
|
57
|
+
|
|
58
|
+
For now, npm publishing may remain a manual maintainer action. Release
|
|
59
|
+
automation should be introduced only after the manual dist shape and release
|
|
60
|
+
checklist remain stable across multiple releases.
|
|
61
|
+
|
|
62
|
+
## Tags
|
|
63
|
+
|
|
64
|
+
Use `v<version>` tags, for example `v0.1.1`.
|
|
65
|
+
|
|
66
|
+
When both development and dist repos are maintained, tag both repos for the same
|
|
67
|
+
published version after verification. The tags may point to different commits
|
|
68
|
+
because the dist repo is a selected projection of the development repo.
|
|
69
|
+
|
|
70
|
+
## Changelog and Release Notes
|
|
71
|
+
|
|
72
|
+
Update `CHANGELOG.md` before publishing. Each release entry should state:
|
|
73
|
+
|
|
74
|
+
- The version and date.
|
|
75
|
+
- User-facing changes.
|
|
76
|
+
- Changed files or affected areas when useful.
|
|
77
|
+
- Verification performed.
|
|
78
|
+
- Any breaking change or migration note.
|
|
79
|
+
|
|
80
|
+
GitHub Release notes may summarize the changelog entry, but they should not be
|
|
81
|
+
the only place where release history is recorded.
|
|
82
|
+
|
|
83
|
+
## Greenfield and Brownfield Changes
|
|
84
|
+
|
|
85
|
+
If a change touches a common SDD flow, update both Greenfield and Brownfield
|
|
86
|
+
skill sources unless the release intentionally changes only one track.
|
|
87
|
+
|
|
88
|
+
Common synchronized flow files include:
|
|
89
|
+
|
|
90
|
+
- `init-project-flow.md`
|
|
91
|
+
- `new-feature-flow.md`
|
|
92
|
+
- `modify-existing-flow.md`
|
|
93
|
+
- `new-phase-flow.md`
|
|
94
|
+
- `finish-feature-flow.md`
|
|
95
|
+
- `drift-verification.md`
|
|
96
|
+
- `pr-review-checklist.md`
|
|
97
|
+
- `git-integration.md`
|
|
98
|
+
|
|
99
|
+
Track-specific changes should be named in the changelog and release notes.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Using Dflow with Claude Code
|
|
2
|
+
|
|
3
|
+
A walk-through of what Dflow looks like when your AI coding agent is
|
|
4
|
+
[Claude Code](https://claude.com/claude-code). About 10 minutes to read.
|
|
5
|
+
|
|
6
|
+
This guide focuses on the Claude Code experience specifically. For the
|
|
7
|
+
tool-neutral evaluation flow, see
|
|
8
|
+
[`docs/evaluating-dflow.md`](evaluating-dflow.md). For the full Get Started
|
|
9
|
+
and feature list, see [`README.md`](../README.md).
|
|
10
|
+
|
|
11
|
+
## Who This Guide Is For
|
|
12
|
+
|
|
13
|
+
You are using or evaluating Dflow with Claude Code as your AI coding agent.
|
|
14
|
+
This guide covers what Claude Code sees after `init`, how Dflow's slash
|
|
15
|
+
commands are recognized, and the small Claude-Code-specific patterns worth
|
|
16
|
+
knowing.
|
|
17
|
+
|
|
18
|
+
You do not need to read this before running `init`. It is most useful after
|
|
19
|
+
you have run `init` once and want to understand what Claude Code is
|
|
20
|
+
actually loading.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- Claude Code CLI installed (see [claude.ai/code](https://claude.com/claude-code)).
|
|
25
|
+
- Node.js / npx available (Dflow ships through npm).
|
|
26
|
+
- A project directory you are comfortable initializing in. A branch or a
|
|
27
|
+
disposable sample project is recommended for first contact; see the
|
|
28
|
+
[evaluator guide playbook](evaluating-dflow.md#a-30-minute-evaluation-playbook).
|
|
29
|
+
|
|
30
|
+
You do not need a paid Claude Code plan to read this document. Running
|
|
31
|
+
`/dflow:*` workflows requires Claude Code itself; the workflows are
|
|
32
|
+
text-based and do not require additional API keys beyond Claude Code's own
|
|
33
|
+
auth.
|
|
34
|
+
|
|
35
|
+
## What Claude Code Sees After `init`
|
|
36
|
+
|
|
37
|
+
Running `npx dflow-sdd-ddd init` and selecting Claude Code as a target tool
|
|
38
|
+
creates a thin shim at the project root:
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
# CLAUDE.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
|
|
54
|
+
below:
|
|
55
|
+
|
|
56
|
+
@dflow/specs/shared/AI-AGENT-GUIDE.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Two things happen when Claude Code starts in this project:
|
|
60
|
+
|
|
61
|
+
1. Claude Code automatically loads `CLAUDE.md` from the project root into
|
|
62
|
+
its context. This is Claude Code's standard project instructions
|
|
63
|
+
mechanism.
|
|
64
|
+
2. The trailing `@dflow/specs/shared/AI-AGENT-GUIDE.md` line uses Claude
|
|
65
|
+
Code's Markdown import syntax to inline the canonical Dflow guide. So
|
|
66
|
+
Claude Code effectively reads both files as one set of instructions.
|
|
67
|
+
|
|
68
|
+
The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is where the
|
|
69
|
+
real workflow rules live: project context (track, tech stack, prose
|
|
70
|
+
language), the `/dflow:*` workflow table, source-of-truth file paths, and
|
|
71
|
+
core SDD/DDD rules. The `CLAUDE.md` shim stays small precisely so the
|
|
72
|
+
canonical guide can evolve without Claude-Code-specific edits.
|
|
73
|
+
|
|
74
|
+
If a `CLAUDE.md` already existed in the project, `init` does not overwrite
|
|
75
|
+
it. Instead it writes a merge snippet under `dflow/specs/shared/` that you
|
|
76
|
+
can paste into your existing `CLAUDE.md` manually. This avoids destroying
|
|
77
|
+
custom project instructions you already had.
|
|
78
|
+
|
|
79
|
+
## Using Dflow Slash Commands in Claude Code
|
|
80
|
+
|
|
81
|
+
Dflow's `/dflow:*` slash commands are workflow names recognized by the AI
|
|
82
|
+
through the workflow table in `AI-AGENT-GUIDE.md`, not Claude Code's
|
|
83
|
+
built-in slash command system. You type them as plain chat:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
/dflow:new-feature
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Claude Code treats this as input. Because it has the workflow table loaded
|
|
90
|
+
via `CLAUDE.md` import, it recognizes the prefix and enters the matching
|
|
91
|
+
workflow. A typical conversation looks like:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
You: /dflow:new-feature
|
|
95
|
+
|
|
96
|
+
Claude Code: Entering new-feature workflow. Please describe the user-facing
|
|
97
|
+
capability or business behavior you want to add.
|
|
98
|
+
|
|
99
|
+
You: Allow expense submitters to attach a receipt image when filing an
|
|
100
|
+
expense.
|
|
101
|
+
|
|
102
|
+
Claude Code: I'll start by drafting a feature spec under
|
|
103
|
+
dflow/specs/features/active/. Before I do, I need a short answer on:
|
|
104
|
+
[clarifying questions about scope, owner, priority]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The workflow then walks you through spec drafting, behavior examples,
|
|
108
|
+
implementation planning, and finish-feature drift checks. The exact
|
|
109
|
+
sequence depends on which workflow you entered (`/dflow:new-feature`,
|
|
110
|
+
`/dflow:modify-existing`, `/dflow:bug-fix`, etc.). All workflow definitions
|
|
111
|
+
live under the Dflow skill source; Claude Code follows them by reading the
|
|
112
|
+
skill files when needed.
|
|
113
|
+
|
|
114
|
+
Available workflow entry points:
|
|
115
|
+
|
|
116
|
+
| Command | Use when |
|
|
117
|
+
|---|---|
|
|
118
|
+
| `/dflow:new-feature` | A new user-visible capability or business behavior is requested. |
|
|
119
|
+
| `/dflow:modify-existing` | Existing behavior needs to change. |
|
|
120
|
+
| `/dflow:bug-fix` | A defect can be described with expected vs actual behavior. |
|
|
121
|
+
| `/dflow:new-phase` | An active feature needs another implementation slice. |
|
|
122
|
+
| `/dflow:finish-feature` | Implementation is complete and needs drift closure. |
|
|
123
|
+
| `/dflow:verify` | Specs, domain docs, implementation, and tests need consistency checks. |
|
|
124
|
+
| `/dflow:pr-review` | A change is ready for SDD/DDD review. |
|
|
125
|
+
| `/dflow:report-dflow-feedback` | You found a Dflow issue or improvement and want a sanitized upstream feedback draft. |
|
|
126
|
+
|
|
127
|
+
If you forget a command name, ask Claude Code "what dflow workflows are
|
|
128
|
+
available?" — the answer comes from the workflow table it already has
|
|
129
|
+
loaded.
|
|
130
|
+
|
|
131
|
+
## Differences vs Other AI Tools
|
|
132
|
+
|
|
133
|
+
The canonical guide (`dflow/specs/shared/AI-AGENT-GUIDE.md`) is identical
|
|
134
|
+
across tools. Only the root-level shim differs:
|
|
135
|
+
|
|
136
|
+
| Tool | Generated shim | Loads canonical guide via |
|
|
137
|
+
|---|---|---|
|
|
138
|
+
| Claude Code | `CLAUDE.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
|
|
139
|
+
| Codex / Copilot coding agent | `AGENTS.md` | Reads file content directly when starting |
|
|
140
|
+
| Gemini CLI | `GEMINI.md` | `@dflow/specs/shared/AI-AGENT-GUIDE.md` Markdown import |
|
|
141
|
+
| GitHub Copilot | `.github/copilot-instructions.md` | Reads file content directly |
|
|
142
|
+
|
|
143
|
+
You can run `dflow configure-agents` later to add another tool's shim
|
|
144
|
+
without re-running `init`. Multiple tools can be active in the same project
|
|
145
|
+
and stay synchronized via the canonical guide.
|
|
146
|
+
|
|
147
|
+
If your team uses both Claude Code and Codex CLI on the same project (a
|
|
148
|
+
common setup), no extra coordination is needed. Both tools read the same
|
|
149
|
+
canonical guide; only the shim file differs.
|
|
150
|
+
|
|
151
|
+
## Common Patterns and Gotchas
|
|
152
|
+
|
|
153
|
+
**Keep `CLAUDE.md` thin.** If you find yourself adding workflow rules,
|
|
154
|
+
spec locations, or SDD constraints to `CLAUDE.md`, those belong in
|
|
155
|
+
`dflow/specs/shared/AI-AGENT-GUIDE.md` instead. The shim stays small so
|
|
156
|
+
that other tools' shims don't drift away from it.
|
|
157
|
+
|
|
158
|
+
**`/dflow:*` is not a Claude Code Skill installation.** `init` does not
|
|
159
|
+
install anything into Claude Code's skill system. The slash commands are
|
|
160
|
+
plain text patterns the AI recognizes from the workflow table. You can use
|
|
161
|
+
them immediately after `init` without any Claude Code configuration.
|
|
162
|
+
|
|
163
|
+
**Permission gates and Dflow workflow gates are separate.** Claude Code may
|
|
164
|
+
ask permission to run a tool (e.g., write a file). Dflow's workflows have
|
|
165
|
+
their own approval gates (e.g., "I drafted the spec — do you want me to
|
|
166
|
+
proceed to implementation?"). Both can fire on the same action; this is
|
|
167
|
+
expected and not a sign of misconfiguration.
|
|
168
|
+
|
|
169
|
+
**The `@` import is not recursive.** `CLAUDE.md` imports
|
|
170
|
+
`AI-AGENT-GUIDE.md`, but if `AI-AGENT-GUIDE.md` references other files
|
|
171
|
+
(e.g., feature specs), those are not auto-loaded — Claude Code reads them
|
|
172
|
+
on demand when entering the relevant workflow. This keeps context usage
|
|
173
|
+
proportional to active work.
|
|
174
|
+
|
|
175
|
+
**A pre-existing `CLAUDE.md` is preserved.** `init` will not overwrite your
|
|
176
|
+
existing project instructions. Look under `dflow/specs/shared/` for the
|
|
177
|
+
merge snippet `init` wrote and paste the relevant sections into your
|
|
178
|
+
existing `CLAUDE.md` manually.
|
|
179
|
+
|
|
180
|
+
**Cross-machine projects work.** `dflow/specs/` is plain Markdown checked
|
|
181
|
+
into your repo. Anyone cloning the repo and using Claude Code in it will
|
|
182
|
+
see the same Dflow setup automatically through the committed `CLAUDE.md`
|
|
183
|
+
shim and the canonical guide.
|
|
184
|
+
|
|
185
|
+
## Where to Go Next
|
|
186
|
+
|
|
187
|
+
If you have not run `init` yet:
|
|
188
|
+
|
|
189
|
+
- Follow the [evaluator guide playbook](evaluating-dflow.md#a-30-minute-evaluation-playbook)
|
|
190
|
+
to try it on a disposable sample project.
|
|
191
|
+
|
|
192
|
+
If you have run `init` and want to see end-to-end workflow examples:
|
|
193
|
+
|
|
194
|
+
- Read [`tutorial/01-greenfield/`](../tutorial/01-greenfield/00-setup.md) or
|
|
195
|
+
[`tutorial/02-brownfield/`](../tutorial/02-brownfield/00-setup.md). The
|
|
196
|
+
tutorial walk-throughs show conversation flows and the resulting
|
|
197
|
+
`dflow/specs/` outputs.
|
|
198
|
+
|
|
199
|
+
If you want to understand the design rationale:
|
|
200
|
+
|
|
201
|
+
- Read [`docs/why-ddd-for-ai.md`](why-ddd-for-ai.md).
|
|
202
|
+
|
|
203
|
+
If something does not work as described:
|
|
204
|
+
|
|
205
|
+
- File a docs feedback issue (see [`CONTRIBUTING.md`](../CONTRIBUTING.md)).
|
|
206
|
+
Per-tool documentation is new and feedback specifically about Claude Code
|
|
207
|
+
behavior is valuable.
|