Official agent skill

Coverage Analysis for .NET

by dotnet in dotnet/skills

Interprets .NET coverage reports to explain line and branch gaps, target arithmetic and, on request, CRAP-based risk hotspots, without rerunning tests.

OfficialMITAuto-check passedTesting & QA

Install Coverage Analysis for .NET

skills CLI
$ npx skills add dotnet/skills --skill coverage-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dotnet/skills coverage-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dotnet-test/skills/coverage-analysis .claude/skills/coverage-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
coverage-analysis
GitHub stars
5.6k
Used in
1 other repo
Token cost
~2.8k tokens
SKILL.md length
1,401 words
Files
7 (incl. scripts, references)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Interprets .NET coverage reports to explain line and branch gaps, target arithmetic and, on request, CRAP-based risk hotspots, without rerunning tests.

  • Works in 4 steps: Read references/setup-discovery.md. → Prefer existing Cobertura discovered… → If none exists, invoke run-tests for… → …
  • Explaining why a Cobertura report shows partial branch coverage
  • SKILL.md covers Purpose, When to Use, When Not to Use and Inputs, plus 8 more sections
  • Runs PowerShell scripts from its folder; calls dotnet

What it does

The skill explains what supplied .NET coverage evidence actually proves: line, branch and condition metrics, Cobertura data, partial conditions, plateaus and target arithmetic. It analyzes reports you provide without rerunning tests or installing tools, and collects coverage only when you explicitly ask. Complexity and CRAP ranking is added only on an explicit request for risk hotspots, priorities by risk or refactoring safety.

Defaults are an 80 percent line threshold, a 70 percent branch threshold, a CRAP threshold of 30 and three hotspots, capped at 10 unless you ask for more. An existing Cobertura file is the preferred input, and the skill picks the smallest matching path, so explaining a pasted excerpt is answered directly with no tools or report files. Helper scripts Extract-MethodCoverage.ps1 and Compute-CrapScores.ps1 and four reference files support the heavier paths.

Adjacent skills take over elsewhere: crap-score for one named method or class, find-untested-sources for files with no tests, test-gap-analysis for behavioral gaps, test-tagging for test categories and run-tests for just collecting a raw percentage. It does not write tests; it identifies where they are needed.

When your agent uses it

  • Explaining why a Cobertura report shows partial branch coverage
  • Working out how many more lines must be covered to reach a target
  • Ranking project-wide risk hotspots by coverage-backed CRAP score
  • Judging whether a refactoring is safe given existing coverage

Example prompts

  • “Here is coverage.cobertura.xml. Why is branch coverage stuck below the threshold?”
  • “Our line coverage is just under the 80 percent target. How many more lines must we cover?”
  • “Using the existing Cobertura report, list the top CRAP hotspots in the solution.”
  • “Explain this partial condition from the coverage summary I pasted.”

Requirements

  • A .NET coverage report such as Cobertura, or an explicit request to collect one
  • PowerShell for the bundled helper scripts

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Read references/setup-discovery.md.
  2. Prefer existing Cobertura discovered under the requested root.
  3. If none exists, invoke run-tests for repository overlay, platform, runner,
  4. Analyze the resulting Cobertura. Compute CRAP only if risk analysis was

What it can do on your machine

Read from SKILL.md and the folder at commit 8d670fa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (PowerShell), which the agent can run.

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Coverage Analysis for .NET loads about 2.8k tokens when it runs, and up to ~7.6k if it reads all its reference files. Until then it costs about 200 tokens; SKILL.md has 1,401 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~200
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from dotnet/skills at commit 8d670fa, republished under its MIT licence (© dotnet). 1,401 words, ~2,830 tokens.

Download SKILL.mdSave it as .claude/skills/coverage-analysis/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
coverage-analysis
description
Activation requires either supplied .NET coverage reports/percentages/line, branch, or condition metrics, or an explicit request to collect .NET coverage for analysis. USE FOR: interpreting that evidence, including Cobertura data, partial conditions, plateaus, target arithmetic, project-wide coverage-backed CRAP, and coverage-backed refactoring safety. Analyze supplied reports directly without rerunning tests or installing tools. DO NOT USE FOR: requests with neither coverage evidence nor explicit coverage-collection intent, including hypothetical change-survival questions (use test-gap-analysis); CRAP or refactoring safety for one named target (use crap-score); or requests owned by test-tagging, find-untested-sources, test-anti-patterns, run-tests, or code-testing-agent.
license
MIT

Coverage Analysis

Purpose

Explain what .NET coverage evidence proves, reconcile target arithmetic, and identify the code blocking progress. Add complexity/CRAP ranking only when the user explicitly asks for risk hotspots, CRAP, priorities by risk, or refactoring safety.

When to Use

Use this skill for interpreting supplied .NET line/branch/condition evidence, coverage gaps and plateaus, target arithmetic, or explicit project-wide coverage-backed risk analysis.

When Not to Use

  • Named method, class, or file CRAP/refactoring-safety analysis — use the crap-score skill instead
  • Static source-to-test pairing or listing files with no tests — use find-untested-sources
  • Behavioral or pseudo-mutation gaps in existing tests — use test-gap-analysis
  • Test trait/category distributions or coverage shape by test type — use test-tagging
  • Writing or generating tests — this skill identifies where tests are needed, not write them
  • General test execution unrelated to coverage or CRAP analysis
  • Only collecting .NET coverage or printing a raw percentage with no diagnosis — use run-tests; use native tooling for non-.NET coverage collection or analysis. Interpreting .NET line/branch gaps remains in scope here

Inputs

InputRequiredDefaultDescription
Project/solution pathNoCurrent directoryPath to the .NET solution or project
Line coverage thresholdNo80%Minimum acceptable line coverage
Branch coverage thresholdNo70%Minimum acceptable branch coverage
Existing Cobertura pathNoDiscover only if not suppliedPreferred input; never rerun tests when usable
CRAP thresholdNo30Used only for explicit risk/CRAP requests
Hotspot countNo3Explicit risk requests only; cap at 10 unless the user asks for more

Discover optional inputs from the workspace. Do not ask for a project path when the current directory or a supplied report is sufficient.

Choose the smallest matching path

User intentRequired workDo not do
Explain a supplied excerpt, condition, or summaryAnswer directly from the supplied evidenceTools, CRAP, discovery, report files
Interpret a supplied Cobertura path or diagnose a plateauRead that report, reconcile totals, name all material gaps, answer directlyRerun tests, install tools, compute CRAP, or generate files unless explicitly requested
Rank risk hotspots, compute project-wide CRAP, or assess refactoring safetyUse the supplied/existing report, read references/guidelines.md, and compute CRAP before rankingCoverage-only ranking or a full report template unless requested
Analyze coverage when no report existsInvoke run-tests to collect coverage with the repository-compatible runner, then analyze the generated reportChoose or execute a test command independently; CRAP unless risk was requested
Produce a full markdown/HTML/CSV reportFirst deliver the direct answer; then read references/output-format.md or references/report-generation.mdReport generation before the answer

Words such as analyze coverage, what is blocking coverage, or why is coverage stuck do not by themselves request CRAP. Explicit signals include risk hotspot, CRAP, complexity-weighted priority, safe to refactor, or an equivalent request to combine complexity with coverage.

Existing-data fast path

When the user supplies a coverage excerpt, summary, or valid Cobertura path:

  • Treat it as authoritative input and start there.
  • Do not discover the solution or test projects unless source mapping is necessary.
  • Do not run dotnet test, install ReportGenerator, add a coverage package, or read references/setup-discovery.md or references/report-generation.md.
  • Do not write coverage-analysis.md or create a report directory unless the user requested a saved/full report.
  • For interpretation and plateau questions, parse only the evidence needed to answer. For explicit project-wide risk requests, use the bundled scripts as described in references/guidelines.md.

A failed read/view operation is not proof that a named path does not exist. Classify the failure, then make one targeted existence probe and use a normalized path or alternate reader only for confirmed tool availability, transport, or path-normalization failures and only after verifying the canonical path remains inside the workspace. Stop on content-exclusion, permission/policy, workspace-boundary, or unknown failures. Report a missing path only when the independent probe also fails; do not broaden the search or substitute another artifact.

Collection path

Use this path only when no usable coverage evidence exists and the user asked for analysis that requires it.

  1. Read references/setup-discovery.md.
  2. Prefer existing Cobertura discovered under the requested root.
  3. If none exists, invoke run-tests for repository overlay, platform, runner, and command selection, and have it collect Cobertura once per entry point.
  4. Analyze the resulting Cobertura. Compute CRAP only if risk analysis was explicitly requested.

When the workspace contains the project/test manifests needed by this path, perform discovery directly and delegate collection to run-tests. Do not ask the user to attach files or pre-run coverage that the current workspace lets you inspect and generate.

Do not modify production code. Any incidental test-project change needed for collection is owned by run-tests; include that change and its revert command in the final analysis.

The automatic collection path is for SDK-style projects. For classic non-SDK or packages.config projects, use only a repository-owned coverage command. If none exists, stop and request Cobertura XML. Never migrate the project, inject an SDK-style provider, create a wrapper project, or report substitute coverage from another assembly.

Show full SKILL.md (599 more words)Show less

Interpretation and arithmetic invariants

  • A line hit proves execution, not both decision outcomes.
  • condition-coverage="50% (1/2)" proves one reported outcome ran, but not which one. Recommend forcing the opposite outcome. Without source, never invent likely predicates or claim whether true or false is missing. State that compound predicates need independently exercised operands and short-circuit combinations when applicable; do not infer the exact combinations without source or fuller XML.
  • Derive overall totals from Cobertura's covered/valid line counts. For target T, required covered lines are ceiling(valid lines × T).
  • Projected coverage is (current covered lines + newly covered distinct lines) / valid lines. State assumptions such as fully covering a method.
  • When asked whether one member can reach a target, show its maximum projected total and at least one concrete sufficient combination of supplied members or line gains. If no supplied combination is sufficient, say so.
  • For a multi-member target, name the exact combination and resulting covered / valid total; saying only "combine it with another member" is incomplete.
  • Reconcile member gaps against project totals. Method line ranges can overlap or omit class-level lines, so do not sum method counts as project truth.
  • Never call one member the sole, entire, or all remaining gap unless its distinct uncovered lines exactly reconcile with the project total and no other below-threshold member remains.
  • Name every supplied or extracted below-threshold member, but keep detail proportional: lead with the blockers, summarize the remainder in one sentence or a compact table.

Response contract

Answer the user's question in the first 2–4 sentences.

  • Excerpt or arithmetic question: one explanation plus the next test or member priority. No dashboard.
  • Existing-report interpretation or plateau: overall line/branch coverage, blocking members, reconciled target impact, and 1–3 recommendations. Use at most one compact table.
  • Explicit risk/CRAP request: top 3 actual hotspots by default, supporting complexity/coverage/CRAP values, remaining flagged count, and 1–3 priorities. Exclude fully covered low-risk methods from the hotspot table. Never exceed 10 rows unless the user requests a larger count. For refactoring safety, rank risky methods by CRAP rather than raw coverage alone, then name comparatively safe well-covered methods separately.
  • Explicit full report request: read references/output-format.md. Save the report only then.

Report only artifacts that exist. Do not announce inaccessible output paths or failed optional file writes when no file was requested.

Optional reports

HTML/CSV/markdown files are not part of normal analysis. Generate them only when the user explicitly requests report files or a CI artifact.

  1. Deliver the direct coverage/risk answer first.
  2. For a full markdown report, read references/output-format.md and save it.
  3. For HTML/CSV, then read references/report-generation.md. Do not install ReportGenerator before the direct answer, and do not retry a failed install.

Validation

  • Confirm a supplied report was used without test execution or tool installation.
  • Reconcile covered, valid, and uncovered line totals before projecting impact.
  • Confirm every stated blocker comes from supplied or extracted evidence.
  • If CRAP was requested, spot-check one score using references/guidelines.md.
  • If files were requested, verify they exist before reporting their paths.

Common Pitfalls

  • Existing report triggers setup work — stop. Analyze the named artifact first.
  • Generic analysis triggers CRAP — stop. CRAP requires explicit risk intent.
  • One method is called the entire gap — reconcile distinct uncovered lines and the full below-threshold set first.
  • A small request gets a dashboard — scale down to a direct answer or one table.
  • No Cobertura from collection — report the collection failure; do not invent substitute coverage.
  • Compiler-generated method names — verify suspicious async, lambda, or local function names against source before presenting them as user-authored members.
  • Test exit code 1 — coverage may still exist; proceed with a warning. Other nonzero build failures stop the collection path.

© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in plugins/dotnet-test/skills/coverage-analysis of dotnet/skills.

  • SKILL.md
  • references/guidelines.md
  • references/output-format.md
  • references/report-generation.md
  • references/setup-discovery.md
  • scripts/Compute-CrapScores.ps1
  • scripts/Extract-MethodCoverage.ps1

Open the folder on GitHubat commit 8d670fa

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in dotnet/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Coverage Analysis for .NET next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Coverage Analysis for .NET compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Coverage Analysis for .NET this skilldotnet/skills5.6k1 repos~2.8kAutomated safety check: PassMIT
Mcaf Dotnet Quality CImanagedcode/Storage138—~1.7kAutomated safety check: PassMIT
Quality CImanagedcode/dotnet-skills486—~2.1kAutomated safety check: PassMIT
Health Checkcodewithmukesh/dotnet-claude-kit7511 repos~1.6kAutomated safety check: PassMIT
Code Review WorkflowResgrid/Core229—~2.1kAutomated safety check: PassApache-2.0
Evaluate PR Testsdotnet/maui23k—~2.9kAutomated safety check: PassMIT

Similar skills

  • Mcaf Dotnet Quality CI

    managedcode/Storage

    Set up or refine open-source .NET code-quality gates for CI: formatting, .editorconfig, SDK analyzers, third-party analyzers, coverage, mutation testing, architecture tests, and security scanning.

    138 GitHub stars~1.7k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Quality CI

    managedcode/dotnet-skills

    Set up or refine open-source .NET code-quality gates for CI: formatting, .editorconfig, SDK analyzers, third-party analyzers, coverage, mutation testing, architecture tests, and security scanning.

    486 GitHub stars~2.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Health Check

    codewithmukesh/dotnet-claude-kit

    Multi-dimensional health assessment for .NET projects with letter grades (A-F) using Roslyn MCP tools.

    751 GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Structured code review workflow for .NET projects using Roslyn MCP tools.

    229 GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.

    23k GitHub stars~2.9k tokensUpdated today
    Testing & QAAuto-check passed
  • Supercov

    supercorp-ai/supercov

    Measures test coverage and code quality in a repository with the supercov CLI, and turns what it finds into small, focused tests or fixes.

    148 GitHub starsUsed in 1 repo~415 tokens
    Testing & QAAuto-check passed

More from dotnet/skills

All 91 skills in this repo
  • Official

    Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.

    5.6k GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed
  • Official

    Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.

    5.6k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Official

    Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.

    5.6k GitHub starsUsed in 3 repos~3.1k tokens
    Auto-check passed
  • Official

    Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.

    5.6k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Microbenchmarking

    dotnet/skills

    Official

    Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.

    5.6k GitHub starsUsed in 3 repos~3.3k tokens
    Auto-check passed
  • Official

    Makes .NET projects compatible with Native AOT and trimming by resolving IL trim and AOT analyzer warnings through annotations rather than suppressions.

    5.6k GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed

Works with

Questions about Coverage Analysis for .NET

What does Coverage Analysis for .NET do?

Interprets .NET coverage reports to explain line and branch gaps, target arithmetic and, on request, CRAP-based risk hotspots, without rerunning tests. NET coverage evidence actually proves: line, branch and condition metrics, Cobertura data, partial conditions, plateaus and target arithmetic. It analyzes reports you provide without rerunning tests or installing tools, and collects coverage only when you explicitly ask.

When should I use Coverage Analysis for .NET?

Coverage Analysis for .NET fits situations like: explaining why a Cobertura report shows partial branch coverage; working out how many more lines must be covered to reach a target; ranking project-wide risk hotspots by coverage-backed CRAP score; judging whether a refactoring is safe given existing coverage.

How do I install Coverage Analysis for .NET in Claude Code?

Run `npx skills add dotnet/skills --skill coverage-analysis -a claude-code`. Or copy the skill folder (plugins/dotnet-test/skills/coverage-analysis in dotnet/skills) into .claude/skills/coverage-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Coverage Analysis for .NET in Codex?

Run `npx skills add dotnet/skills --skill coverage-analysis -a codex`. Or copy the skill folder (plugins/dotnet-test/skills/coverage-analysis in dotnet/skills) into .agents/skills/coverage-analysis in your project. Codex loads it when a task matches its description.

Can I use Coverage Analysis for .NET in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/skills --skill coverage-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/coverage-analysis, .gemini/skills/coverage-analysis, .github/skills/coverage-analysis and .opencode/skills/coverage-analysis in your project.

What does Coverage Analysis for .NET need to run?

Going by SKILL.md and its folder, Coverage Analysis for .NET needs PowerShell for the scripts in its folder and the command-line tools its instructions call (dotnet). Our summary lists: A .NET coverage report such as Cobertura, or an explicit request to collect one; PowerShell for the bundled helper scripts.

Does Coverage Analysis for .NET access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Coverage Analysis for .NET safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Coverage Analysis for .NET use?

Coverage Analysis for .NET is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Coverage Analysis for .NET use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.8k tokens, read only when the agent opens those files.

What are the alternatives to Coverage Analysis for .NET?

Skills that share tags, products or a category with Coverage Analysis for .NET: Mcaf Dotnet Quality CI (managedcode/Storage, 138 stars), Quality CI (managedcode/dotnet-skills, 486 stars), Health Check (codewithmukesh/dotnet-claude-kit, 751 stars) and Code Review Workflow (Resgrid/Core, 229 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Coverage Analysis for .NET?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/skills, which has 5,568 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 7, 2026.

Source: dotnet/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.