Skip to content
Back to search

cyclomatic-complexity-skill

Claude skill: refactor code to reduce cyclomatic complexity

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/saurabhkumar8112--cyclomatic-complexity-skill/badge.svg)](/listings/saurabhkumar8112--cyclomatic-complexity-skill)

HTML

<a href="/listings/saurabhkumar8112--cyclomatic-complexity-skill"><img src="/api/listings/saurabhkumar8112--cyclomatic-complexity-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Claude Code

/plugin marketplace add saurabhkumar8112/cyclomatic-complexity-skill
/plugin install cyclomatic-complexity@cyclomatic-complexity-skill

Claude.ai

Download the `.skill` file from Releases (or zip the `skills/cyclomatic-complexity` folder) and upload it under Settings → Capabilities → Skills.

Claude API

Upload via the [Skills API](https://docs.claude.com/en/api/skills-guide).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 13 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "cyclomatic-complexity-skill",
  3. "owner": {
  4. "name": "Saurabh Kumar"
  5. },
  6. "plugins": [
  7. {
  8. "name": "cyclomatic-complexity",
  9. "source": "./",
  10. "description": "Refactor code to reduce cyclomatic complexity. Measures per-function complexity, refactors hotspots worst-first, reports before/after numbers. Keeps AI-generated code maintainable for humans."
  11. }
  12. ]
  13. }
README.md · README · 50 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # cyclomatic-complexity
  2. A Claude skill that refactors code to reduce cyclomatic complexity. Built for AI-generated code: it works, but branches like a jungle. This skill makes Claude measure complexity, refactor hotspots, and keep code maintainable for humans and the long-term vision of the codebase.
  3. ## What it does
  4. - Measures cyclomatic complexity per function (radon, eslint, gocyclo, lizard, or manual count)
  5. - Respects your project's own linter thresholds when configured
  6. - Refactors worst hotspots first: guard clauses, extract function, lookup tables, named predicates
  7. - Refuses to game the metric. Complexity moves into well-named functions, not into clever one-liners
  8. - Ends every refactor with a before/after complexity table
  9. ## Install
  10. ### Claude Code
  11. ```
  12. /plugin marketplace add saurabhkumar8112/cyclomatic-complexity-skill
  13. /plugin install cyclomatic-complexity@cyclomatic-complexity-skill
  14. ```
  15. ### Claude.ai
  16. Download the `.skill` file from Releases (or zip the `skills/cyclomatic-complexity` folder) and upload it under Settings → Capabilities → Skills.
  17. ### Claude API
  18. Upload via the [Skills API](https://docs.claude.com/en/api/skills-guide).
  19. ## Usage
  20. Triggers automatically on refactoring, cleanup, and code review requests. Or invoke directly:
  21. > "Use the cyclomatic complexity skill to refactor parser.py"
  22. ## Example output
  23. ```
  24. ## Complexity report
  25. | Function | Before | After |
  26. |----------|--------|-------|
  27. | parseOrder | 14 | 4 |
  28. Extracted: validateHeader, resolveDiscount
  29. Behavior verified: existing test suite passes
  30. ```
  31. ## License
  32. Apache 2.0

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.