refactoring

Documents 89 refactoring techniques and 22 code smells for PHP 8.3+.

20|1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill refactoring-krzysztofsurdy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring
Source: https://github.com/krzysztofsurdy/code-virtuoso/tree/main/skills/knowledge/refactoring
Command: npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill refactoring-krzysztofsurdy

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses code that is difficult to understand, maintain, or extend by providing a comprehensive guide to improving code structure and quality.

Core Features & Use Cases

  • Refactoring Techniques: Learn and apply 89 distinct refactoring patterns to improve code.
  • Code Smell Detection: Identify and fix 22 common code smells that hinder maintainability.
  • Use Case: You have a complex method that's hard to read. Use this Skill to apply "Extract Method" or "Decompose Conditional" to simplify it, making it easier to understand and test.

Quick Start

Use the refactoring skill to learn about the 'Extract Method' refactoring.

Frequently Asked Questions about refactoring

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

FAQPage Schema
How do I identify and fix code smells in my PHP codebase?

You can identify and fix code smells by checking your codebase against 22 common code smell categories provided in this reference. It includes practical PHP 8.3+ examples to detect and address maintainability and complexity issues.

What is the best way to simplify complex methods and reduce technical debt?

The best way to simplify complex methods is applying refactoring techniques like Extract Method or Decompose Conditional. This Skill covers 89 distinct refactoring patterns to reduce complexity, improve code quality, and manage technical debt effectively.

Does this refactoring reference support PHP 8.3?

Yes, this refactoring reference supports PHP 8.3+ environments. It provides comprehensive examples and patterns specifically tailored for PHP 8.3+ syntax and features to ensure compatibility and practical application in modern codebases.

How do I apply Extract Method to improve code maintainability?

To apply Extract Method, you select a complex code fragment, move it into a new method, and replace the original code with a method call. This refactoring technique is detailed within the composing methods category to improve readability.

When should I use refactoring techniques for generalization?

You should use generalization refactoring techniques when dealing with inheritance hierarchies and shared features across classes. This Skill covers specific patterns for organizing data, moving features, and simplifying conditionals to optimize software design.