Clean Code deserves Clean Commit.
A minimalist git commit workflow designed to be simple, memorable, and universal. Clean Commit helps you write clear, consistent commit messages that make your project history easy to understand.
Note: This is a documented personal workflow I've refined over years of practice. While I use the term "Clean Commit workflow" to describe this standardized approach, it may evolve into a broader convention as others adopt and adapt it.
Install Clean Commit as a standalone skill for AI assistants. It includes its own instructions and works without Clean Workflow or another Clean skill. You can also use the convention manually with the guides below.
Use a Codex version with codex plugin support; installation and discovery
were verified with Codex CLI 0.158.0-alpha.2.1.
Git and a local repository are required to inspect changes or create commits. Message-only validation does not need GitHub access.
Install the stable version from main:
codex plugin marketplace add wgtechlabs/clean-commit --ref main
codex plugin add clean-commit@clean-commit
codex plugin list --marketplace clean-commit --jsonConfirm the plugin is installed and enabled, then start a new chat and invoke
$clean-commit. Installation alone does not authorize repository changes.
$clean-commit draft a message for my staged changes without committing
$clean-commit validate this message: π§ update (api): fix pagination
$clean-commit check whether my staged changes should be split into separate commits
Drafts describe the staged diff. Drafting and validation do not stage files, create commits, amend history, or push. The target repository's explicit commit convention takes precedence.
Load the entire skills/clean-commit/ folder using
your host's skill installation mechanism. The instructions are self-contained;
the host must still provide the tools required for the requested operation.
Other vendors' hosts have not been verified in this repository's test record.
Clean Workflow provides broader development, review, and delivery guidance. Choose this standalone plugin for Clean Commit alone. This repository owns the skill; updates to the broader bundle are maintained separately.
Refresh the configured marketplace and reinstall its plugin:
codex plugin marketplace upgrade clean-commit
codex plugin remove clean-commit@clean-commit
codex plugin add clean-commit@clean-commitStart a new chat after updating. To uninstall and remove its marketplace:
codex plugin remove clean-commit@clean-commit
codex plugin marketplace remove clean-commitTo test dev before promotion to main, first remove an existing installation
and same-named marketplace with the commands above, then run:
codex plugin marketplace add wgtechlabs/clean-commit --ref dev
codex plugin add clean-commit@clean-commitUse another branch or an existing tag instead of dev to test a specific ref.
For local development, use the absolute checkout path as the marketplace source
and omit --ref. Switch back to the stable installation commands after testing.
See skill verification for recorded installation
results, behavior scenarios, and verification limits.
The current installable package version is tracked in
.codex-plugin/plugin.json. The version badge at
the top of this README refers to the convention specification, not the plugin.
Pushes to main, including a merged promotion PR, run the
release workflow. It uses the same pinned
Release Build Flow Action
configuration as Clean Coding and Clean Code Review: plan the version, update
the plugin manifest, then commit CHANGELOG.md and publish a tag and GitHub
Release when a version bump is needed. Existing release tags determine the
next version; 0.1.0 is the initial version when no tags exist. Other package
manifests are not synchronized by this workflow.
This repository is the canonical source for clean-commit. Maintain its skill
alongside SPECIFICATION.md, which remains authoritative.
Keep instructions self-contained and check examples against the specification.
Downstream bundles should import a released skill directory and record its
version and source commit, rather than maintain independent edits. A bundle
can lag until its update is reviewed and merged.
Existing commit workflows 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
<emoji> <type>!: <description>
Example:
π¦ new!: completely redesign authentication system
- Use lowercase for type
- Use
!immediately after type (no space) for breaking changes onnew,update,remove, orsecurity - Use present tense ("add" not "added")
- No period at the end
- Keep the complete subject at most 72 characters, including emoji, type, scope, and description
π¦ 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 workflow.
- 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 workflow: <emoji> <type>: <description> or <emoji> <type> (<scope>): <description>. Add ! after type for breaking changes (only for new, update, remove, security) e.g. <emoji> <type>!: <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 | π¦ new!: redesign authentication system"
}
]
}- 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 Workflow
Use Clean Commit workflow 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.