git-commit
3
总安装量
3
周安装量
#60738
全站排名
安装命令
npx skills add https://github.com/catch6/ai-toolkits --skill git-commit
Agent 安装分布
opencode
3
mcpjam
1
claude-code
1
junie
1
windsurf
1
zencoder
1
Skill 文档
Git Commit
Goal
Make commits that are easy to review and safe to ship:
- only intended changes are included
- commits are logically scoped (split when needed)
- commit messages describe what changed and why
Workflow Checklist
- Inspect the working tree before staging.
git statusgit diff(unstaged)- If many changes:
git diff --stat
- If many changes:
git diff --staged(unstaged)- If many changes:
git diff --staged --stat
- If many changes:
- Decide commit boundaries (split if needed).
- Split by: feature vs refactor, backend vs frontend, formatting vs logic, tests vs prod code, dependency bumps vs behavior changes.
- If changes are mixed in one file, plan to use patch staging.
- Stage only what belongs in the next commit.
- Prefer patch staging for mixed changes:
git add -p - To unstage a hunk/file:
git restore --staged -porgit restore --staged <path>
- Prefer patch staging for mixed changes:
- Review what will actually be committed.
- Sanity checks:
- no secrets or tokens
- no accidental debug logging
- no unrelated formatting churn
- Sanity checks:
- Describe the staged change in 1-2 sentences (before writing the message)
- “What changed?” + “Why?”
- If you cannot describe it cleanly, the commit is probably too big or mixed; go back to step 2.
- Commit directly without user confirmation.
- Use Conventional Commits (required):
type(scope): <summary>(type and scope MUST be English lowercase, summary MUST be Chinese, no period)- blank line
- body (MUST be Chinese, describe what/why, Use imperative mood for summary, MUST be
-prefix markdown list format, no period) - footer (MUST be Chinese, for BREAKING CHANGE) if needed
- Use Conventional Commits (required):
- Repeat for the next commit until the working tree is clean.
Types:
| Type | Use |
|---|---|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation |
| style | Formatting |
| refactor | Restructure |
| perf | Performance |
| test | Tests |
| build | Build system |
| ci | CI config |
| chore | Other |
| revert | Revert |
Example:
feat(auth): æ·»å ç¨æ·ç»å½åè½
- å®ç°åºäºJWTçç¨æ·è®¤è¯æºå¶
- æ¯æé®ç®±åææºå·ä¸¤ç§ç»å½æ¹å¼
BREAKING CHANGE: ç§»é¤æ§çsession认è¯ï¼éè¦éæ°ç»å½
Deliverable
Provide:
- the final commit message(s)
- a short summary per commit (what/why)