refactoring-analysis

Analyze codebases for Fowler refactoring opportunities and generate prioritized reports in docs/_refacs/.

2.5k|134|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/compozy/compozy --skill refactoring-analysis-compozy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-analysis
Source: https://github.com/compozy/compozy/tree/main/.agents/skills/refactoring-analysis
Command: npx skills add https://github.com/compozy/compozy --skill refactoring-analysis-compozy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes codebases to identify refactoring opportunities based on Martin Fowler's catalog of code smells and refactoring techniques. Detects duplicated code, high coupling, complex conditionals, primitive obsession, long functions, and other structural issues. Produces a structured refactoring report with prioritized findings saved to docs/_refacs/. Use when auditing code quality, preparing for a refactoring sprint, or reviewing architectural health. Don't use for style/formatting issues, performance optimization, or security audits.

Core Features & Use Cases

  • Smell detection: Identify broad categories like Duplicated Code, Long Functions, and Large Modules, and classify severity to guide remediation.
  • Refactoring mapping: Provide recommended Fowler techniques with before/after sketches and rationale.
  • Targeted reports: Generate a structured report stored under docs/_refacs/ with prioritized findings and actionable recommendations.

Quick Start

Run the analysis workflow on your project to generate a prioritized refactoring report.

Frequently Asked Questions about refactoring-analysis

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?

To identify code smells and refactoring opportunities, analyze your codebase against Martin Fowler's catalog to detect duplicated code, long functions, and high coupling, producing a prioritized report with actionable recommendations.

How do I prepare for a refactoring sprint?

Prepare for a refactoring sprint by running an architectural health audit to classify structural issue severity, generating a targeted report with prioritized findings and concrete before/after sketches saved to docs/_refacs/.

Does refactoring analysis work for different programming languages?

Refactoring analysis applies across common programming languages, detecting broad code smell categories like primitive obsession and complex conditionals to guide remediation regardless of the specific language used.

What is the best way to map detected code smells to specific refactoring techniques?

The best way to map detected code smells to refactoring techniques is by applying Fowler's catalog, which provides recommended refactoring methods complete with before/after sketches and rationale for each structural issue.

When should I not use refactoring analysis?

Refactoring analysis should not be used for style or formatting issues, performance optimization, or security audits, as it specifically targets structural code quality and architectural health improvements.

Can I get a structured report of architectural health issues for my project?

You can get a structured architectural health report by analyzing the codebase to detect coupling and large modules, which outputs a prioritized findings document with actionable recommendations saved directly under docs/_refacs/.