Conventional Commits
Write standardized, semantic commit messages that enable automated versioning and changelog generation.
Core Workflow
- Analyze changes: Review staged files and modifications
- Determine type: Select appropriate commit type (feat, fix, etc.)
- Identify scope: Optional component/module affected
- Write description: Concise summary in imperative mood
- Add body: Optional detailed explanation
- Include footer: Breaking changes, issue references
Commit Message Format
Commit Types
Scopes
Scopes indicate the area of the codebase affected:
Breaking Changes
Mark breaking changes with ! or BREAKING CHANGE footer:
Commit Message Examples
Simple Feature
Feature with Scope
Bug Fix with Issue Reference
Breaking Change
Multiple Footers
Revert Commit
Description Guidelines
Do
- Use imperative mood: "add" not "added" or "adds"
- Keep under 72 characters
- Start with lowercase
- No period at the end
- Be specific and concise
Don't
- "Fixed bug" (too vague)
- "Updated stuff" (not descriptive)
- "WIP" (commit when ready)
- "misc changes" (split into separate commits)
Good Examples
Bad Examples
Body Guidelines
When to include a body:
- Changes need context or explanation
- Complex logic that isn't self-evident
- Breaking changes require migration info
- Multiple related changes in one commit
Footer Tokens
Integration with Tooling
Commitlint Configuration
Husky Pre-commit Hook
Package.json Setup
Semantic Release Integration
Conventional commits enable automated versioning:
Version Bumping Rules
Commit Message Generator
When analyzing changes, generate a commit message:
Best Practices
- One logical change per commit: Don't mix features with fixes
- Commit early, commit often: Small, focused commits
- Write for reviewers: Messages should explain why, not just what
- Reference issues: Link to tickets/issues when applicable
- Use scopes consistently: Establish team conventions
- Review before committing:
git diff --cachedto verify changes
Output Checklist
Every commit message should:
- Start with valid type (feat, fix, docs, etc.)
- Use imperative mood in description
- Keep description under 72 characters
- Include scope when applicable
- Mark breaking changes with
!or footer - Reference related issues in footer
- Provide body for complex changes
- Follow team's scope conventions


