refactoring-specialist

Identify code smells and plan test-driven refactorings in multi-language codebases.

68|6|Updated Apr 16, 2020
One-click install
npx skills add https://github.com/zenobi-us/dotfiles --skill refactoring-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-specialist
Source: https://github.com/zenobi-us/dotfiles/tree/main/ai/files/skills/experts/developer-experience/refactoring-specialist
Command: npx skills add https://github.com/zenobi-us/dotfiles --skill refactoring-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps identify code smells, plan safe refactors, and execute incremental transformations without changing observable behavior, reducing technical debt over time.

Core Features & Use Cases

  • Code smell detection, complexity metrics, test coverage checks
  • Refactoring catalog: Extract/Inline methods, Rename, Introduce Parameter Object
  • Advanced patterns: Replace Conditional with Polymorphism, Extract Interface, etc
  • Safety practices: tests, CI, rollback
  • Use Case: Refactor a large method with low test coverage while preserving behavior.

Quick Start

Identify a long method and apply Extract Method refactoring with tests to preserve behavior.

Frequently Asked Questions about refactoring-specialist

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

FAQPage Schema
How do I identify code smells and refactoring opportunities in my codebase?

Code smell detection analyzes your source code for patterns like long methods, large classes, and duplicate logic that signal maintenance risks. The Skill scans multi-language systems, measures complexity metrics, and flags issues—such as divergent change or shotgun surgery—that indicate where refactoring will reduce technical debt and improve structure.

Can I refactor code safely without breaking functionality?

Safe refactoring preserves behavior through test-driven incremental changes. The Skill applies refactoring patterns—Extract Method, Rename, Introduce Parameter Object—while maintaining test coverage, running CI checks, and enabling rollback. AST transformations and pattern-driven automation ensure changes are auditable and functionally equivalent.

What refactoring patterns does this handle?

The Skill covers essential patterns including Extract and Inline methods, Rename variables, Introduce Parameter Object, and advanced patterns like Replace Conditional with Polymorphism and Extract Interface. It applies these incrementally across complex codebases to reduce complexity while preserving behavior and test coverage.

How do I measure if refactoring actually improves my code?

Measurable complexity reduction is tracked through metrics—method length, class size, cyclomatic complexity—and validated by test coverage preservation and performance benchmarks. Documentation updates and auditable change histories via AST transformations provide concrete evidence of structural improvement.

Does this work with legacy code that has low test coverage?

Yes. The Skill addresses low-coverage scenarios by guiding test-driven refactoring incrementally. It identifies coverage gaps, helps preserve behavior while adding tests, and applies safe transformations—such as Extract Method—on large methods before deeper refactoring, enabling gradual modernization of legacy systems.

What languages and codebases can this handle?

The Skill works with multi-language systems and complex codebases. It detects code smells—long methods, large classes, data clumps, primitive obsession—across diverse architectures and applies refactoring patterns systematically to any codebase where structure and maintainability need improvement.