refactoring-catalog

Apply proven refactoring patterns to Python codebases while preserving behavior.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/franciscosanchezn/easyfactu-es --skill refactoring-catalog-franciscosanchezn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-catalog
Source: https://github.com/franciscosanchezn/easyfactu-es/tree/main/.github/skills/refactoring-catalog
Command: npx skills add https://github.com/franciscosanchezn/easyfactu-es --skill refactoring-catalog-franciscosanchezn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers apply proven refactoring patterns to improve code structure while preserving behavior, reducing complexity, eliminating code smells, and improving maintainability.

Core Features & Use Cases

  • Provides a catalog of established refactoring patterns inspired by Martin Fowler.
  • Demonstrates safe, incremental workflows (one small change at a time) to migrate codebases without altering behavior.
  • Suitable for Python projects of medium to large size, tackling issues like long methods, duplication, large classes, and complex conditionals.

Quick Start

Review a target module, select a refactoring pattern from the catalog, and apply it step by step while preserving behavior.

Frequently Asked Questions about refactoring-catalog

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

FAQPage Schema
How do I refactor long methods and complex conditionals in Python?

To refactor long methods and complex conditionals in Python, apply established patterns like Extract Method or Replace Conditional with Polymorphism. These patterns improve code structure while preserving behavior through small, incremental changes verified by baseline tests.

What is the Replace Conditional with Polymorphism refactoring pattern?

Replace Conditional with Polymorphism is a refactoring pattern that moves complex conditional logic into separate polymorphic classes. It eliminates code smells by simplifying conditionals into targeted class behaviors, improving overall software design and code maintainability.

How do I safely refactor a large Python codebase without altering behavior?

To safely refactor a large Python codebase without altering behavior, use an incremental workflow with baseline tests. Apply one small change at a time, verify behavior after each step, and use catalog patterns like Extract Class to systematically reduce complexity.

Does this refactoring catalog work for medium to large Python projects?

Yes, this refactoring catalog is specifically designed for medium to large Python projects. It targets common structural issues in large codebases such as code duplication, large classes, long methods, and complex conditionals using proven software design patterns.

When should I use the Extract Class refactoring pattern?

You should use the Extract Class refactoring pattern when a large class has multiple responsibilities causing code smells. It separates distinct behaviors into new classes, improving overall software design and maintainability while preserving the original program behavior.

What is the best way to eliminate code duplication in Python?

The best way to eliminate code duplication in Python is to apply Martin Fowler-style refactoring patterns. By extracting duplicated logic into targeted methods or introducing parameter objects, you reduce redundancy and improve code maintainability safely.