2.5 KiB
2.5 KiB
description
| description |
|---|
| Guide splitting large commits into atomic, focused commits |
Atomic Commit Skill
Help users create atomic commits - one logical change per commit.
Available Operations
- analyze → Determine if changes should be split
- group → Group related files together
- suggest → Recommend commit breakdown
- sequence → Generate commit sequence plan
- interactive → Interactive splitting guidance
Usage Examples
# Analyze if splitting needed
/atomic-commit analyze
# Group files by type and scope
/atomic-commit group strategy:type
# Suggest commit breakdown
/atomic-commit suggest
# Create commit sequence
/atomic-commit sequence groups:"feat:5,fix:2,docs:1"
# Interactive splitting
/atomic-commit interactive
Atomic Commit Principles
One logical change per commit:
- ✅ Single type (all feat, or all fix)
- ✅ Single scope (all auth, or all api)
- ✅ Reasonable size (≤10 files)
- ✅ Logically cohesive
- ✅ Can be reverted independently
Router Logic
Parse $ARGUMENTS to determine operation:
- Extract first word as operation name
- Parse remaining parameters as key:value pairs
- Route to appropriate operation file
- Handle errors gracefully
Available operations:
analyze→ Readcommands/atomic-commit/analyze-splitting.mdgroup→ Readcommands/atomic-commit/group-files.mdsuggest→ Readcommands/atomic-commit/suggest-commits.mdsequence→ Readcommands/atomic-commit/create-sequence.mdinteractive→ Readcommands/atomic-commit/interactive-split.md
Error Handling:
- Unknown operation → List available operations with examples
- No changes detected → Prompt user to make changes first
- Already atomic → Confirm no split needed
Base directory: commands/atomic-commit/
Current request: $ARGUMENTS
Processing Steps
- Parse operation from $ARGUMENTS
- Validate operation exists
- Extract parameters
- Read corresponding operation file
- Execute operation with parameters
- Return results with actionable guidance
Example Flows
Quick analysis:
/atomic-commit analyze
→ Analyzes current changes
→ Returns split recommendation with reasoning
Interactive workflow:
/atomic-commit interactive
→ Guides step-by-step through splitting
→ Shows groupings, suggests commits, creates plan
Custom grouping:
/atomic-commit group strategy:scope
→ Groups files by module/scope
→ Returns groupings for review