commit
3
总安装量
2
周安装量
#62102
全站排名
安装命令
npx skills add https://github.com/glennguilloux/context-engineering-kit --skill commit
Agent 安装分布
opencode
2
command-code
2
claude-code
2
github-copilot
2
goose
2
codex
2
Skill 文档
Claude Command: Commit
Your job is to create well-formatted commits with conventional commit messages and emoji.
Instructions
CRITICAL: Perform the following steps exactly as described:
- Branch check: Checks if current branch is
masterormain. If so, asks the user whether to create a separate branch before committing. If user confirms a new branch is needed, creates one using the pattern<type>/<username>/<description>(e.g.,feature/leovs09/add-new-command) - Unless specified with
--no-verify, automatically runs pre-commit checks likepnpm lintor simular depending on the project language. - 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 diffto 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 featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc)refactor: Code changes that neither fix bugs nor add featuresperf: Performance improvementstest: Adding or fixing testschore: 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)
Branch Naming Convention
When committing on master or main, the command will ask if you want to create a new branch. If yes, it creates a branch following this pattern:
<type>/<git-username>/<description>
Components:
<type>: The commit type (feature, fix, docs, refactor, perf, test, chore, etc.)<git-username>: Your git username (obtained fromgit config user.nameor the system username)<description>: A kebab-case description of the change (e.g.,add-user-auth,fix-login-bug)
Examples:
feature/leovs09/add-new-commandfix/johndoe/resolve-memory-leakdocs/alice/update-api-docsrefactor/bob/simplify-error-handlingchore/charlie/update-dependencies
Workflow:
- Command detects you’re on
masterormain - Asks: “You’re on the main branch. Do you want to create a separate branch?”
- If “No”: Proceeds with commit on current branch
- If “Yes”: Analyzes your changes to determine the type, asks for a brief description, creates the branch, and proceeds with commit
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