Back to README
- Claude Code CLI installed with access to the skills directory
- Git >= 2.23 (for
git diff --cachedand modern diff behavior) - Target project must be a Git repository
mkdir -p ~/.claude/skills
git clone https://github.com/pardnchiu/skill-commit-generate.git \
~/.claude/skills/commit-generatemkdir -p <project>/.claude/skills
git clone https://github.com/pardnchiu/skill-commit-generate.git \
<project>/.claude/skills/commit-generatels ~/.claude/skills/commit-generate/SKILL.mdRestart Claude Code; invoke via /commit-generate.
# 1. Stage the files you want in the commit
git add <file1> <file2>
# 2. Invoke the skill from Claude Code
/commit-generateExample output:
feat: Add Docker environment auto-detection and database path switching
feat: 新增 Docker 環境自動偵測與資料庫路徑切換機制
When the staged diff crosses unrelated modules or touches 2+ primary tags:
⚠️ Multi-topic change detected; consider splitting into multiple commits:
- Auth module refactor: internal/auth/*.go
- UI style tweaks: web/styles/*.css
If merging anyway, the rollup description is:
refactor: Split auth module and adjust UI styles
refactor: 重構認證模組並調整 UI 樣式
No staged changes. Run `git add` first to select files to commit.
| Tag | Use Case |
|---|---|
feat |
New feature, endpoint, or component |
fix |
Bug fix, error handling, nil check |
update |
Adjust existing behavior or parameters |
add |
New file or resource (non-feature) |
remove |
Delete code or files |
refactor |
Refactor without behavior change |
perf |
Performance optimization |
style |
Formatting and layout |
doc |
Documentation and comments |
test |
Test-related changes |
chore |
CI/CD, tooling, dependency management |
security |
Security patch |
breaking |
Breaking change |
BREAKING > FEAT > FIX > SECURITY > UPDATE > REFACTOR > PERF > others
| Category | Signal |
|---|---|
| Symbol removal | Delete any exported or public function, class, method, type, constant, enum value |
| Signature change | Parameter type, order, new required parameter, return type change |
| HTTP API | Endpoint deletion, URL change, response schema field removed or type changed, status code change |
| Configuration | Delete existing key, add required key, type or format change on existing key |
| Migration | DROP COLUMN, required column added to populated table, type narrowing |
| CLI | Flag deletion, new required positional argument, semantic change to existing flag |
| Imports | Package or module restructure that breaks existing references |
| Category | Signal |
|---|---|
| Injection | SQL / XSS / Command / LDAP / Template injection |
| AuthZ | Missing auth check, privilege escalation, JWT validation gap |
| Sensitive data | Remove secrets, tokens, or PII from log / response / error message |
| Hardcoding | Remove hardcoded tokens, default passwords, API keys |
| Web security | CSRF / CORS / CSP / HSTS patches |
| CVE | Dependency CVE patches (upgraded from chore: upgrade to security) |
Any one of the following triggers detection:
- Diff touches 2+ primary tag categories (
feat/fix/refactor/breaking/security) - Changed files span 2+ semantically unrelated modules (top-level directory or package boundary)
- A single commit contains 3+ unrelated topics
Formatting, comment-only tweaks, and dependency bumps can ride along with the primary commit and do not count as multi-topic.
tag: English one-line description
tag: 繁體中文一句話描述
| Rule | Description |
|---|---|
| Single tag | Pick the tag that best represents the core intent |
| English subject | Imperative mood, <= 72 chars (Add / Fix / Refactor / Remove / Update) |
| Traditional Chinese body | <= 50 chars, verb-first (新增 / 修正 / 重構 / 移除 / 優化) |
| Merge related changes | Roll small edits into a single description |
| Single topic first | One intent per commit; warn before rolling up multi-topic changes |