Agent skill

Git Commit Integrity

by irahardianto in irahardianto/awesome-agv

Ensures every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not just a slice of a working directory that happened to pass while other changes sat nearby.

MITAuto-check passedDevelopment

Install Git Commit Integrity

skills CLI
$ npx skills add irahardianto/awesome-agv --skill git-commit-integrity -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install irahardianto/awesome-agv git-commit-integrity --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/git-commit-integrity .claude/skills/git-commit-integrity && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
git-commit-integrity
GitHub stars
157
Token cost
~2.6k tokens
SKILL.md length
1,374 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Ensures every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not just a slice of a working directory that happened to pass while other changes sat nearby.

  • Works in 2 steps: A passing hook is not proof a commit is… → **Splitting a finished diff into several…
  • Constructing multi-commit history from a single body of work
  • SKILL.md covers Purpose, When to Invoke, Core Principle: A Commit Is… and Pattern 1: Verify a Commit…, plus 3 more sections
  • Calls git and go

What it does

Git Commit Integrity is an agent skill from irahardianto/awesome-agv. Ensures every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not just a slice of a working directory that happened to pass while other changes sat nearby. Covers verifying commit history after the fact, designing pre-commit hooks that check the commit rather than the working tree, and splitting an already-finished diff into multiple logical commits safely. Tech-stack agnostic; applies whether or not the project has a pre-commit hook. Use whenever constructing…

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Commit messages. It works with Git. The repository describes itself as: Comprehensive sets of standards and practices designed to elevate the capabilities of AI coding agents. The licence is MIT.

When your agent uses it

  • Constructing multi-commit history from a single body of work
  • Writing a pre-commit hook
  • Before telling a user this commit is clean

Example prompts

  • “this commit is clean.”
  • “Use the git-commit-integrity skill to ensure every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not…”
  • “/git-commit-integrity”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. A passing hook is not proof a commit is buildable in isolation unless
  2. **Splitting a finished diff into several commits by staging subsets is not,

What it can do on your machine

Read from SKILL.md and the folder at commit 9e997ba. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Git Commit Integrity loads about 2.6k tokens when it runs. Until then it costs about 167 tokens; SKILL.md has 1,374 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~167
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from irahardianto/awesome-agv at commit 9e997ba, republished under its MIT licence (© irahardianto). 1,374 words, ~2,561 tokens.

Download SKILL.mdSave it as .claude/skills/git-commit-integrity/SKILL.md (or your agent's skills folder).
name
git-commit-integrity
description
Ensures every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not just a slice of a working directory that happened to pass while other changes sat nearby. Covers verifying commit history after the fact, designing pre-commit hooks that check the commit rather than the working tree, and splitting an already-finished diff into multiple logical commits safely. Tech-stack agnostic; applies whether or not the project has a pre-commit hook. Use whenever constructing multi-commit history from a single body of work, reviewing or writing a pre-commit hook, or before telling a user "this commit is clean."

Git Commit Integrity

Purpose

A commit records a tree snapshot. Nothing about git commit — or a hook that runs during it — guarantees that snapshot builds, lints, or tests cleanly on its own. The only thing most tooling actually checks is "does the working directory look okay right now", and those two questions are the same only in the ordinary one-change-at-a-time workflow. They diverge the moment more than one commit's worth of work exists in the working tree at once — which is exactly the situation whenever a large, already-finished diff is being organized into multiple readable commits after the fact.

This skill exists because that divergence is easy to miss: every gate can report green and the resulting history can still contain commits that don't build if checked out alone.

When to Invoke

  • Splitting a large, already-complete diff into multiple logical commits (a refactor, a big feature, an after-the-fact history cleanup).
  • Writing or reviewing a pre-commit / pre-push hook, in any language.
  • A user or reviewer asks "is this commit series bisectable?" or "does each commit build?"
  • Before claiming a multi-commit series is clean, complete, or ready for review — verify it, don't infer it from "the hook passed."

Core Principle: A Commit Is Its Snapshot, Not Your Working Directory

Compilers, linters, and test runners (cargo, go build, pytest, tsc, eslint, rspec, ...) read the filesystem. None of them know git's index exists. A tool invoked mid-commit checks whatever is on disk at that moment — staged changes, unstaged changes, and untracked files, all mixed together indiscriminately. git status/git diff --cached can tell you what will be committed; it takes a deliberate extra step to make what a tool checks match that.

Two consequences follow directly:

  1. A passing hook is not proof a commit is buildable in isolation unless you know the hook isolates the working tree to the index before running anything filesystem-based. Most hand-written hooks don't, because it isn't obvious the gap exists until you go looking for it.
  2. Splitting a finished diff into several commits by staging subsets is not, by itself, a safe operation. Each intermediate commit's actual recorded tree may reference symbols, fields, or files that don't exist yet at that point in history, even though the ambient working directory (with later batches still sitting unstaged) compiles fine.

Pattern 1: Verify a Commit Series After the Fact

Whenever a commit series is claimed finished, verify it — don't trust that the hook (if any) already did, unless you've confirmed it isolates (Pattern 2). Two techniques, in order of preference:

A. Isolated worktree replay (most reliable, works for any range):

bash
git worktree add --detach /tmp/verify-wt <first-sha>
cd /tmp/verify-wt
for sha in <sha1> <sha2> <sha3> ...; do
  git checkout --quiet "$sha"
  <build-command>   # e.g. cargo check --workspace --all-targets, go build ./..., npm run build
  <test-command>    # if fast enough to run per commit
done
cd - && git worktree remove --force /tmp/verify-wt

Report the actual pass/fail per commit — don't summarize as "all good" without having run this. If some commits fail in isolation, say so plainly; whether that's acceptable depends on whether the series needs to be bisectable (ask, don't assume).

B. git rebase --exec (fast, but stops at the first failure and needs a willingness to rewrite history to fix):

bash
git rebase -i --exec '<build-command> && <test-command>' <base-sha>

Good for enforcing the guarantee going forward once every commit is fixed up; less good for a first-pass audit since it halts at the first broken commit rather than reporting the full picture.

Neither technique is language-specific — substitute whatever the project's real build/lint/test invocation is.

Pattern 2: Designing a Pre-Commit Hook That Checks the Commit

If a project wants a hook to enforce "every commit builds," the hook must put the working tree into the state the commit will actually produce before running anything that reads the filesystem. There are two categories of gate:

Index-native checks — no isolation needed. These read staged blobs directly and are naturally correct regardless of what else is unstaged:

  • git diff --cached (content/whitespace/conflict-marker scans)
  • git grep --cached (pattern scans across staged content)
  • git cat-file -s :<path> (staged blob size)
  • git diff --cached --name-only (which files are actually part of this commit)

Filesystem-native checks — need isolation. Anything that shells out to a real toolchain has no concept of "staged": cargo/go/pytest/tsc/ eslint/rubocop/golangci-lint/semgrep, and any full-codebase grep over the source tree rather than over git grep --cached.

The isolation algorithm (verified against a reproducible bug in the naive alternative — see Anti-Pattern below):

  1. Diff the index against the working tree for tracked files: git diff-index --binary -r --no-color <tree-from-git-write-tree>.
  2. Save that diff as a patch file; reset the differing tracked paths to the index's content: git checkout-index -f -- <paths-from-diff-index-name-only>.
  3. Move untracked files to a temp directory (git ls-files --others --exclude-standard for the list).
  4. Run every filesystem-native gate now — the working tree exactly matches what the commit will record.
  5. Restore unconditionally on exit (trap ... EXIT, not just at the happy path's end): git apply the saved patch back, move untracked files back, clean up temp files.

This works identically regardless of language — the isolation step operates on git plumbing, not on the project's build tool.

Design checklist for the rest of the hook, independent of language:

  • One gate that can never be skipped (secrets/credential scanning). Every other gate may have a documented, explicit skip mechanism, but skipping must never be silent or the default.
  • Fast, index-native checks first; slow, filesystem-native checks (build, full test suite, SAST) last, so a trivial mistake fails in milliseconds rather than after a multi-minute compile.
  • A toolchain/marker that's absent should report skipped, not failed and not silently passed — so the hook works on day one of a project and grows as new tech stacks are added, without needing a rewrite.
  • If the project also has CI, treat the hook as the fast local signal and CI as the authoritative one — CI running per-commit (a matrix job over the commit range, or git rebase --exec in a CI step) is the only mechanism that catches history-construction mistakes a local hook's working-tree isolation might still miss (e.g. isolation itself disabled via an escape hatch, or the hook not installed on a contributor's machine). See the ci-cd skill for wiring that up.
Show full SKILL.md (396 more words)Show less

Pattern 3: Splitting an Already-Finished Diff Into Logical Commits

When a large, complete change needs to become a readable series of commits (rather than one large commit):

  1. Group by concern, not by file count. Read enough of each file's diff to know what it's actually doing before assigning it to a group — a file touched by three different concerns should go with whichever concern dominates its diff, and the commit message should say so honestly rather than implying the commit is narrower than it is.
  2. Stage and commit incrementally, writing a substantial message per commit that explains what and why, matching the project's established commit-message conventions.
  3. Verify with Pattern 1 before calling the series done. Do not assume intermediate commits build just because the final state does, and do not assume a passing hook proves it either unless you've confirmed the hook isolates (Pattern 2). If intermediate commits don't build in isolation, surface that explicitly and let the user decide whether it matters for their use case (no CI / no bisecting need vs. a project that relies on git bisect).
  4. Prefer fixing forward over hiding the gap. If a commit needs to be independently buildable, the fix is usually moving a small piece (a struct field, an enum variant) earlier via interactive rebase — not disabling the hook or skipping verification.

Anti-Patterns

  • git commit --no-verify to skip a hook that's "probably fine to skip this once." If a hook is wrong, fix the hook; if it's right, don't bypass it.
  • git stash --keep-index --include-untracked as an isolation mechanism. Reproducible bug (confirmed on git 2.43): when a tracked file has both a staged change and a further unstaged edit on top of it — ordinary partial staging — popping the stash produces a spurious merge conflict, even though the two changes don't overlap. This is the exact scenario the isolation exists to support, so the failure mode defeats the purpose. Use the diff/patch approach in Pattern 2 instead; it never invokes a 3-way merge, so it has no conflict surface.
  • Treating "the hook passed" as proof of per-commit integrity without having checked whether the hook isolates the working tree at all. Most hand-written hooks don't, until someone goes looking.
  • Assuming a big refactor's intermediate commits are fine because the final commit compiles. They are two different claims; only verify the one you're actually about to assert.

© irahardianto, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/git-commit-integrity of irahardianto/awesome-agv.

Open the folder on GitHubat commit 9e997ba

Compare with similar skills

Git Commit Integrity next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git Commit Integrity compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Commit Integrity this skillirahardianto/awesome-agv157—~2.6kAutomated safety check: PassMIT
React Router Release Notes Prepremix-run/react-router57k—~1.1kAutomated safety check: PassMIT
ToolJet Multi-Repo CommitToolJet/ToolJet41k—~1.3kAutomated safety check: PassAGPL-3.0
Git Workflow and Versioningaddyosmani/agent-skills102k2 repos~3.5kAutomated safety check: NotesMIT
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
Verdaccio Pull Request Workflowverdaccio/verdaccio18k—~1.9kAutomated safety check: PassMIT

Similar skills

  • React Router Release Notes Prep

    remix-run/react-router

    Polishes pending React Router change files before the versioning scripts run, and decides whether a long-form What's Changed section is warranted.

    57k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Commits changes across ToolJet's root repo and its server/ee and frontend/ee submodules, writing messages from the diffs and updating submodule pointers in order.

    41k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Git Workflow and Versioning

    addyosmani/agent-skills

    Sets git habits for every change: short-lived branches, atomic commits with descriptive messages, clean pull requests, plus versioning, tagging and changelogs for releases.

    102k GitHub starsUsed in 2 repos~3.5k tokens
    DevelopmentAuto-check: notes
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Takes a change through a verdaccio pull request: branch, local checks, changeset, title and body, labels, CI and review rounds, and ports to other release lines.

    18k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Commits changes in the Saleor codebase and works through pre-commit hook failures from ruff, mypy, the GraphQL schema check and the migrations check.

    23k GitHub stars~575 tokensUpdated today
    DevelopmentAuto-check passed

More from irahardianto/awesome-agv

All 34 skills in this repo
  • Distinctive Frontend Design Builder

    irahardianto/awesome-agv

    Commits to one bold aesthetic direction, sets up a CSS token system for it, then builds the interface in Vue or plain HTML using those tokens.

    157 GitHub stars~2.4k tokensUpdated 2 days ago
    Auto-check passed
  • Perf Optimization

    irahardianto/awesome-agv

    Profile-driven performance optimization protocol. An agent skill from irahardianto/awesome-agv.

    157 GitHub stars~4.3k tokensUpdated 2 days ago
    Auto-check passed
  • Angular Idioms and Patterns

    irahardianto/awesome-agv

    Coding conventions for Angular 19 and later: standalone components, signals, OnPush change detection, lazy routes and where RxJS still belongs.

    157 GitHub stars~3.8k tokensUpdated 2 days ago
    Auto-check passed
  • CI/CD Pipeline Principles

    irahardianto/awesome-agv

    Rules for designing CI/CD pipelines in layers: universal lint, test and scan stages, container builds with SBOM attestation, and GitOps for orchestrated deployments.

    157 GitHub stars~2.7k tokensUpdated 2 days ago
    Auto-check: notes
  • Hono Idioms

    irahardianto/awesome-agv

    Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.

    157 GitHub stars~3k tokensUpdated 2 days ago
    Auto-check passed
  • Mobile Testing

    irahardianto/awesome-agv

    Mobile E2E testing patterns — Flutter integrationtest, Patrol, Maestro, golden testing, device matrix, and test data management.

    157 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check: notes

Works with

Categories

Questions about Git Commit Integrity

What does Git Commit Integrity do?

Ensures every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not just a slice of a working directory that happened to pass while other changes sat nearby. Git Commit Integrity is an agent skill from irahardianto/awesome-agv. Ensures every commit in a series is what it claims to be — a working, gate-passing snapshot in isolation, not just a slice of a working directory that happened to pass while other changes sat nearby.

When should I use Git Commit Integrity?

Git Commit Integrity fits situations like: constructing multi-commit history from a single body of work; writing a pre-commit hook; before telling a user this commit is clean.

How do I install Git Commit Integrity in Claude Code?

Run `npx skills add irahardianto/awesome-agv --skill git-commit-integrity -a claude-code`. Or copy the skill folder (.agents/skills/git-commit-integrity in irahardianto/awesome-agv) into .claude/skills/git-commit-integrity in your project. Claude Code loads it when a task matches its description.

How do I install Git Commit Integrity in Codex?

Run `npx skills add irahardianto/awesome-agv --skill git-commit-integrity -a codex`. Or copy the skill folder (.agents/skills/git-commit-integrity in irahardianto/awesome-agv) into .agents/skills/git-commit-integrity in your project. Codex loads it when a task matches its description.

Can I use Git Commit Integrity in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add irahardianto/awesome-agv --skill git-commit-integrity -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/git-commit-integrity, .gemini/skills/git-commit-integrity, .github/skills/git-commit-integrity and .opencode/skills/git-commit-integrity in your project.

What does Git Commit Integrity need to run?

Going by SKILL.md and its folder, Git Commit Integrity needs the command-line tools its instructions call (git and go).

Does Git Commit Integrity access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Git Commit Integrity safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Git Commit Integrity use?

Git Commit Integrity is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git Commit Integrity use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Git Commit Integrity?

Skills that share tags, products or a category with Git Commit Integrity: React Router Release Notes Prep (remix-run/react-router, 57k stars), ToolJet Multi-Repo Commit (ToolJet/ToolJet, 41k stars), Git Workflow and Versioning (addyosmani/agent-skills, 102k stars) and React Router Pull Request Creator (remix-run/react-router, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Commit Integrity?

irahardianto (a GitHub user) maintains it in irahardianto/awesome-agv, which has 157 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 5, 2026.

Source: irahardianto/awesome-agv on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.