Skip to content
Back to skills

Git Atomic Commit

ASecurity

Use when splitting a working tree into atomic commits, or when changes need to be distributed across new commits and/or edits to prior commits on the branch. Especially relevant when changes within a single file belong in different commits.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 10, 2026
ai-agentsgit

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 21, 2026

npx -y skills add LandonSchropp/agent-toolkit --skill git-atomic-commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git Atomic Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Git Atomic Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/landonschropp-git-atomic-commit/badge)](https://www.skillsdirectory.com/skills/landonschropp-git-atomic-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: git-atomic-commit
description: Use when splitting a working tree into atomic commits, or when changes need to be distributed across new commits and/or edits to prior commits on the branch. Especially relevant when changes within a single file belong in different commits.
---

# Git Atomic Commit

An atomic commit captures one logical change. Each commit stays portable: it can be reviewed, reverted, cherry-picked, lifted into its own PR, edited, or reordered without rebase conflicts cascading through the work that came after.

Atomic commits also keep history honest. Without that discipline, the log records false starts and reversals — code added in one commit and removed in another — and readers have to trace every commit to know the final state.

Crucially, **atomic commits optimize for reviewability**. A commit should be small enough that a reviewer can understand all of it at once without context-switching. When a logical change grows too large for that, split it into smaller pieces that each still stand alone.

## Why Changes in One File Get Split

A single file often picks up changes that belong in different commits:

- Refactor + behavior change: You restructured a function and then added new logic in the same edit. The refactor should land as its own commit ("make the change easy, then make the easy change") so reviewers can verify it's pure before evaluating the new behavior.
- Drive-by edits: Mid-feature you fixed a typo, removed dead code, or tidied imports. These don't belong with the feature work and shouldn't have to wait for it to merge.
- Independent concerns: A shared utility or config file gets touched by two unrelated efforts in the same session.

Don't let "but it's just one file" be the reason unrelated changes ship together. **Optimize for the reviewer, not the commit count.**

## What Makes a Commit Reviewable

A reviewable commit:

- Stays focused: One purpose, one narrative. A reviewer should never ask "why is X in this commit?"
- Is small: Typically under 100–200 lines of changes. Larger changes force reviewers to split their attention and miss bugs.
- Stands alone: It can be understood without tracing through other commits. The diff should be self-explanatory.

When a commit strains these bounds, that's a signal to split it — into pieces that each still capture one logical change and pass this test on their own.

## Triggering the Process

When the user invokes this skill, they _might_ be hinting that they'd like to split up some uncommitted changes atomically.

If there are uncommitted changes in the working tree (staged or unstaged), or the user is explicitly asking to reorganize existing work into atomic commits, follow the procedure in [references/process.md](references/process.md). Always present the plan to the user and wait for confirmation before executing.

If there's nothing to split, apply atomic-commit principles to any new commits made during the rest of the session.

## Rationalizations

| Thought                                              | Reality                                                                         |
| ---------------------------------------------------- | ------------------------------------------------------------------------------- |
| "I'll just commit everything as one"                 | The user invoked this skill to split. Propose a plan first.                     |
| "I can use `git add -p`"                             | Requires a TTY. You can't. Use restore-and-replay.                              |
| "I'll add a follow-up commit to patch the prior one" | If it belongs to a prior commit on the branch, edit it. Don't pollute history.  |
| "I'll describe the splits and let the user do it"    | After plan approval, execute the splits yourself.                               |
| "It's one logical change, so size doesn't matter"    | Size still decides whether it can be reviewed. Split it into standalone pieces. |

Files in this skill

  • SKILL.md4.4 KB
  • references/process.md3.4 KB
  • scripts/show-stack-commits.sh1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.