Conventional Commits specification. Covers commit structure, types, breaking changes. Keywords: feat, fix, BREAKING CHANGE.
Specification for structured commit messages that enable automated changelog generation and semantic versioning.
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
| Type | Purpose | SemVer |
|---|---|---|
feat |
New feature | MINOR |
fix |
Bug fix | PATCH |
docs |
Documentation only | - |
style |
Formatting, no code change | - |
refactor |
Code change, no feature/fix | - |
perf |
Performance improvement | - |
test |
Adding/fixing tests | - |
build |
Build system, dependencies | - |
ci |
CI configuration | - |
chore |
Maintenance tasks | - |
revert |
Revert previous commit | - |
feat!: send email when product shipped
feat(api)!: change response format
chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
feat: add user authentication
fix: resolve memory leak in cache
docs: update API documentation
style: format code with prettier
refactor: extract validation logic
perf: optimize database queries
test: add unit tests for auth module
build: upgrade webpack to v5
ci: add GitHub Actions workflow
chore: update dependencies
feat(auth): add OAuth2 support
fix(parser): handle empty arrays
docs(readme): add installation guide
refactor(api): simplify error handling
fix: prevent request racing
Introduce a request id and reference to latest request.
Dismiss incoming responses other than from latest request.
Remove timeouts which were used to mitigate the racing issue
but are obsolete now.
fix: correct minor typos in code
Reviewed-by: John Doe
Refs: #123
feat: allow config object to extend other configs
BREAKING CHANGE: `extends` key in config file is now used
for extending other config files.
chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
revert: let us never again speak of the noodle incident
Refs: 676104e, a215868
feat, fix, etc.)feat MUST be used for new featuresfix MUST be used for bug fixes! before : OR BREAKING CHANGE: footerBREAKING CHANGE MUST be uppercase- instead of spaces (e.g., Reviewed-by)feat(parser):feat and fix MAY be used! MAY be used with BREAKING CHANGE: footerBREAKING CHANGE: MUST be uppercaseBREAKING-CHANGE: synonym for BREAKING CHANGE| Commit Type | SemVer Bump | Version Change |
|---|---|---|
fix: |
PATCH | 1.0.0 → 1.0.1 |
feat: |
MINOR | 1.0.0 → 1.1.0 |
BREAKING CHANGE or ! |
MAJOR | 1.0.0 → 2.0.0 |
Breaking changes override type — fix!: results in MAJOR bump.
Conventional Commits map directly to changelog entries:
| Commit Type | Changelog Section |
|---|---|
feat |
Added |
fix |
Fixed |
perf |
Changed |
refactor |
Changed |
docs |
(usually omitted or Changed) |
BREAKING CHANGE |
Highlight in Changed/Removed |
revert |
Removed or Fixed |
| Security fixes | Security |
Tools like conventional-changelog, semantic-release, or release-please can:
See changelog skill for CHANGELOG.md format.
git commit -m "feat(users): add profile page"
git commit -m "feat(users): add avatar upload"
git commit -m "test(users): add profile page tests"
git commit -m "docs(users): document profile API"
git commit -m "fix(auth): resolve session timeout (#142)"
# Deprecate first
git commit -m "feat(api): add v2 endpoint
DEPRECATED: /api/v1/users will be removed in next major version"
# Later, remove
git commit -m "feat(api)!: remove v1 endpoints
BREAKING CHANGE: /api/v1/* endpoints have been removed.
Use /api/v2/* instead."
Split into multiple commits when possible. This makes history more organized.
Before merge: git rebase -i to edit history.
After release: not critical — commit will be missed by automated tools.
No. Use squash merging and maintainers can write proper message for the merge.
revert: <original commit subject>
Refs: <commit SHA>
Set up git to use template:
git config commit.template .gitmessage
See assets/commit-msg.template for template file.
Use assets/validate-commit-msg.sh with git hooks or CI.
| Tool | Purpose |
|---|---|
| commitlint | Lint commit messages |
| commitizen | Interactive commit helper |
| conventional-changelog | Generate changelogs |
| semantic-release | Automated releases |
| release-please | GitHub release automation |
MANDATORY: Before proposing branch name, commit message, or PR description, the agent MUST:
git status or git diff --name-onlygit diff (staged and unstaged)# Step 1: Get list of all changed files
git status --short
# Step 2: Review actual changes (for unstaged)
git diff
# Step 3: Review staged changes
git diff --staged
# Step 4: Use the complete changeset to propose:
# - Branch name
# - Commit message
# - PR description
When user asks for commit message, provide:
All proposals MUST be based on the actual git diff output, not assumptions.