dflow-sdd-ddd 0.7.0 → 0.9.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 +73 -0
- package/LICENSE +679 -21
- package/README.en.md +5 -4
- package/README.md +3 -3
- package/bin/dflow.js +3 -2
- package/docs/evaluating-dflow.en.md +14 -5
- package/docs/evaluating-dflow.md +14 -5
- package/docs/using-with-claude-code.en.md +17 -9
- package/docs/using-with-claude-code.md +15 -8
- package/docs/using-with-codex.en.md +12 -8
- package/docs/using-with-codex.md +8 -6
- package/lib/init.js +480 -87
- package/package.json +2 -2
- package/templates/brownfield/references/dflow-feedback-flow.md +251 -0
- package/templates/brownfield/references/drift-verification.md +183 -0
- package/templates/brownfield/references/finish-feature-flow.md +294 -0
- package/templates/brownfield/references/git-integration.md +371 -0
- package/templates/brownfield/references/init-project-flow.md +430 -0
- package/templates/brownfield/references/modify-existing-flow.md +448 -0
- package/templates/brownfield/references/new-feature-flow.md +382 -0
- package/templates/brownfield/references/new-phase-flow.md +274 -0
- package/templates/brownfield/references/pr-review-checklist.md +179 -0
- package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +31 -4
- package/templates/brownfield/scaffolding/CLAUDE-md-snippet.md +12 -8
- package/templates/brownfield/scaffolding/Git-principles-gitflow.md +14 -13
- package/templates/brownfield/scaffolding/Git-principles-trunk.md +14 -17
- package/templates/brownfield/scaffolding/_conventions.md +1 -1
- package/templates/brownfield/scaffolding/_overview.md +3 -3
- package/templates/brownfield/templates/_index.md +20 -2
- package/templates/brownfield/templates/context-map.md +1 -1
- package/templates/brownfield/templates/glossary.md +1 -1
- package/templates/brownfield/templates/models.md +1 -1
- package/templates/brownfield/templates/rules.md +1 -1
- package/templates/brownfield/templates/tech-debt.md +1 -1
- package/templates/common/skill/SKILL.md +35 -0
- package/templates/greenfield/references/ddd-modeling-guide.md +351 -0
- package/templates/greenfield/references/dflow-feedback-flow.md +251 -0
- package/templates/greenfield/references/drift-verification.md +195 -0
- package/templates/greenfield/references/finish-feature-flow.md +314 -0
- package/templates/greenfield/references/git-integration.md +344 -0
- package/templates/greenfield/references/init-project-flow.md +464 -0
- package/templates/greenfield/references/modify-existing-flow.md +366 -0
- package/templates/greenfield/references/new-feature-flow.md +412 -0
- package/templates/greenfield/references/new-phase-flow.md +288 -0
- package/templates/greenfield/references/pr-review-checklist.md +130 -0
- package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +31 -4
- package/templates/greenfield/scaffolding/CLAUDE-md-snippet.md +15 -13
- package/templates/greenfield/scaffolding/Git-principles-gitflow.md +14 -13
- package/templates/greenfield/scaffolding/Git-principles-trunk.md +14 -18
- package/templates/greenfield/scaffolding/_conventions.md +1 -1
- package/templates/greenfield/scaffolding/_overview.md +5 -3
- package/templates/greenfield/scaffolding/architecture-decisions-README.md +1 -1
- package/templates/greenfield/templates/_index.md +20 -2
- package/templates/greenfield/templates/context-map.md +1 -1
- package/templates/greenfield/templates/events.md +1 -1
- package/templates/greenfield/templates/glossary.md +1 -1
- package/templates/greenfield/templates/models.md +1 -1
- package/templates/greenfield/templates/rules.md +1 -1
- package/templates/greenfield/templates/tech-debt.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dflow-sdd-ddd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Spec-first SDD/DDD workflow kit for AI-assisted development",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"test": "node test/smoke.mjs"
|
|
43
43
|
},
|
|
44
|
-
"license": "
|
|
44
|
+
"license": "AGPL-3.0-or-later",
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# Dflow Feedback Draft Flow
|
|
2
|
+
|
|
3
|
+
`/dflow:report-dflow-feedback` helps the developer turn a Dflow problem or
|
|
4
|
+
improvement observed during real project work into a high-quality upstream
|
|
5
|
+
feedback draft. The draft is rendered **field by field to match the upstream
|
|
6
|
+
GitHub issue form**, so the developer pastes each field with no reformatting.
|
|
7
|
+
|
|
8
|
+
This flow is **not** a project feature workflow and does not change the
|
|
9
|
+
application being built. It is a standalone governance/support flow for Dflow
|
|
10
|
+
itself.
|
|
11
|
+
|
|
12
|
+
## Hard Boundaries
|
|
13
|
+
|
|
14
|
+
- Do not submit anything to GitHub automatically.
|
|
15
|
+
- Do not run `gh issue create`, `gh pr create`, `git push`, or any networked
|
|
16
|
+
submission command from this flow.
|
|
17
|
+
- Do not expose private project details, business rules, customer data,
|
|
18
|
+
secrets, tokens, internal URLs, or proprietary source snippets.
|
|
19
|
+
- Always show the draft to the developer before anything leaves the local
|
|
20
|
+
machine.
|
|
21
|
+
- If the developer later asks to submit through GitHub CLI, stop and treat that
|
|
22
|
+
as a separate explicit task with fresh permission and environment checks.
|
|
23
|
+
|
|
24
|
+
## Trigger Conditions
|
|
25
|
+
|
|
26
|
+
Enter this flow when:
|
|
27
|
+
|
|
28
|
+
- The developer explicitly runs `/dflow:report-dflow-feedback`.
|
|
29
|
+
- The developer says the Dflow process, template, generated file, or docs seem
|
|
30
|
+
wrong or improvable.
|
|
31
|
+
- The AI notices a clear contradiction or gap in Dflow guidance and asks:
|
|
32
|
+
"This looks like a possible Dflow upstream issue. Should I draft feedback for
|
|
33
|
+
you to review?"
|
|
34
|
+
|
|
35
|
+
Do not interrupt normal development for minor preference differences. If the
|
|
36
|
+
observation is speculative, ask before drafting.
|
|
37
|
+
|
|
38
|
+
## Output Location
|
|
39
|
+
|
|
40
|
+
Write the draft to:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
dflow/feedback/dflow-feedback-YYYY-MM-DD-{slug}.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Create `dflow/feedback/` if it does not exist. The file is local project
|
|
47
|
+
working material; the developer decides whether to copy it into a GitHub issue,
|
|
48
|
+
turn it into a PR, or discard it.
|
|
49
|
+
|
|
50
|
+
## Step 1: Classify the Feedback
|
|
51
|
+
|
|
52
|
+
Classify the feedback as one of the following. Each maps to one upstream issue
|
|
53
|
+
form (see "Upstream Issue Forms" below):
|
|
54
|
+
|
|
55
|
+
| Classification | Upstream issue form | Title prefix |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| Bug report | Bug report | `[Bug]: ` |
|
|
58
|
+
| Workflow change request | Workflow change request | `[Workflow]: ` |
|
|
59
|
+
| Documentation feedback | Documentation feedback | `[Docs]: ` |
|
|
60
|
+
| Question / unclear usage | Question | `[Question]: ` |
|
|
61
|
+
| Maintainer release/process feedback | Workflow change request (closest form; the upstream repo disables blank issues) | `[Workflow]: ` |
|
|
62
|
+
|
|
63
|
+
Capture:
|
|
64
|
+
|
|
65
|
+
- Observed during which flow or command
|
|
66
|
+
- Affected Dflow track: Greenfield, Brownfield, both, or unknown
|
|
67
|
+
- Affected area: CLI, generated template, scaffolding, skill reference,
|
|
68
|
+
tutorial, README/docs, release/governance
|
|
69
|
+
- Whether the issue blocks current project work
|
|
70
|
+
|
|
71
|
+
## Step 2: Capture Evidence Safely
|
|
72
|
+
|
|
73
|
+
Collect only the evidence needed to explain the Dflow issue.
|
|
74
|
+
|
|
75
|
+
Allowed evidence:
|
|
76
|
+
|
|
77
|
+
- Dflow command name
|
|
78
|
+
- Dflow version if known
|
|
79
|
+
- Template or reference file name
|
|
80
|
+
- Generic project type, such as "existing brownfield app" or "legacy batch-processing system"
|
|
81
|
+
- Minimal paraphrased symptom
|
|
82
|
+
- Short sanitized snippets from Dflow-owned files
|
|
83
|
+
|
|
84
|
+
Avoid:
|
|
85
|
+
|
|
86
|
+
- Internal business rules
|
|
87
|
+
- Customer or tenant names
|
|
88
|
+
- Private repository names or URLs
|
|
89
|
+
- Secrets, tokens, credentials, or auth headers
|
|
90
|
+
- Long proprietary code snippets
|
|
91
|
+
- Full logs containing private paths or environment data
|
|
92
|
+
|
|
93
|
+
## Step 3: Redaction Pass
|
|
94
|
+
|
|
95
|
+
Before writing any field content, run a redaction check and use it as your own
|
|
96
|
+
gate. Confirm there are:
|
|
97
|
+
|
|
98
|
+
- No secrets, tokens, credentials, or auth headers
|
|
99
|
+
- No customer, tenant, or private organization names
|
|
100
|
+
- No proprietary business rules beyond a sanitized paraphrase
|
|
101
|
+
- No private repository URLs or internal hostnames
|
|
102
|
+
- No long proprietary source snippets
|
|
103
|
+
|
|
104
|
+
The draft ends with a short submitter self-check (Step 5); leave its items
|
|
105
|
+
unchecked unless the developer explicitly confirms them.
|
|
106
|
+
|
|
107
|
+
## Step 4: Resolve the Target Issue Form
|
|
108
|
+
|
|
109
|
+
Submit upstream at: **https://github.com/weilung/dflow-sdd-ddd/issues/new/choose**
|
|
110
|
+
|
|
111
|
+
Resolve the field schema for the chosen form using this priority chain (it
|
|
112
|
+
avoids any network dependency at draft time):
|
|
113
|
+
|
|
114
|
+
1. **Live upstream schema** — if you can read the target repo's
|
|
115
|
+
`.github/ISSUE_TEMPLATE/*.yml` (for example you are working inside a
|
|
116
|
+
`dflow-sdd-ddd` checkout), use that file; it is authoritative.
|
|
117
|
+
2. **Bundled field map** — otherwise use the field map in "Upstream Issue
|
|
118
|
+
Forms" below. It is a snapshot of the upstream forms shipped with Dflow.
|
|
119
|
+
3. **Generic fallback** — only if the feedback matches none of the forms, use
|
|
120
|
+
Step 6.
|
|
121
|
+
|
|
122
|
+
## Step 5: Render the Draft Field by Field
|
|
123
|
+
|
|
124
|
+
Write the draft as one block per upstream field, in the form's field order, so
|
|
125
|
+
the developer copies each block straight into the matching field.
|
|
126
|
+
|
|
127
|
+
Per field-type rules:
|
|
128
|
+
|
|
129
|
+
| Field type | How to render |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `input` | One short line inside a fenced block. |
|
|
132
|
+
| `textarea` | Multi-line content inside a fenced block. If the field sets a non-empty `render:` attribute, do **not** add an extra fence (the form already code-blocks it). |
|
|
133
|
+
| `dropdown` | State the **recommended option** plus a one-line reason. If `multiple: true`, list the chosen options. |
|
|
134
|
+
| `checkboxes` | List every option as `- [x]` / `- [ ]`; mark any option whose schema sets `required: true`. |
|
|
135
|
+
| `markdown` | Display-only text in the form — produce **no** field block for it. |
|
|
136
|
+
| upload / attachment | Emit a manual step ("drag the relevant screenshot / log into the issue editor"); do not try to handle the file. |
|
|
137
|
+
|
|
138
|
+
Always start with a **Title** block: the form's title prefix plus a concise
|
|
139
|
+
one-line summary. GitHub pre-fills the prefix in the title box; the developer
|
|
140
|
+
can paste the full line over it.
|
|
141
|
+
|
|
142
|
+
Attribute handling: bring `value` / `default` in as starting content; surface
|
|
143
|
+
`placeholder` as a hint; append "(required)" to the block heading when the
|
|
144
|
+
field sets `required: true`.
|
|
145
|
+
|
|
146
|
+
**Fence escaping (dynamic).** Wrap each field's content in a backtick fence
|
|
147
|
+
whose length is *(longest backtick run in the content) + 1*, minimum 3. The
|
|
148
|
+
fence is only a local wrapper so the content survives in the draft file — when
|
|
149
|
+
pasting into the issue form, the developer copies the **inner** content, not
|
|
150
|
+
the fence. State this in the draft.
|
|
151
|
+
|
|
152
|
+
Draft skeleton:
|
|
153
|
+
|
|
154
|
+
````markdown
|
|
155
|
+
# {Issue form name} — {short title}
|
|
156
|
+
|
|
157
|
+
## Where to submit
|
|
158
|
+
|
|
159
|
+
https://github.com/weilung/dflow-sdd-ddd/issues/new/choose → choose
|
|
160
|
+
**"{Issue form name}"**. (A GitHub account is all you need; the title is
|
|
161
|
+
auto-prefixed with `{prefix}`.)
|
|
162
|
+
|
|
163
|
+
## Title
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
{prefix}{concise one-line summary}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## {Field label} (required)
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
{field content; copy the inner text only, not this fence}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
... one block per field, in form order ...
|
|
176
|
+
|
|
177
|
+
## Before you submit (submitter self-check)
|
|
178
|
+
|
|
179
|
+
- [ ] Any real file names / customer names / internal project code names to redact?
|
|
180
|
+
- [ ] If you attach screenshots, do they show sensitive content (internal systems, tokens, passwords)?
|
|
181
|
+
- [ ] Is opening a public issue within what your organization allows?
|
|
182
|
+
````
|
|
183
|
+
|
|
184
|
+
Keep the draft **submitter-facing only**: no maintainer tracking notes, no
|
|
185
|
+
internal references, no "for your friend / for yourself" audience switches.
|
|
186
|
+
|
|
187
|
+
## Upstream Issue Forms (bundled field map)
|
|
188
|
+
|
|
189
|
+
> Snapshot of the `weilung/dflow-sdd-ddd` issue forms. If the live `.yml` is
|
|
190
|
+
> reachable (Step 4 priority 1), prefer it. Resync this map when the upstream
|
|
191
|
+
> forms change.
|
|
192
|
+
|
|
193
|
+
### Bug report — title `[Bug]: `
|
|
194
|
+
|
|
195
|
+
| Field | Type | Required | Notes |
|
|
196
|
+
|---|---|---|---|
|
|
197
|
+
| Dflow version | input | yes | placeholder `0.2.0` |
|
|
198
|
+
| Node.js version | input | yes | from `node --version` |
|
|
199
|
+
| Project track | dropdown | yes | Greenfield / Brownfield / Not sure |
|
|
200
|
+
| Command or workflow | textarea | yes | the command or `/dflow:*` workflow used |
|
|
201
|
+
| Expected behavior | textarea | yes | |
|
|
202
|
+
| Actual behavior | textarea | yes | include relevant output |
|
|
203
|
+
| Reproduction steps | textarea | yes | smallest steps that reproduce |
|
|
204
|
+
| Additional context | textarea | no | screenshots / snippets / environment |
|
|
205
|
+
|
|
206
|
+
### Workflow change request — title `[Workflow]: `
|
|
207
|
+
|
|
208
|
+
| Field | Type | Required | Notes |
|
|
209
|
+
|---|---|---|---|
|
|
210
|
+
| Problem | textarea | yes | |
|
|
211
|
+
| Proposed change | textarea | yes | |
|
|
212
|
+
| Affected track | dropdown | yes | Greenfield / Brownfield / Both / Not sure |
|
|
213
|
+
| Affected area | checkboxes | no | CLI command / Generated template / Generated scaffolding / Skill workflow guidance / Tutorial or examples / Documentation only |
|
|
214
|
+
| Compatibility risk | textarea | yes | |
|
|
215
|
+
| Alternatives considered | textarea | no | |
|
|
216
|
+
|
|
217
|
+
### Documentation feedback — title `[Docs]: `
|
|
218
|
+
|
|
219
|
+
| Field | Type | Required | Notes |
|
|
220
|
+
|---|---|---|---|
|
|
221
|
+
| Affected page or file | input | yes | placeholder `README.md` |
|
|
222
|
+
| Reader goal | textarea | yes | what you were trying to understand or do |
|
|
223
|
+
| What was confusing? | textarea | yes | the missing, unclear, or misleading part |
|
|
224
|
+
| Suggested improvement | textarea | no | optional wording or structure |
|
|
225
|
+
|
|
226
|
+
### Question — title `[Question]: `
|
|
227
|
+
|
|
228
|
+
| Field | Type | Required | Notes |
|
|
229
|
+
|---|---|---|---|
|
|
230
|
+
| Project type | dropdown | yes | New project / Existing project / Not sure |
|
|
231
|
+
| Dflow track you are considering | dropdown | yes | Greenfield / Brownfield / Not sure |
|
|
232
|
+
| What are you trying to do? | textarea | yes | the workflow or decision you need help with |
|
|
233
|
+
| Project context | textarea | no | framework, team workflow, AI agent, constraints |
|
|
234
|
+
|
|
235
|
+
## Step 6: Generic Fallback
|
|
236
|
+
|
|
237
|
+
Use this only when the feedback matches none of the forms above. The upstream
|
|
238
|
+
repo disables blank issues, so direct the developer to pick the closest form at
|
|
239
|
+
`https://github.com/weilung/dflow-sdd-ddd/issues/new/choose` and adapt. Emit
|
|
240
|
+
two paste-ready blocks — a `Title` and a `Body` — plus the URL. Do **not** fall
|
|
241
|
+
back to a generic `## Problem` / `## Evidence` Markdown draft.
|
|
242
|
+
|
|
243
|
+
## Step 7: Present Submission Options
|
|
244
|
+
|
|
245
|
+
After writing the draft, name the draft file path and whether any submitter
|
|
246
|
+
self-check items remain unchecked, then summarize the options:
|
|
247
|
+
|
|
248
|
+
- Open the chosen issue form and paste each field block.
|
|
249
|
+
- Discard the draft if it was only a local observation.
|
|
250
|
+
|
|
251
|
+
Do not submit anything automatically.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Drift Verification — rules.md ↔ behavior.md Consistency Check
|
|
2
|
+
|
|
3
|
+
Triggered by `/dflow:verify` or `/dflow:verify <bounded-context>`.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
The A+C structure (`rules.md` as index + `behavior.md` as scenario content) introduces a drift risk — the two files can fall out of sync. This command provides a mechanical verification safety net that developers can run at key moments: before a PR, after a refactor, or when onboarding to an unfamiliar Bounded Context.
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
|
|
11
|
+
### This command does (mechanical layer)
|
|
12
|
+
|
|
13
|
+
Three string-matching checks that AI can perform deterministically:
|
|
14
|
+
|
|
15
|
+
1. **BR-ID forward check**: Every `BR-*` declared in `rules.md` has a corresponding section in `behavior.md`
|
|
16
|
+
2. **Anchor validity**: If `rules.md` links to `behavior.md#section`, that anchor exists
|
|
17
|
+
3. **BR-ID reverse check**: Every `BR-*` referenced in `behavior.md` is declared in `rules.md`
|
|
18
|
+
|
|
19
|
+
### This command does NOT do (semantic layer — explicitly excluded)
|
|
20
|
+
|
|
21
|
+
Semantic verification (LLM reads the one-line summary in `rules.md` vs the Given/When/Then in `behavior.md` and judges whether they contradict) is **out of scope**. Reasons:
|
|
22
|
+
- Mechanical checks already catch most drift (missing IDs, broken links)
|
|
23
|
+
- Semantic judgment costs tokens and requires human review of LLM conclusions
|
|
24
|
+
- Deferred to Wave D — revisit after 10+ verify runs show the type distribution of actual drift
|
|
25
|
+
|
|
26
|
+
### This command does NOT do (feature-directory aggregation — explicitly excluded)
|
|
27
|
+
|
|
28
|
+
Given the feature directory layout
|
|
29
|
+
(`dflow/specs/features/active/{SPEC-ID}-{slug}/` containing `_index.md` plus
|
|
30
|
+
0..N `phase-spec-*.md` and 0..N `lightweight-*.md`), a tempting but
|
|
31
|
+
**out-of-scope** extension would be: "make `/dflow:verify` aggregate BR
|
|
32
|
+
state across all phase-spec files in a feature, then cross-check against
|
|
33
|
+
`rules.md`." Don't do that here.
|
|
34
|
+
|
|
35
|
+
Reasons:
|
|
36
|
+
- Feature-level BR aggregation is already maintained by `_index.md`
|
|
37
|
+
Current BR Snapshot, refreshed by `/dflow:new-phase` Step 5, reconciled
|
|
38
|
+
by `/dflow:new-phase` Step 7, and promoted by `/dflow:finish-feature`
|
|
39
|
+
Step 3
|
|
40
|
+
- BC-level current state is already maintained by `rules.md` /
|
|
41
|
+
`behavior.md`, written by the same `/dflow:finish-feature` Step 3
|
|
42
|
+
- `/dflow:verify` keeps a small, mechanical scope: just the
|
|
43
|
+
`rules.md` ↔ `behavior.md` correspondence inside one BC
|
|
44
|
+
- Cross-feature / cross-phase aggregation would mix `/dflow:verify`'s
|
|
45
|
+
job with `/dflow:finish-feature`'s job and produce false positives
|
|
46
|
+
during in-progress features
|
|
47
|
+
|
|
48
|
+
If a future need arises to add an `_index.md` Current BR Snapshot ↔
|
|
49
|
+
`rules.md` cross-check, that belongs in a future extension,
|
|
50
|
+
not in this command's current scope.
|
|
51
|
+
|
|
52
|
+
### Anchor coexistence with `dflow:section`
|
|
53
|
+
|
|
54
|
+
`dflow:section` HTML comment anchors and markdown heading anchors serve different purposes:
|
|
55
|
+
|
|
56
|
+
- Markdown heading anchors (e.g., `behavior.md#br-001-rule-name`) remain the primary link target for BR-ID verification.
|
|
57
|
+
- `<!-- dflow:section ... -->` anchors are helper markers for AI/tool section positioning only.
|
|
58
|
+
- `dflow:section` does **not** replace BR-ID markdown anchors, and does **not** change the drift-verification algorithm.
|
|
59
|
+
|
|
60
|
+
So this command still uses BR-ID + markdown auto-id anchors as its primary index; `dflow:section` is auxiliary metadata.
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
/dflow:verify # Verify all Bounded Contexts
|
|
66
|
+
/dflow:verify Expense # Verify a single BC (recommended default)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
When verifying all BCs, run each context independently and report per-context results.
|
|
70
|
+
|
|
71
|
+
## Verification Steps
|
|
72
|
+
|
|
73
|
+
For each Bounded Context:
|
|
74
|
+
|
|
75
|
+
### Step 1: Locate files
|
|
76
|
+
|
|
77
|
+
- Find `dflow/specs/domain/{context}/rules.md`
|
|
78
|
+
- Find `dflow/specs/domain/{context}/behavior.md`
|
|
79
|
+
- If either is missing, report and stop for that context:
|
|
80
|
+
```
|
|
81
|
+
✗ Expense: rules.md exists but behavior.md is missing
|
|
82
|
+
→ Create the missing file using the matching template:
|
|
83
|
+
- rules.md → templates/rules.md
|
|
84
|
+
- behavior.md → templates/behavior.md
|
|
85
|
+
Or run the completion flow to populate it from existing completed specs
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Step 2: Extract BR-IDs from rules.md
|
|
89
|
+
|
|
90
|
+
Scan `rules.md` for all `BR-*` identifiers. Record each ID and any anchor link to `behavior.md`.
|
|
91
|
+
|
|
92
|
+
### Step 3: Extract BR-IDs from behavior.md
|
|
93
|
+
|
|
94
|
+
Build two sets:
|
|
95
|
+
|
|
96
|
+
- **Primary set (scenario-bound)**: BR-IDs that appear in section headings
|
|
97
|
+
(e.g. `## Amount Validation (BR-001)`) or in the formal `(BR-NNN)` marker
|
|
98
|
+
inside a Given/When/Then scenario block. These represent BR-IDs that have
|
|
99
|
+
a dedicated scenario section.
|
|
100
|
+
- **Supplementary set (body-text mentions)**: BR-IDs that appear only in
|
|
101
|
+
prose / discussion text, outside any Given/When/Then block. These are
|
|
102
|
+
informational references, not equivalent to a scenario section.
|
|
103
|
+
|
|
104
|
+
### Step 4: Cross-reference
|
|
105
|
+
|
|
106
|
+
Run the three checks using the primary set from Step 3 as the main comparison basis:
|
|
107
|
+
|
|
108
|
+
| Check | Pass condition | Fail message |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| Forward | Every BR-ID in rules.md has a corresponding scenario section in behavior.md (primary set) | `✗ BR-NNN declared in rules.md but has no scenario section in behavior.md` |
|
|
111
|
+
| Anchor | Every `behavior.md#anchor` in rules.md resolves to an existing heading | `✗ BR-NNN links to behavior.md#section but anchor not found` |
|
|
112
|
+
| Reverse | Every BR-ID formally referenced in behavior.md (primary set) is declared in rules.md | `✗ BR-NNN referenced in behavior.md scenario but not declared in rules.md` |
|
|
113
|
+
|
|
114
|
+
Body-text mentions (supplementary set) do **not** satisfy forward / reverse
|
|
115
|
+
pass conditions on their own. They are reported separately as informational
|
|
116
|
+
signals (see Step 5).
|
|
117
|
+
|
|
118
|
+
### Step 5: Report
|
|
119
|
+
|
|
120
|
+
Output format:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Verifying {Context} — rules.md ↔ behavior.md consistency
|
|
124
|
+
|
|
125
|
+
✓ BR-001 → scenario section exists and references BR-001
|
|
126
|
+
✓ BR-002 → scenario section exists and references BR-002
|
|
127
|
+
✗ BR-003 → behavior.md has no scenario section for BR-003
|
|
128
|
+
(note: BR-003 appears in body text of another section,
|
|
129
|
+
but that does not satisfy the forward check)
|
|
130
|
+
ℹ BR-005 → body text reference only — no dedicated scenario section;
|
|
131
|
+
confirm this is intentional (e.g. cross-reference to another BR)
|
|
132
|
+
|
|
133
|
+
✗ BR-010 → formally referenced in a behavior.md scenario but not
|
|
134
|
+
declared in rules.md
|
|
135
|
+
|
|
136
|
+
Summary: 3 passed, 2 issues, 1 informational
|
|
137
|
+
|
|
138
|
+
Issues:
|
|
139
|
+
1. rules.md declares BR-003, but behavior.md has no corresponding
|
|
140
|
+
scenario section
|
|
141
|
+
→ Possible cause: rule was implemented but behavior.md wasn't
|
|
142
|
+
updated in the completion flow; or a body-text mention was
|
|
143
|
+
mistaken for a scenario
|
|
144
|
+
→ Action: check the implementation, then either add the scenario
|
|
145
|
+
to behavior.md (preferred) or remove BR-003 from rules.md if
|
|
146
|
+
deprecated
|
|
147
|
+
|
|
148
|
+
2. behavior.md's {scenario section name} formally references BR-010,
|
|
149
|
+
but rules.md doesn't declare it
|
|
150
|
+
→ Possible cause: scenario was added directly to behavior.md
|
|
151
|
+
without updating rules.md
|
|
152
|
+
→ Action: add BR-010 to rules.md with a one-line summary, or
|
|
153
|
+
remove the stale scenario reference from behavior.md
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## When to Run
|
|
157
|
+
|
|
158
|
+
Recommended trigger points (not enforced — developer's judgment):
|
|
159
|
+
- Before creating a PR (`/dflow:verify` as a pre-PR sanity check)
|
|
160
|
+
- After a refactor that touched multiple specs or domain docs
|
|
161
|
+
- When onboarding to an unfamiliar Bounded Context (verify before trusting the docs)
|
|
162
|
+
- After running `/dflow:finish-feature` — that command writes BC layer
|
|
163
|
+
updates from the feature's `_index.md` Current BR Snapshot; verify
|
|
164
|
+
catches any anchor / link drift introduced by the merge
|
|
165
|
+
|
|
166
|
+
## Path Assumptions
|
|
167
|
+
|
|
168
|
+
This command operates entirely within `dflow/specs/domain/{context}/` files
|
|
169
|
+
(`rules.md` and `behavior.md`). It does **not** read from
|
|
170
|
+
`dflow/specs/features/active/{SPEC-ID}-{slug}/` directories — the feature
|
|
171
|
+
directory layout is not part of verify's input. The only effect of feature directory layout on this command is
|
|
172
|
+
ensuring `last-updated` dates in `behavior.md` are bumped at
|
|
173
|
+
`/dflow:finish-feature` time (so verify's mechanical drift guard stays
|
|
174
|
+
useful).
|
|
175
|
+
|
|
176
|
+
## Interaction with Other Commands
|
|
177
|
+
|
|
178
|
+
- `/dflow:verify` is a **standalone command** — it does not require an active workflow
|
|
179
|
+
- It can be run mid-workflow (e.g., during Step 7 implementation to check you haven't drifted)
|
|
180
|
+
- It can be run after `/dflow:finish-feature` lands — that's the moment
|
|
181
|
+
BC-layer files get rewritten; verify catches mechanical issues from
|
|
182
|
+
the merge
|
|
183
|
+
- If issues are found, the developer decides whether to fix now or defer — the command does not block other workflows
|