commit · sneg55 — Claude Code skill: one clean git commit
Turns your working changes into a single git commit, matching the repo's message style and explaining why the change was made.
npx skills add sneg55/agent-starter --skill commit -a claude-codeWhat commit does
This skill is invoked by hand and runs a short sequence. It reads git status, git diff HEAD, the current branch from git branch --show-current, and the last ten commits via git log --oneline -10. That tells it what changed and how messages are written in this particular repo.
From there it inspects the staged changes, classifies them — new feature, enhancement, bug fix, refactoring, test, docs — and drafts a one or two sentence message built around the reason for the change. The commit itself goes through HEREDOC syntax so a multi-line message survives quoting intact. One commit, one pass, nothing else.
A safety protocol is baked in. The skill leaves git config alone, does not bypass hooks, and never amends: it always makes a new commit. Ask it to commit .env or credentials.json and it will refuse and warn you. With nothing staged or modified, no empty commit appears. Interactive commands with the -i flag stay out, since they wait on input the skill cannot provide.
What it helps with
- fold scattered edits into one commit
- match the commit message style of a specific repo
- explain the reason for a change instead of listing files
- keep secret-bearing files out of a commit
- commit a multi-line message without quoting mistakes
Example prompts for the agent
- Commit the current changes
- Make a commit for these edits, follow the style in the repo history
- Commit the staged files and say in the message why this change was needed
How to install commit
1Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill commit -a claude-code2Manually: put the files in place
~/.claude/skills/commit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/commit/
1Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill commit -a codex2Manually: put the files in place
.agents/skills/commit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill commit -a cursor2Manually: put the files in place
.cursor/skills/commit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install sneg55/agent-starter commit2Manually: put the files in place
.github/skills/commit/SKILL.md1Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill commit -a gemini-cli2Platform CLI
gemini skills install https://github.com/sneg55/agent-starter --path skills/commitManually: put the files in place
.devin/skills/commit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill commit -a opencodeClaude.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
How do I install the commit skill in Claude Code?
Run npx skills add sneg55/agent-starter --skill commit -a claude-code. The skill lands at ~/.claude/skills/commit/SKILL.md.
What does the commit skill do?
It creates a single git commit from your current changes: reads the diff, checks repo history, follows the existing message style, and writes a short note on why the change was made.
Can it rewrite the last commit with --amend?
No. It always creates a new commit, and only amends if you explicitly ask. It also does not bypass hooks or touch git config.
Source text
SKILL.md · MIT
--- name: commit description: Create a single well-crafted git commit from current changes. Analyzes diff, follows repo's commit style, and writes a concise "why not what" message. user_invocable: true allowed-tools: - Bash(git add:*) - Bash(git status:*) - Bash(git commit:*) --- # Git Commit ## Context Gather this context before committing: - Current git status: `git status` - Current git diff (staged and unstaged): `git diff HEAD` - Current branch: `git branch --show-current` - Recent commits: `git log --oneline -10` ## Git Safety Protocol - NEVER update the git config - NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it - CRITICAL: ALWAYS create NEW commits. NEVER use git commit --amend, unless the user explicitly requests it - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files - If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit - Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported ## Task Based on the changes, create a single git commit: 1. Analyze all staged changes and draft a commit message: - Look at the recent commits to follow this repository's commit message style - Summarize the nature of the changes (new feature, enhancement, bug fix, refactoring, test, docs, etc.) - Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.) - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what" 2. Stage relevant files and create the commit using HEREDOC syntax: ``` git commit -m "$(cat <<'EOF' Commit message here. EOF )" ``` Stage and create the commit in a single message. Do not do anything else.
© sneg55 · MIT · sneg55/agent-starter
Similar skills
All skills for Git and GitHub →commit by other authors comes first.