code-refactor

Identify and document code smells and refactoring opportunities in JavaScript, TypeScript, and Python codebases.

2|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/spideynolove/claude-code-in-action --skill code-refactor-spideynolove
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactor
Source: https://github.com/spideynolove/claude-code-in-action/tree/main/00-materials/claude-howto/03-skills/refactor
Command: npx skills add https://github.com/spideynolove/claude-code-in-action --skill code-refactor-spideynolove

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill provides a structured, repeatable approach to refactor software safely, reducing technical debt while preserving behavior.

Core Features & Use Cases

  • Phased refactoring workflow based on Martin Fowler's methodology (Phase A Quick Wins, Phase B Structural Improvements, Phase C Architectural Changes)
  • Automated artifact templates and references for planning, execution, and validation
  • Integrated checks for code smells and maintainability, with rollback strategies and test guidance

Quick Start

Summarize detected smells, select Phase A quick wins, and start the refactoring workflow.

Frequently Asked Questions about code-refactor

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

FAQPage Schema
How do I safely refactor large multi-file modules with deep class hierarchies?

Safely refactor large modules by applying a phased workflow: identify code smells, execute Phase A quick wins, Phase B structural improvements, and Phase C architectural changes, while validating tests and maintaining rollback steps.

What are code smells and how do I identify refactoring opportunities in JavaScript or Python?

Code smells are indicators of deeper issues in your codebase. You identify refactoring opportunities by analyzing JavaScript, TypeScript, or Python projects to document long methods and deep class hierarchies that require structural improvements.

How do I apply Martin Fowler's refactoring methodology to manage technical debt?

Apply Martin Fowler's methodology through a phased refactoring workflow: start with Phase A quick wins, progress to Phase B structural improvements, and finish with Phase C architectural changes, ensuring validated tests and clear rollback steps.

Can I use this refactoring workflow for TypeScript projects with long methods?

Yes, this refactoring workflow explicitly supports TypeScript projects, along with JavaScript and Python, to identify and refactor long methods and deep class hierarchies using structured phases and test validation.

What is the best way to plan an end-to-end refactoring workflow without breaking existing behavior?

The best way to plan an end-to-end refactoring workflow is to use automated artifact templates for execution and validation, integrate checks for maintainability, and follow clear rollback strategies to preserve behavior.

When should I not use a phased refactoring approach for code maintenance?

You should reconsider a phased refactoring approach if your project lacks validated tests, as the workflow relies on test guidance and clear rollback steps to safely execute structural and architectural changes without breaking behavior.