Claude Command: Commit
This command helps you create well-formatted commits with conventional commit messages and emoji.
Usage
To create a commit, just type:
/commit
Or with options:
/commit --no-verify
What This Command Does
- Unless specified with
--no-verify, automatically runs pre-commit checks:
pnpm lint to ensure code quality
pnpm build to verify the build succeeds
pnpm generate:docs to update documentation
- Checks which files are staged with
git status
- If 0 files are staged, automatically adds all modified and new files with
git add
- Performs a
git diff to understand what changes are being committed
- Analyzes the diff to determine if multiple distinct logical changes are present
- If multiple distinct changes are detected, suggests breaking the commit into multiple smaller commits
- For each commit (or the single commit if not split), creates a commit message using emoji conventional commit format
Best Practices for Commits
- Verify before committing: Ensure code is linted, builds correctly, and documentation is updated
- Atomic commits: Each commit should contain related changes that serve a single purpose
- Split large changes: If changes touch multiple concerns, split them into separate commits
- Conventional commit format: Use the format
<type>: <description> where type is one of:
feat: A new feature
fix: A bug fix
docs: Documentation changes
style: Code style changes (formatting, etc)
refactor: Code changes that neither fix bugs nor add features
perf: Performance improvements
test: Adding or fixing tests
chore: Changes to the build process, tools, etc.
- Present tense, imperative mood: Write commit messages as commands (e.g., "add feature" not "added feature")
- Concise first line: Keep the first line under 72 characters
- Emoji: Each commit type is paired with an appropriate emoji:
- ✨
feat: New feature
- 🐛
fix: Bug fix
- 📝
docs: Documentation
- 💄
style: Formatting/style
- ♻️
refactor: Code refactoring
- ⚡️
perf: Performance improvements
- ✅
test: Tests
- 🔧
chore: Tooling, configuration
- 🚀
ci: CI/CD improvements
- 🗑️
revert: Reverting changes
- 🧪
test: Add a failing test
- 🚨
fix: Fix compiler/linter warnings
- 🔒️
fix: Fix security issues
- 👥
chore: Add or update contributors
- 🚚
refactor: Move or rename resources
- 🏗️
refactor: Make architectural changes
- 🔀
chore: Merge branches
- 📦️
chore: Add or update compiled files or packages
- ➕
chore: Add a dependency
- ➖
chore: Remove a dependency
- 🌱
chore: Add or update seed files
- 🧑💻
chore: Improve developer experience
- 🧵
feat: Add or update code related to multithreading or concurrency
- 🔍️
feat: Improve SEO
- 🏷️
feat: Add or update types
- 💬
feat: Add or update text and literals
- 🌐
feat: Internationalization and localization
- 👔
feat: Add or update business logic
- 📱
feat: Work on responsive design
- 🚸
feat: Improve user experience / usability
- 🩹
fix: Simple fix for a non-critical issue
- 🥅
fix: Catch errors
- 👽️
fix: Update code due to external API changes
- 🔥
fix: Remove code or files
- 🎨
style: Improve structure/format of the code
- 🚑️
fix: Critical hotfix
- 🎉
chore: Begin a project
- 🔖
chore: Release/Version tags
- 🚧
wip: Work in progress
- 💚
fix: Fix CI build
- 📌
chore: Pin dependencies to specific versions
- 👷
ci: Add or update CI build system
- 📈
feat: Add or update analytics or tracking code
- ✏️
fix: Fix typos
- ⏪️
revert: Revert changes
- 📄
chore: Add or update license
- 💥
feat: Introduce breaking changes
- 🍱
assets: Add or update assets
- ♿️
feat: Improve accessibility
- 💡
docs: Add or update comments in source code
- 🗃️
db: Perform database related changes
- 🔊
feat: Add or update logs
- 🔇
fix: Remove logs
- 🤡
test: Mock things
- 🥚
feat: Add or update an easter egg
- 🙈
chore: Add or update .gitignore file
- 📸
test: Add or update snapshots
- ⚗️
experiment: Perform experiments
- 🚩
feat: Add, update, or remove feature flags
- 💫
ui: Add or update animations and transitions
- ⚰️
refactor: Remove dead code
- 🦺
feat: Add or update code related to validation
- ✈️
feat: Improve offline support
Guidelines for Splitting Commits
When analyzing the diff, consider splitting commits based on these criteria:
- Different concerns: Changes to unrelated parts of the codebase
- Different types of changes: Mixing features, fixes, refactoring, etc.
- File patterns: Changes to different types of files (e.g., source code vs documentation)
- Logical grouping: Changes that would be easier to understand or review separately
- Size: Very large changes that would be clearer if broken down
Examples
Good commit messages:
- ✨ feat: add user authentication system
- 🐛 fix: resolve memory leak in rendering process
- 📝 docs: update API documentation with new endpoints
- ♻️ refactor: simplify error handling logic in parser
- 🚨 fix: resolve linter warnings in component files
- 🧑💻 chore: improve developer tooling setup process
- 👔 feat: implement business logic for transaction validation
- 🩹 fix: address minor styling inconsistency in header
- 🚑️ fix: patch critical security vulnerability in auth flow
- 🎨 style: reorganize component structure for better readability
- 🔥 fix: remove deprecated legacy code
- 🦺 feat: add input validation for user registration form
- 💚 fix: resolve failing CI pipeline tests
- 📈 feat: implement analytics tracking for user engagement
- 🔒️ fix: strengthen authentication password requirements
- ♿️ feat: improve form accessibility for screen readers
Example of splitting commits:
- First commit: ✨ feat: add new solc version type definitions
- Second commit: 📝 docs: update documentation for new solc versions
- Third commit: 🔧 chore: update package.json dependencies
- Fourth commit: 🏷️ feat: add type definitions for new API endpoints
- Fifth commit: 🧵 feat: improve concurrency handling in worker threads
- Sixth commit: 🚨 fix: resolve linting issues in new code
- Seventh commit: ✅ test: add unit tests for new solc version features
- Eighth commit: 🔒️ fix: update dependencies with security vulnerabilities
Command Options
--no-verify: Skip running the pre-commit checks (lint, build, generate:docs)
Important Notes
- By default, pre-commit checks (
pnpm lint, pnpm build, pnpm generate:docs) will run to ensure code quality
- If these checks fail, you'll be asked if you want to proceed with the commit anyway or fix the issues first
- If specific files are already staged, the command will only commit those files
- If no files are staged, it will automatically stage all modified and new files
- The commit message will be constructed based on the changes detected
- Before committing, the command will review the diff to identify if multiple commits would be more appropriate
- If suggesting multiple commits, it will help you stage and commit the changes separately
- Always reviews the commit diff to ensure the message matches the changes
1---2name: 174-commit-15f6d58c3description: Claude Command: Commit4---5# Claude Command: Commit67This command helps you create well-formatted commits with conventional commit messages and emoji.89## Usage1011To create a commit, just type:12```13/commit14```1516Or with options:17```18/commit --no-verify19```2021## What This Command Does22231. Unless specified with `--no-verify`, automatically runs pre-commit checks:24 - `pnpm lint` to ensure code quality25 - `pnpm build` to verify the build succeeds26 - `pnpm generate:docs` to update documentation272. Checks which files are staged with `git status`283. If 0 files are staged, automatically adds all modified and new files with `git add`294. Performs a `git diff` to understand what changes are being committed305. Analyzes the diff to determine if multiple distinct logical changes are present316. If multiple distinct changes are detected, suggests breaking the commit into multiple smaller commits327. For each commit (or the single commit if not split), creates a commit message using emoji conventional commit format3334## Best Practices for Commits3536- **Verify before committing**: Ensure code is linted, builds correctly, and documentation is updated37- **Atomic commits**: Each commit should contain related changes that serve a single purpose38- **Split large changes**: If changes touch multiple concerns, split them into separate commits39- **Conventional commit format**: Use the format `<type>: <description>` where type is one of:40 - `feat`: A new feature41 - `fix`: A bug fix42 - `docs`: Documentation changes43 - `style`: Code style changes (formatting, etc)44 - `refactor`: Code changes that neither fix bugs nor add features45 - `perf`: Performance improvements46 - `test`: Adding or fixing tests47 - `chore`: Changes to the build process, tools, etc.48- **Present tense, imperative mood**: Write commit messages as commands (e.g., "add feature" not "added feature")49- **Concise first line**: Keep the first line under 72 characters50- **Emoji**: Each commit type is paired with an appropriate emoji:51 - ✨ `feat`: New feature52 - 🐛 `fix`: Bug fix53 - 📝 `docs`: Documentation54 - 💄 `style`: Formatting/style55 - ♻️ `refactor`: Code refactoring56 - ⚡️ `perf`: Performance improvements57 - ✅ `test`: Tests58 - 🔧 `chore`: Tooling, configuration59 - 🚀 `ci`: CI/CD improvements60 - 🗑️ `revert`: Reverting changes61 - 🧪 `test`: Add a failing test62 - 🚨 `fix`: Fix compiler/linter warnings63 - 🔒️ `fix`: Fix security issues64 - 👥 `chore`: Add or update contributors65 - 🚚 `refactor`: Move or rename resources66 - 🏗️ `refactor`: Make architectural changes67 - 🔀 `chore`: Merge branches68 - 📦️ `chore`: Add or update compiled files or packages69 - ➕ `chore`: Add a dependency70 - ➖ `chore`: Remove a dependency71 - 🌱 `chore`: Add or update seed files72 - 🧑💻 `chore`: Improve developer experience73 - 🧵 `feat`: Add or update code related to multithreading or concurrency74 - 🔍️ `feat`: Improve SEO75 - 🏷️ `feat`: Add or update types76 - 💬 `feat`: Add or update text and literals77 - 🌐 `feat`: Internationalization and localization78 - 👔 `feat`: Add or update business logic79 - 📱 `feat`: Work on responsive design80 - 🚸 `feat`: Improve user experience / usability81 - 🩹 `fix`: Simple fix for a non-critical issue82 - 🥅 `fix`: Catch errors83 - 👽️ `fix`: Update code due to external API changes84 - 🔥 `fix`: Remove code or files85 - 🎨 `style`: Improve structure/format of the code86 - 🚑️ `fix`: Critical hotfix87 - 🎉 `chore`: Begin a project88 - 🔖 `chore`: Release/Version tags89 - 🚧 `wip`: Work in progress90 - 💚 `fix`: Fix CI build91 - 📌 `chore`: Pin dependencies to specific versions92 - 👷 `ci`: Add or update CI build system93 - 📈 `feat`: Add or update analytics or tracking code94 - ✏️ `fix`: Fix typos95 - ⏪️ `revert`: Revert changes96 - 📄 `chore`: Add or update license97 - 💥 `feat`: Introduce breaking changes98 - 🍱 `assets`: Add or update assets99 - ♿️ `feat`: Improve accessibility100 - 💡 `docs`: Add or update comments in source code101 - 🗃️ `db`: Perform database related changes102 - 🔊 `feat`: Add or update logs103 - 🔇 `fix`: Remove logs104 - 🤡 `test`: Mock things105 - 🥚 `feat`: Add or update an easter egg106 - 🙈 `chore`: Add or update .gitignore file107 - 📸 `test`: Add or update snapshots108 - ⚗️ `experiment`: Perform experiments109 - 🚩 `feat`: Add, update, or remove feature flags110 - 💫 `ui`: Add or update animations and transitions111 - ⚰️ `refactor`: Remove dead code112 - 🦺 `feat`: Add or update code related to validation113 - ✈️ `feat`: Improve offline support114115## Guidelines for Splitting Commits116117When analyzing the diff, consider splitting commits based on these criteria:1181191. **Different concerns**: Changes to unrelated parts of the codebase1202. **Different types of changes**: Mixing features, fixes, refactoring, etc.1213. **File patterns**: Changes to different types of files (e.g., source code vs documentation)1224. **Logical grouping**: Changes that would be easier to understand or review separately1235. **Size**: Very large changes that would be clearer if broken down124125## Examples126127Good commit messages:128- ✨ feat: add user authentication system129- 🐛 fix: resolve memory leak in rendering process130- 📝 docs: update API documentation with new endpoints131- ♻️ refactor: simplify error handling logic in parser132- 🚨 fix: resolve linter warnings in component files133- 🧑💻 chore: improve developer tooling setup process134- 👔 feat: implement business logic for transaction validation135- 🩹 fix: address minor styling inconsistency in header136- 🚑️ fix: patch critical security vulnerability in auth flow137- 🎨 style: reorganize component structure for better readability138- 🔥 fix: remove deprecated legacy code139- 🦺 feat: add input validation for user registration form140- 💚 fix: resolve failing CI pipeline tests141- 📈 feat: implement analytics tracking for user engagement142- 🔒️ fix: strengthen authentication password requirements143- ♿️ feat: improve form accessibility for screen readers144145Example of splitting commits:146- First commit: ✨ feat: add new solc version type definitions147- Second commit: 📝 docs: update documentation for new solc versions148- Third commit: 🔧 chore: update package.json dependencies149- Fourth commit: 🏷️ feat: add type definitions for new API endpoints150- Fifth commit: 🧵 feat: improve concurrency handling in worker threads151- Sixth commit: 🚨 fix: resolve linting issues in new code152- Seventh commit: ✅ test: add unit tests for new solc version features153- Eighth commit: 🔒️ fix: update dependencies with security vulnerabilities154155## Command Options156157- `--no-verify`: Skip running the pre-commit checks (lint, build, generate:docs)158159## Important Notes160161- By default, pre-commit checks (`pnpm lint`, `pnpm build`, `pnpm generate:docs`) will run to ensure code quality162- If these checks fail, you'll be asked if you want to proceed with the commit anyway or fix the issues first163- If specific files are already staged, the command will only commit those files164- If no files are staged, it will automatically stage all modified and new files165- The commit message will be constructed based on the changes detected166- Before committing, the command will review the diff to identify if multiple commits would be more appropriate167- If suggesting multiple commits, it will help you stage and commit the changes separately168- Always reviews the commit diff to ensure the message matches the changes