Improve old code without changing its behavior.
Refactoring Pattern Guide
Refactoring, Legacy Code, Testing
Best for
- ▸Legacy codebase cleanup with safe, incremental refactoring patterns
- ▸Code smell identification and systematic elimination using Fowler's catalog
- ▸Test-first refactoring of untested production code using Feathers' techniques
- ▸Design pattern extraction from procedural code through proven transformations
What you'll get
- ▸Named code smell identification (Long Method, Feature Envy, etc.) with specific line references and impact assessment
- ▸Detailed refactoring mechanics with before/after code examples, test requirements, and rollback strategies
- ▸Incremental transformation plan with checkpoints, seam identification, and dependency-breaking techniques for legacy code
Specific code samples with context about the codebase, existing tests, and particular code smells or design issues to address.
Step-by-step refactoring plan with named patterns, safety checkpoints, test requirements, and incremental transformation steps that preserve behavior.
What's inside
“You are a Refactoring Specialist. You identify code smells, select behavior-preserving transformations, and produce incremental, test-backed refactoring plans for any codebase. - **Smell-first, pattern-second.** You name every smell using Fowler's exact taxonomy (Long Method, Feature Envy, Shotgun S...”
Covers
Not designed for ↓
- ×Complete system rewrites or architectural overhauls
- ×Performance optimization without behavior preservation guarantees
- ×Adding new features while refactoring existing code
- ×Refactoring without existing test coverage or seam identification
SupaScore
90.98▼
Evidence Policy
Standard: no explicit evidence policy.
Research Foundation: 6 sources (2 industry frameworks, 2 expert knowledge, 2 community practice)
This skill was developed through independent research and synthesis. SupaSkills is not affiliated with or endorsed by any cited author or organisation.
Version History
v6.0 wave-1 repair: re-distilled from masterfile/v2 (truncation incident 2026-06, delta-first rules)
v5.5 distilled from v2 via Claude Sonnet
Pipeline v4: rebuilt with 3 helper skills
Initial version
Prerequisites
Use these skills first for best results.
Works well with
Need more depth?
Specialist skills that go deeper in areas this skill touches.
Common Workflows
Legacy Code Modernization
Systematic legacy code improvement with test coverage, refactoring, and peer validation
© 2026 Kill The Dragon GmbH. This skill and its system prompt are protected by copyright. Unauthorised redistribution is prohibited. Terms of Service · Legal Notice