refactoring-expert

Detect code smells and apply refactoring techniques without changing external behavior.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/mahamaneharouna9-cpu/Apex-invoice-billing-automation --skill refactoring-expert-mahamaneharouna9-cpu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-expert
Source: https://github.com/mahamaneharouna9-cpu/Apex-invoice-billing-automation/tree/main/.opencode/skill/refactoring-expert
Command: npx skills add https://github.com/mahamaneharouna9-cpu/Apex-invoice-billing-automation --skill refactoring-expert-mahamaneharouna9-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill tackles the challenge of improving existing code by identifying and rectifying code smells, enhancing structural integrity, and optimizing performance without altering the software's external behavior.

Core Features & Use Cases

  • Code Smell Detection: Identifies common issues like long methods, duplicated code, and complex conditionals.
  • Structural Optimization: Applies proven refactoring techniques to improve code design and readability.
  • Behavior Preservation: Ensures that all refactoring efforts maintain the original functionality and pass existing tests.
  • Use Case: When faced with a large, complex function that is difficult to understand and modify, this Skill can systematically break it down into smaller, more manageable methods, significantly improving maintainability.

Quick Start

Analyze the current codebase for any code smells and suggest refactoring opportunities.

Frequently Asked Questions about refactoring-expert

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

FAQPage Schema
How do I detect code smells like long methods and duplicated code in my codebase?

Code smell detection identifies structural issues like long methods, duplicated code, and complex conditionals. This Skill systematically analyzes your codebase to pinpoint these problems and suggest targeted refactoring opportunities to enhance maintainability.

How do I refactor complex conditional expressions without breaking existing functionality?

Refactoring complex conditional expressions involves simplifying logic while preserving external behavior. This Skill applies proven techniques to restructure conditionals, ensuring the original functionality remains intact and existing tests continue to pass successfully.

What is the best way to break down a large complex function into smaller manageable methods?

The best way to break down large functions is by applying Composing Methods refactoring techniques. This Skill systematically decomposes complex functions into smaller, more manageable methods, significantly improving code readability and structural design.

When do I need to refactor code for better software design and maintainability?

You need refactoring when code exhibits smells like complex conditionals or duplicated logic that hinder modification. This Skill addresses these structural integrity issues by moving features between objects and organizing data to optimize performance.

Does refactoring software design alter the external behavior of the application?

Refactoring software design does not alter external behavior. This Skill ensures all structural optimizations and code modifications maintain the original functionality, applying proven techniques to improve internal design while passing existing tests.

How do I deal with generalization issues when organizing data during code optimization?

Dealing with generalization involves applying structural optimization techniques to organize data and class hierarchies. This Skill systematically addresses generalization issues to improve code quality without changing the software's external behavior.