dflow-sdd-ddd 0.8.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +679 -21
  3. package/README.en.md +5 -4
  4. package/README.md +3 -3
  5. package/bin/dflow.js +3 -2
  6. package/docs/using-with-codex.en.md +12 -8
  7. package/docs/using-with-codex.md +8 -6
  8. package/lib/init.js +217 -35
  9. package/package.json +2 -2
  10. package/templates/brownfield/references/dflow-feedback-flow.md +135 -63
  11. package/templates/brownfield/references/finish-feature-flow.md +56 -21
  12. package/templates/brownfield/references/git-integration.md +65 -6
  13. package/templates/brownfield/references/init-project-flow.md +36 -19
  14. package/templates/brownfield/references/modify-existing-flow.md +4 -0
  15. package/templates/brownfield/references/new-feature-flow.md +15 -0
  16. package/templates/brownfield/references/new-phase-flow.md +15 -0
  17. package/templates/brownfield/scaffolding/Git-principles-gitflow.md +13 -12
  18. package/templates/brownfield/scaffolding/Git-principles-trunk.md +13 -16
  19. package/templates/brownfield/templates/_index.md +20 -2
  20. package/templates/greenfield/references/dflow-feedback-flow.md +135 -63
  21. package/templates/greenfield/references/finish-feature-flow.md +55 -21
  22. package/templates/greenfield/references/git-integration.md +65 -6
  23. package/templates/greenfield/references/init-project-flow.md +36 -19
  24. package/templates/greenfield/references/modify-existing-flow.md +4 -0
  25. package/templates/greenfield/references/new-feature-flow.md +15 -0
  26. package/templates/greenfield/references/new-phase-flow.md +15 -0
  27. package/templates/greenfield/scaffolding/Git-principles-gitflow.md +13 -12
  28. package/templates/greenfield/scaffolding/Git-principles-trunk.md +13 -17
  29. package/templates/greenfield/templates/_index.md +20 -2
@@ -7,9 +7,10 @@ project's Git *branching strategy* (Git Flow, GitHub Flow, trunk-based,
7
7
  etc.) — it only prescribes the feature-branch-per-feature convention
8
8
  that SDD traceability depends on.
9
9
 
10
- > If your project adopts Git Flow specifically, see the optional
11
- > optional `scaffolding/Git-principles-gitflow.md` template
12
- > for Git-Flow-specific conventions.
10
+ > Dflow does not pick `gitflow` vs `trunk` for you, but it now requires you to
11
+ > record one at `dflow init` so the runtime branch gate and finish-stage merge
12
+ > guidance can adapt. The selected policy's `Git-principles-{gitflow|trunk}.md`
13
+ > is seeded under `dflow/specs/shared/`.
13
14
 
14
15
  ## Branch-to-Workflow Mapping
15
16
 
@@ -104,6 +105,64 @@ This requirement is independent of the branching strategy — whether you
104
105
  branch off `develop`, `main`, or something else, the feature-per-branch
105
106
  convention stays.
106
107
 
108
+ ## Commit Checkpoints, Branch Gate & AI Commits
109
+
110
+ Dflow actively helps keep the Git trace aligned with the workflow — the AI
111
+ reminds, can do the work, and leaves policy to the team.
112
+
113
+ ### Branch gate
114
+
115
+ Before implementation starts (and before the first commit), the AI checks
116
+ whether the current branch is the feature / bugfix branch this work belongs to.
117
+ Both Git policies (`gitflow` / `trunk`, per `dflow/specs/shared/_conventions.md`
118
+ § Git Policy) use a feature branch, so:
119
+
120
+ - **Already on the matching `feature/{SPEC-ID}-{slug}` (or
121
+ `bugfix/{BUG-ID}-{slug}`) branch** — e.g. continuing an active feature with
122
+ `new-phase`, `modify-existing`, or `bug-fix` — the gate is satisfied; nothing
123
+ is created or switched.
124
+ - **Not on this work's feature / bugfix branch** (you are on the base branch the
125
+ project cuts features from — `main` / `develop` / `trunk`, or whatever your
126
+ policy uses — or on an unrelated branch) — the AI offers to create and switch
127
+ to the correct branch, switch to an existing matching one, or override and
128
+ stay (recorded in the feature `_index.md` Checkpoint Log; three consecutive
129
+ overrides → the AI suggests re-running `dflow init`, never changing the
130
+ setting on its own).
131
+
132
+ Dflow does not need to identify your base branch to evaluate the gate — it only
133
+ checks whether you are on the right feature branch. The base branch matters only
134
+ when a new branch is actually created, and which base to cut from is your
135
+ project's decision (GitFlow → `develop`, Trunk / GitHub Flow → `main`).
136
+
137
+ ### Commit checkpoints
138
+
139
+ At lifecycle milestones the AI offers a commit checkpoint, folded into the
140
+ existing Step Gate prompt (it does not add a separate question):
141
+
142
+ ```
143
+ ✓ {milestone} complete
144
+ Commit here?
145
+ [Y] Yes — the AI commits with your Git identity (marker per _conventions.md § AI Commit Policy)
146
+ [N] No — skip this checkpoint
147
+ ```
148
+
149
+ Tier sets how many checkpoints a change has: T1 three (spec / implementation /
150
+ closeout), T2 two (spec+implementation merged / closeout), T3 a single commit.
151
+ Whether you choose Y or N, the AI records one row in the feature `_index.md`
152
+ Checkpoint Log. A commit hash is written only after the commit succeeds; a hook
153
+ rejection or failed commit is recorded as `failed` (never a fake hash). After
154
+ several consecutive skips in a project the AI mentions you can turn checkpoints
155
+ off in config — it does not turn them off for you.
156
+
157
+ ### AI commits
158
+
159
+ The AI may commit at these checkpoints using your Git identity; you can always
160
+ decline. How AI commits are marked is the `## AI Commit Policy` setting in
161
+ `_conventions.md` (`none` / `co-authored-by` / `prefix`), chosen once at init.
162
+ This is a deliberate reversal of Dflow's earlier "the AI never commits" stance:
163
+ the AI helps at natural break points, while merge / push / PR still follow the
164
+ team's policy and your explicit go-ahead.
165
+
107
166
  ## Directory Moves Must Use `git mv`
108
167
 
109
168
  When you rename or move a directory or file that is tracked in Dflow
@@ -245,9 +304,9 @@ with the rule.
245
304
  Domain
246
305
 
247
306
  > The exact merge strategy (merge commit, squash, rebase, fast-forward)
248
- > is a project-level decision and sits outside Dflow's scope. See your
249
- > project's Git-principles document (e.g. the optional
250
- > Git-principles scaffolding) for integration commit conventions.
307
+ > follows the team's selected Git policy. See the seeded
308
+ > `Git-principles-{gitflow|trunk}.md` under `dflow/specs/shared/` for that
309
+ > policy's integration commit conventions.
251
310
 
252
311
  ## Commit Message Convention
253
312
 
@@ -128,25 +128,42 @@ blank input, or prose descriptions such as "Traditional Chinese". Dflow
128
128
  templates keep canonical English structural language; this setting controls
129
129
  free prose inside generated spec sections.
130
130
 
131
- ### Q5. Optional starter files (multi-select)
131
+ ### Q5. Git policy (mandatory — pick one)
132
132
 
133
- > "Besides the mandatory baseline, which optional starter files do
134
- > you want me to seed? You can check as many as apply:
133
+ > "Which Git policy does the team follow? This drives the runtime branch gate
134
+ > and the finish-stage merge guidance, so it is required:
135
135
  >
136
- > - [ ] `dflow/specs/shared/_overview.md` — system overview template
137
- > - [ ] Git principles — **pick one** if your project has opinions
138
- > about Git conventions (decision hint: **if you're not sure,
139
- > pick trunk-based** — that's the default for GitHub / GitLab.
140
- > Pick Git Flow only if you have a formal release cycle with
141
- > dedicated release / hotfix branches):
142
- > - [ ] `dflow/specs/shared/Git-principles-gitflow.md`
143
- > - [ ] `dflow/specs/shared/Git-principles-trunk.md`"
136
+ > 1. GitFlow — long-lived develop / release branches
137
+ > 2. Trunk / GitHub Flow — short-lived feature branches (lightest; the
138
+ > default for most GitHub / GitLab teams)"
144
139
 
145
- Wait for answers. If the developer picks both Git-principles flavours,
146
- confirm once more that they really want both (usually a project picks
147
- one).
140
+ Required — do not accept a skip. Both policies use feature branches; the choice
141
+ only changes finish-stage merge guidance. The selected policy seeds exactly one
142
+ `dflow/specs/shared/Git-principles-{gitflow|trunk}.md` (**mandatory, not
143
+ optional**) and is recorded in `_conventions.md` under `## Git Policy`.
148
144
 
149
- ### Q6. AI coding agents (multi-select)
145
+ ### Q6. AI commit marker (mandatory — default None)
146
+
147
+ > "How should AI-made commits be marked? The AI offers to commit at lifecycle
148
+ > checkpoints (you can always decline); this sets how those commits are tagged:
149
+ >
150
+ > 1. None (default) — AI commits look like any other commit
151
+ > 2. Co-Authored-By trailer (`dflow-ai <noreply@dflow.local>`) — filterable
152
+ > 3. `[ai-assisted]` commit-subject prefix — visible at a glance"
153
+
154
+ Recorded in `_conventions.md` under `## AI Commit Policy`; the runtime does not
155
+ re-ask.
156
+
157
+ ### Q7. Optional starter files (multi-select)
158
+
159
+ > "Besides the mandatory baseline, which optional starter files do you want me
160
+ > to seed?
161
+ >
162
+ > - [ ] `dflow/specs/shared/_overview.md` — system overview template"
163
+
164
+ Wait for answers.
165
+
166
+ ### Q8. AI coding agents (multi-select)
150
167
 
151
168
  > "Which AI coding agents should Dflow configure?
152
169
  >
@@ -215,7 +232,7 @@ Key Greenfield-track notes:
215
232
  moment the first bounded context is established. Creating empty
216
233
  `behavior.md` files here would create stale placeholders.
217
234
 
218
- ### 3.2 Optional files (from Step 2 Q5)
235
+ ### 3.2 Optional files (from Step 2 Q7)
219
236
 
220
237
  Use the packaged scaffolding templates listed below; their project-local
221
238
  outputs are under `dflow/specs/shared/` (the scaffolding root, not the
@@ -251,7 +268,7 @@ skip, and wait for developer confirmation:
251
268
  > | `dflow/specs/architecture/tech-debt.md` | `templates/tech-debt.md` (mandatory baseline) |
252
269
  > | `dflow/specs/architecture/decisions/README.md` | `scaffolding/architecture-decisions-README.md` (mandatory baseline) |
253
270
  > | `dflow/specs/shared/_overview.md` | optional (you picked it) |
254
- > | `dflow/specs/shared/Git-principles-trunk.md` | optional (you picked it) |
271
+ > | `dflow/specs/shared/Git-principles-trunk.md` | mandatory (selected Git policy) |
255
272
  > | `dflow/specs/shared/AI-AGENT-GUIDE.md` | selected AI agent guide |
256
273
  > | `CLAUDE.md` | selected tool shim because repo has no CLAUDE.md |
257
274
  >
@@ -274,7 +291,7 @@ skip, and wait for developer confirmation:
274
291
  **→ Step Gate: Step 3 → Step 4**
275
292
 
276
293
  Wait for explicit confirmation. If the developer asks to change the
277
- selection, go back to Step 2 Q5 or Q6 and re-run Step 3.
294
+ selection, go back to the relevant Step 2 question (Q5–Q8) and re-run Step 3.
278
295
 
279
296
  ---
280
297
 
@@ -322,7 +339,7 @@ notice:
322
339
 
323
340
  ### 4.3 Special case — AI agent instruction files
324
341
 
325
- If the developer selected any AI coding agent in Q6, create
342
+ If the developer selected any AI coding agent in Q8, create
326
343
  `dflow/specs/shared/AI-AGENT-GUIDE.md` as the canonical Dflow project
327
344
  guide.
328
345
 
@@ -265,6 +265,8 @@ If the lightweight checklist looks larger than a short-fix checklist, AI must pa
265
265
  Announce to developer:
266
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
267
 
268
+ > Branch gate (policy-aware): a feature branch is mandatory for every tier (T1 / T2 / T3) under both Git policies (`_conventions.md` § Git Policy). If you are already on this work's `feature/{SPEC-ID}-{slug}` (or `bugfix/{BUG-ID}-{slug}`) branch — e.g. the change belongs to the active feature you are already in — the gate is satisfied and nothing new is created. Otherwise (on the base branch the project cuts from, or an unrelated branch) the AI offers to create/switch to the correct branch, switch to an existing matching one, or override and record it in the `_index.md` Checkpoint Log. Dflow does not need to know which branch is your base. See `references/git-integration.md` § Commit Checkpoints, Branch Gate & AI Commits.
269
+
268
270
  Wait for confirmation before entering Step 4.
269
271
 
270
272
  ## Step 4: Implement
@@ -283,6 +285,8 @@ Even for bug fixes, verify:
283
285
  Announce to developer:
284
286
  > "Implementation appears complete. Ready to update documentation (spec, models.md, rules.md, events.md, glossary, tech-debt)? `/dflow:next` to proceed."
285
287
 
288
+ > Commit checkpoint (per `references/git-integration.md` § Commit Checkpoints, Branch Gate & AI Commits): offer to commit, then record the result in the `_index.md` Checkpoint Log. Tier sets the count — T2 commits the merged spec+implementation here (closeout is the second checkpoint); T3 is a single commit.
289
+
286
290
  Wait for confirmation before entering Step 5. This step gate is where the completion checklist is triggered — do not skip.
287
291
 
288
292
  ## Step 5: Update Documentation
@@ -278,11 +278,24 @@ The slug **must match the slug agreed in Step 3.5** (which is also the
278
278
  feature directory name). The SPEC-ID + slug links the branch to its
279
279
  feature directory and `_index.md`.
280
280
 
281
+ **Branch gate (policy-aware).** A feature branch is mandatory under both Git
282
+ policies (`gitflow` / `trunk`, per `_conventions.md` § Git Policy). The gate
283
+ checks whether you are already on this feature's `feature/{SPEC-ID}-{slug}`
284
+ branch: if so, it is satisfied. If you are not yet on it (still on the base
285
+ branch the project cuts from, or an unrelated branch), the AI offers to create
286
+ and switch to `feature/{SPEC-ID}-{slug}`, switch to an existing matching branch,
287
+ or override and stay (recorded in the `_index.md` Checkpoint Log; three
288
+ consecutive overrides → the AI suggests re-running `dflow init`). Dflow does not
289
+ need to know which branch is your base. See `references/git-integration.md`
290
+ § Commit Checkpoints, Branch Gate & AI Commits.
291
+
281
292
  **→ Step Gate: Step 6 → Step 7**
282
293
 
283
294
  Announce to developer:
284
295
  > "Branch `feature/{SPEC-ID}-{description}` is created. Ready to start layer-by-layer implementation (Domain first)? `/dflow:next` to proceed, or discuss layer order / scope first."
285
296
 
297
+ > Commit checkpoint (T1 milestone 1 of 3 — see `references/git-integration.md` § Commit Checkpoints, Branch Gate & AI Commits): now that the feature branch exists (the branch gate above ran first, so this commit lands on the feature branch — never on a base branch), offer to commit the spec baseline, then record the result (committed / skipped) in the `_index.md` Checkpoint Log. Milestone 2 = implementation (Step 7→8); milestone 3 = closeout (`/dflow:finish-feature`).
298
+
286
299
  Wait for confirmation before entering Step 7.
287
300
 
288
301
  ## Step 7: Implementation Checklist
@@ -318,6 +331,8 @@ During implementation, continuously verify:
318
331
  Announce to developer:
319
332
  > "Implementation appears complete across all four layers. Ready to run the completion checklist (verify against spec, update domain docs + context-map, ensure test coverage, archive the spec)? `/dflow:next` to proceed."
320
333
 
334
+ > Commit checkpoint (T1 milestone 2 of 3): offer to commit the implementation, then record the result in the `_index.md` Checkpoint Log. Milestone 3 (closeout) is the `/dflow:finish-feature` checkpoint.
335
+
321
336
  Wait for confirmation before entering Step 8. This step gate is where the completion checklist is triggered — do not skip.
322
337
 
323
338
  ## Step 8: Completion
@@ -67,6 +67,17 @@ AI must locate the target feature and load its current state:
67
67
  and `behavior.md` if the new phase is likely to touch system-level
68
68
  state (BC-level current state lives there, not in `_index.md`)
69
69
 
70
+ 4. **Branch gate — ensure you are on this feature's branch (before any commit)**
71
+
72
+ This phase's commits must land on the active feature's
73
+ `feature/{SPEC-ID}-{slug}` branch. If you are not already on it (you
74
+ identified the feature by name, or are on a base / unrelated branch),
75
+ switch to the existing branch — or override and record it in the
76
+ `_index.md` Checkpoint Log. **Never create a new feature branch here:**
77
+ `new-phase` extends an existing active feature, it does not start one. See
78
+ `references/git-integration.md` § Commit Checkpoints, Branch Gate & AI
79
+ Commits.
80
+
70
81
  Share what you found:
71
82
 
72
83
  > "OK — `{SPEC-ID}-{slug}` has {N} prior phases in BC `{context}`. The
@@ -167,6 +178,8 @@ Announce to developer:
167
178
  > Ready to refresh `_index.md` (add Phase Specs row, regenerate Current BR
168
179
  > Snapshot from the Delta)? `/dflow:next` to proceed."
169
180
 
181
+ > Commit checkpoint (per `references/git-integration.md` § Commit Checkpoints, Branch Gate & AI Commits): with the Step 1 branch gate satisfied (you are on the feature's branch), offer to commit the phase-spec baseline and record the result in the `_index.md` Checkpoint Log.
182
+
170
183
  Wait for confirmation before entering Step 5.
171
184
 
172
185
  ## Step 5: Refresh `_index.md`
@@ -240,6 +253,8 @@ Announce to developer:
240
253
  > Ready to mark this phase completed and update `_index.md`? `/dflow:next`
241
254
  > to proceed."
242
255
 
256
+ > Commit checkpoint (per `references/git-integration.md` § Commit Checkpoints, Branch Gate & AI Commits): offer to commit the phase implementation, then record the result in the `_index.md` Checkpoint Log.
257
+
243
258
  Wait for confirmation before entering Step 7.
244
259
 
245
260
  ## Step 7: Complete the Phase
@@ -125,8 +125,6 @@ Commits must tie back to a SPEC-ID:
125
125
  [{SPEC-ID}] {short description}
126
126
 
127
127
  {optional detailed body}
128
-
129
- Co-Authored-By: Claude <noreply@anthropic.com> ← suggested, not mandatory
130
128
  ```
131
129
 
132
130
  ### Type prefix (recommended)
@@ -309,19 +307,22 @@ Three categories:
309
307
  | `git stash` (local-only) |
310
308
  | `git branch` (listing only) |
311
309
 
312
- ### AI commit authorship (suggested, not enforced)
310
+ ### AI commit authorship
313
311
 
314
- When an AI assists in producing a commit, appending a `Co-Authored-By`
315
- line is **suggested** but not mandatory. The canonical form for
316
- Claude is:
312
+ How AI-made commits are marked is chosen once at `dflow init` and recorded in
313
+ `dflow/specs/shared/_conventions.md` § AI Commit Policy:
317
314
 
318
- ```
319
- Co-Authored-By: Claude <noreply@anthropic.com>
320
- ```
315
+ - `none` — AI commits carry no extra marker.
316
+ - `co-authored-by` — a `Co-Authored-By: dflow-ai <noreply@dflow.local>` trailer
317
+ (teams may customize the name / email).
318
+ - `prefix` — an `[ai-assisted]` commit-subject prefix.
321
319
 
322
- For other AI assistants, use the vendor-documented author line (or omit
323
- it). This is a project-level transparency convention, not a Dflow
324
- requirement.
320
+ This recorded setting is authoritative and the runtime does not re-ask. The AI
321
+ offers commits at lifecycle checkpoints (see `references/git-integration.md`
322
+ § Commit Checkpoints, Branch Gate & AI Commits) using your Git identity, and you
323
+ can always decline. If your team also wants vendor attribution, appending the
324
+ assistant's documented line (e.g. `Co-Authored-By: Claude
325
+ <noreply@anthropic.com>`) is an independent, optional convention on top.
325
326
 
326
327
  ---
327
328
 
@@ -77,8 +77,6 @@ recommended but not strictly required:
77
77
  {type}({scope}): {short description}
78
78
 
79
79
  [{SPEC-ID}] {longer description, optional}
80
-
81
- Co-Authored-By: Claude <noreply@anthropic.com> ← suggested, not mandatory
82
80
  ```
83
81
 
84
82
  ### Type prefix (Conventional Commits)
@@ -106,8 +104,6 @@ feat(expense): add ExpenseReport submission invariants
106
104
  [SPEC-20260421-001] Introduce ExpenseReport Aggregate with submission
107
105
  state machine; enforces non-negative Amounts and requires at least one
108
106
  ExpenseItem before submission.
109
-
110
- Co-Authored-By: Claude <noreply@anthropic.com>
111
107
  ```
112
108
 
113
109
  ---
@@ -183,7 +179,6 @@ Related BR-IDs:
183
179
  Domain Events introduced / modified: {Event names, or "(none)"}
184
180
 
185
181
  Related SPEC-IDs: {SPEC-ID}{, follow-up SPEC-IDs if any}
186
- Co-Authored-By: Claude <noreply@anthropic.com>
187
182
  ```
188
183
 
189
184
  GitHub PR editor can be pre-filled with this body; the merge button
@@ -210,8 +205,6 @@ feat({scope}): {Phase N title} — closes {SPEC-ID}
210
205
  Change Scope: ... (as in §4.1)
211
206
  Related BR-IDs: ...
212
207
  Domain Events: ...
213
-
214
- Co-Authored-By: Claude <noreply@anthropic.com>
215
208
  ```
216
209
 
217
210
  ### 4.3 Fast-forward (feature has 1 commit total)
@@ -288,19 +281,22 @@ Three categories:
288
281
  | `git branch` (listing only) |
289
282
  | `gh pr status` / `gh pr view` |
290
283
 
291
- ### AI commit authorship (suggested, not enforced)
284
+ ### AI commit authorship
292
285
 
293
- When an AI assists in producing a commit, appending a `Co-Authored-By`
294
- line is **suggested** but not mandatory. The canonical form for
295
- Claude is:
286
+ How AI-made commits are marked is chosen once at `dflow init` and recorded in
287
+ `dflow/specs/shared/_conventions.md` § AI Commit Policy:
296
288
 
297
- ```
298
- Co-Authored-By: Claude <noreply@anthropic.com>
299
- ```
289
+ - `none` — AI commits carry no extra marker.
290
+ - `co-authored-by` — a `Co-Authored-By: dflow-ai <noreply@dflow.local>` trailer
291
+ (teams may customize the name / email).
292
+ - `prefix` — an `[ai-assisted]` commit-subject prefix.
300
293
 
301
- For other AI assistants, use the vendor-documented author line (or omit
302
- it). This is a project-level transparency convention, not a Dflow
303
- requirement.
294
+ This recorded setting is authoritative and the runtime does not re-ask. The AI
295
+ offers commits at lifecycle checkpoints (see `references/git-integration.md`
296
+ § Commit Checkpoints, Branch Gate & AI Commits) using your Git identity, and you
297
+ can always decline. If your team also wants vendor attribution, appending the
298
+ assistant's documented line (e.g. `Co-Authored-By: Claude
299
+ <noreply@anthropic.com>`) is an independent, optional convention on top.
304
300
 
305
301
  ---
306
302
 
@@ -12,13 +12,14 @@ Template note (for AI):
12
12
  This is the **feature-level dashboard** (`_index.md`) for a feature
13
13
  directory. Place at `dflow/specs/features/active/{SPEC-ID}-{slug}/_index.md`.
14
14
 
15
- Six required sections (see below):
15
+ Seven required sections (see below):
16
16
  1. Metadata (YAML front matter above)
17
17
  2. Goals & Scope (prose)
18
18
  3. Phase Specs (T1 list)
19
19
  4. Current BR Snapshot (feature-level cumulative state)
20
20
  5. Lightweight Changes (T2 outbound link + T3 inline)
21
- 6. Resume Pointer
21
+ 6. Checkpoint Log (commit / skip timeline)
22
+ 7. Resume Pointer
22
23
 
23
24
  Optional section (append at end if applicable):
24
25
  - Follow-up Tracking (when this feature has follow-up features derived)
@@ -95,6 +96,23 @@ Template note (for AI):
95
96
  | {YYYY-MM-DD} | T2 | bug fix XYZ — 見 [`lightweight-{date}-{slug}.md`](./lightweight-{date}-{slug}.md) | {hash} |
96
97
  | {YYYY-MM-DD} | T3 | 按鈕顏色從藍改綠 `[cosmetic]` | {hash} |
97
98
 
99
+ <!-- dflow:section checkpoint-log -->
100
+ ## Checkpoint Log
101
+
102
+ > 生命週期 checkpoint 的 commit / skip 時間線(讓三週後回溯不必手動重建)。
103
+ > 每個 checkpoint 無論 commit 或 skip 都記一列。Tier 決定 checkpoint 數:
104
+ > T1 三點(spec 完 / impl 完 / closeout)、T2 兩點(spec+impl 合併 / closeout)、
105
+ > T3 單一 commit。
106
+ >
107
+ > commit hash 只在 commit 實際成功後填入;pre-commit hook reject 或 commit
108
+ > 失敗記 `failed`、不寫假 hash。
109
+
110
+ | Timestamp | Checkpoint | Result |
111
+ |---|---|---|
112
+ | {YYYY-MM-DD HH:MM} | spec-baseline | committed ({hash}) / skipped / failed |
113
+ | {YYYY-MM-DD HH:MM} | implementation | committed ({hash}) / skipped / failed |
114
+ | {YYYY-MM-DD HH:MM} | closeout | committed ({hash}) / skipped / failed |
115
+
98
116
  ## Resume Pointer
99
117
 
100
118
  > 一句話:目前進展到哪?下一個動作是什麼?