← ClaudeAtlas

commit-msglisted

Generate a conventional commit message from staged git changes. Use this skill whenever the user asks to generate, write, or produce a commit message — including phrases like "幫我產commit message", "generate commit message", "根據staged changes產commit message", "commit訊息", "幫我寫commit", "產生commit", "寫commit message", "commit 怎麼寫", or any request to commit staged changes. Always invoke this skill before writing commit messages yourself.
hsinhan-h/hh-claude-skills · ★ 0 · Code & Development · score 60
Install: claude install-skill hsinhan-h/hh-claude-skills
# Commit Message Generator Generate a well-structured commit message based on the current staged changes. ## Step 1: Read the staged diff ```bash git diff --staged ``` If there are no staged changes, tell the user and stop. Suggest they run `git add <files>` first. Also check the language used in recent commits to decide whether the message should be in Traditional Chinese or English: ```bash git log --oneline -5 ``` Use Traditional Chinese if recent commits are in Chinese, otherwise use English. ## Step 2: Analyze the changes Look at what files changed and what the diff shows. Ask yourself: - What was the purpose of this change from a user's perspective? - Does it add new capability, fix broken behavior, update structure, or something else? ## Step 3: Pick the commit type Choose exactly one type based on the primary intent of the change: | Type | When to use | |------|-------------| | `feat` | New feature for the user (not a build-script feature) | | `fix` | Bug fix for the user (not a build-script fix) | | `docs` | Documentation only — no code logic changed | | `style` | Formatting, whitespace, semicolons — zero semantic change | | `refactor` | Code restructured without fixing a bug or adding a feature | | `chore` | Maintenance, dependency updates, config — no production code touched | | `perf` | Performance improvement | | `revert` | Reverts a previous commit | | `test` | Adding or fixing tests — no production code change | | `build` | Build system or external