code-refactoring

Installation
Summary

Refactor code while preserving behavior, improving clarity, and reducing complexity.

  • Covers five core refactoring patterns: Extract Method, DRY principle removal, conditional-to-polymorphism conversion, parameter object introduction, and SOLID principle application
  • Includes behavior validation workflow with pre-refactoring analysis, post-refactoring testing (unit, type, lint, snapshot), and change documentation
  • Provides refactoring checklist covering function length, parameter count, nesting depth, magic numbers, and self-documentation
  • Enforces mandatory constraints: write tests first, change one thing at a time, preserve all functional behavior
  • Supports multi-agent workflows with role-based verification across orchestration, analysis, and test execution phases
SKILL.md

Code Refactoring

When to use this skill

  • Code review: Discovering complex or duplicated code
  • Before adding new features: Cleaning up existing code
  • After bug fixes: Removing root causes
  • Resolving technical debt: Regular refactoring

Instructions

Step 1: Extract Method

Before (long function):

function processOrder(order: Order) {
  // Validation
Related skills

More from supercent-io/skills-template

Installs
11.9K
GitHub Stars
88
First Seen
Jan 24, 2026