Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add saurabhkumar8112/cyclomatic-complexity-skill --skill cyclomatic-complexitygit clone --depth 1 https://github.com/saurabhkumar8112/cyclomatic-complexity-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/saurabhkumar8112/cyclomatic-complexity-skill/cyclomatic-complexity)<a href="https://agentmods.dev/skills/saurabhkumar8112/cyclomatic-complexity-skill/cyclomatic-complexity"><img src="https://agentmods.dev/badge/skills/saurabhkumar8112/cyclomatic-complexity-skill/cyclomatic-complexity/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/saurabhkumar8112/cyclomatic-complexity-skill/cyclomatic-complexity"><img src="https://agentmods.dev/badge/skills/saurabhkumar8112/cyclomatic-complexity-skill/cyclomatic-complexity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Excessive Agency · line 43 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00103 | $0.00727 |
| Opus 5.5 | $0.00041 | $0.00291 |
| Sonnet 5.5 | $0.00021 | $0.00145 |
| Haiku 4.5 | $0.00010 | $0.00073 |
Grade A, and why
cyclomatic-complexity scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cyclomatic Complexity
Purpose: AI-written code often works but branches like a jungle. This skill: measure complexity, refactor hotspots, keep code human-maintainable.
Measure first
CC = decision points + 1. Decision points: if, else if, case, loops, catch, ternary, &&, || in conditions.
Project linter config wins. If eslintrc, radon config, sonar config, or similar sets a complexity threshold, use that. No config: use defaults below.
Thresholds:
- 1-5: fine, leave alone
- 6-10: watch, refactor if touching anyway
- 11-15: refactor now
- 15+: must split, no debate
Prefer real tools over eyeballing when environment allows:
- Python:
radon cc -s -a <path> - JS/TS: eslint
complexityrule - Go:
gocyclo - Polyglot:
lizard <path>
No tool available: count manually, per function, show the count.
Refactor tactics, in order of preference
- Guard clauses. Invert conditions, return early, kill nesting.
- Extract function. Each extracted piece gets a name that says what, not how. Names are documentation.
- Lookup table / map instead of if-else or switch chains.
- Named predicates.
if (isEligibleForRefund(order))beats a 4-clause boolean soup. - Polymorphism / strategy for switch-on-type. Only when the switch appears in 2+ places.
- Flatten loops. Extract loop body, use continue instead of nested if.
Hard rules
- Preserve behavior. Run tests before and after. No tests: say so, suggest adding, refactor conservatively.
- Don't game the metric. A dense one-liner hiding 6 branches is worse than the honest if-chain it replaced. Complexity should move into well-named units, not disappear into cleverness.
- Don't break public APIs or exported signatures without asking.
- Small functions with clear names > few functions with comments explaining sections.
- One responsibility per function. If the name needs "and", split.
Workflow
- Measure all touched functions, rank by CC descending.
- Report hotspots with numbers before touching anything.
- Refactor worst first, one function at a time.
- Re-measure. Show before/after table: function, CC before, CC after.
- Verify: tests pass, behavior unchanged, diff reviewable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 70 lines · 103 tokens per session scan A 6e8edae7a225
cyclomatic-complexity is a skill published in the GitHub repository saurabhkumar8112/cyclomatic-complexity-skill (405 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 103 tokens to every session and 727 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
software-code-refactoring
Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…
refactor
Refactor code to improve structure and maintainability.
designing-data-intensive-applications
Apply Martin Kleppmann-inspired data-system rules when designing reliability, scalability, consistency, replication, transactions, streams, or schema evolution.
domain-driven-design-distilled
Apply Vaughn Vernon-inspired lightweight DDD rules when using bounded contexts, subdomains, context maps, and tactical modeling without excess ceremony.
implementing-domain-driven-design
Apply Vaughn Vernon-inspired implementation DDD rules when building aggregates, domain events, repositories, application services, or context integrations.
patterns-of-enterprise-application-architecture
Apply Martin Fowler-inspired enterprise architecture rules when choosing layers, service layers, transaction scripts, domain models, repositories, mappers, or DTOs.