| English | 中文 |
A good commit message lets people in the future know why this change exists.
It is not just written for the current reviewer, but also for yourself and your teammates in the future when troubleshooting, reverting code, or generating changelogs.
<type>(<scope>): <subject>
Examples:
feat(auth): add GitHub OAuth login
fix(api): handle empty response
docs(git): add troubleshooting guide
refactor(order): simplify pricing calculation
This format comes from Conventional Commits, which has been adopted by many open-source projects and automated release tools.
| type | Meaning |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation |
style |
Purely formatting adjustments |
refactor |
Refactoring that does not change behavior |
test |
Tests |
chore |
Tooling, dependencies, maintenance |
perf |
Performance optimization |
ci |
CI/CD |
A good subject should:
update, misc, wipNot recommended:
update
fix bug
misc changes
wip
Recommended:
fix(order): reject expired timeout config
docs(ai): add git workflow for coding agents
test(auth): cover expired token case
When AI modifies many files at once, do not commit them all as one large commit directly.
Split them by intent:
test(order): cover timeout validation
fix(order): reject expired timeout config
docs(order): explain timeout behavior
For splitting methods, see AI Commit Splitting.
See Commit Message Convention.