Skip to content

Commit 73b7e5c

Browse files
authored
Add commit and PR title conventions to prevent duplicate references (#126)
1 parent f243d58 commit 73b7e5c

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

.claude/commands/pr-create.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ Create an outcome-focused title that:
145145
- Uses imperative mood ("Add...", "Enable...", "Fix...")
146146
- Matches the issue title style when applicable
147147
- Is concise (50-72 characters preferred)
148+
- **Does NOT include issue references** (e.g., avoid `Fix bug (#42)`)—GitHub automatically
149+
appends the PR number during squash merge; issue linking belongs in the body via `Refs #NN`
150+
or `Fixes #NN`
148151

149152
### 9. Preview and Confirm
150153

.github/pull_request_template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<!--
22
PR workflow reminder:
33
- Use a clear, outcome-focused title (this becomes a release note entry)
4+
- Do NOT include issue numbers in the title — GitHub appends the PR number on squash merge
45
- Apply appropriate labels (e.g. enhancement, documentation, bug)
56
- Use special labels (`breaking-change`, `security`, `dependencies`) intentionally — they affect release notes
6-
- Reference related issues using `Refs #NN` or `Fixes #NN`
7+
- Reference related issues in the description using `Refs #NN` or `Fixes #NN`
78
- Squash merge is preferred unless stated otherwise
89
-->
910

CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,16 @@ Template repository URLs are configurable via settings.
245245
- Target framework defined centrally in `Directory.Build.props`; see
246246
`docs/how-to/how-to-upgrade-dotnet.md` for upgrade instructions
247247

248+
## Git Workflow
249+
250+
This project uses squash merges. Follow the conventions in
251+
[docs/how-to/how-to-workflow.md](docs/how-to/how-to-workflow.md), particularly:
252+
253+
- **Commit messages**: Do not reference issue numbers; short descriptive summaries are fine
254+
- **PR titles**: Must be release-note quality; do not include issue references (GitHub appends
255+
the PR number on squash merge)
256+
- **Issue linking**: Use `Fixes #NN` or `Refs #NN` in the PR **description**, not the title
257+
248258
## CI/CD and Release Process
249259

250260
### GitHub Workflows

docs/how-to/how-to-workflow.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,30 @@ GitHub generates branch names in the format `<issue-number>-<issue-title-slug>`
3434
(e.g., `42-fix-login-bug`). Following this pattern ensures consistency whether the branch
3535
is created automatically or manually.
3636

37+
#### Writing Commit Messages
38+
39+
Since PRs are squash-merged, individual commits don't need to be release-note quality—but
40+
good commit messages still help reviewers and your future self understand the progression of changes.
41+
42+
**Do:**
43+
- Write short, descriptive summaries (e.g., `Add validation for empty input`)
44+
- Use commits to mark logical checkpoints (e.g., `WIP: basic structure`, `Add tests`, `Fix edge case`)
45+
- Feel free to use `WIP`, `fixup`, or `checkpoint` prefixes for in-progress work
46+
47+
**Don't:**
48+
- Reference issue numbers in commit messages—the PR description handles issue linking
49+
- Worry about perfect formatting—squash merge discards individual commit messages
50+
- Write multi-paragraph commit bodies unless the context is genuinely useful for review
51+
3752
### 3. Opening a Pull Request
3853

3954
Open a Pull Request when the work is ready for review or merge.
4055

4156
- The PR title **must be release-note quality** (it will appear verbatim in release notes)
42-
- The PR description should reference the issue using one of the following:
57+
- **Do not include issue references in the PR title** – GitHub automatically appends the PR number
58+
during squash merge, so including `#<issue-number>` in the title results in duplicate references
59+
(e.g., `Fix bug (#42) (#43)`)
60+
- Reference the issue in the **PR description** using one of the following:
4361
- `Fixes #<issue-number>` – closes the issue when merged
4462
- `Refs #<issue-number>` – links the issue without closing it
4563

0 commit comments

Comments
 (0)