Back to Skills
🔧

Refactor Code

Official Skill
/refactor

Refactors code for better readability, performance, or maintainability.

C

by Claude Rules

Skill author

.claude/commands/refactor.md
Refactor the code at $ARGUMENTS.

Goals:
1. Readability: Clear names, logical structure
2. Correctness: No behavior changes unless fixing a bug
3. Performance: Only optimize if measurable

Do not change the external API unless explicitly asked.

How to install this skill

Save the content above as a .md file in your .claude/commands/ directory, then use /refactor in Claude Code.

Project-level (current project only):

.claude/commands/refactor.md

Global (all projects):

~/.claude/commands/refactor.md

Browse by Tag

What are Skills?

Claude Code Skills are reusable slash commands stored as .md files in your .claude/commands/ directory. Type /refactor in Claude Code to run this skill.

Learn more in the docs