atomic-commits

Split pending worktree changes into ordered atomic commits matching repository conventions.

Updated Jul 4, 2024
One-click install
npx skills add https://github.com/hareki/dotfiles --skill atomic-commits-hareki
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: atomic-commits
Source: https://github.com/hareki/dotfiles/tree/main/agents/.agents/skills/atomic-commits
Command: npx skills add https://github.com/hareki/dotfiles --skill atomic-commits-hareki

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? A messy worktree full of staged and unstaged changes is hard to commit cleanly. This Skill regroups all pending changes into small, logically separated commits with messages that follow the repository's existing style, while guaranteeing nothing is lost or invented. ## Core Features & Use Cases - Snapshot-Based Safety: Records the full worktree state with git write-tree before committing, then verifies at the end that the committed tree exactly matches the snapshot. - Convention Matching: Analyzes recent git log output to mirror the repo's commit message style, including prefixes, scopes, tense, and body usage. - Approval-Gated Plan: Presents the ordered commit plan with proposed messages and file groupings for user approval before committing anything. - Use Case: After a long coding session with mixed refactors, fixes, and features, invoke this Skill to turn the pile of changes into a clean, reviewable commit history. ## Quick Start Ask the assistant to split all current uncommitted changes into atomic commits following this repository's commit message conventions.

Frequently Asked Questions about atomic-commits

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split uncommitted changes into multiple git commits?▼

Stage related files or hunks with git add or git add -p, then commit each logical group separately with its own message. This Skill automates that flow by grouping all pending changes, proposing an ordered plan, and committing each group after your approval.

How to write commit messages that match a repository's style?▼

Inspect recent history with git log to learn the repo's conventions, such as Conventional Commits prefixes, scopes, capitalization, and body usage. The Skill reads the last 30 subjects and recent bodies, then mirrors that style for every new commit.

Can I stage only part of a file for an atomic commit?▼

Yes, git add -p lets you stage individual hunks of a file interactively, which is how a file spanning multiple logical changes gets split across commits. It only stages content and never discards anything from the worktree.

Is it safe to reorganize uncommitted work into new commits?▼

Yes, when guarded by a snapshot. The Skill records the full tree with git write-tree before starting and verifies afterward that the committed tree matches it exactly, so no change is lost and nothing new is introduced.

What happens if something goes wrong while splitting commits?▼

Run git reset --soft to the original HEAD, which un-commits everything back into the index without touching any file contents. You can then regroup the changes and retry the commit sequence.