commit-smart — Claude Code skill for Git commits
This skill reads Git changes, suggests a commit type and scope, then drafts a message that explains the reason behind the work. Use it when a diff alone would leave the intent unclear.
npx claude-code-templates@latest --skill git/commit-smartWhat commit-smart does
The skill checks the working tree and inspects the staged diff to choose a commit type and scope. If nothing is staged, it lists changed files, proposes a logical group, and asks what should go into the index. You can override the detected type or scope with arguments such as fix or refactor api.
Before writing anything to Git history, it presents the proposed message and waits for approval. The subject uses a conventional commit format; for substantive changes, the body gives the motivation rather than restating the diff. After approval, the skill runs git commit and checks the latest entry with git log. Your confirmation is required before the commit is created.
What it helps with
- infer a commit type from a diff
- choose a scope from the affected module
- group unstaged files before adding them
- write a commit message that explains the reason
- verify the latest commit in Git history
Example prompts for the agent
- Review my current Git changes and suggest which files belong in one commit.
- Use
fixas the commit type and explain the reason in the message. - Create a
refactor apicommit message and wait for my approval before committing.
How to install commit-smart
1claude-code-templates
npx claude-code-templates@latest --skill git/commit-smart2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill commit-smart -a claude-code3Manually: put the files in place
~/.claude/skills/commit-smart/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/commit-smart/
Manually: put the files in place
.agents/skills/commit-smart/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/commit-smart/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates commit-smart2Manually: put the files in place
.github/skills/commit-smart/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/git/commit-smartManually: put the files in place
.devin/skills/commit-smart/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about commit-smart
How do I install commit-smart in Claude Code?
Run npx claude-code-templates@latest --skill git/commit-smart to install the skill.
What does commit-smart do?
It examines Git changes, chooses a likely commit type and scope, and drafts a message that describes the motivation. It asks for approval before creating the commit.
Can I set the commit type and scope myself?
Yes. Pass one argument, such as fix, to set the type, or two, such as refactor api, to specify both type and scope.