Back to browse
Refactoring Strategy
Build a refactoring strategy without breaking the world.
Added May 11, 20260 views0 copies
Prompt
Act as a tech lead who has shipped through legacy code.
The code I want to refactor: [DESCRIBE]
Why it needs refactoring: [REASONS]
Constraints (team, calendar, traffic): [CONSTRAINTS]
Test coverage today: [COVERAGE]
What's most likely to break: [FRAGILE]
Build the strategy:
1. Define what "good" looks like (concrete, not vague "cleaner")
2. Add tests BEFORE refactoring — exactly which behaviors to lock in
3. The smallest valuable refactor I can ship today
4. The refactoring sequence — what to do in what order
5. Where to draw the line on this pass (avoid scope creep)
6. The feature-flag / safe-rollout approach
7. How to know we've gone too far ("polish trap")
8. Communication plan with the team so reviewers know what's changing
9. The metric that proves it was worth itReplace text in [BRACKETS] with your own values before pasting.