What it does
Smart Git Commit reads your staged diff in full and passes it to Claude, which analyzes every changed file to determine the most accurate commit type — feat, fix, refactor, chore, docs, test, perf, or ci. It infers the scope from the directory structure or package name, writes a concise imperative subject line under 72 characters, and optionally produces a wrapped body paragraph that explains the rationale behind the change.
Breaking changes are detected automatically by scanning for removed exports, changed function signatures, renamed environment variables, and modified API contracts. When a breaking change is found, the skill appends a BREAKING CHANGE: footer with a plain-English description, keeping your changelog tools and semantic versioning toolchains fully informed without any manual input from you.
How to install
npx skills add user/smart-git-commit
The command fetches the skill definition, validates the schema, and registers it with your Claude Code environment. No global npm packages are installed. The skill is stored in your project's .claude/skills/ directory and can be committed alongside your code.
How to use
Stage your changes as normal with git add, then ask Claude to generate your commit message:
Generate a commit message for my staged changes
Claude will analyze the diff and return a structured message. A typical output looks like this:
feat(auth): add JWT refresh token rotation Implements automatic token refresh to prevent session expiry during active use. The refresh endpoint accepts the existing token and returns a new token pair, invalidating the previous refresh token immediately. Closes #142
You can then commit directly: git commit -m "$(claude commit)" or paste the message into your editor. Additional prompts like "Make the commit message shorter" or "Add a scope for the API module" refine the output interactively.
Configuration
Smart Git Commit respects a .commitlintrc file if present, adapting its output to your project's custom scopes and allowed types. You can also pass inline options:
# Include a breaking change footer Generate a commit message for my staged changes, mark as breaking # Enforce a specific scope Generate a commit message, scope: payments # Skip the body paragraph Generate a short one-line commit message only
Tip: Add smart-git-commit to your team's shared CLAUDE.md under a "Git workflow" section. That way every contributor gets consistent, spec-compliant commit messages without a style guide document.
Related skills
Pair Smart Git Commit with PR Review Assistant to automate the full pull request lifecycle — from commit message to review comments. Use Changelog Gen to build release notes directly from your commit history, and Branch Namer to keep branch names consistent with the same Conventional Commits vocabulary.