One-click install
npx skills add https://github.com/heitorfreitasferreira/.dotfiles --skill refactor-heitorfreitasferreira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/heitorfreitasferreira/.dotfiles/tree/main/.agents/skills/refactor
Command: npx skills add https://github.com/heitorfreitasferreira/.dotfiles --skill refactor-heitorfreitasferreira

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Surgical code refactoring to improve maintainability without changing external behavior.

Core Features & Use Cases

  • Extracting functions to reduce complexity
  • Renaming variables for clarity
  • Breaking down god functions and improving type safety
  • Eliminating code smells and applying design patterns
  • Gradual improvements without rewriting from scratch

Quick Start

Start by identifying a small refactor target, extract a focused function, and add a test to ensure behavior remains unchanged.

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 maintainability without changing behavior?

To refactor code safely, apply a deterministic workflow with small, testable steps: extract focused functions, improve naming, add regression tests, and eliminate code smells gradually without rewriting from scratch.

What is the best way to break down god functions and monolithic files?

Breaking down god functions and monolithic files involves safe extraction of functions to reduce complexity, improving type safety, and applying design patterns to eliminate code smells while ensuring external behavior remains unchanged.

Can I use this approach for mid- to large-sized codebases with long functions?

Yes, this refactoring approach is designed for mid- to large-sized codebases where functions are long, files are monolithic, or code smells exist, allowing gradual improvements without a full rewrite.

How do I start a test-driven refactor to eliminate code smells?

Start a test-driven refactor by identifying a small target, extracting a focused function, and adding a regression test to verify unchanged behavior before moving to the next code smell.

Does refactoring with clean code principles require rewriting everything?

No, refactoring for clean code focuses on gradual improvements without rewriting from scratch, applying design patterns and clearer naming to achieve surgical maintainability safely.