| name | git-commit-conventional |
| description | Standardize Git commit messages with Conventional Commits v1.0.0. Use this skill when the user mentions commit, 提交, 提交代码, 提交信息, commit message, conventional commit, feat/fix/chore, or asks to create/amend a commit. |
Git Commit Conventional
When to use
Use this skill whenever the user asks to commit changes, optimize commit messages,
or enforce commit message conventions.
Typical triggers include:
- "commit"
- "提交" / "提交代码" / "提交信息"
- "帮我写 commit message"
- "按 conventional commits 提交"
- "amend commit"
Goal
Produce clear, machine-friendly commit messages aligned with
Conventional Commits v1.0.0 and use non-interactive git commands.
Required format
Follow this structure:
<type>[optional scope][!]: <description>
[optional body]
[optional footer(s)]
Core rules to enforce:
- Prefix with a valid
type and a colon-space separator.
- Use
feat for new features, fix for bug fixes.
- Add optional
scope in parentheses when useful.
- Mark breaking changes with
! before : or with footer:
BREAKING CHANGE: <details>.
- Keep subject concise and specific.
Recommended types
feat: new feature
fix: bug fix
docs: documentation only
refactor: code change without feature/fix
test: tests added or changed
chore: maintenance work
build: build/dependency changes
ci: CI/CD changes
perf: performance improvements
style: formatting/style-only changes
revert: revert previous change
Execution workflow
- Inspect changes first:
git status --short
git diff --staged (or git diff if nothing staged)
- Infer one primary change intent and pick the best
type.
- Choose
scope only if it adds clear context (module, package, feature area).
- Draft the subject in imperative style, no trailing period.
- Add body only when context is needed.
- Add footers for issue links or breaking changes.
- Run non-interactive commit command.
Command patterns
Single-line message:
git commit -m "type(scope): short description"
With body/footer:
git commit \
-m "type(scope): short description" \
-m "Detailed context for reviewers." \
-m "Refs: #123"
Breaking change:
git commit \
-m "feat(api)!: simplify authentication flow" \
-m "BREAKING CHANGE: token refresh endpoint changed to /v2/auth/refresh"
Amend last commit:
git commit --amend -m "type(scope): updated description"
Output contract
When helping the user, return:
- Chosen
type (and scope if any)
- Final commit message text
- Exact git command to run
If changes mix multiple intents, recommend splitting into multiple commits.
Reference
Spec: https://www.conventionalcommits.org/en/v1.0.0/