Imported from JohnMarvin237/claude-code-toolkit (
skills/SKILL.md). Install upstream withnpx skills add JohnMarvin237/claude-code-toolkit --skill skills. Copyright stays with the author.
Commit message
Generate a Conventional Commits-compliant message from the ACTUAL git diff, not from memory.
Core principle
The message describes what the diff contains — nothing more, nothing less. If the diff shows a bug fix, the message is fix:, even if the conversation was about a feature. Read the diff first.
Execution
- Run
git diff --stagedto see what's staged. - If nothing is staged, run
git diffto see unstaged changes and ask the user whether to stage them first (suggestgit add -pfor selective staging). - Classify the change type using the table in
references/types.md. - Identify the scope — the module, feature, or area most affected (lowercase, single word or hyphenated).
- Write the subject line:
type(scope): imperative-mood summary under 72 chars. - Decide if a body is warranted (see "When to add a body" below).
- Propose the message to the user; do not run
git commituntil they confirm.
Subject line rules
- Imperative mood: "add", "fix", "remove" — not "added" / "adds" / "adding"
- Lowercase after the colon, no period at the end
- Under 72 characters (hard limit at 100)
- One scope only; if the change crosses scopes, consider splitting the commit
When to add a body
Add a body (blank line after subject, then wrap at 72 chars) only if any of these apply:
- The change is non-obvious from the diff (explain the "why")
- There's a breaking change (use
BREAKING CHANGE:footer) - The change fixes an issue (use
Closes #123footer) - The change references an ADR (use
ADR: docs/adr/NNNN-slug.mdfooter)
For trivial changes (typo fix, dependency bump, formatting), the subject line alone is sufficient.
Type selection
See references/types.md for the full table. The most common:
feat: new user-facing capabilityfix: bug correctionrefactor: code restructuring without behavior changeperf: performance improvementtest: adding or fixing testsdocs: documentation onlychore: tooling, deps, CI, build configrevert: reverting a prior commit
Special cases
- Schema/migration changes: type is
featorfixdepending on intent, scope isdbor the entity name. Add migration name in body. - Security fixes: type is
fix, scope issecurity. Keep the subject vague if the bug is undisclosed; put detail in a private issue. - Breaking changes: add
!after scope (feat(api)!: ...) AND includeBREAKING CHANGE:footer with migration instructions.
Presenting the result
Format:
Proposed commit message:
<type>(<scope>): <subject>
<body if any>
<footers if any>
Run: git commit -m "<subject>" [-m "<body>"]
Ask: "Commit with this message? Any adjustments?"
What NOT to do
- Do not invent changes that aren't in the diff.
- Do not write WIP messages in production branches (if current branch looks like
main/master/develop, flag it). - Do not run
git commitwithout the user's confirmation. - Do not use
--amendor--forceflags without explicit instruction from the user. - Do not write sign-offs like "Generated by Claude" — the git
authormetadata suffices.
References
references/types.md— full type table with examplesreferences/examples.md— before/after examples of good vs bad messages