agentleFS
bsamsonovbsamsonov/claude-code-config/skills/atomic-commit/SKILL.md

atomic-commit

Skill0 starsChanged 2 months agoMITView on GitHub

Splits the current working-tree changes into several atomic commits by meaning, with clean conventional-commit messages. Each commit is one logical unit. Use when the user says "commit and split unrelated changes", "make atomic commits", "split into separate commits", "commit by meaning", "several commits", "atomic commits", "split into commits", and also for a plain "commit the changes" when the working tree mixes unrelated edits. This is about HOW to slice and word commits; for pushing to GitHub — the github-push skill.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the actual diffs, not just file names — one file can hold unrelated edits.

    line 30
  2. Distinctive:

    When one file mixes groups — stage by hunk:

    line 57
  3. Distinctive:

    Commit groups in a sensible order: the foundation first (refactoring/infrastructure) that later commits rely on, then the features on top.

    line 65
  4. Distinctive:

    If the repository already has its own message style (check git log --oneline -15) and it is not conventional — follow the repository's …

    line 88
  5. Very specific:

    After committing show git log --oneline -<N> with the new commits.

    line 93

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Atomic commits

Purpose

A clean history where every commit is self-contained and reflects one change: easier review, precise reverts, meaningful blame. This skill turns a mixed pile of edits into a tidy sequence of commits.

Step 1 — Inspect the changes

git -C "$PWD" status
git -C "$PWD" diff --stat
git -C "$PWD" diff            # working tree
git -C "$PWD" diff --staged   # if something is already staged

Read the actual diffs, not just file names — one file can hold unrelated edits. If there are few changes and they are about one thing — don't invent a split, make one commit. Splitting for the sake of splitting hurts.

Step 2 — Group by meaning

Signs of different commits:

  • different subsystems / folders / features;
  • bug fix vs new functionality vs refactoring vs documentation;
  • functional change vs formatting/renaming;
  • a change plus an unrelated config tweak.

Signs of one commit: a code change + its tests; an API change + updating all callers; a feature + its entry in the relevant doc.

Show the user the proposed commit plan (one line per commit) before committing if there are more than two or three groups or any ambiguity. For obvious cases, commit right away and show the result.

Step 3 — Stage and commit group by group

Stage by file when groups live in different files:

git add path/to/file_a path/to/file_b
git commit -m "<message>"

When one file mixes groups — stage by hunk:

git add -p path/to/file

git add -p is interactive. If the environment does not allow interaction, apply a prepared hunk patch with git apply --cached, or honestly tell the user this file will have to be committed whole.

Commit groups in a sensible order: the foundation first (refactoring/infrastructure) that later commits rely on, then the features on top.

Message format — Conventional Commits

<type>(<scope>): <short imperative description>

Types: feat, fix, refactor, docs, test, chore, style, perf, build, ci. Scope is optional: the module/area (auth, ingestion, chunker).

Example 1: Changes: JWT authentication added + a pagination bug fixed in the user list.

  • feat(auth): add JWT-based authentication
  • fix(users): correct off-by-one in pagination

Example 2: Changes: variables renamed across a module + a new endpoint.

  • refactor(billing): rename ambiguous variables for clarity
  • feat(billing): add invoice export endpoint

Subject up to ~70 characters, imperative mood ("add", not "added"). If the change needs a "why" — add a body after a blank line.

If the repository already has its own message style (check git log --oneline -15) and it is not conventional — follow the repository's style, don't impose yours.

Finish

After committing show git log --oneline -<N> with the new commits. Don't push without a separate request — pushing is the github-push skill or an explicit command.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.