Refactor this code to be more readable
A ready-to-use “Programming” AI prompt template, designed and tested with Cursor. Replace the (bracketed) parts below with your own needs.
Prompt template
Refactor the code below to be more readable and maintainable: 1) improve naming; 2) break up overly long functions; 3) remove duplication; 4) keep behavior unchanged. After, explain what you changed and why, and include the full refactored code. Code: ``` paste the code ```
How to use this prompt
- Copy the whole prompt above and paste it into Cursor or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.
Recommended tool: Cursor — A code editor built for AI.