refactoring-expert

Identify and remediate code smells using refactoring techniques without altering external behavior.

Updated Oct 17, 2025
One-click install
npx skills add https://github.com/duynhne/monitoring --skill refactoring-expert-duynhne
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-expert
Source: https://github.com/duynhne/monitoring/tree/main/.agent/skills/refactoring-expert
Command: npx skills add https://github.com/duynhne/monitoring --skill refactoring-expert-duynhne

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams identify and remediate code smells and suboptimal structures, enabling safer, incremental refactoring without changing external behavior.

Core Features & Use Cases

  • Detects common code smells (long methods, duplicated logic, complex conditionals) and suggests targeted refactorings.
  • Guides teams through a safe, incremental workflow with testing, linting, and validation to preserve behavior.
  • Provides a toolkit of proven refactoring techniques (Extract Method, Move Method, Replace Conditional with Polymorphism) and practical examples.

Quick Start

Start by applying the Refactoring Expert to a module with suspected smells, and request a guided plan outlining the first two refactors.

Frequently Asked Questions about refactoring-expert

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

FAQPage Schema
How do I refactor long methods and duplicated logic without changing external behavior?

To refactor long methods and duplicated logic safely, apply proven techniques like Extract Method and Move Method while enforcing a workflow of tests, linting, and type checks to preserve external behavior.

What is the best way to resolve complex conditionals and code smells in my codebase?

The best way to resolve complex conditionals and code smells is to identify the specific smell and apply targeted techniques like Replace Conditional with Polymorphism, incrementally improving the structure.

How do I start improving code quality through incremental refactoring?

Start improving code quality by applying refactoring techniques to a module with suspected smells, then request a guided plan outlining the first two targeted refactors to safely increment structure.

Do I need tests and linting to safely execute a refactoring workflow?

Yes, you need tests, linting, and type checks to safely execute a refactoring workflow; these validations enforce a safe, incremental process that preserves the code's external behavior.

When should I use Replace Conditional with Polymorphism over Extract Method for code smells?

Use Replace Conditional with Polymorphism for complex conditional smells, whereas Extract Method targets long methods and duplicated logic; choosing the targeted technique ensures safe structural improvement.