Commit Message Helper
Format
Use Conventional Commits:
():
[optional body explaining WHY, not WHAT]
Types
| Type | Usage |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, no logic change |
refactor | Code change without feat/fix |
test | Adding or updating tests |
chore | Maintenance (deps, config) |
Rules
- Subject line: max 72 characters, imperative mood ("add" not "added")
- Scope is optional but recommended (e.g.
auth,api,ui) - Body explains why, not what (the diff shows what)
- One logical change per commit
Workflow
- Run
git diff --stagedto see staged changes - Identify the primary type and scope
- Draft the message
- Verify: subject ≤ 72 chars, imperative mood, explains why if non-obvious
Examples
Feature: feat(auth): add JWT token refresh endpoint
Prevents users from being logged out during long sessions
Bug fix: fix(reports): correct date formatting in timezone conversion
Timestamps were displayed in local time instead of UTC
Documentation: docs: add setup instructions to README