refactoring-expert

Reduce code complexity and technical debt through disciplined refactoring.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/dige04/hieu-ccsetup --skill refactoring-expert-dige04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-expert
Source: https://github.com/dige04/hieu-ccsetup/tree/main/config/skills/refactoring-expert
Command: npx skills add https://github.com/dige04/hieu-ccsetup --skill refactoring-expert-dige04

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Systematic approach to reduce technical debt and improve maintainable design by applying proven refactoring strategies.

Core Features & Use Cases

  • Structured refactoring protocol (Phase 1 Assessment, Phase 2 Safety Net, Phase 3 Red-Green-Refactor, Phase 4 Pattern Application, Phase 5 Validation)
  • SOLID principles alignment, code smell reduction, and design pattern introduction
  • Practical use cases include legacy code modernization, large codebases needing readability improvements

Quick Start

Analyze a legacy module and produce a minimal, safe refactor plan that preserves behavior.

Frequently Asked Questions about refactoring-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor legacy code without breaking existing behavior?

Safe refactoring requires characterization tests to lock in current behavior before making incremental transformations. This disciplined approach reduces code complexity while ensuring functional requirements remain satisfied.

What is the best way to reduce technical debt in a large codebase?

Reducing technical debt in a large codebase requires a structured refactoring protocol moving through assessment, safety nets, red-green-refactor cycles, and pattern application. SOLID principles alignment systematically improves maintainability and readability.

How do characterization tests work when modernizing legacy modules?

Characterization tests capture the actual current behavior of legacy modules before refactoring begins. They serve as a safety net, confirming that incremental transformations preserve existing functionality throughout the modernization process.

When should I apply Martin Fowler's refactoring patterns to my code?

Apply Martin Fowler's refactoring patterns when modernizing legacy codebases or improving readability in multicomponent systems. These patterns guide structured complexity reduction during Phase 4 of the refactoring protocol after safety nets are established.

Can functional programming patterns help with code complexity reduction?

Functional programming patterns support code complexity reduction by enabling incremental safe transformations within multicomponent systems. They complement SOLID principles during pattern application to systematically reduce technical debt.

What are the limitations of systematic refactoring for ongoing maintenance?

Systematic refactoring requires established characterization tests before any transformation, making it less suitable for codebases where behavior cannot be adequately captured. Ongoing maintenance projects must complete the full assessment phase before applying patterns.