code-refactor

Detect code smells and execute refactoring to maintain DDD architecture.

Updated Dec 19, 2025
One-click install
npx skills add https://github.com/u9401066/copilot-capability-manager --skill code-refactor-u9401066
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-refactor
Source: https://github.com/u9401066/copilot-capability-manager/tree/main/.claude/skills/code-refactor
Command: npx skills add https://github.com/u9401066/copilot-capability-manager --skill code-refactor-u9401066

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automatically detects when code needs refactoring and executes improvements to maintain DDD architecture and code quality standards.

Core Features & Use Cases

  • Architecture Compliance: Ensures code follows DDD principles and maintains proper separation of concerns.

Quick Start

Refactor the current file to improve maintainability and reduce complexity.

Frequently Asked Questions about code-refactor

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

FAQPage Schema
How do I detect and fix code smells in large codebases?▼

Code smell detection identifies structural issues like excessive nesting, high complexity, or poor separation of concerns. This Skill automatically analyzes files against complexity thresholds and executes refactoring actions—Extract Method, Extract Class, Split Module—to improve maintainability while preserving functionality and updating tests.

Can I refactor code while maintaining Domain-Driven Design architecture?▼

Yes. This Skill enforces DDD principles during refactoring by ensuring proper separation of concerns and architectural compliance. It applies Extract Class, Replace Conditional with Polymorphism, and Introduce Parameter Object patterns while tracking metrics to maintain design integrity.

What refactoring techniques reduce code complexity automatically?▼

Automated refactoring reduces complexity through Extract Method (breaking long functions), Split Module (dividing oversized files), and Replace Conditional with Polymorphism (simplifying branching logic). This Skill applies these techniques when files exceed length or complexity thresholds.

How does modularization improve code quality?▼

Modularization breaks monolithic code into focused, independent components with clear boundaries. This Skill splits modules and extracts classes to reduce dependencies, lower cyclomatic complexity, and enforce separation of concerns—making code easier to test, maintain, and extend.

Does refactoring update tests and documentation automatically?▼

Yes. When this Skill executes refactoring actions, it updates tests and documentation to reflect structural changes. This ensures test coverage remains valid and documentation stays synchronized with the refactored architecture.

When should I trigger code refactoring in my workflow?▼

Refactor when files grow beyond maintainable size, cyclomatic complexity rises, nesting becomes excessive, or dependencies proliferate. This Skill can run on request or automatically when these thresholds are exceeded, preventing quality decay without interrupting development flow.