dflow-sdd-ddd 0.11.0 → 0.13.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 (55) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.en.md +83 -17
  3. package/README.md +39 -9
  4. package/TEMPLATE-COVERAGE.md +1 -0
  5. package/bin/dflow.js +58 -2
  6. package/docs/evaluating-dflow.en.md +21 -2
  7. package/docs/evaluating-dflow.md +17 -3
  8. package/docs/using-with-claude-code.en.md +23 -16
  9. package/docs/using-with-claude-code.md +20 -14
  10. package/docs/using-with-codex.en.md +15 -8
  11. package/docs/using-with-codex.md +10 -7
  12. package/docs/using-with-github-copilot.en.md +8 -3
  13. package/docs/using-with-github-copilot.md +6 -3
  14. package/lib/init.js +93 -8
  15. package/lib/render.js +1263 -0
  16. package/package.json +5 -2
  17. package/templates/brownfield/references/finish-feature-flow.md +85 -29
  18. package/templates/brownfield/references/git-integration.md +29 -9
  19. package/templates/brownfield/references/init-project-flow.md +43 -1
  20. package/templates/brownfield/references/modify-existing-flow.md +23 -0
  21. package/templates/brownfield/references/new-feature-flow.md +34 -1
  22. package/templates/brownfield/references/new-phase-flow.md +12 -1
  23. package/templates/brownfield/scaffolding/AI-AGENT-GUIDE.md +45 -5
  24. package/templates/brownfield/scaffolding/Git-principles-gitflow.md +1 -1
  25. package/templates/brownfield/scaffolding/Git-principles-trunk.md +2 -2
  26. package/templates/brownfield/templates/_index.md +25 -4
  27. package/templates/brownfield/templates/context-definition.md +2 -0
  28. package/templates/brownfield/templates/context-map.md +1 -0
  29. package/templates/brownfield/templates/glossary.md +1 -0
  30. package/templates/brownfield/templates/lightweight-spec.md +3 -3
  31. package/templates/brownfield/templates/models.md +1 -0
  32. package/templates/brownfield/templates/phase-spec.md +5 -3
  33. package/templates/brownfield/templates/rules.md +1 -0
  34. package/templates/brownfield/templates/tech-debt.md +1 -0
  35. package/templates/common/references/ddd-modeling-guide.md +197 -3
  36. package/templates/greenfield/references/finish-feature-flow.md +86 -29
  37. package/templates/greenfield/references/git-integration.md +29 -9
  38. package/templates/greenfield/references/init-project-flow.md +43 -1
  39. package/templates/greenfield/references/modify-existing-flow.md +23 -0
  40. package/templates/greenfield/references/new-feature-flow.md +35 -1
  41. package/templates/greenfield/references/new-phase-flow.md +11 -0
  42. package/templates/greenfield/scaffolding/AI-AGENT-GUIDE.md +45 -5
  43. package/templates/greenfield/scaffolding/Git-principles-gitflow.md +1 -1
  44. package/templates/greenfield/scaffolding/Git-principles-trunk.md +4 -2
  45. package/templates/greenfield/templates/_index.md +25 -4
  46. package/templates/greenfield/templates/aggregate-design.md +4 -1
  47. package/templates/greenfield/templates/context-definition.md +2 -0
  48. package/templates/greenfield/templates/context-map.md +1 -0
  49. package/templates/greenfield/templates/events.md +3 -1
  50. package/templates/greenfield/templates/glossary.md +1 -0
  51. package/templates/greenfield/templates/lightweight-spec.md +3 -3
  52. package/templates/greenfield/templates/models.md +1 -0
  53. package/templates/greenfield/templates/phase-spec.md +5 -3
  54. package/templates/greenfield/templates/rules.md +1 -0
  55. package/templates/greenfield/templates/tech-debt.md +1 -0
@@ -10,6 +10,8 @@ Triggered by `/dflow:new-feature` (or natural language implying a new-feature ta
10
10
  - Step 6 → Step 7 (branch ready → start implementation)
11
11
  - Step 7 → Step 8 (implementation done → completion)
12
12
 
13
+ Crossing any step gate above also updates the host feature's `_index.md` Resume Pointer cursor (Active Workflow / Current Step / Gates Passed / Awaiting) once the feature directory exists — fold it into that gate's existing `_index.md` / Resume Pointer edit, no separate ceremony (see the `_index.md` template's Resume Pointer notes).
14
+
13
15
  All other step transitions are **step-internal**: announce "Step N complete, entering Step N+1" and proceed without waiting. See AI-AGENT-GUIDE.md § Workflow Transparency for the full transparency protocol and confirmation signals.
14
16
 
15
17
  **Ceremony**: this flow always defaults to **T1 Heavy** — the first phase of a brand-new feature is by definition a full SDD cycle. Tier judgement (T1 / T2 / T3) only applies to `/dflow:modify-existing` (see `references/modify-existing-flow.md` and AI-AGENT-GUIDE.md § Ceremony Scaling).
@@ -31,6 +33,27 @@ Check existing assets:
31
33
  - Search `dflow/specs/features/` for related features
32
34
  - Check `dflow/specs/domain/glossary.md` and `context-map.md`
33
35
 
36
+ **In-flight overlap scan (cross-branch + other unfinished features)** — this
37
+ branch's `dflow/specs/` does not show everything in flight. Run the in-flight
38
+ scan (classification and dedup rules in `AI-AGENT-GUIDE.md` § Status / Control
39
+ Commands):
40
+
41
+ ```bash
42
+ git fetch # when the network allows; skip gracefully offline
43
+ git branch --all --list '*feature/*' --list '*bugfix/*'
44
+ ```
45
+
46
+ - List other unfinished features already in this branch's `active/` (one
47
+ cursor line each, from their `_index.md` Resume Pointer).
48
+ - Classify every listed branch by the guide's rules — in flight elsewhere /
49
+ closed out awaiting integration / stale (completed here) / unknown — do
50
+ not shortcut the classification. If a branch classified as **in flight
51
+ elsewhere, closed out awaiting integration, or unknown** has an ID / slug
52
+ that semantically overlaps this request, surface it and wait for the
53
+ developer to decide — continue there / integrate it first / treat as
54
+ related / unrelated — **before creating any new directory, spec, or
55
+ branch**. Only stale (completed here) branches are non-blocking.
56
+
34
57
  **→ Transition (step-internal)**: Step 1 complete. Announce "Step 1 complete (intake). Entering Step 2: Identify the Bounded Context." and continue.
35
58
 
36
59
  ## Step 2: Identify the Bounded Context
@@ -96,6 +119,17 @@ Those things form an Aggregate. Everything else is eventually consistent."
96
119
  - What entities belong inside this Aggregate?
97
120
  - What Value Objects can we extract?
98
121
 
122
+ **Established-model re-read (when the feature reuses an existing
123
+ Aggregate).** Re-read that Aggregate's recorded Design Decisions — its
124
+ `aggregate-design.md` worksheet in the feature directory that introduced it
125
+ (usually under `features/completed/`) — before extending it. If this change
126
+ matches a recorded re-evaluation condition ("revisit when …") or trips a
127
+ model-resistance signal, follow `references/ddd-modeling-guide.md`
128
+ § "Revising an Established Model": record one short passage in the
129
+ phase-spec's Design Decisions / Open Questions — proceed as-is, split, or
130
+ rename, with the reason. Deciding to keep the current model, recorded, is a
131
+ valid outcome; extending silently is not.
132
+
99
133
  ### Domain Events
100
134
  ```
101
135
  "After this happens, what else in the system needs to know?"
@@ -192,7 +226,7 @@ dflow/specs/features/active/{SPEC-ID}-{slug}/
192
226
  - Current BR Snapshot: initialise from the first phase's planned BRs
193
227
  (will be refreshed when the phase-spec finalises)
194
228
  - Lightweight Changes: empty table at start
195
- - Resume Pointer: "phase-1 in progress: drafting phase-spec." / "Next Action: finish phase-spec, then implement Domain layer."
229
+ - Resume Pointer: "phase-1 in progress: drafting phase-spec." / "Next Action: finish phase-spec, then implement Domain layer." / cursor fields: Active Workflow `new-feature`, Current Step `Step 4 — write the spec`, Gates Passed `3→3.5`, Awaiting `none (mid-step)`
196
230
  3. **Create the first phase-spec** at `phase-spec-{YYYY-MM-DD}-{slug}.md`
197
231
  using `templates/phase-spec.md`. The "Delta from prior phases" section
198
232
  is filled with "首 phase,無前置 Delta" (first phase has nothing to
@@ -19,6 +19,8 @@ adds a new phase to an in-progress feature only.
19
19
  - Step 5 → Step 6 (`_index.md` refreshed → start implementation)
20
20
  - Step 6 → Step 7 (implementation done → complete the phase)
21
21
 
22
+ Crossing any step gate above also updates the feature's `_index.md` Resume Pointer cursor (Active Workflow / Current Step / Gates Passed / Awaiting) — fold it into that gate's existing `_index.md` / Resume Pointer edit, no separate ceremony (see the `_index.md` template's Resume Pointer notes).
23
+
22
24
  All other step transitions are **step-internal**: announce "Step N complete,
23
25
  entering Step N+1" and proceed without waiting. See AI-AGENT-GUIDE.md § Workflow
24
26
  Transparency for the full transparency protocol and confirmation signals.
@@ -66,6 +68,11 @@ AI must locate the target feature and load its current state:
66
68
  - Cross-reference the bounded context's `dflow/specs/domain/{context}/rules.md`
67
69
  and `behavior.md` if the new phase is likely to touch system-level
68
70
  state (BC-level current state lives there, not in `_index.md`)
71
+ - Run the in-flight overlap scan (classification and dedup rules in
72
+ `AI-AGENT-GUIDE.md` § Status / Control Commands): list other unfinished
73
+ features in `active/` and any feature / bugfix branches whose work is
74
+ not visible on this branch — if the incoming phase scope overlaps one
75
+ of them, surface it before writing the phase-spec.
69
76
 
70
77
  4. **Branch gate — ensure you are on this feature's branch (before any commit)**
71
78
 
@@ -99,6 +106,10 @@ Walk the developer through what the new phase covers:
99
106
  at the depth set by the BC's Subdomain Type (see
100
107
  `references/ddd-modeling-guide.md` § Subdomain-Aware Modeling Depth) — don't
101
108
  bypass the classification just because this is a phase, not a new feature.
109
+ If the phase **extends an existing Aggregate**, apply the established-model
110
+ re-read from `references/ddd-modeling-guide.md` § "Revising an Established
111
+ Model" (match recorded re-evaluation conditions; record proceed / split /
112
+ rename in the phase-spec).
102
113
  4. **Cross-context impact?** Does this phase introduce / change Domain
103
114
  Events that other contexts consume? (If yes, plan for `context-map.md`
104
115
  updates at finish-feature time.)
@@ -64,6 +64,11 @@ input like this (supporting files live in the workflow bundle at
64
64
  - **"Quick question about..." / "How does X work?"** → check
65
65
  `dflow/specs/domain/` first and answer from the documented domain knowledge.
66
66
  - **"I'm creating a branch"** → read `references/git-integration.md`.
67
+ - **"Turn the specs into HTML" / "make the specs easier to read"** → run the
68
+ CLI command `dflow render` (a human-readability tool, not a `/dflow:*`
69
+ workflow). It mirrors `dflow/specs/` into a browsable static HTML tree
70
+ (default output: `dflow-specs-html/`); re-run it after specs change —
71
+ Markdown stays the AI-facing source of truth.
67
72
  - **"Dflow seems wrong" / "this template is confusing"** (or you notice Dflow
68
73
  guidance drift) → suggest `/dflow:report-dflow-feedback`; never submit
69
74
  anything upstream automatically.
@@ -74,10 +79,43 @@ input like this (supporting files live in the workflow bundle at
74
79
 
75
80
  ## Status / Control Commands
76
81
 
77
- `/dflow:status` reports active workflow state. Include these fields: workflow,
78
- step, completed, in-progress, remaining, pending decision, and next valid action.
79
- If no workflow is active, say that no workflow is active and list valid flow-entry
80
- or standalone commands.
82
+ `/dflow:status` reports in two parts.
83
+
84
+ **Part 1 — in-flight overview (always shown, workflow active or not).**
85
+ Aggregate every in-flight feature so unfinished work surfaces without anyone
86
+ remembering to look:
87
+
88
+ - Scan this branch's `dflow/specs/features/active/*/_index.md` and print one
89
+ line per feature: SPEC-ID / Active Workflow / Current Step / Awaiting / last
90
+ Checkpoint Log row (read from each Resume Pointer cursor).
91
+ - Cross-branch: run `git fetch` when the network allows (skip gracefully
92
+ offline), then `git branch --all --list '*feature/*' --list '*bugfix/*'`,
93
+ deduplicating local and remote refs of the same branch (prefer local). For
94
+ each branch, classify in order: (1) its feature directory exists in this
95
+ branch's `active/` → already covered above; (2) exists in this branch's
96
+ `completed/` → a stale undeleted branch — list as "completed; branch can be
97
+ deleted", **not** in-flight; (3)
98
+ `git show {branch}:dflow/specs/features/active/{dir}/_index.md` is readable
99
+ → in flight on that branch, print its cursor line (no branch switching);
100
+ (4) the `completed/` path is readable on that branch → closed out there,
101
+ awaiting integration; (5) nothing readable → list the branch as unknown
102
+ state.
103
+ - If `features/backlog/` is non-empty, append one count line.
104
+ - Inherent limit: work never committed anywhere is invisible to any git scan.
105
+
106
+ **Part 2 — current feature detail (when a workflow is active).** Read the
107
+ Resume Pointer cursor as the **declared** state, then cross-check it against
108
+ derived evidence (Checkpoint Log, phase-spec statuses, recent git log). On
109
+ mismatch, report both sides explicitly and ask the developer to correct the
110
+ cursor — the cursor is a claim; evidence wins. If the cursor fields are absent
111
+ (an older `_index.md`), fall back to pure derivation. For readability you may
112
+ expand the cursor into a step checklist (done / in progress / not started)
113
+ derived live from the flow file — display only, never stored.
114
+
115
+ Include these fields: workflow, step, completed, in-progress, remaining,
116
+ pending decision, and next valid action. If no workflow is active, say so and
117
+ list valid flow-entry or standalone commands (Part 1 still shows the
118
+ in-flight overview).
81
119
 
82
120
  `/dflow:next` is valid only at a step gate in an active workflow. Treat it as
83
121
  developer confirmation equivalent to "OK" or "continue", then move to the next
@@ -85,7 +123,9 @@ workflow step.
85
123
 
86
124
  `/dflow:cancel` aborts the current workflow and returns to free conversation.
87
125
  Do not rollback changes, delete artifacts, or rewrite specs merely because the
88
- workflow was cancelled.
126
+ workflow was cancelled. If the feature directory exists, set the Resume
127
+ Pointer cursor's Active Workflow to `none` (keep Current Progress as a trace
128
+ of where the cancellation happened).
89
129
 
90
130
  When no workflow is active, `/dflow:next` and `/dflow:cancel` must report that
91
131
  there is no active workflow to advance or cancel.
@@ -141,7 +141,7 @@ When applicable, prefix with a type (conventional commits-style):
141
141
  | test | tests only |
142
142
  | chore | build / tooling |
143
143
 
144
- Example: `[EXP-001] feat: introduce ExpenseReport Aggregate with submission invariants`
144
+ Example: `[SPEC-20260424-002] feat: introduce ExpenseReport Aggregate with submission invariants`
145
145
 
146
146
  ---
147
147
 
@@ -305,8 +305,10 @@ assistant's documented line (e.g. `Co-Authored-By: Claude
305
305
  There is no separate `hotfix/*` branch. A hotfix is:
306
306
 
307
307
  1. A (small) feature branch cut from `main`
308
- 2. Named `feature/{SPEC-ID}-{slug}` where SPEC-ID is a lightweight spec
309
- or a full-ceremony spec depending on severity
308
+ 2. Named by the normal Dflow branch scheme, chosen by severity: a
309
+ bug-type hotfix (T2 lightweight) uses `bugfix/{BUG-ID}-{slug}`; a
310
+ hotfix that warrants full ceremony uses `feature/{SPEC-ID}-{slug}`
311
+ (see `references/git-integration.md` § Branch Naming Convention)
310
312
  3. Merged back to `main` via the team's chosen merge strategy
311
313
  4. Deployed via the same pipeline as any other change
312
314
 
@@ -46,6 +46,8 @@ Template note (for AI):
46
46
  initial BR Snapshot + Resume Pointer. The other sections can stay empty.
47
47
  -->
48
48
 
49
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
50
+
49
51
  # {Feature Title}
50
52
 
51
53
  ## Goals & Scope
@@ -105,23 +107,42 @@ Template note (for AI):
105
107
  > T3 單一 commit。
106
108
  >
107
109
  > commit hash 只在 commit 實際成功後填入;pre-commit hook reject 或 commit
108
- > 失敗記 `failed`、不寫假 hash。
110
+ > 失敗記 `failed`、不寫假 hash。**例外:closeout 列不填 hash**——closeout
111
+ > commit 無法自含自身 hash,該列於 commit 前寫入、隨歸檔目錄一起進 commit;
112
+ > 溯源用 `git log -1 -- completed/{SPEC-ID}-{slug}` 或選配的
113
+ > `Dflow-Checkpoint` trailer(見 references/git-integration.md)。
109
114
 
110
115
  | Timestamp | Checkpoint | Result |
111
116
  |---|---|---|
112
117
  | {YYYY-MM-DD HH:MM} | spec-baseline | committed ({hash}) / skipped / failed |
113
118
  | {YYYY-MM-DD HH:MM} | implementation | committed ({hash}) / skipped / failed |
114
- | {YYYY-MM-DD HH:MM} | closeout | committed ({hash}) / skipped / failed |
119
+ | {YYYY-MM-DD HH:MM} | closeout | committed / skipped / failed |
115
120
 
116
121
  ## Resume Pointer
117
122
 
118
- > 一句話:目前進展到哪?下一個動作是什麼?
119
- > 開新對話接續工作時,從這裡讀起。
123
+ > 目前進展到哪?下一個動作是什麼?開新對話接續工作時,從這裡讀起。
124
+ >
125
+ > 下方四個 cursor 欄位是 workflow 進度的**存放層(宣告,claim)**:
126
+ > 進入 flow 時設 Active Workflow;**每過一個 step gate** 更新 Current Step /
127
+ > Gates Passed / Awaiting(與該 gate 既有的 `_index.md` 更新合併,不另加儀式);
128
+ > closeout / `/dflow:cancel` 時 Active Workflow 設回 `none`。
129
+ > `/dflow:status` 讀 cursor 後會與推導證據(Checkpoint Log、phase-spec
130
+ > status、git log)交叉,不一致會明確報 mismatch——cursor 是宣告、證據優先。
131
+ > Phase 粒度進度由上方 Phase Specs 表承載;cursor 只補 workflow step / gate
132
+ > 粒度,不展開成 per-step 全表(步驟線性,游標可推導每一步的完成/未做)。
120
133
 
121
134
  **Current Progress**: {one-line summary}
122
135
 
123
136
  **Next Action**: {suggested next action}
124
137
 
138
+ **Active Workflow**: {new-feature | modify-existing | bug-fix | new-phase | finish-feature | none}
139
+
140
+ **Current Step**: {Step N — short step name | n/a}
141
+
142
+ **Gates Passed**: {e.g. "3→3.5, 4→5" | n/a}
143
+
144
+ **Awaiting**: {step-gate description | none}
145
+
125
146
  <!--
126
147
  ## Follow-up Tracking
127
148
  >(選用段;只有當本 feature 衍生出 follow-up feature 時才填)
@@ -4,6 +4,8 @@ bounded-context: {ContextName}
4
4
  created: {YYYY-MM-DD}
5
5
  ---
6
6
 
7
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
8
+
7
9
  # {AggregateName} Aggregate
8
10
 
9
11
  ## Purpose
@@ -61,4 +63,5 @@ created: {YYYY-MM-DD}
61
63
 
62
64
  ## Design Decisions
63
65
 
64
- > 為什麼 Aggregate 的邊界劃在這裡?有沒有考慮過其他方案?
66
+ > 為什麼 Aggregate 的邊界劃在這裡?有沒有考慮過其他方案?每個決策附
67
+ > **再評估條件**:什麼情況出現時,這個決策應該被重看?(「revisit when …」)
@@ -5,6 +5,8 @@ owner: {負責的開發者或團隊}
5
5
  created: {YYYY-MM-DD}
6
6
  ---
7
7
 
8
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
9
+
8
10
  # {ContextName} Bounded Context
9
11
 
10
12
  ## Responsibilities
@@ -1,4 +1,5 @@
1
1
  <!-- Seeded by Dflow. -->
2
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
2
3
 
3
4
  # Context Map
4
5
 
@@ -1,4 +1,5 @@
1
1
  <!-- Seeded by Dflow. -->
2
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
2
3
 
3
4
  # Domain Events
4
5
 
@@ -15,7 +16,8 @@
15
16
  - {事件發生時序、交易邊界、重試或一致性注意事項;跨 aggregate 的 async(eventual
16
17
  consistency)event chain,handler 重試耗盡的最終失敗若造成 business-visible 後果
17
18
  (補償/權益/金流/庫存/合規/人工對帳)→ 升級為 BR/EC 寫進 behavior.md 與 spec,
18
- best-effort 副作用(通知/logging)記這裡或 tech-debt 即可}
19
+ best-effort 副作用(通知/logging)記這裡或 tech-debt 即可;多步驟且失敗需補償
20
+ → 見 ddd-modeling-guide 的 Long-Running Processes 段(process 判準與階梯)}
19
21
 
20
22
  ## Open Questions
21
23
 
@@ -1,4 +1,5 @@
1
1
  <!-- Seeded by Dflow. -->
2
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
2
3
 
3
4
  # Glossary
4
5
 
@@ -1,10 +1,10 @@
1
1
  ---
2
- id: BUG-{NUMBER}
2
+ id: BUG-{NUMBER} # bug-type T2 only; a non-bug T2 (lightweight-{date}-{slug}.md) carries no id — the filename identifies it
3
3
  title: {簡述問題}
4
- status: in-progress
4
+ status: in-progress # in-progress | completed
5
5
  bounded-context: {ContextName}
6
6
  created: {YYYY-MM-DD}
7
- branch: bugfix/BUG-{NUMBER}-{short-description}
7
+ branch: bugfix/BUG-{NUMBER}-{slug}
8
8
  ---
9
9
 
10
10
  <!--
@@ -1,4 +1,5 @@
1
1
  <!-- Seeded by Dflow. -->
2
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
2
3
 
3
4
  # Domain Models
4
5
 
@@ -1,13 +1,15 @@
1
1
  ---
2
- id: {CONTEXT}-{NUMBER}
2
+ spec-id: SPEC-{YYYYMMDD}-{NNN} # the owning feature's SPEC-ID (matches the feature directory name)
3
3
  title: 功能標題
4
- status: draft | in-progress | completed
4
+ status: in-progress # in-progress | completed
5
5
  bounded-context: {ContextName}
6
6
  created: {YYYY-MM-DD}
7
7
  author: {developer-name}
8
- branch: feature/{CONTEXT}-{NUMBER}-{short-description}
8
+ branch: feature/{SPEC-ID}-{slug}
9
9
  ---
10
10
 
11
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
12
+
11
13
  # {功能標題}
12
14
 
13
15
  <!--
@@ -1,4 +1,5 @@
1
1
  <!-- Seeded by Dflow. -->
2
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
2
3
 
3
4
  # Business Rules
4
5
 
@@ -1,4 +1,5 @@
1
1
  <!-- Seeded by Dflow. -->
2
+ <!-- Formatting convention: keep table cells concise. When one cell holds multiple short items (invariants, rules, steps), separate them with <br> so each renders on its own line - never chain them into one line with ;/; separators. Long narrative detail does not belong in a table cell: keep the cell to a concise summary and put extended detail in an existing section of this document when one fits, or give each item its own row. -->
2
3
 
3
4
  # Architecture Tech Debt
4
5