Code Refactor Advisor
Reviews a code snippet and returns a prioritized refactor plan — readability, structure, and performance issues, each with a concrete fix.
Code Refactor Advisor is a free AI skill for code improvement. Reviews a code snippet and returns a prioritized refactor plan — readability, structure, and performance issues, each with a concrete fix. It works with Claude, ChatGPT, Cursor and is ready to use out of the box.
About this skill
Code Refactor Advisor analyzes a pasted code snippet and produces a prioritized, actionable refactor plan rather than a vague 'this could be cleaner' comment. It identifies specific readability issues, structural problems (poor separation of concerns, duplicated logic), and performance concerns, ranks them by impact, and shows a concrete before/after fix for the highest-priority issues. Built for developers who want a second pair of eyes on their code before a PR or during cleanup.
What it does
Given a code snippet, the skill outputs a prioritized list of refactor opportunities, each categorized (readability, structure, performance), ranked by impact, with a brief explanation and a concrete before/after code example for the top 2-3 issues.
What is included
- Prioritized issue identification (readability, structure, performance)
- Impact ranking so the user knows what to fix first
- Before/after code examples for top issues
- Language-agnostic review framework
- Guidance for applying fixes incrementally without a full rewrite
How to use it
1. Download the SKILL.md file 2. Upload it into a new Claude conversation 3. Paste the code snippet you want reviewed 4. Receive a prioritized refactor plan with before/after examples
Examples
def process(data):
result = []
for i in range(len(data)):
if data[i]['status'] == 'active':
if data[i]['type'] == 'user':
result.append(data[i]['name'].upper())
return resultREFACTOR PLAN
1. [Structure, High impact] Nested conditionals should be combined
Combine the two if statements into one condition for readability.
Before:
if data[i]['status'] == 'active':
if data[i]['type'] == 'user':
Before/After shown as combined 'and' condition.
2. [Readability, Medium impact] Avoid index-based iteration
Use direct iteration over data instead of range(len(data)).
Before: for i in range(len(data)):
After: for item in data:
3. [Readability, Low impact] Consider a list comprehension
After: return [item['name'].upper() for item in data if item['status']=='active' and item['type']=='user']FAQ
What is this skill for?
How do I install it?
What programming languages does it support?
Will it rewrite my entire file?
How is this different from a linter?
Does it check for bugs, not just style?
Related Skills
Code Review & Refactor Assistant
Reviews a pasted code snippet for bugs, readability, and performance issues, then delivers a prioritized refactor with explanations for each change.
Engineering Judgment Coach
Makes an AI coding agent pause and reason like a senior engineer before writing code — right layer, reuse over rebuild, the right pattern, and honest refactor timing.
Code Refactoring Planner
Analyze a codebase or module and produce a safe refactoring plan with risks, boundaries, tests, migration steps, and acceptance criteria.
Related Prompts
Code Review Simulator
Simulates a thorough senior engineer code review, flagging bugs, edge cases, readability issues, and security concerns with specific, actionable comments.
Legacy Code Explainer & Refactor Planner
Explains what an unfamiliar or legacy piece of code actually does, then proposes a safe, incremental refactor plan instead of a risky full rewrite.
Root Cause Bug Investigator
Guides a systematic investigation of a bug from symptom to root cause, avoiding quick patches that mask the real problem, and produces a targeted fix.