refactor-code

Analyze code directories to identify refactoring candidates by size and responsibility.

Updated Jun 21, 2025
One-click install
npx skills add https://github.com/grad13/cctop --skill refactor-code-grad13
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-code
Source: https://github.com/grad13/cctop/tree/main/.claude/skills/refactor-code
Command: npx skills add https://github.com/grad13/cctop --skill refactor-code-grad13

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill analyzes codebases to identify large or complex files that are candidates for refactoring, aiming to improve maintainability and adherence to single responsibility principles.

Core Features & Use Cases

  • Automated Code Analysis: Scans specified directories for files exceeding 500 lines or exhibiting mixed responsibilities.
  • Prioritized Refactoring Suggestions: Categorizes files into 'must' (e.g., >500 lines) and 'should' (e.g., mixed responsibilities) for targeted refactoring efforts.
  • Use Case: A developer can use this Skill to quickly pinpoint the most problematic files in a legacy codebase, generating a clear report to guide their refactoring strategy.

Quick Start

Analyze the code in the 'src/' directory for refactoring candidates.

Frequently Asked Questions about refactor-code

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

FAQPage Schema
How do I identify files in my codebase that need refactoring?

Large files are flagged as refactoring candidates based on size and responsibility. Files over 500 lines are categorized as 'must' refactor, while files with mixed responsibilities or fallback patterns are marked as 'should' refactor candidates.

What is the best way to split large code files with mixed responsibilities?

Large files are flagged as refactoring candidates based on size and responsibility. Files over 500 lines are categorized as 'must' refactor, while files with mixed responsibilities or fallback patterns are marked as 'should' refactor candidates.

Can I analyze a specific directory like 'src/' for code refactoring candidates?

Large files are flagged as refactoring candidates based on size and responsibility. Files over 500 lines are categorized as 'must' refactor, while files with mixed responsibilities or fallback patterns are marked as 'should' refactor candidates.

Why does code maintainability suffer when files have mixed responsibilities?

Large files are flagged as refactoring candidates based on size and responsibility. Files over 500 lines are categorized as 'must' refactor, while files with mixed responsibilities or fallback patterns are marked as 'should' refactor candidates.

What are the limitations of automated code analysis for refactoring?

Large files are flagged as refactoring candidates based on size and responsibility. Files over 500 lines are categorized as 'must' refactor, while files with mixed responsibilities or fallback patterns are marked as 'should' refactor candidates.