What problem does it solve? Deeply nested logic, god functions, and heavily branched code are hard to test, review, and maintain. This Skill measures cyclomatic complexity, ranks hotspots, and applies a disciplined refactoring sequence to bring functions back under maintainable thresholds without changing behavior. ## Core Features & Use Cases - Complexity Measurement: Uses deterministic AST tools like radon, ruff, gocyclo, golangci-lint, ESLint complexity rule, or lizard, with manual decision-point counting as fallback. - Ordered Refactoring Hierarchy: Applies guard clauses, function extraction, lookup tables, named predicates, polymorphism, and loop flattening in a strict preference sequence. - Behavior Preservation: Requires running tests before and after refactoring, protects public API signatures, and forbids gaming the metric with dense one-liners. - Use Case: Before submitting a PR with a 200-line function full of nested if/else chains, use this Skill to get a baseline CC report, refactor the worst functions, and finish with a before/after complexity table proving zero regressions. ## Quick Start Ask the AI to measure the cyclomatic complexity of the functions in your changed files and refactor the highest-complexity ones using guard clauses and function extraction.