What problem does it solve? Long methods with deep nesting, chained conditionals, and repeated logic accumulate high cognitive complexity, making code hard to read, test, and maintain. This Skill systematically restructures such methods by extracting helper methods until a target complexity threshold is met. ## Core Features & Use Cases - Complexity Analysis: Identifies sources of cognitive complexity such as nested conditionals, if-else chains, repeated blocks, and complex boolean expressions. - Helper Method Extraction: Extracts validation, type-specific handling, and common operations into focused single-responsibility helper methods. - Mandatory Test Verification: Requires running existing tests and explicitly confirming "failed=0" in the output before considering the refactoring complete. - Use Case: A developer has a 200-line order-processing method with a cognitive complexity score of 45. They invoke this Skill with the method name and a threshold of 15, and receive a refactored version with extracted validation and handler methods, verified against the existing test suite. ## Quick Start Refactor the method ProcessOrder to reduce its cognitive complexity to 15 or below by extracting helper methods, then run the tests and confirm zero failures.