Agent skill
squash-commits
Review all changes (commits and working changes) and organize into appropriate commit granularity
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/squash-commits-sasamuku-dotfiles-2
SKILL.md
Squash Commits
Organize all changes into well-structured commits.
Steps
1. Review the current state
git status
git diff
git diff --staged
git log origin/main..HEAD --oneline
git log origin/main..HEAD
2. Analyze and determine optimal commit structure
- Group related changes across commits and working directory
- Identify logical units that should be separate commits
- Consider proper commit granularity (one logical change per commit)
- Determine which changes should be combined or split
- Decide on clear, descriptive commit messages for each logical unit
3. Execute the reorganization
- If there are working changes, create temporary commits or stash them
- Use interactive rebase to reorganize existing commits
- Apply working changes to appropriate commits using
git commit --amendor as new commits - Ensure the final commit history is clean and logical
- Show the final result after completion
This command automatically restructures commits based on optimal commit granularity without requiring user approval.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?