What problem does it solve? AI-driven refactoring often fails in two ways: it changes observable behavior because it lacks context about real constraints, or it takes on too much scope and loses track of earlier decisions. This Skill inserts a structured scan-design-apply workflow between "wanting to optimize" and "editing code", so refactoring stays behavior-equivalent and reviewable. ## Core Features & Use Cases - Three-phase gated workflow: scan produces a quantified optimization checklist for user selection, design maps each item to a numbered refactoring method, and apply executes one step at a time with mandatory human sign-off. - Refusal routing: seven pre-checks stop the process when the request mixes in behavior changes, lacks test coverage, spans modules, is style-only, targets generated code, or is too large, and route the user to the right workflow instead. - Method library: a four-layer catalog (L1 safe migration, L2 Fowler-style code refactors, L3 structural splits, L4 performance) with applicability, steps, risks, and verification for each method. - Use Case: A user says "this 400-line Vue monitor component is too long". The Skill scans the component, lists measurable issues (line counts, cyclomatic complexity, mixed container/presentational logic), lets the user pick items, then applies component splitting and composable extraction step by step with tests run after each step. ## Quick Start Ask the AI to refactor a specific file or component, for example: "Refactor the serial monitor component, it's too long and mixes data logic with rendering."