<type>: <description> (#issue)
First line under 72 characters. Focus on why, not what.
| Type | When |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
test |
Adding or updating tests |
refactor |
Code change that doesn't add a feature or fix a bug |
chore |
Build, deps, config, CI changes |
feat: Add user search with fuzzy matching (#42)
fix: Prevent duplicate form submissions (#15)
docs: Update API authentication guide
test: Add integration tests for checkout flow (#30)
refactor: Extract scoring logic into pure functions
chore: Upgrade Next.js to v15
- First line under 72 characters — this is the subject line
- Imperative mood — "Add feature" not "Added feature"
- Reference issues — append
(#XX)when applicable - No period at the end of the subject line
- Body is optional — separate from subject with a blank line
For commits that need more explanation:
fix: Prevent negative handicaps from breaking match play (#88)
Math.floor was truncating toward negative infinity, causing -0.7 to
become -1 instead of 0. Switched to Math.trunc which truncates toward
zero. Also clamp ESC lookup to minimum of 0.
Some projects use component prefixes for additional context:
[Auth] Add Google SSO provider
[DB] Create rounds and round_scores tables
[Scorecard] Implement score input with auto-totals
These are optional and project-specific — the <type>: prefix is always required.