Skip to content

wgtechlabs/clean-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Clean Commit

Clean Code deserves Clean Commit.

License: MIT Version

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.


Why Clean Commit?

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

The 9 Types

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

Quick Start

Basic Format

<emoji> <type>: <description>

Example:

πŸ“¦ new: user authentication system

With Optional Scope

<emoji> <type>(<scope>): <description>

Example:

πŸ”§ update(api): improve error handling

Rules

  • Use lowercase for type
  • Use present tense ("add" not "added")
  • No period at the end
  • Keep description under 72 characters

Examples

πŸ“¦ new - Adding Code

πŸ“¦ new: login page with email validation
πŸ“¦ new(api): endpoint for user registration
πŸ“¦ new: dark mode theme support

πŸ”§ update - Changing Code

πŸ”§ update: improve database query performance
πŸ”§ update(ui): enhance button hover animations
πŸ”§ update: refactor payment processing logic

πŸ—‘οΈ remove - Removing Code

πŸ—‘οΈ remove: deprecated legacy authentication
πŸ—‘οΈ remove(deps): unused lodash dependency
πŸ—‘οΈ remove: obsolete migration scripts

πŸ”’ security - Security Fixes

πŸ”’ security: patch XSS vulnerability in user input
πŸ”’ security(auth): fix JWT token validation
πŸ”’ security: update dependencies with known CVEs

βš™οΈ setup - Project Configuration

βš™οΈ setup: add eslint configuration
βš™οΈ setup(ci): configure github actions workflow
βš™οΈ setup: initialize docker compose environment

β˜• chore - Maintenance

β˜• chore: update npm dependencies
β˜• chore(deps): bump react to version 18
β˜• chore: clean up unused imports

πŸ§ͺ test - Testing

πŸ§ͺ test: add unit tests for auth service
πŸ§ͺ test(api): integration tests for user endpoints
πŸ§ͺ test: fix flaky date parsing test

πŸ“– docs - Documentation

πŸ“– docs: update installation instructions
πŸ“– docs(api): add endpoint documentation
πŸ“– docs: fix typos in contributing guide

πŸš€ release - Version Releases

πŸš€ release: version 1.0.0
πŸš€ release: prepare for 2.1.0 release
πŸš€ release: hotfix version 1.0.1

Optional Scope

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

GitHub Copilot Integration

Automate Clean Commit in VS Code by configuring GitHub Copilot to generate commit messages following this convention.

Setup Instructions

  1. Open VS Code Settings (JSON): Ctrl/Cmd + Shift + P β†’ "Preferences: Open User Settings (JSON)"
  2. 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"
    }
  ]
}
  1. Save and reload VS Code
  2. 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-commit

Real-World Examples

This section shows real-world commit examples organized by project type to help you apply Clean Commit to your projects.

Web Application

Context: A full-stack web app with React frontend and Node.js backend

Feature Development

πŸ“¦ 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

Bug Fixes & Improvements

πŸ”§ 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

Testing & Documentation

πŸ§ͺ test(e2e): add cypress tests for checkout flow
πŸ§ͺ test: increase coverage for payment module
πŸ“– docs: update component usage examples
πŸ“– docs(api): document authentication flow

Maintenance

β˜• 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

πŸš€ release: version 2.0.0
πŸš€ release: hotfix version 2.0.1 for login bug

API / Backend

Context: RESTful API service with database and authentication

API Development

πŸ“¦ 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 & Performance

πŸ”’ 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

Database & Infrastructure

πŸ“¦ 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

Testing & Documentation

πŸ§ͺ test(api): integration tests for auth endpoints
πŸ§ͺ test: add load testing with artillery
πŸ“– docs(api): generate swagger documentation
πŸ“– docs: add architecture decision records

Maintenance & Release

β˜• chore(deps): update express to latest security patch
β˜• chore: clean up deprecated api endpoints
πŸš€ release: version 3.1.0 with new features

Library / SDK

Context: JavaScript/TypeScript library for developers

Library Features

πŸ“¦ 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

API Changes

πŸ”§ 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

Developer Experience

πŸ“¦ 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

Testing & Quality

πŸ§ͺ 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

Distribution

πŸ“¦ 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

CLI Tool

Context: Command-line tool built with Node.js

Commands & Features

πŸ“¦ 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

User Experience

πŸ“¦ 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

Installation & Distribution

βš™οΈ 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

Testing & Debugging

πŸ§ͺ 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

Documentation

πŸ“– docs: create comprehensive usage guide
πŸ“– docs(examples): add real-world workflow examples
πŸ“– docs: add troubleshooting section
πŸ“– docs(install): platform-specific installation guides

Bot (Discord/Telegram)

Context: Chat bot with commands and event handlers

Bot Commands

πŸ“¦ 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

Features & Integrations

πŸ“¦ 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

Event Handlers

πŸ“¦ 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

Configuration & Deployment

βš™οΈ setup: add environment variable configuration
βš™οΈ setup(deploy): containerize bot with docker
πŸ“¦ new(config): per-server configuration system
β˜• chore: update discord.js to latest version

Testing & Documentation

πŸ§ͺ 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

GitHub Action

Context: Custom GitHub Action for CI/CD workflows

Action Development

πŸ“¦ 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

Integration & Compatibility

πŸ“¦ 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

Documentation & Examples

πŸ“– 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

Distribution & Versioning

βš™οΈ 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

Testing & Quality

πŸ§ͺ 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

AI Integration

Copy these templates to integrate Clean Commit with AI coding assistants.

GitHub Copilot

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.md

AI Agents (Codex, Claude, Cursor, Windsurf, etc.)

Copy examples/AGENTS.md to your project root:

curl -o AGENTS.md https://raw.githubusercontent.com/wgtechlabs/clean-commit/main/examples/AGENTS.md

Real-World Implementation


Learn More


Contributing

We welcome contributions! Please read our Contributing Guidelines to get started.


License

MIT License - see the LICENSE file for details.


Credits

Created with ❀️ by Waren Gonzaga / WG Tech Labs


Clean Code deserves Clean Commit.

About

Clean Code deserves Clean Commit

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •