2 min read
Refactoring
For improving existing code without changing what it does.
Simplification
General cleanup
This file has gotten messy. Clean it up without changing functionality.
Remove complexity
[Feature] feels over-engineered.
Simplify it — we don't need [unnecessary capability].
Consolidate
We have similar code in [places]. Can we consolidate this?
Organization
Split file
This file is getting long. Split it into logical pieces.
Move code
Move [code/feature] to its own file. It doesn't belong in [current location].
Rename
Rename [thing] to [new name]. It's confusing as-is.
Group related
Group related [functions/components] together.
The current organization is confusing.
Improving Quality
Make readable
Make this code more readable. I want to understand it when I come back later.
Add comments
Add comments explaining [the non-obvious parts] of this code.
Remove dead code
Remove any code that's not being used.
Preparing for Growth
Before adding feature
I want to add [feature] soon. Should we restructure anything first to make that easier?
Extensibility
We might need to [future capability] later.
Is our current structure going to make that hard?
Performance
Make faster
[Feature] feels slow. Can we make it faster?
Identify bottlenecks
Where are the performance bottlenecks in [feature]?
Fixing Bad Patterns
Something feels wrong
Something about how [feature] is built feels wrong, but I can't articulate it.
Is there a better way to structure this?
Tech debt
What's the most important thing to clean up in this codebase?
Safe Refactoring
Check before changing
I want to refactor [thing]. Before we do:
- What could break?
- How do we verify it still works after?
Small steps
Let's refactor [thing] in small steps so we can verify each change works.