ProstDev ProstDev
Beginner Added Jul 8, 2026 · 3 min read

Commit

commit

Turn the staged diff into one clean conventional commit — nothing added, nothing pushed.

Claude Code skill

Note

Pairs with commit-and-push. commit stops at the commit; commit-and-push does the same commit and then ships it. Install both and pick per invocation — say “commit” when you’re not ready to push yet, “commit and push” when you are.

What it does

commit is a Claude Code skill that takes your already-staged changes and turns them into a single, well-formed commit. It doesn’t stage anything, doesn’t touch untracked or unstaged files, and — importantly — doesn’t push. You decide what goes in the commit by staging it yourself; the skill just writes a sensible message and commits.

The commit message is a conventional-commit one-liner: a type: summary line where type is inferred from the diff (feat, fix, docs, refactor, test, chore, style, perf, build, ci) and the summary is imperative.

When to use it

  • You’ve staged exactly what you want (git add -p, a few files) and just want it committed cleanly.
  • You want a conventional-commit message written from the diff instead of typing one yourself.
  • You’re mid-work and want a checkpoint commit without pushing — e.g. before a risky refactor, or when you’ll push a batch later with commit-and-push.

How it works

The skill is a short Markdown file — frontmatter plus plain-English steps. There’s no code; Claude runs the git commands with its normal tools. A few deliberate design choices make it safe to hand off:

  • It never stages for you. No git add, no git commit -a, no path args. If nothing is staged, it stops and says so rather than guessing what you meant to include. Your staging area is the spec.
  • It reads the diff before writing the message. git diff --cached --stat both confirms something is staged and gives the model the material to infer the right conventional-commit type.
  • It refuses the destructive neighbors. No push, no amend, no rebase, no force-push, no branch switching, no PR. The blast radius is exactly one local commit.
  • It runs on Haiku in a forked context. model: haiku + context: fork keep it fast and cheap — a mechanical task doesn’t need the main model or the full conversation.

The skill definition

Here’s the actual SKILL.md, verbatim — copy it and drop it in your project’s skills directory.

---
name: commit
description: Commit whatever is currently staged — commit only, no push. Use when the user says "commit", "commit this", "commit the staged changes". Does not stage anything and does not push. For committing AND pushing, use commit-and-push instead.
model: haiku
context: fork
---

# Commit

Commit the currently staged changes. Commit only — **do not push**. Do not `git add`, do not stage
untracked or unstaged files.

## Steps

1. `git diff --cached --stat` — confirm something is staged. If nothing is staged, stop and tell
   the user there's nothing to commit (don't stage anything for them).
2. Write a short commit message from the staged diff: a `type: summary` line, where `type` is a
   conventional-commit prefix inferred from the change (`feat`, `fix`, `docs`, `refactor`, `test`,
   `chore`, `style`, `perf`, `build`, `ci`) and the summary is imperative.
3. `git commit` with that message (staged changes only — no `-a`, no path args).
4. Report the commit hash and message.

## Don't

- Don't push.
- Don't stage anything (`git add`, `git commit -a`, `git commit <path>`).
- Don't amend, rebase, or force-push.
- Don't touch other branches or open a PR.
Claude CodeGit
Search

Loading search…