refactor

Installation
Summary

Surgical code refactoring to improve maintainability without changing behavior.

  • Covers 10 common code smells: long methods, duplication, large classes, long parameter lists, feature envy, primitive obsession, magic numbers, nested conditionals, dead code, and inappropriate intimacy
  • Includes extract method, extract class, and introduce type safety patterns with before/after examples
  • Provides design pattern refactoring strategies: Strategy, Chain of Responsibility, and others for replacing conditional logic
  • Emphasizes safe refactoring process: prepare with tests, make small changes, verify with tests, commit incrementally
SKILL.md

Refactor

Overview

Improve code structure and readability without changing external behavior. Refactoring is gradual evolution, not revolution. Use this for improving existing code, not rewriting from scratch.

When to Use

Use this skill when:

  • Code is hard to understand or maintain
  • Functions/classes are too large
  • Code smells need addressing
  • Adding features is difficult due to code structure
  • User asks "clean up this code", "refactor this", "improve this"

Refactoring Principles

Related skills

More from github/awesome-copilot

Installs
16.1K
GitHub Stars
32.7K
First Seen
Jan 23, 2026