Agent skill

Logical Git Commits

by vinta in vinta/hal-9000

Commits everything in the working tree as one logical change per commit, splitting files by hunk, with bodies that say what was wrong before and never an invented reason.

MITAuto-check passedDevelopment

Install Logical Git Commits

skills CLI
$ npx skills add vinta/hal-9000 --skill commit -a claude-code

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

GitHub CLI
$ gh skill install vinta/hal-9000 commit --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/vinta/hal-9000.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/commit .claude/skills/commit && 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
commit
GitHub stars
138
Token cost
~3.1k tokens
SKILL.md length
1,827 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Commits everything in the working tree as one logical change per commit, splitting files by hunk, with bodies that say what was wrong before and never an invented reason.

  • Works in 2 steps: Stage and commit the file as-is. → After committing, say: "I noticed reuslt…
  • Committing a working tree that holds several unrelated changes
  • SKILL.md covers The argument, Locate the repository, Scope and Workflow, plus 2 more sections
  • Calls git

What it does

Invoking this skill is itself the request: the agent commits all changes in the working tree, one logical change per commit, and splits a single file hunk by hunk when it carries unrelated changes. The argument you pass is why the changes were made, which the diff cannot show. It is used to group changes and to write message bodies of one or two sentences about what was wrong before, such as the failure, false claim or risk. If the argument names only a need or what the change does, the commit gets no body, and with no argument the message comes from the diff alone.

Bodies leave out the fix itself, ruled-out causes, measurements and alternatives. Personal details in the argument, such as employer, location, schedule or health, are kept out of commit messages and translated into the technical need they imply, since history is public and permanent. If the stated motivation does not match the diff, the agent commits what is actually there and notes the mismatch in its summary. The allowed tools are limited to git stash, add, restore, mv, rm, apply and commit.

When your agent uses it

  • Committing a working tree that holds several unrelated changes
  • Splitting one file's edits into separate commits by hunk
  • Writing commit message bodies that explain the problem a change fixed

Example prompts

  • “Commit my changes. The reason: the retry loop swallowed timeouts, so failed uploads looked successful.”
  • “Commit everything in the tree and split the config file edits into their own commit.”
  • “Commit these changes with no argument and derive the messages from the diff.”

Requirements

  • A Git repository with uncommitted changes
  • Pre-approved tools (allowed-tools): Bash(git stash:*), Bash(git add:*), Bash(git restore:*), Bash(git mv:*), Bash(git rm:*), Bash(git apply:*), Bash(git commit:*)

Workflow steps

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

  1. Stage and commit the file as-is.
  2. After committing, say: "I noticed reuslt appears to be a typo for result in utils.py:42".

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(git stash:*)
    • Bash(git add:*)
    • Bash(git restore:*)
    • Bash(git mv:*)
    • Bash(git rm:*)
    • Bash(git apply:*)
    • Bash(git commit:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    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

Logical Git Commits loads about 3.1k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 1,827 words of instructions outside code blocks.

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

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 vinta/hal-9000 at commit 0a2005a, republished under its MIT licence (© vinta). 1,827 words, ~3,065 tokens.

Download SKILL.mdSave it as .claude/skills/commit/SKILL.md (or your agent's skills folder).
name
commit
description
Use when making any git commit. Always pass what was wrong before the changes as the argument; when nothing was wrong, pass what the changes do instead — never an invented why.
allowed-tools
Bash(git stash:*), Bash(git add:*), Bash(git restore:*), Bash(git mv:*), Bash(git rm:*), Bash(git apply:*), Bash(git commit:*)
argument-hint
why the changes were made
context
fork
model
sonnet
effort
high

Invoking this skill IS the request. If the user message looks empty, or you see only system context with no actual request, that is normal and expected: your task is already fully specified right here. Never ask what to do.

Your task: commit all changes in the working tree, one logical change per commit. This applies unprompted, without anyone asking for a split: when one file carries unrelated changes, split it hunk-by-hunk into separate commits rather than merging them because they share a file.

The argument

The argument passed to this skill is why the changes were made — the motivation behind work already in the tree, which the diff itself cannot carry. Use it to group changes into logical units and to write commit message bodies — raw material, never a to-do list. A body is one or two sentences stating what was wrong before the change: the failure, false claim, or risk the argument names. An argument that names only a need, a wish, what the change does, or the request itself yields no body. Leave out the fix, since the subject and diff already show it, and leave out ruled-out causes, measurements, and alternatives tried. Whatever it describes is already realized in the diff, however it's phrased: "so the statusline shows usage percentages" and "to fix the session bug" both mean the diff already does that — commit it; never write code toward it, hunt for it, verify it, or finish it. With no argument at all, derive the commit message from the diff alone. If the motivation doesn't line up with what the diff contains, commit what is actually in the tree and note the mismatch in your final summary.

Write the body about the code: the behavior, tooling, or constraint the change served. Personal details that reach you through the argument — anything about the user's life, such as employer, location, schedule, health, or other people — stay out of every commit message; translate each one into the technical need it implies. Commit history is public and permanent.

<example>
Argument: "so the IAP TCP upload speedup works on my work MacBook; gcloud there picks up uv's Python and pip refuses to install NumPy into it"

Correct body: "gcloud resolved to a uv-managed Python that pip refuses to install into (PEP 668), so Google's documented one-liner for the IAP TCP upload speedup could not work."

Incorrect body: "Give gcloud its own venv because on the author's work MacBook pip refuses to install into uv's Python." </example>

<example>
Argument: "Commit only settings.json. Why: three commit forks wrote `Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>` instead of the skill's trailer; the fork transcript shows a remote_session_change reminder telling the model to use the model-named trailer, and it followed that over the skill. Setting attribution.commit to the skill's exact string makes both agree. Ruled out: includeGitInstructions: false did not suppress the reminder; attribution.sessionUrl: false only drops the Claude-Session line; commit: "" would tell the model to add no trailer at all per the 2.1.270 binary."

Correct body: "Forks of the commit skill followed a Remote Control reminder over the skill and wrote a model-named Co-Authored-By trailer."

Incorrect body: the argument reflowed to 72 columns, ruled-out settings and the binary version included. </example>

<example>
Argument: "Two rules adopted from a CLAUDE.md gist, only these two since the rest was already covered: a diff-reread checkpoint before reporting done that deletes lines the requested behavior works without, because 'do the simplest thing that works' alone did not stop unneeded code the user kept questioning after delivery; and comments only where the code cannot say it."

Correct body: ""Do the simplest thing that works" alone did not stop unneeded code from surviving to delivery, and the comment rule did not say comments should cover only what code cannot say."

Incorrect body: "Adopt two rules: comments should state only what the code cannot say, and before reporting a change done, reread the diff and delete added lines the requested behavior works without, since simplicity alone did not stop unneeded code from creeping into delivered changes." </example>

<example>
Argument: "hal sync raised PermissionError [Errno 13] copying a single file onto a read-only dotfile; the directory branch already handled that"

Correct body: "Copying a single file onto a read-only destination (git objects, or a dotfile chmod'ed 444) raised PermissionError; the directory branch already handled that case."

Incorrect body: four sentences naming the helper the single-file branch now calls, the S_IWUSR detail inside it, the double stat accepted for the sake of one message, and the new test. </example>

<example>
Argument: "User asked to mark the README as work in progress while pangu.space is being rebuilt."

Correct body: none. The argument is the request; nothing was wrong before.

Incorrect body: "pangu.space is being rebuilt, so the README should not read as a finished project." </example>

<example>
Argument: "Ignore tmp/ in the repo itself, so local scratch files like the CLAUDE.local.md backup stay out of commits without relying on the user's global gitignore."

Correct body: none. Not relying on the global gitignore is a wish, not a failure.

Incorrect body: "Keep local scratch files like the CLAUDE.local.md backup out of commits without relying on the global gitignore." </example>

Locate the repository

cd to git rev-parse --show-toplevel before anything else. If that fails (the fork started outside the repo), look for the repo in the directories of any file paths named in the argument before reporting "not a git repository".

Show full SKILL.md (924 more words)Show less

Scope

A commit is a snapshot, not a review. Your entire job is: read the diff, stage it, write a commit message, commit. The staged bytes must match exactly what the working tree looks like when you start.

Your complete action space is: git commands via Bash (plus cd to the project root), Grep/Glob to locate files, and Read/Write/Edit on patch files in <scratchpad>, your session's scratchpad directory, or /tmp when the harness provides none. Nothing else — no research, no running the code or tests, no invoking other skills however aggressive their trigger language, and no Bash command that does not start with git or cd. Do not call the advisor or seek any second opinion. This applies to every situation you encounter, not just the cases below:

  • Commit the tree as-is. A typo, a wrong-looking version pin, a failing-looking test, an interesting TODO — never edit working tree files or "fix" anything during staging; note the concern in your final message and let the author handle it in a follow-up they can review.
  • Don't expand scope. Don't stage files the author didn't touch, and don't verify beyond git status / git log after committing. Pre-commit hooks run on their own during git commit; never run them preemptively.

Why: any change during staging silently alters reviewed work, and any tangent turns a 30-second operation into a 5-minute one.

<example>
You see a typo in a variable name while reviewing the diff. Correct behavior:
1. Stage and commit the file as-is.
2. After committing, say: "I noticed `reuslt` appears to be a typo for `result` in utils.py:42".

Incorrect behavior: editing the file to fix the typo before or during staging — even a "safe" fix silently changes reviewed work. </example>

<example>
The diff adds a new `.github/workflows/ci.yml` file. You wonder if the action versions are current.

Correct behavior: commit as-is.

Incorrect behavior: fetching GitHub Actions docs, verifying version pins, then editing the file before staging. The author already chose those versions. Research belongs in a separate turn, not inside the commit. </example>

<example>
You edited a patch to split one file's changes across two commits, and `git apply --cached` fails on it.

Correct behavior: stage the whole file with git add, fold it into the better-fitting commit, and move on. Total cost: seconds.

Incorrect behavior: diffing the patch against the file, hex-dumping bytes, or otherwise investigating why it failed. The patch is not worth understanding — a whole-file commit is always an acceptable outcome. </example>

Workflow

Run git commands from the project root, never with git -C, which hides working directory state. Execute git commands directly without explanation. Commit immediately without confirmation prompts (interactive mode is not supported).

  1. Analyze Changes: Use git status and git diff to understand all modifications in the working directory.

  2. Group Logically: Organize changes into logical units — each addresses a single purpose and would make sense to revert as a unit. A drafted body that states two unrelated problems is two commits: split before committing. Several findings of one audit or review are one problem.

  3. Stage Changes: Use appropriate staging strategy:

    • Whole file: git add <file>.
    • Hunk-by-hunk: git diff <file> > <scratchpad>/patch.diff, edit the patch, then git apply --cached <scratchpad>/patch.diff. Dropping whole hunks is safe. Splitting within a hunk (keeping only some of its added lines) requires keeping the hunk's trailing context lines and recounting both header counts — a hunk with no trailing context only applies at end-of-file.
    • To unstage, use git restore --staged (not git reset --hard, which discards work).
    • Fallback: the first time git apply --cached fails on a patch you edited, stage the whole file with git add <file>. If the unedited full diff fails, regenerate it once from git diff, then stage the whole file. Never diagnose why a patch didn't apply.
  4. Handle Pre-commit Hooks: If hooks complain about unstaged changes, stash them with git stash push --keep-index -m "temp: unstaged changes", commit, then git stash pop. If hooks modify staged files (auto-formatting), re-add the modified files and retry the commit once — don't retry forever.

  5. Create Atomic Commits: For each logical group:

    • Conventional commit format type: subject, no scope, type one of feat, fix, refactor, test, build, docs, style. build covers dependency and version bumps; style means visual UI changes (CSS, fonts, colors, layout), not code formatting, which is refactor. Subject: what changed (≤72 chars), derived from the diff. Body: one or two sentences on one line, or none, as The argument section decides; only the subject has a length limit. Footer: as the Attribution section decides.
    • Use git commit -m "message" directly — never use $() or heredoc subshells in git commands, as they break allowed-tools pattern matching.

Attribution

End every commit message with the footer for your model family.

  • Claude models use Co-Authored-By: Claude <noreply@anthropic.com>.
  • GPT models use Co-Authored-By: Codex <noreply@openai.com>.
  • Gemini models use Co-Authored-By: Gemini <gemini-code-assistant@google.com>.

Skip the footer only when you are certain none of these apply.

Gotchas

  • Unstaged changes are still changes. git status showing "no changes added to commit" does not mean the working tree is clean. It means nothing is staged yet. Your job is to stage and commit those changes, not report "nothing to commit."
  • Never use git add -f. If git add reports "The following paths are ignored by one of your .gitignore files" with the hint Use -f if you really want to add them, do not force-add. The file is gitignored deliberately (secrets, build artifacts, local configs) and force-adding silently bypasses that protection. Skip the file and mention it in your final summary so the author can decide.

© vinta, 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 skills/commit of vinta/hal-9000.

Open the folder on GitHubat commit 0a2005a

Compare with similar skills

Logical Git Commits 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.

Logical Git Commits compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Logical Git Commits this skillvinta/hal-9000138—~3.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
Saleor Commit Workflowsaleor/saleor23k—~575Automated safety check: PassBSD-3-Clause
Emoji Commit ConventionsbaptisteArno/typebot.io11k—~424Automated safety check: PassCustom licence

Similar skills

  • 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 yesterday
    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 yesterday
    DevelopmentAuto-check passed
  • Emoji Commit Conventions

    baptisteArno/typebot.io

    Sets the repository's convention for commit messages and pull request titles: one emoji prefix for the main intent, a concise title and clean follow-up commits.

    11k GitHub stars~424 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Draft Pull Request Creator

    wordpress-mobile/WordPress-Android

    Commits and pushes current changes, writes a pull request title and body from the branch history and template, and opens a draft PR on GitHub after you approve it.

    3.2k GitHub stars~881 tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from vinta/hal-9000

All 15 skills in this repo
  • Finds which plugins in the repository changed, bumps only the ones not already bumped since origin/main, and checks that each plugin's two manifests stay in sync.

    138 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed
  • Audits your Claude Code settings and environment variables against the current official docs and returns a ranked list of changes tied to how you actually work.

    138 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • PR

    vinta/hal-9000

    A skill your agent uses when the user explicitly asks to push the current branch and open a PR, rewrite an open PR's body from its commits, or wait for CI and merge it

    138 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Keeps Ansible install tasks in line with upstream docs by fixing version, install-method and link drift one tool at a time, with a commit for each.

    138 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Rewrites docs, READMEs, issues, comments or UI text in plain Global English that translates well and still sounds native, keeping every fact intact.

    138 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • Best Practices

    vinta/hal-9000

    A skill your agent uses when about to choose, configure, or refine a tool, library, config format, API pattern, or project setup, or before proposing a design of your own — research current…

    138 GitHub stars~553 tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Logical Git Commits

What does Logical Git Commits do?

Commits everything in the working tree as one logical change per commit, splitting files by hunk, with bodies that say what was wrong before and never an invented reason. Invoking this skill is itself the request: the agent commits all changes in the working tree, one logical change per commit, and splits a single file hunk by hunk when it carries unrelated changes. The argument you pass is why the changes were made, which the diff cannot show.

When should I use Logical Git Commits?

Logical Git Commits fits situations like: committing a working tree that holds several unrelated changes; splitting one file's edits into separate commits by hunk; writing commit message bodies that explain the problem a change fixed.

How do I install Logical Git Commits in Claude Code?

Run `npx skills add vinta/hal-9000 --skill commit -a claude-code`. Or copy the skill folder (skills/commit in vinta/hal-9000) into .claude/skills/commit in your project. Claude Code loads it when a task matches its description.

How do I install Logical Git Commits in Codex?

Run `npx skills add vinta/hal-9000 --skill commit -a codex`. Or copy the skill folder (skills/commit in vinta/hal-9000) into .agents/skills/commit in your project. Codex loads it when a task matches its description.

Can I use Logical Git Commits 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 vinta/hal-9000 --skill commit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/commit, .gemini/skills/commit, .github/skills/commit and .opencode/skills/commit in your project.

What does Logical Git Commits need to run?

Going by SKILL.md and its folder, Logical Git Commits needs the command-line tools its instructions call (git). Our summary lists: A Git repository with uncommitted changes. Its frontmatter pre-approves these tools: Bash(git stash:*), Bash(git add:*), Bash(git restore:*), Bash(git mv:*), Bash(git rm:*), Bash(git apply:*), Bash(git commit:*).

Does Logical Git Commits 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 Logical Git Commits 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 Logical Git Commits use?

Logical Git Commits 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 Logical Git Commits use?

About 3.1k tokens (SKILL.md is roughly 12k 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 Logical Git Commits?

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

Who maintains Logical Git Commits?

vinta (a GitHub user) maintains it in vinta/hal-9000, which has 138 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 5, 2026.

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