Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

atomic-commits

БесплатноБез исполняемых скриптовНе проверен

Break unstaged or mixed changes into small, atomic, logical git commits with Conventional Commit messages. Use when the user asks to commit, stage, or split…

ericmjlот ericmjl★ 45 звёзд на GitHub

Об этом скилле

Atomic Commits

Guide the user from a dirty working tree to a clean commit history where each commit is one logical change with a clear Conventional Commit message.

Critical: Match the Repo's Existing Commit Style First

Before drafting any commit message, run git log --oneline -15 to inspect the repo's existing commit style. Do this as the FIRST step, before proposing any type(scope): prefix. Repos vary widely:

  1. Conventional Commits (feat:, fix(scope):, etc.) — many modern OSS projects
  2. Sentence-case prose, no prefix (Clarify Genie 3 feature dictionaries, Simplify the published architecture directory) — many blog/doc/personal repos
  3. Lowercase prose, no prefix
  4. Always-single-line subjects vs always-with-body

The Conventional Commits format documented in §2 below is the DEFAULT, applied when the repo's recent history shows CC prefixes OR has no clear pattern. If the repo uses a different convention, MATCH IT — do not impose Conventional Commits on a repo that does not use them.

Also check whether bodies are used. If the last 10-20 commits are all single-line subjects with no body, put the detail in the PR description instead of writing a multi-paragraph commit body.

Concrete instance (explainer repo, 2026-07-19): assistant initially drafted feat(renderer): add canvas-chat-style keyboard navigation shortcuts + a 14-line body, then checked git log and found the repo uses prose single-line subjects (Clarify Genie 3..., Simplify the published architecture directory, Harden touch rendering and selective Pages builds). It adapted to a single-line prose subject (Add canvas-chat-style keyboard navigation shortcuts) and moved the detail to the PR body. Without this check the commit would have been stylistically inconsistent with the rest of the history.

Workflow

1. Analyze changes

Run in parallel:

git status
git diff
git diff --cached

If there are too many files, also run git diff --stat for a summary.

2. Propose a commit plan

Group changes into atomic commits. Present the plan as an ordered table:

# Scope Files Commit message
1 ... ... type(scope): description

Grouping rules (priority order):

  1. One concern per commit. Separate refactorings from features from bug fixes. If a file has changes for two concerns, plan to use git add -p to split hunks within that file.
  2. Dependencies first. If commit B depends on commit A, order A before B.
  3. Tests alongside or after. Tests for a change go in the same commit or the immediately following one — never alone in a distant commit.
  4. Config/infra before features. Build/config changes that features depend on come first.

Commit message format — Conventional Commits:

type(scope): imperative-mood summary

Optional body explaining why, not what.

Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.

Scope: optional but encouraged — the module, package, or area affected.

Rules:

  • Imperative mood: "add feature" not "added feature"
  • Lowercase summary, no period at end
  • Under 72 characters for the summary line
  • Body wraps at 72 characters

3. Execute — one commit at a time

For each proposed commit:

  1. Stage exactly the right files/hunks: git add <files> or git add -p <file>
  2. Show the user what will be committed: git diff --cached --stat
  3. Create the commit: git commit -m "type(scope): summary"
  4. If a pre-commit hook modifies files, handle the result (amend only if hook changes are expected and the user agrees)

Within-file splitting (scripted printf | git add -p — proven reliable): Scripted git add -p DOES work in this environment for within-file hunk splitting. Proven workflow (gym-coach 06-21: split an 8-hunk mutations.ts into a refactor commit + a feature commit cleanly):

  1. Pre-analyze hunk headers. Run git diff <file> and read every @@ -old,count +new,count @@ <context> header. The <context> after @@ names the function/region each hunk belongs to, so you can map each hunk to a concern (feature A, refactor B, etc.). Count the hunks. Adjacent hunks (close @@ line numbers, e.g. @665 and @679) are still presented SEPARATELY by git add -p as long as they carry distinct @@ headers.

  2. Determine the y/n sequence. One y/n per hunk, in the order git add -p presents them (top-to-bottom = lowest @@ line first). Worked example: 8 hunks, want all EXCEPT hunk 5 → y y y y n y y y.

  3. Script the split. printf 'y\ny\ny\ny\nn\ny\ny\ny\n' | git add -p <file>. The \n newlines are required — git add -p reads one answer per line.

  4. Verify staged hunks BEFORE committing (mandatory). Run git diff --cached <file> | grep '^@@' and confirm the staged hunk set EXACTLY matches your intent: correct count, correct @@ line numbers, no extras. Also run `git diff --cache

Полный SKILL.md на GitHub

Установить atomic-commits в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл atomic-commits?

Break unstaged or mixed changes into small, atomic, logical git commits with Conventional Commit messages. Use when the user asks to commit, stage, or split changes — e.g. 'help me commit', 'commit my changes', 'break these into logical commits', 'what should I commit first', 'stage my changes', 'commit atomically', or 'make atomic commits'. Uses git diff, git add -p, and Conventional Commits (feat:/fix:/refactor:/chore:/docs:/test:/style:/perf:/build:/ci).

Как установить скилл atomic-commits?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл atomic-commits запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить atomic-commits с