Skill v1.0.1
currentLLM-judged scan90/100+1 new
version: "1.0.1" name: git-commit description: Generate a conventional commit message (conventionalcommits.org) from the staged/unstaged diff and create the commit. Use when the user wants to commit, stage changes, or needs a commit message written. Not for release commits or changelogs (use git-release) or branch-finish workflows (use gitflow). metadata: summary: "Conventional commit message generation" author: mgiovani version: 1.0.0 disable-model-invocation: false argument-hint: '' hooks: PreToolUse:
- matcher: Bash(git commit*)
hooks:
- type: command
command: ${CLAUDE_PLUGIN_ROOT}/skills/git-commit/scripts/pre-commit-lint.sh timeout: 60
Git Commit
Generate a conventional commit message and create the commit.
Quality Guidelines
Base the message only on what the diff actually shows, not assumptions:
- Read
git statusandgit diff --staged(orgit diffif nothing is staged yet) before writing anything. - Check which files/modules changed before setting scope.
- Look for removed exports, changed signatures, deleted functions to catch breaking changes.
- If the purpose of a change is unclear, ask the user rather than guess.
Pre-commit Linting
In Claude Code, a PreToolUse hook runs before every git commit: it detects the project's linter (Node's npm/bun/pnpm/yarn run lint, Python's ruff/flake8, make lint, rubocop, golangci-lint) and blocks the commit if it fails. No linter configured means the commit proceeds unblocked. Outside Claude Code (no hook support), run the project's lint command yourself before committing. Never bypass a failing lint with --no-verify: fix the errors and re-run the commit instead.
Workflow
- Run
git statusandgit diff --stagedto see what actually changed. - If the diff mixes unrelated concerns (e.g. a feature plus an unrelated fix plus docs),
split into separate commits by staging each group with git add <files> and committing them one at a time. Otherwise, one commit is enough, don't force a split.
- For each commit, pick the type:
feat: new featurefix: bug fixdocs: documentation onlystyle: formatting, no code meaning changerefactor: neither fixes a bug nor adds a featureperf: performance improvementtest: adding or correcting testsbuild: build system or dependency changesci: CI configuration/scriptschore: everything else that doesn't touch src or testsrevert: reverts a previous commit
- Format as
type(scope): description, scope optional, description imperative mood
("add" not "added"), max ~50 characters. Skip the body for a typo fix or a single dependency bump; add a wrapped body (why, not how) once the change alters behavior or touches multiple files. For breaking changes, append ! after the scope and add a BREAKING CHANGE: ... footer.
Example formats
feat(auth): add OAuth2 login supportfix(api): resolve null pointer in user endpointdocs: update installation instructionschore(deps): bump lodash to 4.17.21feat(shopping-cart)!: remove deprecated calculate methodBREAKING CHANGE: calculate has been removed, use computeTotal instead
Ask for confirmation before committing if the changes are complex or span multiple concerns; otherwise just commit.