refactoring-patterns

Apply named refactorings to multi-language codebases without altering behavior.

3|2|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/wesleyegberto/software-engineering-skills --skill refactoring-patterns-wesleyegberto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-patterns
Source: https://github.com/wesleyegberto/software-engineering-skills/tree/main/plugins/programming-skills/skills/refactoring-patterns
Command: npx skills add https://github.com/wesleyegberto/software-engineering-skills --skill refactoring-patterns-wesleyegberto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a structured approach to improving code readability and maintainability by applying a curated set of named refactorings, enabling teams to safely evolve codebases without changing observable behavior.

Core Features & Use Cases

  • Catalog-driven mapping of code smells to proven refactorings (e.g., Extract Method, Move Method, Replace Conditional with Polymorphism) to break down large methods and reorganize responsibilities.
  • Stepwise workflow guidance for identifying smells, prioritizing changes, executing targeted transformations, and validating outcomes with tests across languages (Python, JavaScript/TypeScript, Java).
  • Reusable, knowledge-base references (smell catalogs, pattern descriptions, and guidance) to support consistent refactoring practices across teams.
  • Real-world scenarios demonstrating how to reduce duplication, improve cohesion, and minimize regression risk during feature evolution.

Quick Start

Run a smell-detection pass on a target file, apply a single refactoring pattern in a small, verifiable step, and re-run tests to ensure behavior remains unchanged.

Frequently Asked Questions about refactoring-patterns

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

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

To safely refactor code without altering behavior, apply named patterns step-by-step and validate each transformation by running a test suite. This ensures structural improvements maintain observable functionality.

What is the best way to fix code smells like large methods and duplication?

Fixing code smells involves mapping them to proven refactorings like Extract Method or Move Method. This breaks down large methods, reduces duplication, and improves overall cohesion.

Can I apply pattern-based refactoring to JavaScript, Python, and Java codebases?

Yes, pattern-based refactoring supports multi-language codebases including JavaScript, TypeScript, Python, and Java, guiding targeted transformations consistently across different programming languages.

Do I need test-driven development to execute incremental refactoring steps?

Yes, a test suite is required to execute incremental refactoring steps safely. Tests validate that each stepwise structural improvement preserves the original behavior and minimizes regression risk.

How does catalog-driven refactoring compare to manual code reorganization?

Catalog-driven refactoring provides a structured approach using a smell catalog and pattern descriptions, ensuring consistent practices across teams, whereas manual reorganization lacks standardized, verifiable transformations.