refactor

Apply incremental refactorings to improve maintainability without changing external behavior.

1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/han-so1omon/ikam --skill refactor-han-so1omon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/han-so1omon/ikam/tree/main/skills/refactor
Command: npx skills add https://github.com/han-so1omon/ikam --skill refactor-han-so1omon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

Core Features & Use Cases

  • Structured guidance for incremental improvements.
  • Enables extracting focused helper functions from large monoliths.
  • Encourages naming clarity and modular boundaries.

Quick Start

Identify a long function and extract a focused helper, then run tests to verify behavior.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I refactor a large monolith function without changing external behavior?

To refactor safely, extract focused helper functions from large monoliths using small, verifiable steps. This incremental approach improves maintainability while preserving the original external behavior.

What is the best way to eliminate code smells in a gradual refactoring process?

Eliminating code smells involves applying structured guidance for incremental improvements, such as renaming variables for clarity and enforcing type safety to ensure robust modular boundaries.

Do I need tests and version control to perform surgical code refactoring?

Yes, surgical code refactoring requires a safety net of tests and version control. These prerequisites allow you to verify behavior and manage small, incremental steps throughout the process.

When should I choose gradual refactoring over a drastic repository rebuild?

Choose gradual refactoring over a drastic repository rebuild when your codebase needs incremental improvements. It applies design patterns and extracts methods safely without altering external behavior.

How do I break down god functions into smaller, maintainable units?

Break down god functions by extracting focused helper functions and improving naming clarity. This enforces modular boundaries and significantly improves overall code maintainability.