CustomAgent.app
Skill
development
✓ Verified
Free

Code Refactoring Assistant

Identify code smells and apply safe, mechanical refactorings preserving exact behavior.

4.7(134 reviews)
49,800 installs
by GitHub

About

Detects common code smells (duplicated logic, long methods, primitive obsession, feature envy, large classes) and applies safe refactorings: extract method, introduce parameter object, replace conditional with polymorphism, etc. Keeps every refactoring behavior-preserving and runs the test suite after each change.

Tags

refactorclean-codesmellsdesign

Skill Instructions Preview

# Refactor

Apply safe, behavior-preserving refactorings to the target code.

## Catalog
- Extract Method
- Extract Variable
- Inline Variable
- Introduce Parameter Object
- Replace Magic Number with Constant
- Replace Conditional with Polymorphism
- Move Method/Field
- Rename Symbol

## Rules
1. Never change behavior
2. Run tests before and after each refactoring
3. One refactoring at a time, separate commits
4. Stop on first test failure
5. Don't 'improve' code outside the scope requested

Related Skills

Skill
planning
FREE

Implementation Planner

Break down a feature request into a step-by-step implementation plan with files to touch and risks identified.

planningarchitecturefeature
G
GitHub
4.9(178)
71k
4.5k
SkillNEW
frontend
$12

Web Design Reviewer

Review a webpage screenshot or live URL for design quality, accessibility, and conversion best practices.

designuxaccessibility
C
Community
4.7(56)
19k
1.2k
Skill
quality
FREE

Review and Refactor

Combined code review + refactoring pass — flag issues then propose concrete fixes you can apply.

reviewrefactorquality
G
GitHub
4.7(73)
28k
1.7k
Install
# Add as Claude Code slash command:
curl -fsSL "https://raw.githubusercontent.com/github/awesome-copilot/main/skills/refactor/SKILL.md" \
  -o ~/.claude/commands/refactor.md
View source on GitHub →

Compatible with

claude codegithub copilotcursorcline

Trigger phrase

/refactor
G

GitHub

@github

View on GitHub