Claude-skill-registry git-commit-helper
Adherence to Conventional Commits and efficient Git history management using types, scopes, and advanced commit tools like fixup/amend. Triggers: git-commit, conventional-commits, breaking-change, fixup, git-amend, rebase.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/git-commit-helper" ~/.claude/skills/majiayu000-claude-skill-registry-git-commit-helper && rm -rf "$T"
manifest:
skills/data/git-commit-helper/SKILL.mdsource content
Git Commit Helper
Overview
Conventional Commits provide a standardized format for commit messages, enabling automated versioning and clearer project history. This skill covers formatting, managing breaking changes, and using advanced Git features like
fixup for a clean history.
When to Use
- Professional Collaboration: To make histories readable and searchable.
- Automated Releases: To trigger Semantic Versioning bumps (PATCH/MINOR/MAJOR).
- Clean History: To fix small mistakes in previous commits without creating "junk" commits.
Decision Tree
- Does the change add a new capability?
- YES: Type
(MINOR bump).feat
- YES: Type
- Does it fix a bug?
- YES: Type
(PATCH bump).fix
- YES: Type
- Does it break backward compatibility?
- YES: Append
after type/scope OR add!
footer (MAJOR bump).BREAKING CHANGE:
- YES: Append
- Did you forget a small detail in the last commit?
- YES: Use
orgit commit --amend
.--fixup
- YES: Use
Workflows
1. Formatting a Feature Commit
- Start the message with
and an optional scope in parentheses (e.g.,feat
).feat(auth): - Provide a concise description of the new capability.
- If the change breaks compatibility, append
to the type or add a!
footer.BREAKING CHANGE: - Run
using the formatted string.git commit -m "..."
2. Using Fixup for Clean History
- Identify the SHA of the commit needing a minor fix.
- Run
to stage the fix as agit commit --fixup <SHA>
commit.fixup! - Later, perform
to automatically merge the fix into the original commit.git rebase -i --autosquash
3. Amending the Last Commit
- Stage any missed changes using
.git add - Run
to update the last commit with new files while keeping the same message.git commit --amend --no-edit - Alternatively, use
without--amend
to refine the commit message structure.--no-edit
Non-Obvious Insights
- Case Sensitivity: Conventional Commit units are not case-sensitive, EXCEPT for
, which MUST be uppercase.BREAKING CHANGE - Breaking Change Indicator: The
indicator is a shorthand for marking API breaks without needing a full footer.! - Trailers: Footers should follow the Git trailer convention (
) to be recognized by automated tools.word-token: value
Evidence
- "feat: a commit of the type feat introduces a new feature... (this correlates with MINOR in Semantic Versioning)." - Conventional Commits
- "The units... MUST NOT be treated as case sensitive... with the exception of BREAKING CHANGE which MUST be uppercase." - Conventional Commits
- "--fixup=reword:<commit> creates an 'amend!' commit which replaces the log message..." - Git Docs
Scripts
: Script to generate conventional commit messages via CLI.scripts/git-commit-helper_tool.py
: Shell wrapper for executingscripts/git-commit-helper_tool.js
andfixup
commands.amend
Dependencies
(CLI tool)git