Code Refactor Advisor Prompt
Get a ranked list of refactors before touching a file.
/ quick answer
Use as a pre-commit thinker to avoid over-engineering. Get a ranked list of refactors before touching a file.
Review the file. Return refactors ranked by ROI (impact / effort).
For each: what to change, why, effort (S/M/L), risk (S/M/L).
Do not propose renames unless the name is misleading.
Do not propose 'add tests' as a refactor.
File:
{{code}}1. Extract retry logic into util (M/S) — reused in 4 places. 2. Replace switch with map lookup (S/S) — easier to extend. 3. ...
/ frequently asked
What does the Code Refactor Advisor Prompt prompt do?
Use as a pre-commit thinker to avoid over-engineering.
Which AI models work with this prompt?
It is model-agnostic: it works with any capable general model. Replace the bracketed variables with your own context before running it.
How do I use this prompt?
1) Copy the prompt with the copy button. 2) Replace every bracketed variable with your real details. 3) Paste it into your AI assistant. 4) Compare the answer with the example output and ask for changes if needed.
What output should I expect?
1. Extract retry logic into util (M/S) — reused in 4 places. 2. Replace switch with map lookup (S/S) — easier to extend. 3. ...
/ continue exploring
Related prompts
Reusable prompts for this job.
- →SQL Explainer Prompt
Explain a SQL query in plain English with data implications.
- →Error Diagnoser Prompt
Turn a stack trace + code into a ranked diagnosis with next steps.
- →Test Case Generator Prompt
Generate meaningful test cases from a function signature.
- →AI Code Review Rubric Prompt
A reviewer prompt that finds real defects instead of style opinions.
Related use cases
How people apply it, and what came out.
- →10-Person Dev Team Adds AI Code Reviewer, Cuts Cycle Time 30%
Engineering team wires an LLM into PR review as a first-pass gate.