agentsclimarketplace

Git smart commit

Skill xmqywx/claude-code-skills/skills/git-smart-commit

17 professional Claude Code skills - code review, API scaffold, n8n workflow generator, and more

Install
npx -y skills add xmqywx/claude-code-skills --skill git-smart-commit

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Generate intelligent conventional commit messages from staged changes. Analyzes diffs, auto-detects scope and breaking changes, and commits with approval.

SKILL.md

3.6 KB, as published. Nobody here has run it

Git Smart Commit

Generate a precise conventional commit message from the currently staged changes, then commit after user approval.

Steps

1. Gather Context

Run these commands to understand the staged changes and recent commit style:

git diff --cached --stat
git diff --cached
git log --oneline -10

If there are no staged changes, inform the user and suggest they stage files first (git add <files>). Do not proceed with an empty diff.

2. Analyze the Diff

Examine every file in the staged diff. Determine:

  • What changed: New files, modified logic, deleted code, config changes, dependency updates.
  • Why it changed: Infer intent from the nature of the change (new feature, bug fix, refactor, etc.).
  • Scope: Derive scope from the file paths. Use the most specific meaningful directory or module name.
    • src/auth/login.ts -> scope is auth
    • tests/utils/parser.test.js -> scope is utils
    • package.json only -> scope is deps
    • .github/workflows/ci.yml -> scope is ci
    • Multiple unrelated scopes -> omit scope or use the dominant one.
  • Breaking changes: Look for removed public APIs, renamed exports, changed function signatures, deleted fields, major dependency version bumps, or migration-requiring config changes.

3. Select Commit Type

Choose exactly one type based on priority:

TypeWhen to use
featNew feature or capability added
fixBug fix or correction
docsDocumentation only changes
refactorCode restructuring with no behavior change
perfPerformance improvement
testAdding or updating tests
ciCI/CD pipeline changes
buildBuild system or dependency changes
choreMaintenance tasks, tooling, config
styleFormatting, whitespace, semicolons (no logic change)
revertReverting a previous commit

4. Compose the Commit Message

Follow this structure:

<type>(<scope>): <subject>

<body>

<footer>

Rules:

  • Subject line: imperative mood, lowercase, no period, max 72 characters.
  • Body (optional): Explain what and why, not how. Wrap at 80 characters. Include only if the subject alone is insufficient.
  • Footer: Add BREAKING CHANGE: <description> if breaking changes were detected. Reference issue numbers if visible in branch name or diff comments (e.g., Closes #42).

5. Present for Approval

Show the complete commit message to the user in a fenced code block. Ask:

Ready to commit with this message? (yes / edit / abort)

  • If yes: Run git commit -m "<message>" using a HEREDOC for multi-line messages.
  • If edit: Ask the user what to change, revise, and re-present.
  • If abort: Stop without committing.

6. Confirm

After committing, run git log --oneline -1 to confirm the commit was created and display the short hash and message.

Edge Cases

  • Merge commits: Note that the staged changes are part of a merge and keep the message descriptive of the merge resolution.
  • Large diffs (>500 lines): Summarize by file group rather than reading every line. Focus on the overall intent.
  • Mixed concerns: If staged changes span multiple unrelated concerns, recommend the user split them into separate commits. Offer to help unstage files.
  • Amend requests: If the user says "amend", use git commit --amend but warn that this rewrites history.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.