refactor-assist

Guide safe incremental refactoring of multi-file codebases while preserving behavior.

9|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/d0d012/claude-trim --skill refactor-assist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-assist
Source: https://github.com/d0d012/claude-trim/tree/main/testdata/demo/plugins/dev-tools/skills/refactor-assist
Command: npx skills add https://github.com/d0d012/claude-trim --skill refactor-assist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps engineers safely refactor existing code by identifying opportunities, suggesting proven patterns, and ensuring behavior remains intact throughout incremental changes.

Core Features & Use Cases

  • Identify refactoring opportunities across modules.
  • Propose patterns like extract function, introduce parameter object, replace conditional with polymorphism, decompose large classes, remove dead code, and inline temporary variables.
  • Enforce behavior preservation with stepwise guidance and validation.

Quick Start

Provide a target module and goal, and it will guide a safe, incremental refactor while preserving behavior.

Frequently Asked Questions about refactor-assist

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

FAQPage Schema
How do I refactor legacy code incrementally while preserving behavior?

To refactor legacy code incrementally while preserving behavior, you identify opportunities across modules and apply proven patterns like extract function or decompose large classes in small, validated steps. This ensures functionality remains unchanged throughout the modification process.

What is the best way to decompose large classes in a multi-file codebase?

The best way to decompose large classes in a multi-file codebase is through incremental pattern application. You apply targeted refactoring patterns across modules step by step, using validation checks to ensure behavior remains unchanged throughout the structural improvements.

Can I replace conditional logic with polymorphism without breaking existing functionality?

Yes, you can replace conditional logic with polymorphism without breaking functionality by using behavior-preserving refactoring techniques. This involves applying the pattern incrementally and running validation checks to verify the modified code matches the original operational outcomes.

How do I identify refactoring opportunities across multiple modules?

Identifying refactoring opportunities across multiple modules involves analyzing the codebase for patterns like dead code, large classes, or complex conditionals. You provide a target module and goal, then receive guidance on safe, incremental improvements with behavior preservation checks.

Does incremental refactoring work for multi-file codebases requiring regression-safe improvements?

Yes, incremental refactoring works for multi-file codebases needing regression-safe improvements. It supports applying patterns across modules with built-in validation checks to ensure behavior remains unchanged, making it suitable for complex structural modifications.

When should I avoid refactoring code incrementally?

You should avoid incremental refactoring when you cannot establish baseline behavior validation checks. Without the ability to verify that functionality remains unchanged after each step, applying structural patterns like extract function or introduce parameter object risks introducing regressions.