refactor

Analyze code scopes for bugs, reuse, dead code, and performance, then refactor and update documentation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/macintacos/dotfiles --skill refactor-macintacos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/macintacos/dotfiles/tree/main/managed/private_dot_claude/skills/refactor
Command: npx skills add https://github.com/macintacos/dotfiles --skill refactor-macintacos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill systematically improves code quality, maintainability, and correctness by identifying and addressing issues like naming precision, potential bugs, code reuse opportunities, and outdated documentation.

Core Features & Use Cases

  • Code Analysis: Analyzes code for clarity, efficiency, and adherence to best practices.
  • Bug Detection: Identifies potential bugs, edge cases, and error handling deficiencies.
  • Refactoring Execution: Implements improvements such as code reuse, dead code removal, and performance optimizations.
  • Documentation Updates: Ensures inline and external documentation accurately reflects code changes.
  • Use Case: Improve the readability and reduce the maintenance overhead of a complex legacy module by applying a structured refactoring process.

Quick Start

Initiate a refactoring pass on the uncommitted changes in your working tree.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I refactor code to improve readability and maintainability?

Code refactoring analyzes specified scopes to enhance quality by identifying naming precision issues, potential bugs, and code reuse opportunities. It executes improvements like dead code removal and performance optimizations to reduce overall maintenance overhead.

What is the best way to identify potential bugs and dead code during refactoring?

Refactoring identifies potential bugs and dead code by performing comprehensive analysis on clarity, efficiency, and best practices. This process detects edge cases, error handling deficiencies, and unnecessary code segments for targeted removal.

Can I automatically update documentation when refactoring a legacy module?

Yes, refactoring automatically updates inline and external documentation to accurately reflect code changes. This ensures that documentation remains synchronized with naming updates and structural modifications after the refactoring process.

How do I run linters and tests after applying code optimizations?

Refactoring runs linters and tests post-execution to validate the applied code optimizations and structural changes. This verifies that maintainability improvements and bug fixes do not introduce regressions in the modified code scopes.

Does code analysis work for uncommitted changes in my working tree?

Code analysis and refactoring can be initiated directly on uncommitted changes in your working tree. This allows you to systematically improve code quality and correctness before committing modifications to version control.