Python Refactor Transform complex Python into clear, maintainable code while preserving correctness. Phased workflow with safety-by-design and continuous validation. For deep references (anti-patterns, OOP principles, cognitive complexity, regression prevention), see the directory. When to invoke - Explicit "human", "readable", "maintainable", "clean", or "refactor" request - Code review flags comprehension or maintainability issues - Legacy code modernization - Onboarding / educational contexts - Complexity metrics exceed thresholds - Red flags : file 500 lines with scattered functions and g…