What problem does it solve? Refactoring often drifts into style churn, speculative rewrites, or behavior-breaking changes. This Skill provides a disciplined decision framework for determining which code changes are earned, how to execute them in coherent slices, and when to stop. ## Core Features & Use Cases - Earned-Change Filter: Distinguishes real maintenance, correctness, and cognitive costs from style-only churn, speculative abstractions, and compatibility shims. - Structured Refactor Loop: Maps entry boundaries, canonical data shapes, state owners, and verification gates before patching the smallest set of files per responsibility. - Risk-Matched Verification: Scales checks from package-local lint and typecheck to broader validation when touching shared schemas, public exports, authorization, or route contracts. - Use Case: When cleaning up a Next.js/tRPC feature module, use this Skill to consolidate duplicated validation rules at the true boundary, delete unsupported legacy branches, and run focused typecheck and tests without weakening type safety or domain rules. ## Quick Start Use the code-refinement-discipline skill to run a behavior-preserving refactor pass on this module with clear scope, evidence, and verification.