BigHugger
sk Skill · saurabhkumar8112

cyclomatic-complexity

Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension. Use whenever the user asks to refactor, simplify, clean up, or review code quality; mentions complexity, maintainability, readability, spaghetti code, deeply nested logic, or god functions; or asks to check AI-generated code before merging.…

installs 8w
0
30-day movement
starts with the next reading
Related entries
1
Connections
0

An agent skill that guides refactoring code to reduce cyclomatic complexity, measuring decision points and applying tactics like guard clauses and function extraction. It defines rules, a measure-then-refactor workflow, and a required output format, with emphasis on preserving behavior and keeping code human-maintainable.

Reach for it when AI-generated or legacy code works but is heavily branched and hard for humans to maintain.

Use it to

  • Refactor deeply nested or god functions
  • Review code quality before merging
  • Check AI-generated code for complexity hotspots
  • Rank touched functions by complexity before refactoring

For Developers using AI coding agents to write or review code

Host repository
saurabhkumar8112/cyclomatic-complexity-skill
Host stars
388
topicscyclomatic-complexityrefactoringcode-qualitymaintainabilityreadabilityagent-skill