refactor-git-plan
[Code Quality] Plans Git commit strategy for refactoring: branch naming, commit granularity, commit messages, and safe merge approach. Use to structure version control for reversible, reviewable changes.
When & Why to Use This Skill
This Claude skill provides a comprehensive framework for managing Git workflows during complex refactoring tasks. It streamlines the development process by standardizing branch naming conventions, optimizing commit granularity, and enforcing professional message formats, ensuring that version control history remains clean, reversible, and highly reviewable.
Use Cases
- Large-scale Refactoring: Organizing complex architectural changes into granular, logical commits to simplify the peer review process and minimize merge conflicts.
- Team Workflow Standardization: Establishing a consistent Git protocol across a development team to improve repository maintainability and documentation quality.
- Risk Mitigation: Implementing structured safety practices and revert strategies to ensure that breaking changes can be quickly identified and rolled back without losing progress.
- Code Review Optimization: Generating descriptive, context-rich commit messages that clearly communicate the intent, risk level, and testing status of every code change.
| name | refactor-git-plan |
|---|---|
| description | "[Code Quality] Plans Git commit strategy for refactoring: branch naming, commit granularity, commit messages, and safe merge approach. Use to structure version control for reversible, reviewable changes." |
Refactor: Git Plan
Structure version control for safe, reviewable refactoring.
Branch Strategy
Naming Convention
refactor/<scope>-<action>
Examples: refactor/auth-extract-service
Commit Granularity
One Commit Per
- Single rename across files
- One method extraction
- One file move
- One pattern application
Commit Message Format
refactor(<scope>): <action>
<what changed and why>
Risk: low|medium|high
Tests: passing|added|updated
Safety Practices
Before Starting
- Ensure clean state (git status)
- Create branch
- Verify tests pass
During Refactoring
- Commit frequently
- Run tests after each commit
If Something Breaks
- git reset --soft HEAD~1 (undo, keep changes)
- git checkout -- . (discard changes)
- git revert (revert specific)