AI agent skills for refactoring
A refactoring skill's job is to keep behaviour fixed while structure changes, and to keep the diff small enough to review. The better ones require a green test run before and after, and refuse to bundle a behaviour change into the same commit. Be wary of anything that promises to modernise a whole codebase in one pass: the review burden of a 4,000-line diff is the reason that work never lands.
People land here searching for “claude code refactoring skill”, “agent skill to clean up code”, “legacy code refactor skill”.
266 refactoring skills Refine in search →
-
omer-metin Bundle Code CleanupCode Cleanup
128 -
getsentry Skill Code SimplifierSimplifies and refines code for clarity, consistency, and maintainability while preserving all functionality.
Audited 845 -
haongo232 Skill Simplify CodeReduce complexity of over-engineered code. Identify unnecessary abstractions, remove dead code, flatten deep nesting, and simplify logic while preserving behavior.
3 -
dvy1987 Bundle Code SimplificationSimplify application code for clarity without changing behavior — refactor after tests pass, reduce nesting and duplication, match project conventions. Load when refactoring for readability, cleaning up after a feature ships, or when code review flags complexity. Also triggers on "simplify this code", "code simplification", "make this easier to read", "reduce complexity", "refactor for clarity". Not for compress/split/prune-skill (skill-library files). Pairs with technical-debt-audit.
Audited 3 -
antood69 Skill Code SimplifierUse this skill after completing code changes to review for reuse, quality, and efficiency. Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality.
0 -
mohitagw15856 Skill Code SimplificationSimplify code that works — remove speculative abstraction, dead flexibility, and needless indirection while keeping behaviour identical and verified. Use after a feature lands ('now simplify it'), when AI-generated code arrives over-engineered, when a file has grown hard to follow, or as the cleanup pass before review. Produces a smaller, flatter version with identical behaviour, plus a ledger of what was removed and why it was safe. For finding bugs use code-review-checklist / ai-code-review — this skill assumes it works and makes it simple.
-
iabhisekbosepm Skill CleanupRefactoring sprint: remove dead code, eliminate duplicates, simplify complex code.
Audited -
cskwork Skill Clean CodeRefactor legacy code for readability and maintainability while preserving observable behavior and externally consumed contracts.
Audited -
aj-geddes-useful-ai-prompts Bundle Refactor Legacy CodeModernize and improve legacy codebases while maintaining functionality. Use when you need to refactor old code, reduce technical debt, modernize deprecated patterns, or improve code maintainability without breaking existing behavior.
-
mkanat Skill CleanupClean up the design of a large change, or a whole codebase.
Audited -
s-hiraoku Skill SimplifyReview changed code on the current branch for reuse, clarity, and dead complexity, then propose or apply minimal cleanup without changing behavior.
Audited -
andrewgleave Bundle CleanseReview code for readability, then simplify it to be easy to follow and understand. Use this skill when the user wants to simplify code, improve readability, clean up for handoff, make code skimmable, reduce complexity, refactor for clarity, strip boilerplate, prepare code for future maintainers, or make a codebase easier to pick up. Trigger liberally — any request touching readability, simplification, cleanup, or "make this easier to understand" should use this skill. Also trigger when the user says things like "review this", "clean this up", "tidy this", "make this simpler", "reduce complexity", "flatten this", "strip the noise", or "I want to understand this code quickly next time I open it".
-
aravinds-wick Skill Code SimplifierTakes recently modified or complex code blocks and refactors them for readability and simplicity without changing behavioral logic. Use when refactoring complex logic, cleaning up nested conditions, or simplifying code structure.
Audited -
dzhng Skill Refactor CleanRefactor cleanly instead of layering sediment. Use when a change reveals duplicated concepts, local adapters, obsolete owners, compatibility wrappers, parallel abstractions, an over-large module that has accreted many responsibilities, or "just tack this on" pressure in any code area.
Audited -
sylphxai Skill Source Command CleanupClean technical debt, refactor, optimize, and simplify codebase
Audited -
github Skill RefactorImprove code structure and readability without changing external behavior through surgical refactoring techniques.
Audited 36.2k -
iliaal Bundle Simplifying CodeSimplifies, polishes, and declutters code without changing behavior. Use when asked to simplify, clean up, refactor, declutter, remove dead code or AI slop, or improve readability. For analysis-only reports without code changes, use code-simplicity-reviewer agent.
Audited -
oyi77 Skill Code SimplificationUse when simplifies code for clarity. Use when code is overly complex, has unnecessary abstractions, or when refactoring for readability.
10 -
luokai0 Bundle Simplifying CodeSimplifies, polishes, and declutters code without changing behavior. Use when asked to simplify, clean up, refactor, declutter, remove dead code or AI slop, or improve readability. For analysis-only reports without code changes, use code-simplicity-reviewer agent.
10 -
seifbenayed Skill SimplifyReview code for unnecessary complexity and simplify it. Use when the user wants to clean up code, reduce complexity, remove dead code, or make code more readable.
-
robsonrung Skill Clean CodeRefactor existing code with behavior-preserving Clean Code practices. Use for local naming, readability, duplication, or structure problems; use architecture-lens for module boundary decisions.
Audited -
outlinedriven-odin-gemini-cli-extension Bundle Cleanup CodebaseReduce concepts, duplication, and ceremony in internal code while touching nearby code. Use when working an existing path and you spot dead fields, redundant wrappers, or speculative abstractions; distinct from refactor-break-bw-compat (internal hygiene, not public API removal).
-
jacksmack1971 Bundle Refactor Legacy CodeUse when cleaning up code or moving logic to new files. Enforces Strangler Fig pattern and atomic refactoring to prevent Big Bang rewrites.
-
mahdtech Skill Refactor CodebaseRemove engineering debt, untangle large modules, collapse duplicated logic, and modernize legacy patterns without changing behavior. Use when refactoring a codebase, removing dead code, or cleaning up stale abstractions.
Audited
How to install a refactoring skill
- Compare the skills. Read the refactoring skills below — each page shows the full SKILL.md, its safety verdict, and the capabilities it declares.
- Install it. Run npx skillmds@latest add <owner>/<name>. The CLI writes the skill into every agent directory it detects, or use --agent to pin one.
- Use it. Restart your agent. It loads the skill on demand the next time you ask for something that matches — you do not have to name the skill.
What makes a good refactoring skill?
A refactoring skill's job is to keep behaviour fixed while structure changes, and to keep the diff small enough to review. The better ones require a green test run before and after, and refuse to bundle a behaviour change into the same commit. Be wary of anything that promises to modernise a whole codebase in one pass: the review burden of a 4,000-line diff is the reason that work never lands.
Every skill listed here is a plain SKILL.md file in the format Anthropic documents for Agent Skills, read unchanged by Cursor, OpenAI Codex and 60+ agents. Each passes a safety review before it is publicly listed; the verdict and declared capabilities are on every skill's page.
Frequently asked questions
What is an agent skill for refactoring?
A refactoring skill's job is to keep behaviour fixed while structure changes, and to keep the diff small enough to review. The better ones require a green test run before and after, and refuse to bundle a behaviour change into the same commit. Be wary of anything that promises to modernise a whole codebase in one pass: the review burden of a 4,000-line diff is the reason that work never lands.
Is it safe to let an agent refactor without tests?
No, and good refactoring skills say so explicitly — several will stop and ask you to add characterization tests first. Without a test, neither you nor the agent can tell a refactor from a rewrite.
Which agents can use these refactoring skills?
Any agent that reads SKILL.md files: Claude Code, Claude.ai, Cursor, OpenAI Codex, Windsurf, OpenCode and 60+ others. The format is not vendor-specific, so the same file works everywhere — each agent just keeps its skills in a different directory, listed at /agents.
Are these refactoring skills free?
Yes. Searching, reading and installing skills on SkillMD is free and needs no account. Individual skills carry their own licence, shown on each skill's page.