Skip to main content
skill CX Codex

commit · prathamdby — Claude Code skill: diff-backed commits, install guide

This skill commits only the changes you scoped and writes a message where every line traces back to a proving hunk.

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

What commit does

Four steps run in order. Lock reads status plus the selected diff, cached for staged work and worktree for unstaged, then hashes those bytes with git hash-object. Draft builds the message from the locked hunks alone, ignoring session, ticket, branch or earlier review context. Commit mutates, Verify compares the resulting diff and %B against the snapshot.

Defaults are staged changes, conventional style, trailers denied. Hooks stay on unless the host policy allows a bypass. Choosing unstaged work requires an empty index, and untracked files never enter the commit. Contradictory scope or style requests block the run; a failing hook does not change the recorded policy.

Subject goes in one -m, body in at most one more. No editor, HEREDOC, -F, -a or per-bullet argument. The skill never pushes and ends in one of three terminals: SUCCESS, NO_CHANGES, BLOCKED.

What it helps with

  • commit one slice of edits while leaving the rest of the tree alone
  • write a commit message that only states what the diff proves
  • keep stray files and leftovers from earlier tasks out of the commit
  • respect the repository's hook and trailer policy
  • re-check the diff and message after the commit lands

Example prompts for the agent

  • Commit only the staged changes under src/api, conventional style
  • Make a commit from my unstaged edits, index is empty, do not skip hooks
  • Commit these changes and show which hunks back each message line

How to install commit

1Skills CLI (Vercel)

npx skills add prathamdby/skills --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 commit in Claude Code?

Run npx skills add prathamdby/skills --skill commit -a claude-code. The skill file lands at ~/.claude/skills/commit/SKILL.md.

What does the commit skill do?

It saves a scoped set of changes and drafts a message tied to the selected hunks. Afterwards it checks the commit against the locked snapshot and reports a terminal status.

What is required to commit unstaged work?

The index has to be empty, and untracked files stay excluded. Only locked tracked paths get staged.

Source text

SKILL.md · MIT
---
name: commit
description: >
  commit to save scoped changes with a message proved by the selected diff.
---

# Commit

## Options

Default: staged, conventional, trailers denied; hooks off only where host
policy permits bypass, otherwise hooks on. "Unstaged work" requires an empty
index; untracked files stay excluded. "Plain subject"/"simple message" selects
simple. "Run hooks"/"do not skip hooks" selects on. Explicit identity-trailer
requests opt in only to those trailers. Conflicting scopes/styles or missing
needed values block; hook failure does not change the chosen policy.

## 1. Lock

Read status and the selected diff (cached for staged, worktree for unstaged).
Empty → NO_CHANGES, naming other layers without switching. Hash selected bytes
with git hash-object. For unstaged, block if index is nonempty.
Record `scope | style | hooks | requested trailers | hash | paths | message | command | SHA | terminal`.
Done when intended bytes and out-of-scope work are fixed.

## 2. Draft and trace

Load the selected style and rejection check in `REFERENCE.md`.
Draft only from locked hunks, not session/ticket/plan/branch/reviewer context
or a prior review-follow-up draft. Map every message line to proving hunks.
Rewrite unproved copy and all rejected forms. Use one subject -m and at most
one body -m, not an editor, HEREDOC, -F, -a, or an argument per bullet.
Done when style, clean-room trace, and requested-trailer policy pass.

## 3. Commit

Rehash immediately before mutation; movement restarts Lock. For unstaged,
stage only locked tracked paths and require cached bytes equal the snapshot.
Use separate literal argv values for subject/body; shell variables must
preserve quotes, backticks, dollars, backslashes, and newlines.
Run hooks when required/chosen; bypass only if both recorded policy and host
permit it. Done when one commit exists; errors/interruption are BLOCKED with
stderr and any index mutation, never silently changing hook policy.

## 4. Verify

Compare commit diff/paths and `%B` to the locked snapshot/message, check command
shape/hook policy and preservation of unrelated work. Mismatch blocks with SHA
and exact difference. For denied trailers always apply Trailer hygiene in
`REFERENCE.md`; with opt-in, apply it when an unrequested banned line appears.
Keep the REPL strip and unpublished/run-owned-HEAD checks; a clean -m is not
proof of clean HEAD. Done when commit and message match after any safe amend.

Report SHA, subject, scope, hooks/trailers, trace, amend status, and remaining
tracked/untracked work. Terminals: SUCCESS, NO_CHANGES, BLOCKED. Never push.

© prathamdby · MIT · prathamdby/skills

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 set7

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