Refactoring
Refactoring
Cleaning up the code inside while keeping what it does on the outside exactly the same.
💡 It's reorganizing your closet into neat sections without changing the clothes in it.
🤖 Say this to your AI
Only refactor, don't change any features. Split the overly long page.tsx into several components and merge duplicated code into one. When you're done, check that everything works exactly as before.
The key word is ‘Refactoring’. Including it helps AI understand you much more precisely.
When to use it
- When a single file has gotten way too long
- When the AI has copy-pasted the same code in several places
Also called: refactor, clean up code, tidy code, remove duplicates, reorganize code, clean code, restructure