dflow-sdd-ddd 0.7.0 → 0.8.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 +26 -0
- 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/lib/init.js +263 -52
- package/package.json +1 -1
- package/templates/brownfield/references/dflow-feedback-flow.md +179 -0
- package/templates/brownfield/references/drift-verification.md +183 -0
- package/templates/brownfield/references/finish-feature-flow.md +259 -0
- package/templates/brownfield/references/git-integration.md +312 -0
- package/templates/brownfield/references/init-project-flow.md +413 -0
- package/templates/brownfield/references/modify-existing-flow.md +444 -0
- package/templates/brownfield/references/new-feature-flow.md +367 -0
- package/templates/brownfield/references/new-phase-flow.md +259 -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 +1 -1
- package/templates/brownfield/scaffolding/Git-principles-trunk.md +1 -1
- package/templates/brownfield/scaffolding/_conventions.md +1 -1
- package/templates/brownfield/scaffolding/_overview.md +3 -3
- 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 +179 -0
- package/templates/greenfield/references/drift-verification.md +195 -0
- package/templates/greenfield/references/finish-feature-flow.md +280 -0
- package/templates/greenfield/references/git-integration.md +285 -0
- package/templates/greenfield/references/init-project-flow.md +447 -0
- package/templates/greenfield/references/modify-existing-flow.md +362 -0
- package/templates/greenfield/references/new-feature-flow.md +397 -0
- package/templates/greenfield/references/new-phase-flow.md +273 -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 +1 -1
- package/templates/greenfield/scaffolding/Git-principles-trunk.md +1 -1
- 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/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
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# Modify Existing Feature Workflow — Greenfield Clean Architecture
|
|
2
|
+
|
|
3
|
+
Step-by-step guide for changing or fixing existing functionality.
|
|
4
|
+
|
|
5
|
+
Triggered by `/dflow:modify-existing` or `/dflow:bug-fix` (or natural language implying a modification task — see SKILL.md § Workflow Transparency for the auto-trigger safety net).
|
|
6
|
+
|
|
7
|
+
**Step Gates** in this flow (stop-and-confirm before proceeding):
|
|
8
|
+
- Step 2 → Step 3 (baseline captured → assess DDD impact)
|
|
9
|
+
- Step 3 → Step 4 (DDD impact decision → implement)
|
|
10
|
+
- Step 4 → Step 5 (implementation done → update documentation)
|
|
11
|
+
|
|
12
|
+
All other step transitions are **step-internal**: announce "Step N complete, entering Step N+1" and proceed without waiting. See SKILL.md § Workflow Transparency for the full transparency protocol and confirmation signals.
|
|
13
|
+
|
|
14
|
+
**Note on step count**: Greenfield edition has 5 steps (Brownfield has
|
|
15
|
+
6) because Clean Architecture's layered structure already separates
|
|
16
|
+
concerns — there's no delivery/entrypoint extraction step to perform.
|
|
17
|
+
|
|
18
|
+
**Ceremony adjustment when triggered by `/dflow:bug-fix`**: treat as lightweight — use the Lightweight Spec Template (see `templates/lightweight-spec.md`) instead of the full spec, and Step 3 may default to "no DDD impact, fix in place" unless the bug itself is in Domain logic. T2 still generates a concise `Implementation Tasks` checklist (see Step 3).
|
|
19
|
+
|
|
20
|
+
## Step 1: Assess the Change — Ceremony Tier + Feature Linkage + Layer
|
|
21
|
+
|
|
22
|
+
Before producing any spec prose, read `dflow/specs/shared/_conventions.md`
|
|
23
|
+
and apply the `## Prose Language` setting. If the setting is missing or not
|
|
24
|
+
an explicit language tag, ask the developer to update `_conventions.md`
|
|
25
|
+
before continuing. This requirement also applies when this flow is entered
|
|
26
|
+
through `/dflow:bug-fix`.
|
|
27
|
+
|
|
28
|
+
This step has three parallel concerns:
|
|
29
|
+
|
|
30
|
+
**Part A — Determine the Ceremony Tier (T1 / T2 / T3)**
|
|
31
|
+
|
|
32
|
+
Dflow runs three ceremony tiers (full table in SKILL.md § Ceremony Scaling).
|
|
33
|
+
For a modification, AI judges which tier fits before deciding what to
|
|
34
|
+
produce:
|
|
35
|
+
|
|
36
|
+
| Tier | When to choose | Production |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| **T1 Heavy** | Architectural change / new BR / new Aggregate or VO / new Domain Event / new data structure → escalate to `/dflow:new-phase` (if extending an active feature) or `/dflow:new-feature` (if it's truly a new concern) | Full phase-spec via the appropriate flow |
|
|
39
|
+
| **T2 Light** | Bug fix / UI input validation tweak / flow branch change — **has BR Delta** but no Aggregate / data-structure overhaul | Independent `lightweight-{date}-{slug}.md` placed in feature directory + outbound-link row in `_index.md` Lightweight Changes |
|
|
40
|
+
| **T3 Trivial** | Button colour / copy fix / typo / formatting / pure comments — **all four T3 criteria** must hold (no BR change, no Domain concept change, no data structure change, only UI surface / comments / formatting) | **Inline row in `_index.md` Lightweight Changes only** (no independent spec file) |
|
|
41
|
+
|
|
42
|
+
If any T3 criterion fails → drop to T2. If Domain / BR / data structure
|
|
43
|
+
is touched → escalate to T1.
|
|
44
|
+
|
|
45
|
+
**Below T3** (pure typo, formatting commit) → tell the developer Dflow
|
|
46
|
+
doesn't track this and they can `git commit` directly.
|
|
47
|
+
|
|
48
|
+
**Part B — Locate the Feature this Change Belongs To**
|
|
49
|
+
|
|
50
|
+
Walk through these in order:
|
|
51
|
+
|
|
52
|
+
1. **Active features**: scan `dflow/specs/features/active/*/_index.md`. Does
|
|
53
|
+
the change belong inside an existing active feature directory? If
|
|
54
|
+
yes, use that as the host (T1 → `/dflow:new-phase`; T2 → place
|
|
55
|
+
lightweight-spec inside; T3 → inline row in that `_index.md`).
|
|
56
|
+
2. **Completed features**: scan `dflow/specs/features/completed/*/_index.md`
|
|
57
|
+
Goals & Scope sections. If the change description is semantically
|
|
58
|
+
related to a completed feature, this becomes the **completed feature
|
|
59
|
+
reopen** scenario — go to Step 1.5 below.
|
|
60
|
+
3. **Standalone**: if no related feature exists (active or completed),
|
|
61
|
+
this is a new concern. For T1, use `/dflow:new-feature`. For T2 / T3
|
|
62
|
+
on a standalone bug, see Step 1.5 — `/dflow:bug-fix` will create a
|
|
63
|
+
minimal feature directory to host the lightweight-spec.
|
|
64
|
+
|
|
65
|
+
> **Why scan completed too?** Completed features are frozen history
|
|
66
|
+
> and **cannot accept** any T2 / T3 directly
|
|
67
|
+
> (would break the "completed = frozen" semantic). Reopen routes through
|
|
68
|
+
> a new follow-up feature instead — see Step 1.5.
|
|
69
|
+
|
|
70
|
+
**Part C — Identify the Affected Layer (Clean Architecture)**
|
|
71
|
+
|
|
72
|
+
This still matters for picking the right fix location:
|
|
73
|
+
- Domain invariant broken → Domain fix
|
|
74
|
+
- Application orchestration issue → Application fix
|
|
75
|
+
- Infrastructure bug (DB, external service) → Infrastructure fix
|
|
76
|
+
- API contract change → Presentation fix (becomes T1 if behaviour changes)
|
|
77
|
+
|
|
78
|
+
**→ Transition (step-internal)**: Step 1 complete. Announce "Step 1 complete (tier {T1/T2/T3} decided, host feature {SPEC-ID-slug / new / follow-up} identified, layer {Domain/Application/Infrastructure/Presentation}). Entering Step 1.5 / Step 2 as appropriate." and continue.
|
|
79
|
+
|
|
80
|
+
## Step 1.5: Completed-Feature Reopen Detection (only if Step 1 found a related completed feature)
|
|
81
|
+
|
|
82
|
+
If Step 1 Part B identified a semantically related completed feature, AI
|
|
83
|
+
must explicitly disambiguate the user's intent **before** writing any
|
|
84
|
+
files:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
"I notice this change overlaps with completed feature
|
|
88
|
+
`{SPEC-ID}-{slug}` (Goals & Scope: '{first 1-2 sentences}', completed on
|
|
89
|
+
{date}).
|
|
90
|
+
|
|
91
|
+
Is this a follow-up to that feature, or an independent new concern?
|
|
92
|
+
|
|
93
|
+
Option A — follow-up of `{SPEC-ID}-{slug}`
|
|
94
|
+
→ Build a new feature with a fresh SPEC-ID and `follow-up-of:
|
|
95
|
+
{SPEC-ID}` link back to the original. Inherits BR Snapshot baseline
|
|
96
|
+
from the BC's rules.md.
|
|
97
|
+
Option B — independent new requirement
|
|
98
|
+
→ Run /dflow:new-feature normally; no link to the completed feature.
|
|
99
|
+
Option C — actually I think it's just a tiny lightweight tweak, no
|
|
100
|
+
new feature needed
|
|
101
|
+
→ Refused. Completed features are frozen — even T3 inline rows must
|
|
102
|
+
live in a new follow-up feature directory. (You can still pick A
|
|
103
|
+
and have the new feature contain only one T3 row in _index.md if
|
|
104
|
+
that fits the change.)"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Wait for the developer's explicit choice (A / B / C).**
|
|
108
|
+
|
|
109
|
+
If A (follow-up): proceed to **Step 1.6: Create Follow-up Feature**.
|
|
110
|
+
If B (independent): tell the developer to `/dflow:new-feature`; this
|
|
111
|
+
flow ends.
|
|
112
|
+
If C: gently re-explain (per decision 17) that completed features
|
|
113
|
+
cannot accept direct T2 / T3 writes; offer Option A (follow-up with
|
|
114
|
+
just a T3 inline row) as the lightweight equivalent.
|
|
115
|
+
|
|
116
|
+
## Step 1.6: Create Follow-up Feature (only if user picked Option A)
|
|
117
|
+
|
|
118
|
+
Build the follow-up feature using the same machinery as
|
|
119
|
+
`/dflow:new-feature` (see `new-feature-flow.md` Steps 3.5 and 4), with
|
|
120
|
+
these follow-up-specific differences:
|
|
121
|
+
|
|
122
|
+
- **New SPEC-ID** (today's date sequence — do NOT reuse the original
|
|
123
|
+
SPEC-ID): e.g. original `SPEC-20260201-003-訂單折扣` → follow-up
|
|
124
|
+
`SPEC-20260424-002-訂單折扣-匯率擴充` (or any new slug)
|
|
125
|
+
- **New slug**: not required to equal the original slug; pick whatever
|
|
126
|
+
best describes the follow-up scope
|
|
127
|
+
- **`_index.md` Metadata**: `follow-up-of: {原 SPEC-ID}` is REQUIRED
|
|
128
|
+
(uncomment the optional line in the template; can be a YAML array if
|
|
129
|
+
the follow-up spans multiple originals)
|
|
130
|
+
- **`_index.md` Goals & Scope** auto-prepended note:
|
|
131
|
+
```
|
|
132
|
+
> 本 feature 為 `{原 SPEC-ID}-{原 slug}` 的 follow-up,原 feature
|
|
133
|
+
> 完成於 `{date}`,詳見 `completed/{原 SPEC-ID}-{原 slug}/_index.md`。
|
|
134
|
+
```
|
|
135
|
+
- **`_index.md` Current BR Snapshot baseline**: AI reads the BC's
|
|
136
|
+
`dflow/specs/domain/{context}/rules.md` and inherits the BRs that are
|
|
137
|
+
in-scope for this follow-up. Mark each inherited row with First Seen
|
|
138
|
+
= `inherited from rules.md` and Last Updated = (empty until the new
|
|
139
|
+
feature's first phase Delta touches it)
|
|
140
|
+
|
|
141
|
+
**Reverse-link into the old `_index.md`**: AI also updates
|
|
142
|
+
`dflow/specs/features/completed/{原 SPEC-ID}-{原 slug}/_index.md` —
|
|
143
|
+
uncomment the Follow-up Tracking section (if not already present) and
|
|
144
|
+
add a row:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
| {新 SPEC-ID} | {新 slug} | {today} | in-progress |
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
This update is **part of the same change set** (the developer commits
|
|
151
|
+
both at once; commit message should mention "Add follow-up reference to
|
|
152
|
+
`{新 SPEC-ID}`"). The reverse link is a derived index — the new
|
|
153
|
+
feature's `follow-up-of` field is the authoritative source.
|
|
154
|
+
|
|
155
|
+
After the follow-up feature is set up, this flow hands off to the
|
|
156
|
+
`/dflow:new-phase` flow (or stays in this flow at Step 2 for the first
|
|
157
|
+
phase's content).
|
|
158
|
+
|
|
159
|
+
## Step 2: Check Documentation
|
|
160
|
+
|
|
161
|
+
## Step 2: Check Documentation
|
|
162
|
+
|
|
163
|
+
- Spec in `dflow/specs/features/completed/`?
|
|
164
|
+
- Domain model in `dflow/specs/domain/{context}/models.md`?
|
|
165
|
+
- Business rules in `rules.md`?
|
|
166
|
+
- Domain events in `events.md`?
|
|
167
|
+
|
|
168
|
+
If no documentation exists, capture current behavior BEFORE changing — use the **Delta** format below.
|
|
169
|
+
|
|
170
|
+
If baseline domain docs are missing, create them from templates before filling content:
|
|
171
|
+
- `dflow/specs/domain/glossary.md` → `templates/glossary.md`
|
|
172
|
+
- `dflow/specs/domain/{context}/models.md` → `templates/models.md`
|
|
173
|
+
- `dflow/specs/domain/{context}/rules.md` → `templates/rules.md`
|
|
174
|
+
- `dflow/specs/domain/{context}/behavior.md` → `templates/behavior.md`
|
|
175
|
+
- `dflow/specs/domain/{context}/events.md` → `templates/events.md`
|
|
176
|
+
- `dflow/specs/domain/context-map.md` (when cross-context mapping is needed) → `templates/context-map.md`
|
|
177
|
+
- `dflow/specs/architecture/tech-debt.md` (if missing) → `templates/tech-debt.md`
|
|
178
|
+
|
|
179
|
+
### Delta Spec Format (for modifications)
|
|
180
|
+
|
|
181
|
+
Use ADDED / MODIFIED / REMOVED / RENAMED + an optional UNCHANGED section. Keep Given/When/Then for each rule; the Delta section lives inside the spec and does not accumulate into `dflow/specs/domain/{context}/behavior.md` (git history already covers the trail).
|
|
182
|
+
|
|
183
|
+
```markdown
|
|
184
|
+
## Behavior Delta
|
|
185
|
+
|
|
186
|
+
### ADDED - BR / behavior added
|
|
187
|
+
#### Rule: BR-NN {規則名稱}
|
|
188
|
+
Given {Aggregate 初始狀態}
|
|
189
|
+
When {呼叫的 Command 或 Aggregate 方法}
|
|
190
|
+
Then {新的 Aggregate 狀態}
|
|
191
|
+
And {產生的 Domain Event}
|
|
192
|
+
|
|
193
|
+
### MODIFIED - BR / behavior modified
|
|
194
|
+
#### Rule: BR-NN {規則名稱}
|
|
195
|
+
**Before**: Given … When … Then {old result} / {old event}
|
|
196
|
+
**After**: Given … When … Then {new result} / {new event}
|
|
197
|
+
**Reason**: {why this change}
|
|
198
|
+
|
|
199
|
+
### REMOVED - BR removed
|
|
200
|
+
#### Rule: BR-NN {規則名稱}
|
|
201
|
+
**Reason**: {why removed}
|
|
202
|
+
|
|
203
|
+
### RENAMED - BR renamed
|
|
204
|
+
#### Rule: {old name} -> {new name}
|
|
205
|
+
**Reason**: {why renamed — e.g. terminology evolution / Aggregate split / glossary alignment}
|
|
206
|
+
|
|
207
|
+
### UNCHANGED - explicitly unaffected (optional)
|
|
208
|
+
- BR-003 金額上限
|
|
209
|
+
- BR-005 提交後不可修改
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Section rules**:
|
|
213
|
+
- Use **ADDED / MODIFIED / REMOVED / RENAMED** for every behavioral change; skip a sub-section if it has no entries.
|
|
214
|
+
- `MODIFIED` must keep the "原本 / 改為" pair so reviewers see the before/after without guessing.
|
|
215
|
+
- `RENAMED` is only about naming (e.g., 「簽核」→「審批」、「Order → CustomerOrder」). If the behavior also changed, split into RENAMED + MODIFIED entries.
|
|
216
|
+
- `UNCHANGED` is **recommended but optional**; fill it when regression risk is high or MODIFIED entries are many.
|
|
217
|
+
- Always pair with `## Reason for Change` (why this PR exists — ticket / stakeholder ask).
|
|
218
|
+
- For Aggregate state transitions and Domain Events, include them in the Given/When/Then — this is how `/dflow:pr-review` Step 0 understands the intent.
|
|
219
|
+
|
|
220
|
+
**→ Step Gate: Step 2 → Step 3**
|
|
221
|
+
|
|
222
|
+
Announce to developer:
|
|
223
|
+
> "Baseline captured — existing documentation reviewed, current behavior is documented and the proposed change is marked. Ready to assess the DDD impact (Aggregate design, Domain Events, Value Objects)? `/dflow:next` or reply 'OK' to continue."
|
|
224
|
+
|
|
225
|
+
Wait for confirmation before entering Step 3.
|
|
226
|
+
|
|
227
|
+
## Step 3: Assess DDD Impact
|
|
228
|
+
|
|
229
|
+
### Is the Aggregate design still correct?
|
|
230
|
+
|
|
231
|
+
Changes that require Aggregate redesign:
|
|
232
|
+
- New invariant that spans objects currently in different Aggregates
|
|
233
|
+
- Performance issue from too-large Aggregate
|
|
234
|
+
- Concurrency conflict from too-large Aggregate
|
|
235
|
+
- Business rule that now crosses Aggregate boundary
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
"This change affects [invariant]. Does the current Aggregate
|
|
239
|
+
boundary still make sense, or do we need to split/merge?"
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Do we need new Domain Events?
|
|
243
|
+
|
|
244
|
+
If the behavior change means other parts of the system need to react differently:
|
|
245
|
+
- Add new events
|
|
246
|
+
- Modify event payloads (careful: backward compatibility)
|
|
247
|
+
- Add new event handlers
|
|
248
|
+
|
|
249
|
+
### Are Value Objects still valid?
|
|
250
|
+
|
|
251
|
+
If constraints change:
|
|
252
|
+
- Update Value Object validation
|
|
253
|
+
- Check all usages of the Value Object
|
|
254
|
+
|
|
255
|
+
### Generate Implementation Tasks List
|
|
256
|
+
|
|
257
|
+
For a phase-spec modification, AI generates a concrete task list and writes it into the spec's `Implementation Tasks` section using `[LAYER]-[NUMBER]:description` (DOMAIN / APP / INFRA / API / TEST).
|
|
258
|
+
|
|
259
|
+
For a lightweight-spec (T2), AI still generates a concise `Implementation Tasks` checklist instead of skipping task generation.
|
|
260
|
+
|
|
261
|
+
If the lightweight checklist looks larger than a short-fix checklist, AI must pause and ask the developer whether to keep T2 or upgrade to T1. Do not auto-upgrade based on task count alone.
|
|
262
|
+
|
|
263
|
+
**→ Step Gate: Step 3 → Step 4**
|
|
264
|
+
|
|
265
|
+
Announce to developer:
|
|
266
|
+
> "DDD impact analysis done — {Aggregate boundary OK / needs redesign}, {no new events / new events needed}. Ready to implement? `/dflow:next` to proceed, or adjust the design first."
|
|
267
|
+
|
|
268
|
+
Wait for confirmation before entering Step 4.
|
|
269
|
+
|
|
270
|
+
## Step 4: Implement
|
|
271
|
+
|
|
272
|
+
Follow the layer order: Domain → Application → Infrastructure → Presentation.
|
|
273
|
+
|
|
274
|
+
Even for bug fixes, verify:
|
|
275
|
+
- [ ] Fix is in the correct layer
|
|
276
|
+
- [ ] Aggregate invariants still hold
|
|
277
|
+
- [ ] Domain Events still fire correctly
|
|
278
|
+
- [ ] Tests updated to cover the fix
|
|
279
|
+
- [ ] No business logic leaked to wrong layer
|
|
280
|
+
|
|
281
|
+
**→ Step Gate: Step 4 → Step 5**
|
|
282
|
+
|
|
283
|
+
Announce to developer:
|
|
284
|
+
> "Implementation appears complete. Ready to update documentation (spec, models.md, rules.md, events.md, glossary, tech-debt)? `/dflow:next` to proceed."
|
|
285
|
+
|
|
286
|
+
Wait for confirmation before entering Step 5. This step gate is where the completion checklist is triggered — do not skip.
|
|
287
|
+
|
|
288
|
+
## Step 5: Update Documentation
|
|
289
|
+
|
|
290
|
+
Triggered by the Step 4 → Step 5 Step Gate. AI runs the completion checklist in the order below; do **not** skip a section. `Implementation Tasks` checks apply to both `phase-spec.md` and `lightweight-spec.md` (T3 inline-only has no task section).
|
|
291
|
+
|
|
292
|
+
### 5.1 Verification — AI runs independently
|
|
293
|
+
|
|
294
|
+
Items marked *(post-5.3)* are re-verified after the documentation merge in 5.3 lands:
|
|
295
|
+
|
|
296
|
+
- [ ] Every ADDED / MODIFIED / REMOVED / RENAMED entry in the Delta section is covered by implementation or tests
|
|
297
|
+
- [ ] The fix is in the correct layer (Domain / Application / Infrastructure / Presentation)
|
|
298
|
+
- [ ] Domain layer/package has **no** external package-manager dependencies beyond the language/runtime baseline
|
|
299
|
+
- [ ] Aggregate invariants still hold; state changes go through methods
|
|
300
|
+
- [ ] Any new / changed Domain Events are raised in the implementation
|
|
301
|
+
- [ ] ORM / persistence mapping is kept outside Domain entities (no persistence attributes/annotations on Domain entities)
|
|
302
|
+
- [ ] `Implementation Tasks` section (`phase-spec.md` or `lightweight-spec.md`): all tasks checked, or unchecked items explicitly labelled as follow-up
|
|
303
|
+
- [ ] *(post-5.3)* `dflow/specs/domain/{context}/behavior.md` has a section anchor for every `BR-*` in ADDED / MODIFIED entries; REMOVED entries' anchors have been deleted (mechanical input for `/dflow:verify`)
|
|
304
|
+
- [ ] *(post-5.3)* `dflow/specs/domain/{context}/behavior.md` `last-updated` is later than this spec's `created` date (mechanical drift guard)
|
|
305
|
+
|
|
306
|
+
If any item fails, report the gap and pause — don't proceed to 5.2.
|
|
307
|
+
|
|
308
|
+
### 5.2 Verification — needs developer confirmation
|
|
309
|
+
|
|
310
|
+
- [ ] Does the fix faithfully express the **intent** of the Delta entries? (AI lists delta → impl location; developer judges fit)
|
|
311
|
+
- [ ] Is the Aggregate boundary still correct after this change (especially for MODIFIED / RENAMED entries)?
|
|
312
|
+
- [ ] Are Domain Event payloads and handler placements still correct?
|
|
313
|
+
- [ ] Did we miss any tech debt worth recording?
|
|
314
|
+
- [ ] Do the scenarios merged into `behavior.md` (incl. Aggregate transitions + Events) faithfully express the Delta's final-state behavior? (AI lists updated anchors; developer judges)
|
|
315
|
+
- [ ] Should the `Implementation Tasks` section in the spec be collapsed / removed now that it's complete? (team convention — developer decides; applies to both phase-spec and lightweight-spec)
|
|
316
|
+
|
|
317
|
+
Ask these one-by-one.
|
|
318
|
+
|
|
319
|
+
### 5.3 Documentation updates
|
|
320
|
+
|
|
321
|
+
- [ ] Update or create the feature / bug spec; set `status: completed`
|
|
322
|
+
- [ ] `dflow/specs/domain/{context}/models.md` — Aggregate structure updates
|
|
323
|
+
- [ ] `dflow/specs/domain/{context}/rules.md` — business rule updates
|
|
324
|
+
- [ ] `dflow/specs/domain/{context}/events.md` — Domain Event updates
|
|
325
|
+
- [ ] `dflow/specs/domain/glossary.md` — new / renamed terms (mirror any RENAMED delta entries here)
|
|
326
|
+
- [ ] `dflow/specs/domain/{context}/behavior.md` — update scenarios to reflect Delta result (merge final state, not Delta markup). Sub-steps:
|
|
327
|
+
- Promote any Activity 3 (Spec Writing) draft sections (from B3 mid-sync) to formal sections
|
|
328
|
+
- Update the corresponding `rules.md` anchor's `last-updated` date (B4)
|
|
329
|
+
- [ ] `behavior.md` draft cleanup — if the Delta was abandoned mid-way, keep the `## 提案中變更` section's history or explicitly REMOVE it
|
|
330
|
+
- [ ] `dflow/specs/domain/context-map.md` — updated if cross-context interaction changed
|
|
331
|
+
- [ ] `dflow/specs/architecture/tech-debt.md` — findings recorded
|
|
332
|
+
|
|
333
|
+
### 5.4 Archival
|
|
334
|
+
|
|
335
|
+
If this modification was a **T1 new-phase** within an existing active
|
|
336
|
+
feature, archival happens at the *feature* level, not the *phase* level —
|
|
337
|
+
do NOT move individual phase-spec files. Instead:
|
|
338
|
+
|
|
339
|
+
- [ ] Mark this phase-spec's `status` field `completed` in its frontmatter
|
|
340
|
+
- [ ] Keep the phase-spec inside its feature directory at
|
|
341
|
+
`dflow/specs/features/active/{SPEC-ID}-{slug}/` (it stays alongside
|
|
342
|
+
sibling phase-specs)
|
|
343
|
+
- [ ] When the developer is ready to wrap the whole feature, run
|
|
344
|
+
`/dflow:finish-feature` — that command does the BC-layer sync,
|
|
345
|
+
`git mv`s the **whole feature directory** to `completed/`, and
|
|
346
|
+
emits an Integration Summary
|
|
347
|
+
|
|
348
|
+
If this modification was a **T2 lightweight** spec, archival is
|
|
349
|
+
similarly at the feature level — the lightweight-spec stays in the
|
|
350
|
+
feature directory and `_index.md`'s Lightweight Changes row references it. No
|
|
351
|
+
file move at this point. The whole feature directory moves to
|
|
352
|
+
`completed/` when the developer eventually runs `/dflow:finish-feature`.
|
|
353
|
+
|
|
354
|
+
If this modification was a **T3 inline-only** change, no spec file
|
|
355
|
+
exists — archival is just leaving the row in `_index.md` Lightweight Changes.
|
|
356
|
+
|
|
357
|
+
If the modification was a **standalone follow-up feature** (created
|
|
358
|
+
via Step 1.6), the same rule applies: this flow does not archive the
|
|
359
|
+
new follow-up directory; that happens at `/dflow:finish-feature` time.
|
|
360
|
+
|
|
361
|
+
Only announce "change complete" after the appropriate archival step
|
|
362
|
+
above (or the Step 5.3 docs sweep) is done.
|