complexity

complexity is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 106 tokens per session (1,087 once invoked), scanned A, original, MIT.

A guide for using built-in .NET maintainability checks to find overly complex methods and highly coupled classes. Cyclomatic complexity measures how many decision paths code has, while coupling measures how much code depends on other code.

In plain words
What is it for?
Use it to configure thresholds for complex methods, low maintainability, and excessive class coupling.
Why use it?
It makes hard-to-maintain code measurable and lets a team set limits for builds or reviews. The focus is structural complexity, not formatting.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it to configure thresholds for complex methods, low maintainability, and excessive class coupling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/complexity
Install

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.

Any agent
npx skills add managedcode/dotnet-skills --skill complexity
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for complexity

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/complexity/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/complexity)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/complexity"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/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.

agentmods 80×15 button for complexity

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/complexity"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/complexity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,087 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00106 $0.01087
Opus 5 $0.00053 $0.00544
Sonnet 5 $0.00021 $0.00217
Haiku 4.5 $0.00011 $0.00109

Measured 5d ago against content hash 0bd1a9bb9b04, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

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 5d 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.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

catalog/Tools/Complexity/skills/complexity/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.NET Complexity Review

Trigger On

  • the team wants to find overly complex methods
  • cyclomatic complexity thresholds are needed in CI
  • maintainability metrics or coupling thresholds need to be configured

Value

  • produce a concrete project delta: code, docs, config, tests, CI, or review artifact
  • reduce ambiguity through explicit planning, verification, and final validation skills
  • leave reusable project context so future tasks are faster and safer

Do Not Use For

  • formatting-only work
  • generic analyzer setup with no complexity policy change

Inputs

  • the nearest AGENTS.md
  • current analyzer settings
  • current maintainability limits

Quick Start

  1. Read the nearest AGENTS.md and confirm scope and constraints.
  2. Run this skill's Workflow through the Ralph Loop until outcomes are acceptable.
  3. Return the Required Result Format with concrete artifacts and verification evidence.

Workflow

  1. Start with the built-in maintainability analyzers before reaching for non-standard tooling.
  2. Use these rules deliberately:
    • CA1502 for excessive cyclomatic complexity in methods
    • CA1505 for low maintainability index
    • CA1506 for excessive class coupling
    • CA1501 when inheritance depth is also part of the design problem
  3. Keep rule severity in the root .editorconfig.
  4. Keep metric thresholds in a checked-in CodeMetricsConfig.txt added as AdditionalFiles.
  5. Pair analyzer findings with MCAF maintainability limits in AGENTS.md.

Bootstrap When Missing

If complexity thresholds are not configured yet:

  1. Detect current state:
    • rg -n "CA1501|CA1502|CA1505|CA1506|CodeMetricsConfig" -g '.editorconfig' -g '*.csproj' -g 'Directory.Build.*' .
    • rg --files -g 'CodeMetricsConfig.txt'
  2. Add severity entries for CA1502, CA1505, CA1506, and CA1501 in root .editorconfig.
  3. Add checked-in CodeMetricsConfig.txt and include it as AdditionalFiles in project props.
  4. Keep maintainability limits aligned with AGENTS.md.
  5. Run dotnet build SOLUTION_OR_PROJECT and return status: configured or status: improved.
  6. If policy relies only on AGENTS.md limits with no analyzer gate by design, return status: not_applicable.

Read the full file on GitHub · 114 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 5d ago First seen · 114 lines · 106 tokens per session scan A 0bd1a9bb9b04

Subscribe to this mod's changes

complexity is a skill published in the GitHub repository managedcode/dotnet-skills (477 stars, last pushed 4d ago), licensed MIT. It adds 106 tokens to every session and 1,087 once invoked, about $0.0005 per session on Opus 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-09-03.

Related

Other skills, from other repositories

pr-review

Multi-dimensional review of a PR or feature branch in microsoft/win-dev-skills. Activate on "review my PR / changes / branch", "vet before pushing", "PR review", "is this ready to merge". Fans out parallel sub-agents over skill content, the skill-vs-tool boundary (solution hierarchy), tool correctness…

microsoft/win-dev-skills · 98 tokens

winui-code-review

Code quality review for WinUI 3 apps — MVVM compliance, x:Bind correctness, accessibility, theming, security, and performance. Use before committing to catch issues that the compiler and UI tests won't find.

microsoft/win-dev-skills · 49 tokens

clean-code-review

Run a comprehensive Clean Code audit against the codebase — module size, function complexity, long parameter lists, TODO/FIXME markers, commented-out code, duplication (DRY), Boy Scout delta, dead exports, test smells, shell-parity (PS/Bash twins), dep boundaries (cross-package imports), frozen-arrays drift…

srnichols/plan-forge · 92 tokens

code-review

Plan-Forge-tuned comprehensive code review — runs public-surface diff, forge analysis, architecture / security / testing / patterns checks, plus Plan-Forge-specific gates (ACI compliance, dual-shell parity, branch model). Use before merging features or at the end of a phase. With --quorum, dispatches multi-model…

srnichols/plan-forge · 70 tokens

maf-anti-pattern-scanner

Scans a MAF 1.3.0 codebase for known anti-patterns AFTER migration is complete. Prefer the MCP tool MafScanAntiPatterns for one-shot scans; this skill is for understanding the rule taxonomy or contributing new anti-pattern rules. Detects insecure credential usage (DefaultAzureCredential, hard-coded keys), unsafe…

joslat/maf-doctor · 130 tokens

forge-quench

Systematically reduce .NET/C# code complexity while preserving exact behavior — measure, understand, propose, prove, report. Use after a feature is complete and tests pass, when code works but is harder to maintain than it should be.

srnichols/plan-forge · 51 tokens