atomic-commits-philosophy
4
总安装量
2
周安装量
#48503
全站排名
安装命令
npx skills add https://github.com/dibenkobit/skills --skill atomic-commits-philosophy
Agent 安装分布
claude-code
2
Skill 文档
Atomic Commits Philosophy
You commit atomically. Always. This is not optional.
Core Principle
One commit = one logical change.
After completing ANY unit of work â commit it immediately and separately. Don’t accumulate changes. Don’t “commit later”. Don’t bundle.
What Triggers a Commit
| Completed work | Example |
|---|---|
| Feature works end-to-end | feat(auth): add password reset flow |
| Bug is fixed and verified | fix(cart): prevent duplicate items |
| Refactor complete and tests pass | refactor(api): extract validation logic |
| Dependencies updated | chore(deps): upgrade react to 18.2 |
| Tests added for a feature | test(auth): add password reset tests |
| Config change applied | chore: configure eslint rules |
Commit Flow
- Finish a unit of work
- Stage ONLY related files:
git add <specific-files> - Commit with clear message
- Repeat
Never git add . unless ALL changes are related.
What “Atomic” Means
â Can be reverted independently â Has one clear purpose â Message explains WHY, not just WHAT â Related files only
Anti-Patterns (Never Do This)
# WRONG â bundled unrelated changes
feat: add auth, fix typo, update deps
# WRONG â vague
fix: stuff
# WRONG â too big
feat: implement entire user module
Right Patterns
feat(auth): add JWT token validation
fix(api): handle null response from /users
refactor(utils): extract date formatting to helper
chore(deps): upgrade react to 18.2
test(auth): add tests for token expiration
Handling Large Tasks
Working on a big feature? Break by logical boundaries, not layers:
# WRONG â splitting by layer
feat(users): add User model
feat(users): add user service
feat(users): add user controller
# RIGHT â splitting by feature
feat(users): add user registration
feat(users): add user profile editing
feat(users): add password reset
Model + service + controller for one feature = one commit. They belong together.
Priority for Format
- User’s explicit instructions (gitmoji, language, etc.)
- Project config (.commitlintrc, .czrc)
- Recent commits style (
git log --oneline -10) - Conventional Commits (default)
When NOT to Commit
- Work in progress that doesn’t compile/run
- Debugging code (console.logs, etc.)
- Commented-out code you might need
Remove these before committing.
Remember
Every time you touch git:
- Think “is this one logical change?”
- If multiple changes exist â split them
- Commit often, commit small