Command Palette

Search for a command to run...

Back to skills
skill № 79321

Refactor

Use when refactoring code to improve structure, reduce duplication, and apply SRP/DRY principles without changing behavior.

FreeNo executable scripts
whchoi98by whchoi98★ 20 GitHub stars

Install Refactor in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Refactor Skill

Refactor existing code to improve quality without changing behavior.

Principles

  • Improve structure without changing behavior
  • Single Responsibility Principle (SRP)
  • Remove duplicate code (DRY)
  • Small, incremental steps with verification

Process

1. Analysis

  • Identify the target code and its tests
  • Map all callers and dependencies
  • Confirm test coverage exists (suggest adding tests first if not)

2. Plan

Present the refactoring plan to the user:

  • What will change
  • What will NOT change (behavior preservation)
  • Risk assessment (low/medium/high)

3. Execute

  • Make changes in small, verifiable steps
  • Run tests after each step if possible
  • Keep commits atomic

4. Verify

  • Confirm all existing tests pass
  • Verify no behavior changes
  • Check that the refactoring achieved its goal

Usage

Run with /refactor command

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the Refactor skill do?

Use when refactoring code to improve structure, reduce duplication, and apply SRP/DRY principles without changing behavior.

How do I install the Refactor skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the Refactor skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare Refactor with