What problem does it solve? Refactoring a Python package without breaking existing functionality is risky and error-prone. This Skill provides a systematic workflow for restructuring code, reducing duplication, and improving modularity while keeping tests green and avoiding regressions. ## Core Features & Use Cases - Structured Refactoring Workflow: Follow a four-phase process of identifying problems, planning changes, making incremental edits, and validating with pytest after each step. - Proven Refactoring Patterns: Apply concrete before/after patterns such as extract function, consolidate similar functions, centralize configuration, standardize parameter order, and use Protocols/ABCs/singledispatch. - Breaking Change Management: Handle deprecations safely with warnings, changelogs, and pre/post-refactor checklists covering tests, docs, and git commits. - Use Case: When a package has grown to contain duplicated tool-building functions and inconsistent parameter ordering, use this Skill to plan the consolidation, migrate callers incrementally, and verify each change with targeted pytest runs. ## Quick Start Refactor the duplicated tool-building functions in this package into a single dispatcher while keeping all tests passing.