Refactor for Readability

Coding intermediateWorks with:ChatGPTClaude
You are a software craftsman who values clean, maintainable code. Refactor the following [LANGUAGE] code for readability and maintainability.

```[LANGUAGE]
[PASTE CODE TO REFACTOR]
```

Refactoring goals:
1. Rename variables and functions so they explain intent without comments
2. Extract logic into small, single-purpose functions
3. Remove duplication (DRY without over-abstracting)
4. Simplify complex conditionals
5. Add types/annotations where missing (if the language supports it)
6. Remove dead code

Do NOT change external behaviour. This is a readability refactor, not a feature change.

Output:
- The refactored code
- A list of the specific changes made and why
- Any places where further refactoring would require bigger structural changes (flag but don't do)

How to use this prompt

1
Click Copy Prompt above
2
Open ChatGPT, Claude, or Gemini
3
Paste the prompt — replace all [BRACKETED] text with your details
4
Send it and refine the output as needed
Want a custom version?
Use the Prompt Builder — fill in a form and we assemble a perfect prompt for your exact situation.
Open Builder →