dflow-sdd-ddd 0.1.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/LICENSE +21 -0
- package/README.md +209 -0
- package/bin/dflow.js +72 -0
- package/lib/init.js +1206 -0
- package/package.json +42 -0
- package/templates/core/scaffolding/CLAUDE-md-snippet.md +168 -0
- package/templates/core/scaffolding/Git-principles-gitflow.md +350 -0
- package/templates/core/scaffolding/Git-principles-trunk.md +375 -0
- package/templates/core/scaffolding/_conventions.md +175 -0
- package/templates/core/scaffolding/_overview.md +165 -0
- package/templates/core/scaffolding/architecture-decisions-README.md +34 -0
- package/templates/core/templates/CLAUDE.md +172 -0
- package/templates/core/templates/_index.md +118 -0
- package/templates/core/templates/aggregate-design.md +58 -0
- package/templates/core/templates/behavior.md +62 -0
- package/templates/core/templates/context-definition.md +64 -0
- package/templates/core/templates/context-map.md +25 -0
- package/templates/core/templates/events.md +19 -0
- package/templates/core/templates/glossary.md +15 -0
- package/templates/core/templates/lightweight-spec.md +82 -0
- package/templates/core/templates/models.md +47 -0
- package/templates/core/templates/phase-spec.md +195 -0
- package/templates/core/templates/rules.md +24 -0
- package/templates/core/templates/tech-debt.md +15 -0
- package/templates/webforms/scaffolding/CLAUDE-md-snippet.md +167 -0
- package/templates/webforms/scaffolding/Git-principles-gitflow.md +333 -0
- package/templates/webforms/scaffolding/Git-principles-trunk.md +316 -0
- package/templates/webforms/scaffolding/_conventions.md +139 -0
- package/templates/webforms/scaffolding/_overview.md +109 -0
- package/templates/webforms/templates/CLAUDE.md +157 -0
- package/templates/webforms/templates/_index.md +110 -0
- package/templates/webforms/templates/behavior.md +58 -0
- package/templates/webforms/templates/context-definition.md +57 -0
- package/templates/webforms/templates/context-map.md +25 -0
- package/templates/webforms/templates/glossary.md +15 -0
- package/templates/webforms/templates/lightweight-spec.md +82 -0
- package/templates/webforms/templates/models.md +39 -0
- package/templates/webforms/templates/phase-spec.md +187 -0
- package/templates/webforms/templates/rules.md +24 -0
- package/templates/webforms/templates/tech-debt.md +15 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
<!-- Scaffolding template maintained alongside Dflow skill. See proposals/PROPOSAL-010 for origin. -->
|
|
2
|
+
|
|
3
|
+
# Git Principles — Git Flow edition
|
|
4
|
+
|
|
5
|
+
> Created: {YYYY-MM-DD}
|
|
6
|
+
> Scope: project Git conventions. This project adopts **Git Flow** as
|
|
7
|
+
> its branching strategy.
|
|
8
|
+
> Audience: engineers + AI assistants performing Git operations.
|
|
9
|
+
|
|
10
|
+
Dflow itself is branching-strategy-neutral — it only requires the
|
|
11
|
+
feature-branch-per-feature convention (see the Dflow skill's
|
|
12
|
+
`references/git-integration.md`). This file records the Git Flow-
|
|
13
|
+
specific conventions chosen by this project.
|
|
14
|
+
|
|
15
|
+
If your project adopts a different branching strategy (single `main`,
|
|
16
|
+
trunk-based, GitHub Flow), use `Git-principles-trunk.md` instead.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. Branch Structure
|
|
21
|
+
|
|
22
|
+
| Branch | Naming | Cut from | Merges to |
|
|
23
|
+
|--------|--------|----------|-----------|
|
|
24
|
+
| `main` / `master` | `main` | — | release / hotfix only |
|
|
25
|
+
| `develop` | `develop` | — | integration branch for features |
|
|
26
|
+
| feature | `feature/{SPEC-ID}-{slug}` | `develop` | `develop` |
|
|
27
|
+
| release | `release/{version}` | `develop` | `main` + `develop` |
|
|
28
|
+
| hotfix | `hotfix/{version}-hotfix{n}` | `main` | `main` + `develop` |
|
|
29
|
+
|
|
30
|
+
The `feature/{SPEC-ID}-{slug}` pattern is a **Dflow requirement** (not
|
|
31
|
+
a Git Flow requirement). It ties each feature branch to its
|
|
32
|
+
corresponding `dflow/specs/features/active/{SPEC-ID}-{slug}/` directory.
|
|
33
|
+
|
|
34
|
+
### Feature Branch Workflow
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 1. Create feature branch
|
|
38
|
+
git checkout develop
|
|
39
|
+
git pull origin develop
|
|
40
|
+
git checkout -b feature/{SPEC-ID}-{slug}
|
|
41
|
+
|
|
42
|
+
# 2. Stay in sync with develop during development
|
|
43
|
+
git fetch origin
|
|
44
|
+
git rebase origin/develop
|
|
45
|
+
|
|
46
|
+
# 3. Commit as you go (see § 2 below)
|
|
47
|
+
git add .
|
|
48
|
+
git commit -m "[{SPEC-ID}] {short description}"
|
|
49
|
+
|
|
50
|
+
# 4. Push
|
|
51
|
+
git push -u origin feature/{SPEC-ID}-{slug}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Release Workflow
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# 1. Cut release branch
|
|
58
|
+
git checkout develop
|
|
59
|
+
git pull origin develop
|
|
60
|
+
git checkout -b release/{version}
|
|
61
|
+
|
|
62
|
+
# 2. Version bump / final adjustments
|
|
63
|
+
git add .
|
|
64
|
+
git commit -m "release {version}"
|
|
65
|
+
|
|
66
|
+
# 3. Merge to main with --no-ff
|
|
67
|
+
git checkout main
|
|
68
|
+
git pull origin main
|
|
69
|
+
git merge --no-ff release/{version} -m "Release {version}"
|
|
70
|
+
|
|
71
|
+
# 4. Tag
|
|
72
|
+
git tag -a {version} -m "{version summary}"
|
|
73
|
+
|
|
74
|
+
# 5. Back-merge into develop
|
|
75
|
+
git checkout develop
|
|
76
|
+
git merge --no-ff release/{version} -m "Merge release/{version} back to develop"
|
|
77
|
+
|
|
78
|
+
# 6. Push + cleanup
|
|
79
|
+
git push origin main develop --tags
|
|
80
|
+
git branch -d release/{version}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Hotfix Workflow
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# 1. Cut hotfix branch from main
|
|
87
|
+
git checkout main
|
|
88
|
+
git pull origin main
|
|
89
|
+
git checkout -b hotfix/{version}-hotfix{n}
|
|
90
|
+
|
|
91
|
+
# 2. Fix + commit
|
|
92
|
+
git add .
|
|
93
|
+
git commit -m "hotfix{n}: {fix description}"
|
|
94
|
+
|
|
95
|
+
# 3. Merge to main + tag
|
|
96
|
+
git checkout main
|
|
97
|
+
git merge --no-ff hotfix/{version}-hotfix{n}
|
|
98
|
+
git tag -a {version}-hotfix{n} -m "{fix description}"
|
|
99
|
+
|
|
100
|
+
# 4. Back-merge to develop
|
|
101
|
+
git checkout develop
|
|
102
|
+
git merge --no-ff hotfix/{version}-hotfix{n}
|
|
103
|
+
|
|
104
|
+
# 5. Push + cleanup
|
|
105
|
+
git push origin main develop --tags
|
|
106
|
+
git branch -d hotfix/{version}-hotfix{n}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Hotfix spec requirement (team convention)**: Hotfixes often skip the
|
|
110
|
+
upfront SDD cycle for speed. This project commits to writing a
|
|
111
|
+
lightweight spec within **24 hours** after the hotfix lands, documenting
|
|
112
|
+
root cause + fix + (if applicable) a tech-debt entry in
|
|
113
|
+
`dflow/specs/migration/tech-debt.md` if the bug reveals a systemic issue.
|
|
114
|
+
This is a **human-to-human commitment** — Dflow / AI cannot track the
|
|
115
|
+
24-hour clock; the team enforces it in retros.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 2. Commit Message Format
|
|
120
|
+
|
|
121
|
+
Commits must tie back to a SPEC-ID:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
[{SPEC-ID}] {short description}
|
|
125
|
+
|
|
126
|
+
{optional detailed body}
|
|
127
|
+
|
|
128
|
+
Co-Authored-By: Claude <noreply@anthropic.com> ← suggested, not mandatory
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Type prefix (recommended)
|
|
132
|
+
|
|
133
|
+
When applicable, prefix with a type (conventional commits-style):
|
|
134
|
+
|
|
135
|
+
| Type | Meaning |
|
|
136
|
+
|------|---------|
|
|
137
|
+
| feat | new feature |
|
|
138
|
+
| fix | bug fix |
|
|
139
|
+
| refactor | internal refactor (no behavior change) |
|
|
140
|
+
| docs | documentation only |
|
|
141
|
+
| style | formatting only |
|
|
142
|
+
| test | tests only |
|
|
143
|
+
| chore | build / tooling |
|
|
144
|
+
|
|
145
|
+
Example: `[EXP-001] feat: add JPY currency support to Money VO`
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 3. Gate Checks
|
|
150
|
+
|
|
151
|
+
See `Git-principles-gitflow.md` § 1 for the branch naming. Additionally,
|
|
152
|
+
before making key Git operations:
|
|
153
|
+
|
|
154
|
+
### Before `git commit`
|
|
155
|
+
|
|
156
|
+
- [ ] If the change corresponds to a phase-spec, that phase-spec's
|
|
157
|
+
`Implementation Tasks` section items are checked (or remaining items have
|
|
158
|
+
justification in the spec's notes section)
|
|
159
|
+
- [ ] `_index.md` status reflects the current work (Phase Specs row
|
|
160
|
+
updated, `Resume Pointer` refreshed if the commit reaches a meaningful
|
|
161
|
+
checkpoint)
|
|
162
|
+
|
|
163
|
+
### Before merging a feature branch to `develop`
|
|
164
|
+
|
|
165
|
+
- [ ] `/dflow:finish-feature` has run (or the equivalent Step 8.4
|
|
166
|
+
manual archival is complete)
|
|
167
|
+
- [ ] `_index.md` status = `completed`, feature directory moved to
|
|
168
|
+
`dflow/specs/features/completed/` via `git mv`
|
|
169
|
+
- [ ] BC layer synced: `dflow/specs/domain/{context}/rules.md` and
|
|
170
|
+
`behavior.md` reflect the feature's net BR changes
|
|
171
|
+
- [ ] `dflow/specs/domain/glossary.md` updated with any new terms
|
|
172
|
+
- [ ] `dflow/specs/migration/tech-debt.md` updated with any debt discovered
|
|
173
|
+
- [ ] Domain layer (`src/Domain/`) has no `System.Web` references
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 4. Integration Commit Message Conventions
|
|
178
|
+
|
|
179
|
+
`/dflow:finish-feature` emits a **Git-strategy-neutral Integration
|
|
180
|
+
Summary** (see `references/finish-feature-flow.md` in the Dflow skill).
|
|
181
|
+
This section specifies how to turn that Summary into the actual merge
|
|
182
|
+
commit message under Git Flow.
|
|
183
|
+
|
|
184
|
+
Git Flow typically uses `--no-ff` merges (keeps the branch history
|
|
185
|
+
visible). The recommended merge commit format is:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
Merge feature/{SPEC-ID}-{slug} into develop
|
|
189
|
+
|
|
190
|
+
{Feature Goal block, copied from Integration Summary}
|
|
191
|
+
|
|
192
|
+
Change Scope:
|
|
193
|
+
- BC: {context-name}
|
|
194
|
+
- Phase Count: {N}
|
|
195
|
+
- Lightweight Changes: {n_t2} T2 + {n_t3} T3
|
|
196
|
+
|
|
197
|
+
Related BR-IDs:
|
|
198
|
+
- ADDED: BR-NN, BR-NN
|
|
199
|
+
- MODIFIED: BR-NN
|
|
200
|
+
- REMOVED: (none)
|
|
201
|
+
|
|
202
|
+
Related SPEC-IDs: {SPEC-ID}{, follow-up SPEC-IDs if any}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Concrete example
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
git checkout develop
|
|
209
|
+
git pull origin develop
|
|
210
|
+
git merge --no-ff feature/SPEC-20260421-001-jpy-support \
|
|
211
|
+
-m "Merge feature/SPEC-20260421-001-jpy-support into develop" \
|
|
212
|
+
-m "Feature Goal: 支援 JPY 幣別,涵蓋報銷與匯率換算" \
|
|
213
|
+
-m "Change Scope: BC Expense; Phase Count 2; Lightweight Changes 1 T2" \
|
|
214
|
+
-m "Related BR-IDs: ADDED BR-07, BR-08; MODIFIED BR-03" \
|
|
215
|
+
-m "Related SPEC-IDs: SPEC-20260421-001"
|
|
216
|
+
git push origin develop
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The `-m` flags stack as separate paragraphs in the commit body.
|
|
220
|
+
Alternatively, write a single `-m` with the entire body or open the
|
|
221
|
+
editor with `git merge --no-ff feature/...` and paste the Integration
|
|
222
|
+
Summary directly.
|
|
223
|
+
|
|
224
|
+
### Why `--no-ff` is recommended here
|
|
225
|
+
|
|
226
|
+
Git Flow's value proposition is preserving branch history. `--no-ff`
|
|
227
|
+
makes the merge commit an explicit node on `develop`, which:
|
|
228
|
+
- Keeps the feature branch visible in `git log --graph`
|
|
229
|
+
- Lets `git log --first-parent develop` summarise features as single
|
|
230
|
+
commits
|
|
231
|
+
- Gives reviewers a single commit to reference for the whole feature
|
|
232
|
+
|
|
233
|
+
If your project prefers squash merge under Git Flow (unusual but valid),
|
|
234
|
+
use the trunk-edition template (`Git-principles-trunk.md`) for the
|
|
235
|
+
commit format; the branch model stays Git Flow.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 5. Tags & Release Notes
|
|
240
|
+
|
|
241
|
+
### Tag naming
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
git tag -a v{major}.{minor}.{patch} -m "{release summary}"
|
|
245
|
+
# e.g. git tag -a v1.2.3 -m "Expense report export + JPY support"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### `CHANGELOG.md`
|
|
249
|
+
|
|
250
|
+
Detailed version history lives in `CHANGELOG.md` at the repo root. One
|
|
251
|
+
section per release tag; link back to the SPEC-IDs included in that
|
|
252
|
+
release.
|
|
253
|
+
|
|
254
|
+
Example entry:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
## [1.2.3] — {YYYY-MM-DD}
|
|
258
|
+
|
|
259
|
+
### Added
|
|
260
|
+
- {SPEC-20260421-001}: JPY currency support in Money value object
|
|
261
|
+
|
|
262
|
+
### Changed
|
|
263
|
+
- {SPEC-20260415-003}: Tightened expense report validation
|
|
264
|
+
|
|
265
|
+
### Fixed
|
|
266
|
+
- {BUG-042}: Rounding inconsistency in multi-currency totals
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 6. AI Collaboration Rules (Project Policy)
|
|
272
|
+
|
|
273
|
+
Three categories:
|
|
274
|
+
|
|
275
|
+
### Must-confirm operations (AI asks before running)
|
|
276
|
+
|
|
277
|
+
| Operation | Why |
|
|
278
|
+
|-----------|-----|
|
|
279
|
+
| `git commit` | Stage needs human review |
|
|
280
|
+
| `git push` | Publishing to shared remote |
|
|
281
|
+
| `git merge` (onto develop / main / release) | Shared-branch impact |
|
|
282
|
+
| Any `git rebase` that rewrites shared history | Force-push risk |
|
|
283
|
+
|
|
284
|
+
### Forbidden operations
|
|
285
|
+
|
|
286
|
+
| Operation | Reason |
|
|
287
|
+
|-----------|--------|
|
|
288
|
+
| `git push -f` to `main` / `develop` | Overwrites other people's work |
|
|
289
|
+
| `git reset --hard` to a remote branch | Irreversible |
|
|
290
|
+
| `git commit --amend` on a pushed commit | Rewrites public history |
|
|
291
|
+
| Deleting `main` / `develop` | Protected branches |
|
|
292
|
+
|
|
293
|
+
### Allowed without asking
|
|
294
|
+
|
|
295
|
+
| Operation |
|
|
296
|
+
|-----------|
|
|
297
|
+
| `git status` / `git diff` / `git log` / `git show` |
|
|
298
|
+
| `git fetch` (no merge) |
|
|
299
|
+
| `git stash` (local-only) |
|
|
300
|
+
| `git branch` (listing only) |
|
|
301
|
+
|
|
302
|
+
### AI commit authorship (suggested, not enforced)
|
|
303
|
+
|
|
304
|
+
When an AI assists in producing a commit, appending a `Co-Authored-By`
|
|
305
|
+
line is **suggested** but not mandatory. The canonical form for
|
|
306
|
+
Claude is:
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
For other AI assistants, use the vendor-documented author line (or omit
|
|
313
|
+
it). This is a project-level transparency convention, not a Dflow
|
|
314
|
+
requirement.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## 7. CI / CD
|
|
319
|
+
|
|
320
|
+
{Fill in this project's CI/CD pipeline shape: trigger (e.g. push to
|
|
321
|
+
develop, tag), stages (build → test → deploy), environments
|
|
322
|
+
(dev / staging / prod). Reference the pipeline config file if one
|
|
323
|
+
exists, e.g. `.github/workflows/ci.yml` or `azure-pipelines.yml`.}
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Related Documents
|
|
328
|
+
|
|
329
|
+
- `references/git-integration.md` in the Dflow skill — canonical
|
|
330
|
+
source for feature-branch-per-feature, `git mv` mandate, Gate Checks
|
|
331
|
+
- [System overview](_overview.md)
|
|
332
|
+
- [Spec conventions](_conventions.md)
|
|
333
|
+
- `CHANGELOG.md` at repo root
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
<!-- Scaffolding template maintained alongside Dflow skill. See proposals/PROPOSAL-010 for origin. -->
|
|
2
|
+
|
|
3
|
+
# Git Principles — Trunk-based / GitHub Flow edition
|
|
4
|
+
|
|
5
|
+
> Created: {YYYY-MM-DD}
|
|
6
|
+
> Scope: project Git conventions. This project adopts a **single-`main`
|
|
7
|
+
> trunk-based / GitHub Flow** branching strategy.
|
|
8
|
+
> Audience: engineers + AI assistants performing Git operations.
|
|
9
|
+
|
|
10
|
+
Dflow itself is branching-strategy-neutral — it only requires the
|
|
11
|
+
feature-branch-per-feature convention (see the Dflow skill's
|
|
12
|
+
`references/git-integration.md`). This file records the trunk-based
|
|
13
|
+
conventions chosen by this project.
|
|
14
|
+
|
|
15
|
+
If your project uses Git Flow (with `develop` / `release/*` /
|
|
16
|
+
`hotfix/*`), use `Git-principles-gitflow.md` instead.
|
|
17
|
+
|
|
18
|
+
**If you are unsure which to pick**: choose this (trunk) template.
|
|
19
|
+
It is the default style of GitHub, GitLab, and most modern open
|
|
20
|
+
source. Git Flow is best suited to teams with formal release cycles
|
|
21
|
+
and long-lived release branches.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. Branch Structure
|
|
26
|
+
|
|
27
|
+
| Branch | Naming | Cut from | Merges to |
|
|
28
|
+
|--------|--------|----------|-----------|
|
|
29
|
+
| `main` | `main` | — | — (integration branch) |
|
|
30
|
+
| feature | `feature/{SPEC-ID}-{slug}` | `main` | `main` |
|
|
31
|
+
| bugfix | `bugfix/{BUG-ID}-{slug}` | `main` | `main` |
|
|
32
|
+
|
|
33
|
+
There are no `develop`, `release/*`, or `hotfix/*` branches. All work
|
|
34
|
+
happens on short-lived feature / bugfix branches cut from `main` and
|
|
35
|
+
merged back into `main` quickly (ideally within a day, always
|
|
36
|
+
within a week).
|
|
37
|
+
|
|
38
|
+
The `feature/{SPEC-ID}-{slug}` pattern is a **Dflow requirement** (not
|
|
39
|
+
a trunk-based requirement). It ties each feature branch to its
|
|
40
|
+
corresponding `dflow/specs/features/active/{SPEC-ID}-{slug}/` directory.
|
|
41
|
+
|
|
42
|
+
### Feature Branch Workflow
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# 1. Create feature branch from main
|
|
46
|
+
git checkout main
|
|
47
|
+
git pull origin main
|
|
48
|
+
git checkout -b feature/{SPEC-ID}-{slug}
|
|
49
|
+
|
|
50
|
+
# 2. Stay in sync with main during development (rebase preferred to
|
|
51
|
+
# keep history linear; merge is also fine per project taste)
|
|
52
|
+
git fetch origin
|
|
53
|
+
git rebase origin/main
|
|
54
|
+
|
|
55
|
+
# 3. Commit as you go (see § 2 below)
|
|
56
|
+
git add .
|
|
57
|
+
git commit -m "[{SPEC-ID}] {short description}"
|
|
58
|
+
|
|
59
|
+
# 4. Push
|
|
60
|
+
git push -u origin feature/{SPEC-ID}-{slug}
|
|
61
|
+
|
|
62
|
+
# 5. Open a PR to main when ready (or earlier as draft)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 2. Commit Message Format
|
|
68
|
+
|
|
69
|
+
Commits must tie back to a SPEC-ID:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
[{SPEC-ID}] {short description}
|
|
73
|
+
|
|
74
|
+
{optional detailed body}
|
|
75
|
+
|
|
76
|
+
Co-Authored-By: Claude <noreply@anthropic.com> ← suggested, not mandatory
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Conventional Commits style (recommended, optional)
|
|
80
|
+
|
|
81
|
+
This project {does / does not} require Conventional Commits. When
|
|
82
|
+
adopted, the format is:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
{type}({scope}): {short description}
|
|
86
|
+
|
|
87
|
+
[SPEC-ID] reference in body if not in scope
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
| Type | Meaning |
|
|
91
|
+
|------|---------|
|
|
92
|
+
| feat | new feature |
|
|
93
|
+
| fix | bug fix |
|
|
94
|
+
| refactor | internal refactor (no behavior change) |
|
|
95
|
+
| docs | documentation only |
|
|
96
|
+
| style | formatting only |
|
|
97
|
+
| test | tests only |
|
|
98
|
+
| chore | build / tooling |
|
|
99
|
+
|
|
100
|
+
Example: `feat(expense): add JPY currency support` with `[EXP-001]` in
|
|
101
|
+
the body.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 3. Merge Strategy (Project Chooses)
|
|
106
|
+
|
|
107
|
+
Trunk-based strategies typically pick **one** merge style and stick to
|
|
108
|
+
it. This project uses: **{squash | rebase | fast-forward}**. Delete
|
|
109
|
+
the two unused options once decided, or keep all three in the table
|
|
110
|
+
and circle the chosen one.
|
|
111
|
+
|
|
112
|
+
| Strategy | How the feature lands on `main` | When to prefer |
|
|
113
|
+
|----------|--------------------------------|----------------|
|
|
114
|
+
| Squash merge | One commit summarising the whole feature | Default for most teams; simplest history |
|
|
115
|
+
| Rebase + merge | Each commit replays on `main` | Want full feature commit history on `main`, clean linear log |
|
|
116
|
+
| Fast-forward only | Branch pointer advances `main` | Only works when feature is 1 commit or branch has been rebased to linear history |
|
|
117
|
+
|
|
118
|
+
### Gate Checks — Before `git commit`
|
|
119
|
+
|
|
120
|
+
- [ ] If the change corresponds to a phase-spec, that phase-spec's
|
|
121
|
+
`Implementation Tasks` section items are checked (or remaining items have
|
|
122
|
+
justification in the spec's notes section)
|
|
123
|
+
- [ ] `_index.md` status reflects the current work (Phase Specs row
|
|
124
|
+
updated, `Resume Pointer` refreshed if the commit reaches a meaningful
|
|
125
|
+
checkpoint)
|
|
126
|
+
|
|
127
|
+
### Gate Checks — Before merging a feature PR to `main`
|
|
128
|
+
|
|
129
|
+
- [ ] `/dflow:finish-feature` has run (or the equivalent Step 8.4
|
|
130
|
+
manual archival is complete)
|
|
131
|
+
- [ ] `_index.md` status = `completed`, feature directory moved to
|
|
132
|
+
`dflow/specs/features/completed/` via `git mv`
|
|
133
|
+
- [ ] BC layer synced: `dflow/specs/domain/{context}/rules.md` and
|
|
134
|
+
`behavior.md` reflect the feature's net BR changes
|
|
135
|
+
- [ ] `dflow/specs/domain/glossary.md` updated with any new terms
|
|
136
|
+
- [ ] `dflow/specs/migration/tech-debt.md` updated with any debt discovered
|
|
137
|
+
- [ ] Domain layer (`src/Domain/`) has no `System.Web` references
|
|
138
|
+
- [ ] CI green
|
|
139
|
+
- [ ] PR has at least one review approval
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 4. Integration Commit Message Conventions
|
|
144
|
+
|
|
145
|
+
`/dflow:finish-feature` emits a **Git-strategy-neutral Integration
|
|
146
|
+
Summary** (see `references/finish-feature-flow.md` in the Dflow skill).
|
|
147
|
+
This section specifies how to turn that Summary into the actual
|
|
148
|
+
commit message under each trunk-based merge style.
|
|
149
|
+
|
|
150
|
+
### 4.1 Squash merge (most common)
|
|
151
|
+
|
|
152
|
+
When GitHub / GitLab squashes the feature branch into `main`, the PR
|
|
153
|
+
title + description becomes the squash commit. Recommended format:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
feat({scope}): {1-line summary from Integration Summary Feature Goal}
|
|
157
|
+
|
|
158
|
+
{Integration Summary body, lightly formatted:}
|
|
159
|
+
|
|
160
|
+
Feature Goal: {copied from Integration Summary}
|
|
161
|
+
|
|
162
|
+
Change Scope:
|
|
163
|
+
- BC: {context-name}
|
|
164
|
+
- Phase Count: {N}
|
|
165
|
+
- Lightweight Changes: {n_t2} T2 + {n_t3} T3
|
|
166
|
+
|
|
167
|
+
Related BR-IDs:
|
|
168
|
+
- ADDED: BR-NN, BR-NN
|
|
169
|
+
- MODIFIED: BR-NN
|
|
170
|
+
- REMOVED: (none)
|
|
171
|
+
|
|
172
|
+
Related SPEC-IDs: {SPEC-ID}{, follow-up SPEC-IDs if any}
|
|
173
|
+
|
|
174
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Example:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
feat(expense): add JPY currency support (SPEC-20260421-001)
|
|
181
|
+
|
|
182
|
+
Feature Goal: 支援 JPY 幣別,涵蓋報銷與匯率換算。
|
|
183
|
+
|
|
184
|
+
Change Scope:
|
|
185
|
+
- BC: Expense
|
|
186
|
+
- Phase Count: 2 (phase-spec-2026-04-21-core / phase-spec-2026-04-23-ui)
|
|
187
|
+
- Lightweight Changes: 1 T2 (BUG-042-rounding)
|
|
188
|
+
|
|
189
|
+
Related BR-IDs:
|
|
190
|
+
- ADDED: BR-07, BR-08
|
|
191
|
+
- MODIFIED: BR-03
|
|
192
|
+
|
|
193
|
+
Related SPEC-IDs: SPEC-20260421-001
|
|
194
|
+
|
|
195
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 4.2 Rebase + merge (preserve feature commits on `main`)
|
|
199
|
+
|
|
200
|
+
Each commit from the feature branch lands on `main` as-is. The
|
|
201
|
+
Integration Summary does not become a single commit — instead, make
|
|
202
|
+
sure each of the feature's phase-spec completion commits already has
|
|
203
|
+
the right body. For the final "closeout" commit that runs
|
|
204
|
+
`/dflow:finish-feature`, use:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
[{SPEC-ID}] closeout: archive feature + sync BC
|
|
208
|
+
|
|
209
|
+
{Integration Summary — same body as squash example above}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This lets `git log` on `main` tell the phase-by-phase story without
|
|
213
|
+
losing the feature-level summary.
|
|
214
|
+
|
|
215
|
+
### 4.3 Fast-forward (feature has exactly 1 commit)
|
|
216
|
+
|
|
217
|
+
If the entire feature was a single commit (common for T2 / T3-only
|
|
218
|
+
features or minimal features), fast-forward is fine. Use the commit
|
|
219
|
+
message format from § 4.1 (squash) for that single commit — it already
|
|
220
|
+
reads as the feature's single narrative.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
git checkout main
|
|
224
|
+
git pull --ff-only origin main
|
|
225
|
+
git merge --ff-only feature/{SPEC-ID}-{slug}
|
|
226
|
+
git push origin main
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 5. Tags & Release Notes
|
|
232
|
+
|
|
233
|
+
Trunk-based projects typically release from `main` (continuous delivery
|
|
234
|
+
or on-demand tagging). If this project tags releases:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
git tag -a v{major}.{minor}.{patch} -m "{release summary}"
|
|
238
|
+
# e.g. git tag -a v1.2.3 -m "Expense report export + JPY support"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Otherwise, release cadence is continuous — each merge to `main` that
|
|
242
|
+
passes CI is deployable.
|
|
243
|
+
|
|
244
|
+
### `CHANGELOG.md`
|
|
245
|
+
|
|
246
|
+
Whether or not tags are used, `CHANGELOG.md` at the repo root captures
|
|
247
|
+
the narrative of merges. See `Git-principles-gitflow.md` § 5 for the
|
|
248
|
+
entry format, or adopt [Keep a Changelog](https://keepachangelog.com/)
|
|
249
|
+
style.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 6. AI Collaboration Rules (Project Policy)
|
|
254
|
+
|
|
255
|
+
Three categories:
|
|
256
|
+
|
|
257
|
+
### Must-confirm operations (AI asks before running)
|
|
258
|
+
|
|
259
|
+
| Operation | Why |
|
|
260
|
+
|-----------|-----|
|
|
261
|
+
| `git commit` | Stage needs human review |
|
|
262
|
+
| `git push` | Publishing to shared remote |
|
|
263
|
+
| Any `git rebase` that rewrites shared history | Force-push risk |
|
|
264
|
+
|
|
265
|
+
### Forbidden operations
|
|
266
|
+
|
|
267
|
+
| Operation | Reason |
|
|
268
|
+
|-----------|--------|
|
|
269
|
+
| `git push -f` to `main` | Overwrites other people's work |
|
|
270
|
+
| `git reset --hard` to a remote branch | Irreversible |
|
|
271
|
+
| `git commit --amend` on a pushed commit | Rewrites public history |
|
|
272
|
+
| Deleting `main` | Protected branch |
|
|
273
|
+
|
|
274
|
+
### Allowed without asking
|
|
275
|
+
|
|
276
|
+
| Operation |
|
|
277
|
+
|-----------|
|
|
278
|
+
| `git status` / `git diff` / `git log` / `git show` |
|
|
279
|
+
| `git fetch` (no merge) |
|
|
280
|
+
| `git stash` (local-only) |
|
|
281
|
+
| `git branch` (listing only) |
|
|
282
|
+
| `git rebase` on a private (not-yet-pushed) branch |
|
|
283
|
+
|
|
284
|
+
### AI commit authorship (suggested, not enforced)
|
|
285
|
+
|
|
286
|
+
When an AI assists in producing a commit, appending a `Co-Authored-By`
|
|
287
|
+
line is **suggested** but not mandatory. The canonical form for
|
|
288
|
+
Claude is:
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
For other AI assistants, use the vendor-documented author line (or omit
|
|
295
|
+
it). This is a project-level transparency convention, not a Dflow
|
|
296
|
+
requirement.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 7. CI / CD
|
|
301
|
+
|
|
302
|
+
{Fill in this project's CI/CD pipeline shape. Trunk-based projects
|
|
303
|
+
typically run CI on every PR + every merge to `main`. Stages: build
|
|
304
|
+
→ test → (optional) deploy to staging → (optional) deploy to
|
|
305
|
+
production. Reference the pipeline config file, e.g.
|
|
306
|
+
`.github/workflows/ci.yml`.}
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Related Documents
|
|
311
|
+
|
|
312
|
+
- `references/git-integration.md` in the Dflow skill — canonical
|
|
313
|
+
source for feature-branch-per-feature, `git mv` mandate, Gate Checks
|
|
314
|
+
- [System overview](_overview.md)
|
|
315
|
+
- [Spec conventions](_conventions.md)
|
|
316
|
+
- `CHANGELOG.md` at repo root
|