refactoring-specialist

Refactor large codebases into modular components without changing behavior.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/matt-metivier/zk-hub --skill refactoring-specialist-matt-metivier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-specialist
Source: https://github.com/matt-metivier/zk-hub/tree/main/skills/general/practices/refactoring-specialist
Command: npx skills add https://github.com/matt-metivier/zk-hub --skill refactoring-specialist-matt-metivier

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Structural code transformation that improves design without changing behavior. It addresses oversized modules, circular dependencies, shotgun surgery, feature envy, and god objects by enabling modularization and clearer interfaces.

Core Features & Use Cases

  • Module decomposition and interface extraction to simplify large codebases.
  • Dependency inversion and cross-file restructuring to reduce coupling.
  • Applies to large modules, circular dependencies, shotgun surgery, and complex legacy code.

Quick Start

Provide a large module or tightly coupled codebase and instruct the Refactoring Specialist to decompose it into modular components while preserving behavior.

Frequently Asked Questions about refactoring-specialist

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

FAQPage Schema
How do I modularize a large codebase safely without changing behavior?

To modularize a large codebase safely, you must establish baseline tests, plan module extraction moves, make atomic commits, and verify the full test suite to ensure no behavior change occurs during the structural transformation.

What is the best way to fix circular dependencies and god objects in legacy code?

Fixing circular dependencies and god objects requires applying dependency inversion and cross-file restructuring. This decomposes oversized modules into clearer interfaces, reducing coupling while preserving the original execution behavior.

How do I decompose large modules to reduce shotgun surgery and feature envy?

Decomposing large modules to reduce shotgun surgery and feature envy involves extracting distinct interfaces and moving behaviors to appropriate modules. This restructuring simplifies the codebase and localizes changes without altering functionality.

Can I refactor complex code if I don't have a baseline test suite?

Refactoring complex code without a baseline test suite is highly discouraged. Baseline tests are a required step in the process to verify behavior preservation and ensure the structural design improvements do not introduce regressions.

What are the limitations of structural code transformation for tightly coupled code?

Structural code transformation requires strict adherence to atomic commits and continuous test verification. If the tightly coupled code lacks sufficient test coverage, safely performing module extraction and dependency inversion becomes significantly limited.