Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add sneg55/agent-starter --skill commit -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/commit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/commit/

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.

commit getsentry A skill that drafts Sentry-style conventional commits with issue references and blocks direct commits to main. CX Codex +1 4,700installs commit NeoLabHQ Automates Git commits using conventional commit messages and matching emojis. It checks the active branch, runs pre-commit linters, and suggests splitting complex diffs into atomic commits. CX Codex +1 1,200installs commit parcadei This skill turns session changes into git commits, shows you the plan first, and keeps Claude's name out of the messages. Handy when an agent has piled up edits. CX Codex +1 499installs commit PaulRBerg Composes the commit message from prepared evidence and hands the commit, index reconciliation and push to ai-commit. CX Codex +1 342installs commit LegendApp Turns the changes from your current task into one or more tidy commits and keeps unrelated work out. Handy when the working tree has piled up several unrelated edits. CX Codex +1 404installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. 990,453installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. 789,521installs implement Matt Pocock Implements work from a specification or tickets, following a test-driven flow and ending with review and a commit. Use it when a coding task needs a defined delivery routine. 774,700installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. 499,069installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. 489,289installs scaffold-exercises Matt Pocock This skill builds course exercise directories with sections, problems, solutions, and explainers. Use it when starting a new course section or creating exercise stubs. 480,196installs

From the same set2

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor