code-refactoring

Detect oversized code files and suggest refactors across JavaScript, TypeScript, React, and Python.

9|3|Updated Oct 29, 2025
One-click install
npx skills add https://github.com/WomenDefiningAI/claude-code-skills --skill code-refactoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactoring
Source: https://github.com/WomenDefiningAI/claude-code-skills/tree/main/skills/code-refactoring
Command: npx skills add https://github.com/WomenDefiningAI/claude-code-skills --skill code-refactoring

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires node-notifier, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Codebases often accumulate technical debt and complexity, leading to hard-to-maintain files, slower development, and increased bug rates. Manual refactoring is time-consuming, risky, and often reactive. This skill proactively manages code health, preventing complexity before it becomes a problem.

Core Features & Use Cases

  • Proactive Monitoring & Alerts: A background file watcher with intelligent, path-based thresholds (e.g., stricter for utilities, looser for pages) alerts you in real-time when files become too large or complex.
  • Automated Refactoring Execution: With your approval, the skill can execute refactoring plans step-by-step, including creating backup commits, running tests, and committing changes incrementally, with automatic rollback on failure.
  • Multi-Language & Pattern Support: Detects 21 code smells and applies language-specific patterns for JavaScript/TypeScript/React (e.g., hook/component/data extraction) and Python (e.g., class/module splitting).
  • Use Case: As you're coding, the skill detects a component growing beyond its recommended size. It pauses, suggests a refactoring plan, and with your "Yes", automatically extracts sub-components, reducing the file size before you continue adding new features. This saves you from "big bang" refactors later.

Quick Start

Start the file watcher to monitor my project for oversized files.

Frequently Asked Questions about code-refactoring

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

FAQPage Schema
How do I detect and prevent code files from becoming too large and complex?

Proactive refactoring detects oversized files in real-time using a background file watcher with path-based thresholds. It alerts you when JavaScript, TypeScript, React, Python, or other codebases exceed complexity limits, letting you address technical debt before it compounds.

Can I automatically refactor my codebase without manual intervention?

Yes. The skill executes refactoring plans step-by-step with your approval—creating backup commits, running tests, and committing changes incrementally. It automatically rolls back on failure, making multi-language refactoring safer and faster.

What code smells and refactoring patterns does this support?

It detects 21 code smells and applies language-specific patterns: for JavaScript/TypeScript/React (hook, component, and data extraction); for Python (class and module splitting). Pattern detection adapts to each language's idioms.

How does the file watcher alert me to complexity issues during development?

A real-time file watcher monitors your project and sends notifications when files trigger size or complexity thresholds you define. Stricter thresholds apply to utilities; looser ones to pages, matching your codebase structure.

Does refactoring work with my existing version control and test suite?

Yes. The skill integrates with your Git workflow by creating backup commits before changes and running your tests mid-refactor. If tests fail, it rolls back automatically, keeping your repository clean.

Can I use this skill during active coding without interrupting my workflow?

Yes. It pauses to suggest refactoring plans when files grow oversized, then executes them on your approval. You stay in control—refactors happen before you add new features, avoiding large later rework.