refactoring-catalog

Apply test-backed refactorings to improve code structure without changing behavior.

2|1|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/dreamingechoes/dx-toolkit --skill refactoring-catalog-dreamingechoes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-catalog
Source: https://github.com/dreamingechoes/dx-toolkit/tree/main/templates/skills/refactoring-catalog
Command: npx skills add https://github.com/dreamingechoes/dx-toolkit --skill refactoring-catalog-dreamingechoes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Catalogs safe refactoring patterns and checks to improve structure without changing behavior.

Core Features & Use Cases

  • Structured catalog of common refactorings with explicit before/after examples.
  • Safety checklists and test requirements accompany each pattern to guard against regressions.
  • Practical guidance showing when to apply patterns like Extract Function, Rename, and Move Function to reduce technical debt.

Quick Start

Identify a readable yet tangled area in your codebase, then choose and apply a safe refactoring pattern from the catalog and run tests to confirm behavior.

Frequently Asked Questions about refactoring-catalog

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

FAQPage Schema
How do I safely refactor code without changing runtime behavior?

Safe refactoring requires applying test-backed patterns like Extract Function or Replace Conditional, running tests after each change, and committing refactorings as isolated steps to prevent regressions. A safety checklist accompanies each catalog pattern.

What are the most common refactoring patterns for reducing technical debt?

Common refactoring patterns include Extract Function, Rename, Move Function, and Replace Conditional. These patterns target tangled code areas to improve readability and structure while preserving existing runtime behavior.

How do I apply a refactoring pattern step by step in a production codebase?

Identify a tangled area, ensure behavior tests exist or write them, select a pattern from the refactoring catalog, apply the before/after transformation, run tests to confirm behavior, and commit as an isolated step.

Do I need existing tests before applying refactoring patterns?

Yes, tests must exist or be written for the behavior before applying refactoring patterns. The catalog explicitly requires running tests after each change to guard against regressions in production-grade codebases.

When should I use the Replace Conditional refactoring pattern?

Use Replace Conditional when facing complex conditional logic that hinders readability and maintenance. The catalog provides before/after examples and safety checks to ensure the refactoring preserves runtime behavior without introducing regressions.