Agent skill · software engineering · samhvw8
refactoring-expert
Systematic code refactoring following Martin Fowler's catalog. Methodologies: characterization tests, Red-Green-Refactor, incremental transformation. Capabilities: SOLID compliance, DRY cleanup, code smell detection, complexity reduction, legacy modernization, design patterns, functional programming patterns. Actions: refactor, extract, inline, rename, move, simplify code. Keywords: refactor, SOLID, DRY, code smell, complexity, extract method, inline, rename, move, clean code, technical debt, legacy code, design pattern, characterization test, Red-Green-Refactor, functional programming, higher-order function, immutability, pure function, composition, currying, side effects. Use when: improving code quality, reducing technical debt, applying SOLID principles, fixing DRY violations, removing code smells, modernizing legacy code, applying design patterns.
Why this skill is useful
Provides domain-specific methodologies and patterns for systematic code refactoring that the AI wouldn't reliably generate on its own.
What it needs
Requires checkstyle, eslint, findbugs, pmd, sonarqube installed locally. About 5k tokens when loaded. Last updated 2025-12-09. 10 stars on the source repository.
What this skill does
Refactoring Expert Purpose Improve code quality and reduce technical debt through systematic refactoring following Martin Fowler's catalog, functional programming best practices, and industry standards. Triggers Activate when working on: Code complexity reduction and technical debt elimination SOLID principles implementation and design pattern application Code quality improvement and maintainability enhancement Legacy code modernization and anti-pattern removal Test-driven refactoring and behavior preservation Characterization testing and safety nets Functional programming transformations (imperative to functional) Higher-order functions, composition, currying, and immutability Side effect elimination and pure function extraction Behavioral Mindset Simplify relentlessly. Preserve behavior religiously. Measure everything. Every refactoring must be: small and safe, tested immediately, measurably better. Reduce cognitive load over cleverness. Incremental improvements beat risky rewrites. First Principle: Stop Making It Worse - Before reducing existing debt, ensure new code doesn't add more. Focus Areas Code Simplification: Cyclomatic complexity reduction, readability improvement, function size optimization Technical Debt Reduction: Intentional and unintentional debt, DRY violations, code smells, anti-pattern elimination Pattern Application: SOLID principles, Gang of Four patterns, Martin Fowler's ~70 refactorings, functional transformations Quality Metrics: Complexity scores, maintainability index, duplication percentages, test coverage Safe Transformation: Behavior preservation, automated tests, characterization tests, incremental changes Automated Tooling: SonarQube, ESLint, PMD, Checkstyle, FindBugs for continuous quality monitoring Technical Debt Types <requirements> Intentional Debt (Strategic) Conscious decision to optimize for present needs Documented with repayment plan Time-boxed with scheduled refactoring Examples: MVP shortcuts, rapid prototyping, deadline-d …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills samhvw8/refactoring-expert