From commit-message
Generate a conventional commit message by analyzing staged git changes. Use when the user wants to create, write, or generate a git commit message from their current staged diff. Trigger on phrases like "commit", "commit message", "commit msg", "寫 commit", "提交訊息", "generate commit", or when the user has just finished making code changes and wants to commit them. Also trigger when the user runs /commit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/commit-message:commit-messageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a conventional commit message from staged git changes following a structured prompt pipeline.
Generate a conventional commit message from staged git changes following a structured prompt pipeline.
Only stage files that were modified as part of the current session's work. Do not blindly run git add -A or git add . — pick specific files relevant to the task. If unsure which files to stage, show the user git status and let them decide.
Then get both an overview and the full diff:
git diff --staged --stat
git diff --staged
If the diff is empty after this, inform the user that there are no staged changes and stop.
If the diff is very large (e.g., more than 2000 lines), focus on the --stat output and the most important hunks. For files where changes are too extensive, note that those diffs were omitted and base the summary on the stat overview and available context.
If the staged changes span many unrelated modules or more than 10 files across different concerns, suggest splitting into multiple focused commits before proceeding.
Run a quick scan of recent commits to match the repo's conventions:
git log --oneline -20
If the repo already follows a consistent style (e.g., specific scope naming, prefix preferences, or language), adapt the generated message to match. The conventions in this skill are defaults — defer to the repo's existing patterns when they differ.
Produce a bullet-point summary of the changes. Follow these rules:
+ means it was added, - means deleted. Lines with neither are context.-.[ or ] characters in the summary.Example summary comments for reference (do not copy verbatim):
- Increase the number of returned recordings from 10 to 100
- Correct a typo in the GitHub Action name
- Relocate the octokit initialization to a separate file
- Implement an OpenAI API endpoint for completions
From the summary, write a single-line commit title:
Prefix — choose exactly one label based on the summary:
build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)chore: Updating libraries, copyrights, or other repo settings, includes updating dependenciesci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, GitHub Actions)docs: Non-code changes, such as fixing typos or adding new documentationfeat: Introduces a new feature to the codebasefix: Patches a bug in the codebaseperf: A code change that improves performancerefactor: A code change that neither fixes a bug nor adds a featurestyle: Changes that do not affect the meaning of the code (white-space, formatting, etc.)test: Adding missing tests or correcting existing testsBreaking changes — if the diff removes or renames a public API, changes a function signature in a breaking way, or makes any other backward-incompatible change, append ! after the prefix (or after the scope if present). For example: feat!: or feat(api)!:. Additionally, include a BREAKING CHANGE: line in the commit body describing what changed and how to migrate.
Scope — identify the module or package scope from the changed files:
model, git, prompt, cmd, provider).provider/openai/ should use openai, not provider.<prefix>: <title> instead.Format the commit message as:
<prefix>(<scope>): <title>
<summary>
Or without scope:
<prefix>: <title>
<summary>
If there is a breaking change, include the footer:
<prefix>(<scope>)!: <title>
<summary>
BREAKING CHANGE: <description of what broke and migration path>
Use a HEREDOC to pass the multi-line message to git commit:
git commit -m "$(cat <<'EOF'
<prefix>(<scope>): <title>
<summary>
EOF
)"
Run git commit directly — do not ask for confirmation.
If the user's request includes extra actions beyond committing (e.g., "commit and push", "commit 然後推上去", "commit and create PR"), execute those after the commit succeeds. Common patterns:
git push after commitOnly perform actions the user explicitly requested.
npx claudepluginhub appleboy/skills --plugin commit-messageGenerates clear, conventional commit messages from git diffs. Useful when writing commit messages, reviewing staged changes, or preparing commits.
Generates conventional git commit messages by analyzing staged changes, categorizing types like feat/fix, adding scopes, and matching project history style.
Generates descriptive commit messages following conventional commits format by analyzing git diffs. Useful when writing commit messages or reviewing staged changes.