What problem does it solve? Refactoring legacy or monolithic code often risks breaking existing behavior, and big-bang rewrites introduce regressions. This Skill provides a disciplined, incremental process that keeps behavior and public contracts stable while modernizing code structure. ## Core Features & Use Cases - Incremental Refactoring Loop: Extract constants, convert procedural code to classes with dependency injection, extract helpers, reorganize folders, and upgrade error handling—each step gated by lint and tests. - Clean Architecture Migration: Move modules into domain/application/infrastructure/presentation folders using compatibility shims so old import paths keep working. - Multi-Language Guidance: Concrete patterns for Python, TypeScript/JavaScript, Go, and Java, including constants extraction, typed exception hierarchies, and retry with exponential backoff. - Use Case: Given a legacy processor.py full of magic strings and procedural logic, produce a smallest-first migration plan, convert it to a service class with injected dependencies, and validate each step with focused tests. ## Quick Start Ask the AI to refactor src/legacy/processor.py to clean architecture with an incremental, test-gated migration plan.