refactor-helper

Refactor code with incremental changes and per-change tests.

Updated Aug 23, 2026
Ready to run
npx skills add https://github.com/ShunsukeHayashi/Miyabi --skill refactor-helper
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: refactor-helper
Source: https://github.com/ShunsukeHayashi/Miyabi/tree/main/.claude/skills/refactor-helper
Command: npx skills add https://github.com/ShunsukeHayashi/Miyabi --skill refactor-helper

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Bash, Read, Write, Grep, Glob, and includes scripts (resource) components.

What problem does it solve?

This Skill transforms the complex, error-prone process of code refactoring into a systematic, safe workflow.

Core Features & Use Cases

  • Safe Code Transformation: Systematically improve code structure without changing behavior.
  • Pattern Recognition: Automatically identify and apply common refactoring patterns like function extraction and polymorphism.

Quick Start

Refactor the 'processOrder' function in 'src/orders.rs' to extract validation and calculation logic.

Quick Start

Refactor the attached code to extract the validation logic into a separate function.

Frequently Asked Questions about refactor-helper

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

FAQPage Schema
How do I safely refactor legacy code without breaking functionality?▼

Refactoring improves code structure through small, incremental changes while preserving behavior. Apply systematic transformations like function extraction and conditional simplification, running automated tests, linting, and type checks after each modification to catch regressions immediately.

What refactoring patterns can eliminate technical debt in my codebase?▼

Common patterns include extracting functions to reduce complexity, simplifying nested conditionals, replacing duplicated logic with polymorphism, and removing dead code. These transformations improve maintainability and performance while keeping behavior unchanged.

Can I automate refactoring across multiple files in my project?▼

Yes. This Skill uses Bash, Grep, and Glob to identify and refactor patterns systematically across codebases. It applies transformations incrementally with verification at each step, enabling safe bulk improvements to code quality and structure.

How do I extract validation logic into separate functions?▼

Function extraction isolates validation steps into reusable components. Define the validation logic, create a new function, move the extracted code, update call sites, then verify tests and type checks pass to ensure behavior remains identical.

What happens if a refactoring breaks existing tests?▼

Incremental refactoring with per-change testing catches breaks immediately. If tests fail after a modification, the change is small enough to diagnose and fix quickly, preventing large-scale regressions and maintaining code correctness throughout the process.