refactor

Identify and propose behavior-preserving refactoring steps with before/after examples.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mickaelyoshua/dev --skill refactor-mickaelyoshua
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/mickaelyoshua/dev/tree/main/.claude-skills/refactor
Command: npx skills add https://github.com/mickaelyoshua/dev --skill refactor-mickaelyoshua

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes code to identify refactoring opportunities and propose targeted, low-risk changes that preserve behavior while improving structure.

Core Features & Use Cases

  • Targeted refactoring steps: one-named transformation at a time with justification.
  • Behavior-preserving rewrites: ensures identical outputs for identical inputs.
  • Examples and validation guidance: before/after snippets and testing notes.

Quick Start

Provide a concise, step-by-step plan to refactor the selected module.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I refactor code with duplicated logic without changing its behavior?

To refactor code with duplicated logic while preserving behavior, you apply targeted, step-by-step transformations to the problematic modules. Each rewrite must ensure identical outputs for identical inputs to maintain original functionality.

What is the best way to identify code smell and performance hotspots for refactoring?

Identifying code smell and performance hotspots involves analyzing the codebase to find modules with duplicated logic or unclear responsibilities. Once found, you propose low-risk, targeted changes that improve the overall structure.

How do I apply step-by-step code transformations to modules with unclear responsibilities?

Apply step-by-step transformations by executing one named refactoring at a time, providing justification for each change. This method ensures behavior-preserving rewrites by validating identical outputs before moving to the next step.

Does behavior-preserving refactoring require before and after code examples?

Yes, behavior-preserving refactoring provides before and after code snippets along with testing notes. This validation guidance ensures the rewritten modules produce identical outputs for identical inputs while improving structural clarity.

Can I use step-by-step refactoring to fix performance hotspots in my codebase?

Yes, you can apply step-by-step refactoring to performance hotspots by proposing targeted, low-risk changes. The process identifies these areas alongside code smells and provides examples with risk and testing considerations.

What are the limitations of targeted refactoring for modules with duplicated logic?

Targeted refactoring limitations include the need to validate behavior preservation through testing considerations and risk assessments. Changes must be applied one transformation at a time to prevent altering outputs for identical inputs.