Skip to main content
rule CX Codex

atomic-commits — Claude Code rule: what it does, how to install

Enforces Git best practices: atomic commits in Conventional Commits format, mandatory feature branches, and selective file staging.

MIT ★ 2,966 updated 2026-09-29

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/atomic-commits.mdc
Open on GitHub

What atomic-commits does

This rule instructs your coding assistant to record Git changes as single logical units. Every commit message must follow the Conventional Commits template <type>(<scope>): <summary> using feat, fix, refactor, test, docs, chore, perf, ci, or style.

Direct commits to the main branch are prohibited. The assistant must work inside dedicated feature branches and inspect staged modifications via git diff --stat before pushing upstream.

Bulk staging with git add . or git add -A is blocked because it risks tracking sensitive files. The agent must stage every target file individually by its path.

What it helps with

  • Split mixed changes into atomic logical commits
  • Standardize commit messages to Conventional Commits syntax
  • Prevent accidental direct pushes to the main branch
  • Avoid staging sensitive local files through indiscriminate git add

Example prompts for the agent

  • Create a feature branch and commit the authentication fixes atomically
  • Format the recent changes using conventional commit messages
  • Stage modified files individually and verify them with git diff --stat

How to install atomic-commits

Manually: put the files in place

.cursor/rules/atomic-commits.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about atomic-commits

How to install atomic-commits in Claude Code?

Add the marketplace source with /plugin marketplace add rohitg00/pro-workflow, then run /plugin install pro-workflow@pro-workflow. Alternatively, place the content in .claude/rules/atomic-commits.md.

What does atomic-commits do?

It guides the agent to write standard <type>(<scope>): <summary> messages, stay off main branches, and review staged files individually.

Which commit types are supported by atomic-commits?

The rule explicitly defines feat, fix, refactor, test, docs, chore, perf, ci, and style.

Source text

atomic-commits.mdc · MIT
---
description: Git best practices - atomic commits, descriptive messages, feature branches
alwaysApply: true
---

Make atomic commits. Each commit should represent one logical change.

Write descriptive commit messages in conventional format: `<type>(<scope>): <summary>`

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

Always work on feature branches. Never commit directly to main.

Review changes before pushing. Run `git diff --stat` to verify what's staged.

Stage specific files by name. Avoid `git add -A` or `git add .` which can include sensitive files.

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar IDE rules

All IDE rules for Git and GitHub →

From the same set83

The whole set →
no-debug-statements The no-debug-statements rule flags debugging calls for removal before a commit in JavaScript, TypeScript, Python, Go, and Rust files. Use it during a pre-commit review. CX Codex +1 ★ 2,966repo stars quality-gates quality-gates — a Claude rule that makes the agent lint and typecheck before a commit, then sweep the staged diff for debug lines and hardcoded keys. CX Codex +1 ★ 2,966repo stars cost-tracker cost-tracker is a Claude Code command that estimates current-session spend, identifies its main cost drivers, and suggests optimizations. Compare the estimate with a task budget. CX Codex +1 ★ 2,966repo stars self-correction self-correction turns a correction into a one-line [LEARN] rule with a category, and saves it only once you approve the wording. CX Codex +1 ★ 2,966repo stars mcp-audit Audits active MCP servers, estimates token overhead from tool schemas, and flags unused integrations to disable. CX Codex +1 ★ 2,966repo stars auto-setup auto-setup detects a project’s stack and configures quality gates, permission rules, and hooks. Useful when bringing a new codebase into Claude Code. CX Codex +1 ★ 2,966repo stars compact-guard compact-guard is a Claude Code command that saves working state before context compaction and restores critical data afterward. Run it before manual compaction or when auto-compaction warnings appear. CX Codex +1 ★ 2,966repo stars wrap-up wrap-up audits git diffs, runs test suites, records lessons learned, and prepares context before closing a Claude Code session. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open