What problem does it solve?
Complex Python codebases often become hard to read, reason about, and maintain as they grow; this Skill provides a systematic approach to transform such code into clear, well-documented, and maintainable implementations without altering observable behavior.
Core Features & Use Cases
- Structured 4-Phase Refactoring: Analysis, Planning, Execution, and Validation workflows to guide safe code improvements.
- Refactoring Patterns Library: Guard clauses, extract method, dictionary dispatch, OOP transformations, dependency injection, and domain modeling for progressively cleaner architectures.
- Quality Assurance & Tooling: Regression-preventive checks (tests, static analysis, cognitive/cyclomatic metrics) and documentation coverage to ensure changes are safe and understandable.
- Use Case: Modernize a legacy module with global state and monolithic functions, improving testability and readability while preserving behavior.
Quick Start
Provide a structured refactor for a Python module by outlining the target file, the intended pattern to apply, and the validation steps; then run the workflow to produce a traceable, test-passing refactor plan.