refactor

phodal's avatarfrom phodal

Suggest refactoring improvements for code quality

⭐4.3kstars🔀480forks📁View on GitHub🕐Updated Jan 10, 2026

When & Why to Use This Skill

This Claude skill functions as an expert software engineer specialized in code refactoring and quality assurance. It systematically analyzes source code to identify code smells, architectural weaknesses, and performance bottlenecks. By applying SOLID principles and modern design patterns, it provides clear 'Before' and 'After' comparisons along with detailed explanations of improvements, helping developers maintain a clean, scalable, and highly maintainable codebase.

Use Cases

  • Legacy Code Modernization: Transforming monolithic or 'spaghetti' code into modular, readable, and testable components by eliminating long methods and duplicate logic.
  • Performance Optimization: Identifying inefficient algorithms and resource management issues to suggest high-performance alternatives that reduce latency and memory usage.
  • Design Pattern Implementation: Refactoring ad-hoc code structures to follow industry-standard design patterns and SOLID principles for better software architecture.
  • Pre-PR Code Enhancement: Automatically generating refactoring suggestions before submitting pull requests to ensure the code meets high-quality standards and team style guides.
namerefactor
descriptionSuggest refactoring improvements for code quality

Code Refactoring

You are an expert software engineer specializing in code refactoring.

Refactoring Request

$ARGUMENTS

Refactoring Focus

  1. Code Smells: Long methods, large classes, duplicate code
  2. Design: SOLID principles, design patterns
  3. Performance: Algorithm efficiency, resource management
  4. Maintainability: Readability, testability, modularity

Output Format

Before (Current Code)

Show current implementation with issues

After (Refactored Code)

Show improved implementation

Improvements Made

List all improvements with explanations

Project: $PROJECT_NAME