refactoring-patterns

Catalog code refactoring patterns for improving software quality and managing technical debt.

10|2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/bugrabilge/bilge-development-kit --skill refactoring-patterns-bugrabilge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-patterns
Source: https://github.com/bugrabilge/bilge-development-kit/tree/main/skills/refactoring-patterns
Command: npx skills add https://github.com/bugrabilge/bilge-development-kit --skill refactoring-patterns-bugrabilge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to code refactoring techniques, helping developers improve existing code quality, reduce technical debt, and plan for safer migrations.

Core Features & Use Cases

  • Method-Level Refactorings: Learn techniques like Extract Method, Inline Method, and Replace Temp with Query.
  • Class/Module-Level Refactorings: Understand Extract Class, Move Method, and Replace Inheritance with Composition.
  • Design Pattern Refactorings: Apply patterns like Strategy, Factory Method, and Null Object.
  • Large-Scale Strategies: Implement Strangler Fig, Branch by Abstraction, and Parallel Change for complex migrations.
  • Use Case: When faced with a complex, hard-to-maintain function, use this Skill to identify and apply appropriate refactoring techniques to simplify it, making it more readable and testable.

Quick Start

Use the refactoring-patterns skill to learn about the Strangler Fig pattern for incremental system migration.

Frequently Asked Questions about refactoring-patterns

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

FAQPage Schema
How do I identify code smells and technical debt before refactoring?

To identify code smells and technical debt, this guide catalogs foundational refactoring principles and specific code smell indicators to help you recognize problematic areas in your codebase that require structural improvement.

What is the best way to migrate a large legacy system incrementally?

The best way to migrate a large legacy system incrementally is using large-scale refactoring strategies like the Strangler Fig pattern, which allows you to gradually replace legacy components without a full system rewrite.

How do I simplify a complex method to improve code quality and testability?

To simplify a complex method and improve code quality, you can apply method-level refactorings such as Extract Method, Inline Method, and Replace Temp with Query to break down logic into readable, testable units.

When should I replace inheritance with composition in software design?

You should replace inheritance with composition when class hierarchies become rigid or complex, utilizing class-level refactorings to decouple modules and apply design patterns like Strategy or Factory Method for better flexibility.

Can I use these refactoring patterns for continuous improvement workflows?

Yes, these refactoring patterns support continuous improvement workflows by providing incremental techniques and structural strategies that ensure safer migrations and ongoing code modernization within existing development cycles.

What are the limitations of using Strangler Fig for system migration?

While effective for incremental migrations, large-scale strategies like Strangler Fig require maintaining both old and new systems simultaneously during the transition, which can increase short-term infrastructure complexity and operational overhead.