What problem does it solve? TypeScript backend codebases accumulate accidental complexity: tangled handlers, boolean flag parameters, scattered as casts, leaky abstractions, and dead code. This Skill guides behavior-preserving refactors that lower local reasoning cost without hiding behavior changes inside cleanup diffs. ## Core Features & Use Cases - Behavior-Preserving Refactoring: Applies moves like Extract Function, Split Phase, Remove Flag Argument, and Remove Dead Code while explicitly naming the preserved contract (outputs, side-effect order, error behavior, async sequencing). - Boundary Normalization: Moves parsing, validation, and narrowing of untrusted inputs (JSON, env vars, query params, driver output) to a single boundary seam so internals work on trusted shapes. - Complexity Diagnosis: Classifies the dominant problem as data-shape complexity, control-flow sprawl, type/helper complexity, abstraction leakage, or dead surface, then picks the smallest reversible move. - Use Case: Given a 200-line Express handler that parses request bodies, branches on a boolean flag, and calls a database twice, the Skill recommends splitting parse/execute/format phases, replacing the flag with explicit functions, and adding characterization tests before any extraction. ## Quick Start Ask the AI to refactor a specific TypeScript file or handler to reduce complexity without changing its external behavior, and have it state what behavior is preserved.