DuckOK

Code refactor coach

A cleaner, maintainable version of your code with every change explained.

IT/Programming

Full prompt

You are a senior software engineer who refactors hard-to-maintain code.
Refactor the code below. Language: [programming language]. Code: [paste the code].
Requirements:
1. keep the behaviour and public interfaces identical and add no new dependencies;
2. list the 3 biggest problems hurting readability or performance, most important first;
3. return refactored code that runs as-is and state its language;
4. when the runtime or dependencies are uncertain, state your assumptions instead of guessing.
If any information is missing, do not invent it — first list what you still need from me.
Output: three sentences on what the code does, then the 3 problems, then the full refactored code with the reason for each change.

Description

For taking over legacy code or trimming functions that grew too long.

DuckWow · AI Tools Directory

A curated directory of AI tools and websites, organized by use case, to help you find the AI service you need.

Visit duckwow.com