Clean Code deserves Clean Commit.
A minimalist git commit convention designed to be simple, memorable, and universal. Clean Commit helps you write clear, consistent commit messages that make your project history easy to understand.
Existing commit conventions are too complex. They require memorizing lengthy type names, complex scoping rules, and rigid formats that slow you down.
Clean Commit is different:
- β¨ Simple: Only 9 types to remember
- π― Visual: Emoji makes scanning history effortless
- π Flexible: Works for any project size or type
- π Fast: No overthinking - just commit
| Emoji | Type | What it covers |
|---|---|---|
| π¦ | new |
Adding new features, files, or capabilities |
| π§ | update |
Changing existing code, refactoring, improvements |
| ποΈ | remove |
Removing code, files, features, or dependencies |
| π | security |
Security fixes, patches, vulnerability resolutions |
| βοΈ | setup |
Project configs, CI/CD, tooling, build systems |
| β | chore |
Maintenance tasks, dependency updates, housekeeping |
| π§ͺ | test |
Adding, updating, or fixing tests |
| π | docs |
Documentation changes and updates |
| π | release |
Version releases and release preparation |
<emoji> <type>: <description>
Example:
π¦ new: user authentication system
<emoji> <type>(<scope>): <description>
Example:
π§ update(api): improve error handling
- Use lowercase for type
- Use present tense ("add" not "added")
- No period at the end
- Keep description under 72 characters
π¦ new: login page with email validation
π¦ new(api): endpoint for user registration
π¦ new: dark mode theme support
π§ update: improve database query performance
π§ update(ui): enhance button hover animations
π§ update: refactor payment processing logic
ποΈ remove: deprecated legacy authentication
ποΈ remove(deps): unused lodash dependency
ποΈ remove: obsolete migration scripts
π security: patch XSS vulnerability in user input
π security(auth): fix JWT token validation
π security: update dependencies with known CVEs
βοΈ setup: add eslint configuration
βοΈ setup(ci): configure github actions workflow
βοΈ setup: initialize docker compose environment
β chore: update npm dependencies
β chore(deps): bump react to version 18
β chore: clean up unused imports
π§ͺ test: add unit tests for auth service
π§ͺ test(api): integration tests for user endpoints
π§ͺ test: fix flaky date parsing test
π docs: update installation instructions
π docs(api): add endpoint documentation
π docs: fix typos in contributing guide
π release: version 1.0.0
π release: prepare for 2.1.0 release
π release: hotfix version 1.0.1
Scopes help specify where the change happened. They're completely optional but helpful in larger projects.
Good scopes:
- Component names:
(header),(footer),(navbar) - Module names:
(api),(database),(auth) - Feature areas:
(payments),(notifications),(search)
Keep scopes:
- Short (one word when possible)
- Lowercase
- Consistent across your project
Automate Clean Commit in VS Code by configuring GitHub Copilot to generate commit messages following this convention.
- Open VS Code Settings (JSON):
Ctrl/Cmd + Shift + Pβ "Preferences: Open User Settings (JSON)" - Add this configuration:
{
"github.copilot.chat.commitMessageGeneration.instructions": [
{
"text": "Use Clean Commit convention: <emoji> <type>: <description> or <emoji> <type>(<scope>): <description>. Choose type: π¦ new=user-facing features/functionality, π§ update=modify existing code/logic, ποΈ remove=delete code/features, π security=fix vulnerabilities, βοΈ setup=configs/CI/tooling/.github files, β chore=maintenance/deps/LICENSE, π§ͺ test=test files, π docs=README/guides/comments, π release=version tags. Format: lowercase type, present tense (add not added), no period, max 72 chars. Examples: βοΈ setup: add GitHub funding configuration | π¦ new: user authentication | π§ update(api): improve error handling | β chore(deps): bump react version"
}
]
}- Save and reload VS Code
- GitHub Copilot will now suggest commit messages using Clean Commit format
Alternative: Project-Specific Setup
Create .github/copilot-instructions.md in your repository:
# Commit Message Convention
Use Clean Commit convention for all commits.
See: https://github.com/wgtechlabs/clean-commitThis section shows real-world commit examples organized by project type to help you apply Clean Commit to your projects.
Context: A full-stack web app with React frontend and Node.js backend
π¦ new: user profile page with avatar upload
π¦ new(auth): social login with google and github
π¦ new(dashboard): real-time analytics widgets
π§ update(ui): improve mobile responsive layout
π§ update: optimize image loading with lazy loading
ποΈ remove(ui): deprecated jquery legacy code
π§ update: fix cart total calculation rounding error
π§ update(form): improve validation error messages
π§ update(api): handle network timeout gracefully
π security: sanitize html input to prevent xss
π security(session): implement csrf token validation
π§ͺ test(e2e): add cypress tests for checkout flow
π§ͺ test: increase coverage for payment module
π docs: update component usage examples
π docs(api): document authentication flow
β chore(deps): bump react from 17.0.2 to 18.2.0
β chore: update webpack to version 5
βοΈ setup(ci): add automated deployment pipeline
βοΈ setup: configure storybook for components
π release: version 2.0.0
π release: hotfix version 2.0.1 for login bug
Context: RESTful API service with database and authentication
π¦ new(api): user registration endpoint with validation
π¦ new: rate limiting middleware for api protection
π¦ new(db): migration for orders table
π¦ new(auth): jwt token refresh mechanism
π§ update(api): improve error response format
π§ update: optimize database query with indexing
π§ update(middleware): refactor logging to use winston
π security(api): add input validation to prevent injection
π security: hash passwords with bcrypt instead of md5
π security(auth): fix authorization bypass in admin routes
π§ update: implement connection pooling for database
π§ update(cache): add redis caching for frequent queries
π¦ new(db): add full-text search indexes
π§ update(db): optimize user query performance
ποΈ remove(db): drop unused legacy tables
βοΈ setup(docker): containerize application with compose
βοΈ setup: configure automated database backups
π§ͺ test(api): integration tests for auth endpoints
π§ͺ test: add load testing with artillery
π docs(api): generate swagger documentation
π docs: add architecture decision records
β chore(deps): update express to latest security patch
β chore: clean up deprecated api endpoints
π release: version 3.1.0 with new features
Context: JavaScript/TypeScript library for developers
π¦ new: add async/await support to all methods
π¦ new(api): client method for batch operations
π¦ new: typescript type definitions
π§ update: improve error handling with custom errors
π§ update: refactor core module for better performance
ποΈ remove: deprecated callback-based api
π§ update(api): simplify configuration options
π§ update: change default timeout to 30 seconds
π docs(breaking): document v3 migration guide
π release: version 3.0.0 with breaking changes
π¦ new: add debug mode for troubleshooting
π§ update: improve error messages with actionable hints
π docs: add interactive examples to readme
π docs(api): document all public methods with jsdoc
π docs: create getting started tutorial
π§ͺ test: add unit tests for all core modules
π§ͺ test: achieve 95% code coverage
βοΈ setup: configure automatic type checking
βοΈ setup(ci): add automated npm publishing
β chore: update dependencies to latest stable
π¦ new: add esm module support
π¦ new: add umd bundle for browsers
βοΈ setup(build): optimize bundle size with rollup
π release: publish version 2.5.0 to npm
Context: Command-line tool built with Node.js
π¦ new: add init command for project setup
π¦ new(cmd): deploy command with progress bar
π¦ new: interactive configuration wizard
π§ update(cli): improve help text formatting
π§ update: add colorized output for better readability
ποΈ remove: deprecated --legacy flag
π¦ new: add autocomplete support for bash and zsh
π¦ new(ui): spinner animation for long operations
π§ update: improve error messages with suggestions
π§ update(config): support yaml and json config files
π docs: add command examples to help text
βοΈ setup: add installation script for multiple platforms
βοΈ setup(ci): automate binary builds for releases
π¦ new: support installation via homebrew
π¦ new: add windows installer
π release: version 1.0.0 stable release
π§ͺ test: add integration tests for all commands
π§ͺ test(cmd): test deploy command with mocked api
π¦ new(debug): add verbose flag for troubleshooting
β chore(deps): update commander to latest version
π docs: create comprehensive usage guide
π docs(examples): add real-world workflow examples
π docs: add troubleshooting section
π docs(install): platform-specific installation guides
Context: Chat bot with commands and event handlers
π¦ new(cmd): welcome command for new members
π¦ new: moderation commands for admins
π¦ new(cmd): poll creation with reaction voting
π§ update: improve help command with categories
π§ update(cmd): enhance music player with queue system
ποΈ remove: deprecated legacy command syntax
π¦ new: integration with spotify api
π¦ new(feature): automated role assignment
π¦ new: custom embed messages with rich formatting
π§ update: improve message parsing and validation
π§ update(db): migrate to postgresql for better scaling
π¦ new(event): handle member join events
π¦ new: reaction role system
π§ update(event): improve message deletion logging
π§ update: add rate limiting for command usage
π security: validate user permissions before commands
βοΈ setup: add environment variable configuration
βοΈ setup(deploy): containerize bot with docker
π¦ new(config): per-server configuration system
β chore: update discord.js to latest version
π§ͺ test: add unit tests for command handlers
π§ͺ test: mock discord api for integration tests
π docs: create bot setup guide for server admins
π docs(commands): document all available commands
π release: deploy version 2.0.0 to production
Context: Custom GitHub Action for CI/CD workflows
π¦ new: initial action for code quality checks
π¦ new(input): add customizable threshold options
π¦ new: support for multiple programming languages
π§ update: improve performance of file scanning
π§ update(output): add detailed report generation
ποΈ remove: legacy node 12 support
π¦ new: add support for pull request comments
π¦ new(integration): slack notification output
π§ update: support both github token and app auth
π§ update: improve error handling with actionable messages
βοΈ setup(ci): add automated testing workflow
π docs: create comprehensive action usage guide
π docs(examples): add workflow examples for common scenarios
π docs: add troubleshooting section
π docs(inputs): document all input parameters
π docs(outputs): document all output values
βοΈ setup: configure automated release process
βοΈ setup(build): optimize action bundle size
π release: version 1.0.0 stable release
π release: tag v2 for breaking changes
β chore(deps): update action dependencies
π§ͺ test: add end-to-end tests with real workflows
π§ͺ test(unit): test action logic with various inputs
π security: validate and sanitize user inputs
β chore: update action to use node 20
Copy these templates to integrate Clean Commit with AI coding assistants.
Copy examples/copilot.instructions.md to your project:
mkdir -p .github/instructions
curl -o .github/instructions/copilot.instructions.md https://raw.githubusercontent.com/wgtechlabs/clean-commit/main/examples/copilot.instructions.mdCopy examples/AGENTS.md to your project root:
curl -o AGENTS.md https://raw.githubusercontent.com/wgtechlabs/clean-commit/main/examples/AGENTS.md- π SPECIFICATION.md - Full technical specification with detailed guidelines
- π QUICK-REFERENCE.md - Single-page cheatsheet for quick lookup
We welcome contributions! Please read our Contributing Guidelines to get started.
MIT License - see the LICENSE file for details.
Created with β€οΈ by Waren Gonzaga / WG Tech Labs
Clean Code deserves Clean Commit.