refactoring-patterns

Apply refactoring patterns to JavaScript/TypeScript codebases with test scaffolding.

Updated Jan 25, 2026
One-click install
npx skills add https://github.com/erhankaraarslan/agent_yazilim_ekibi --skill refactoring-patterns-erhankaraarslan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-patterns
Source: https://github.com/erhankaraarslan/agent_yazilim_ekibi/tree/main/.claude/skills/refactoring-patterns
Command: npx skills add https://github.com/erhankaraarslan/agent_yazilim_ekibi --skill refactoring-patterns-erhankaraarslan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers refactor messy codebases by applying proven patterns to improve structure, readability, and maintainability while preserving behavior.

Core Features & Use Cases

  • Pattern Catalog: Provides a set of common refactoring patterns (Extract Method, Replace Conditional with Polymorphism, Introduce Parameter Object, etc.) with practical examples.
  • Guided Refactoring: Step-by-step guidance to apply patterns safely with tests.
  • Use Case: When you have a large function with duplicated logic, apply Extract Method to break it into smaller, testable units.

Quick Start

Describe your target piece of code or a file path, and ask the AI to propose a refactoring plan and a small, testable change.

Frequently Asked Questions about refactoring-patterns

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

FAQPage Schema
How do I refactor a large JavaScript function to improve code quality?

To refactor a large JavaScript function, apply the Extract Method pattern to break it into smaller, testable units. This approach preserves behavior while improving structure, readability, and maintainability during code debt cleanup.

What is the best way to replace complex conditionals with polymorphism in TypeScript?

Replace conditional with polymorphism by restructuring object-oriented TypeScript code into targeted subclasses. This refactoring pattern eliminates tangled conditional logic, distributing behavior across polymorphic objects to enhance code maintainability.

Can I use automated refactoring patterns for object-oriented codebases during feature work?

Yes, automated refactoring patterns can be applied to object-oriented codebases during feature work and maintenance. The process includes generating a refactoring plan, test scaffolding, and documented guidance to ensure behavior preservation.

How do I ensure behavior preservation when applying refactoring patterns?

Behavior preservation during refactoring is ensured by using step-by-step guidance with tests. The process provides test scaffolding and documented, pattern-driven transformations to verify functionality before and after structural changes.

When do I need to introduce a parameter object for code maintenance?

Introduce a parameter object when a method contains too many parameters, complicating code maintenance. This refactoring pattern groups arguments into a single object, improving readability and simplifying function signatures.

Does this refactoring approach work without existing test coverage?

Applying refactoring patterns safely requires test scaffolding to verify behavior preservation. The guided process generates test structures alongside pattern-driven transformations, ensuring code quality improvements do not introduce regressions.