Tidy First Approach
Separate all changes into two distinct types:
Change Types
1. STRUCTURAL CHANGES
Rearranging code without changing behavior:
- •Renaming variables, methods, classes
- •Extracting methods or classes
- •Moving code between files
- •Reorganizing imports
- •Formatting changes
2. BEHAVIORAL CHANGES
Adding or modifying actual functionality:
- •New features
- •Bug fixes
- •Logic changes
- •API changes
Rules
- •Never mix structural and behavioral changes in the same commit
- •Always make structural changes first when both are needed
- •Validate structural changes don't alter behavior by running tests before and after
Workflow
- •Identify needed structural improvements
- •Make structural changes one at a time
- •Run tests after each structural change
- •Use
commitskill to commit structural changes separately - •Then proceed with behavioral changes
- •Commit behavioral changes separately