Auto-analyze git changes and generate Conventional Commits messages. Use when need to commit changes with proper commit messages. Triggers on "提交", "commit", "gh-commit", "/gh-commit", "自動 commit".
Auto-analyze git changes and generate Conventional Commits messages. Use when need to commit changes with proper commit messages. Triggers on "提交", "commit", "gh-commit", "/gh-commit", "自動 commit".
allowed-tools
Bash, Read, Glob, Grep
version
1.0.0
scope
public
evolution
{"enabled":true,"version":"1.0.0","stability":"stable","auto_evolve":"patch","created":"2026-02-12T00:00:00.000Z","updated":"2026-02-12T00:00:00.000Z","history":[{"version":"1.0.0","date":"2026-02-12","note":"Split from gh-commit-and-push"}]}
Subject limited to 50 characters (25 Chinese characters)
Use imperative mood
Capitalize first letter
No trailing period
Body explains what and why — must state the motivation/reason, not just list files changed. Ask: "Why was this change necessary?" If body only describes what (e.g., "Modified auth.ts"), it is incomplete.
Phase 5: Execute Git Operations
Add all changes
git add .
Commit with message
git commit -m "<generated message>"
Type Classification Reference
Conventional Commits Types
Type
Usage
Examples
feat
New feature
Add API endpoint, add UI component
fix
Bug fix
Fix calculation error, fix UI display issue
docs
Documentation
Update README, add comments
style
Formatting
Adjust indentation, remove blank lines
refactor
Refactoring
Extract function, reorganize file structure
perf
Performance
Optimize queries, reduce memory usage
test
Testing
Add tests, modify tests
build
Build system
Modify webpack config
ci
CI/CD
Modify GitHub Actions
chore
Miscellaneous
Update dependencies, modify .gitignore
Decision Flowchart
File changes
|
New file?
|-- Yes -> feat (new feature)
+-- No |
What type of file was modified?
|-- README/docs -> docs
|-- test files -> test
|-- config files -> chore
+-- source code |
Commit message or diff contains "fix", "bug"?
|-- Yes -> fix
+-- No -> refactor or feat (based on scope of change)
Safety and Escalation
Situation
Action
No uncommitted changes
Notify user, stop
Merge conflicts exist
Prompt user to handle manually
Not a git repository
Prompt to initialize git
Verification
# Confirm last commit
git log -1 --oneline
# Confirm commit details
git show HEAD