Agent skill

Dotnet Unit Test Coverage

by newrelic in newrelic/newrelic-dotnet-agent

Mandatory unit-test and code-coverage rules for the .NET agent.

Apache-2.0Auto-check passedTesting & QA

Install Dotnet Unit Test Coverage

skills CLI
$ npx skills add newrelic/newrelic-dotnet-agent --skill dotnet-unit-test-coverage -a claude-code

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

GitHub CLI
$ gh skill install newrelic/newrelic-dotnet-agent dotnet-unit-test-coverage --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/newrelic/newrelic-dotnet-agent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/dotnet-unit-test-coverage .claude/skills/dotnet-unit-test-coverage && 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
dotnet-unit-test-coverage
GitHub stars
117
Token cost
~1k tokens
SKILL.md length
528 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

Mandatory unit-test and code-coverage rules for the .NET agent.

  • Writing an implementation plan
  • SKILL.md covers Scope, Rule 1: New testable code gets…, Rule 2: Aim for 100% code… and When writing implementation…, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Modifying unit tests

What it does

Dotnet Unit Test Coverage is an agent skill from newrelic/newrelic-dotnet-agent. Mandatory unit-test and code-coverage rules for the .NET agent. Use when writing an implementation plan, writing or modifying unit tests, or adding/changing production code in the Core project or the NewRelic.Agent.Extensions project. Apply without being prompted by the user.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing and Planning. It works with .NET and New Relic. The repository describes itself as: The New Relic .NET language agent. The licence is Apache-2.0.

When your agent uses it

  • Writing an implementation plan
  • Modifying unit tests
  • Adding/changing production code in the Core project
  • The NewRelic.Agent.Extensions project

Example prompts

  • “/dotnet-unit-test-coverage”

What it can do on your machine

Read from SKILL.md and the folder at commit aca7658. 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

    No scripts in the folder and no shell commands in SKILL.md.

    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

Dotnet Unit Test Coverage loads about 1k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 528 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~1k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from newrelic/newrelic-dotnet-agent at commit aca7658, republished under its Apache-2.0 licence (© newrelic). 528 words, ~1,017 tokens.

Download SKILL.mdSave it as .claude/skills/dotnet-unit-test-coverage/SKILL.md (or your agent's skills folder).
name
dotnet-unit-test-coverage
description
Mandatory unit-test and code-coverage rules for the .NET agent. Use when writing an implementation plan, writing or modifying unit tests, or adding/changing production code in the Core project or the NewRelic.Agent.Extensions project. Apply without being prompted by the user.

.NET Agent Unit-Test and Coverage Requirements

These rules are mandatory and apply automatically -- the user does not need to ask for tests or for coverage. Honor them when planning work, when writing or editing tests, and when adding or changing production code.

Scope

  • In scope (must be unit-tested): all production code in the Core project (src/Agent/NewRelic/Agent/Core/) and the NewRelic.Agent.Extensions project (src/Agent/NewRelic/Agent/Extensions/NewRelic.Agent.Extensions/).
  • Out of scope: the wrapper projects under src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/*. They have no unit tests by design (covered by the Integration / Unbounded / Container test solutions). When adding non-trivial logic to a wrapper, lift it into a helper in NewRelic.Agent.Extensions and unit-test the helper -- see the wrapper guidance in tests/CLAUDE.md and the top-level CLAUDE.md.

Rule 1: New testable code gets unit tests in the same change

Adding or changing in-scope production code without accompanying unit tests is incomplete work, not a follow-up task. Write the tests as part of the same change, unprompted. Use TDD where practical: write the failing test first, see it fail, implement, see it pass.

Rule 2: Aim for 100% code coverage

When writing or modifying unit tests, cover every reachable line and branch of the code under test:

  • Include error / catch paths, early returns, and boundary conditions (just-under / just-over a cap, empty / null inputs, first-and-last iterations).
  • The only acceptable uncovered code is a genuinely unreachable defensive guard (for example an IsNaN check on a value that the parser can never produce a NaN for, or a default: no input can hit). Call these out explicitly rather than contorting tests to fake-cover dead code.
  • Do not pad coverage with assertion-free tests. Every test must verify behavior, not merely execute lines.
Show full SKILL.md (256 more words)Show less

When writing implementation plans

Bake these rules into the plan so the implementer applies them without re-deriving them:

  • In the plan's Global Constraints header, state: "All new/changed code in Core and NewRelic.Agent.Extensions must ship with unit tests in the same task; target 100% reachable line and branch coverage."
  • Every task that creates or modifies in-scope production code must include explicit TDD steps (write failing test -> run/fail -> implement -> run/pass -> commit) with the actual test code, not a "write tests for the above" placeholder.
  • A task that only touches wrapper code (and cannot have its logic lifted into a helper) is the sole exception -- note that it is covered by integration tests instead.

Mechanics

Test layout, frameworks (NUnit + JustMock Lite, interfaces/virtual only), the SolutionDir build caveat, and the "run against the built DLL for NewRelic.Agent.Extensions.Tests" caveat are in the top-level CLAUDE.md ("Building and testing from the CLI", "Testing conventions") and tests/CLAUDE.md.

Achieving coverage without piercing encapsulation

JustMock Lite mocks only interfaces and virtual members -- no sealed, static, or non-virtual mocking -- and InternalsVisibleTo is banned in every production and test assembly. So when in-scope code is hard to reach from a test, do NOT widen visibility or expose internals to the test assembly. Make the code coverable by refactoring the production type to expose a proper seam: extract an interface, make the member virtual, inject a mockable dependency, or lift the logic into a public helper. If a line is only reachable by mocking a private/sealed/static member or via InternalsVisibleTo, the design -- not the test -- is what must change.

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

Files

Just SKILL.md in .claude/skills/dotnet-unit-test-coverage of newrelic/newrelic-dotnet-agent.

Open the folder on GitHubat commit aca7658

Compare with similar skills

Dotnet Unit Test Coverage 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.

Dotnet Unit Test Coverage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dotnet Unit Test Coverage this skillnewrelic/newrelic-dotnet-agent117—~1kAutomated safety check: PassApache-2.0
New Event Sourceaws/aws-lambda-dotnet1.7k—~3kAutomated safety check: PassApache-2.0
ScottPlot Test RunnerScottPlot/ScottPlot6.8k—~308Automated safety check: PassMIT
Aspire Integration TestingDevBetterCom/DevBetterWeb1572 repos~2.3kAutomated safety check: PassNone
Vstest Build Testmicrosoft/vstest969—~1.9kAutomated safety check: PassMIT
Coverage Analysisrunceel/ReactiveProperty944—~5.9kAutomated safety check: WarnMIT

Similar skills

  • New Event Source

    aws/aws-lambda-dotnet

    Official

    Add a new AWS event source attribute (e.g., Kinesis, Kafka, MQ) to the Lambda .NET Annotations framework, including the attribute class, source generator integration, CloudFormation writer, unit…

    1.7k GitHub stars~3k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • ScottPlot Test Runner

    ScottPlot/ScottPlot

    Run or add ScottPlot 5 tests. Use for unit-test and cookbook-test work; unless explicitly asked otherwise, restrict manual test execution to the Unit Tests…

    6.8k GitHub stars~308 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Aspire Integration Testing

    DevBetterCom/DevBetterWeb

    Write integration tests using .NET Aspire's testing facilities with xUnit.

    157 GitHub starsUsed in 2 repos~2.3k tokens
    Testing & QAAuto-check passed
  • Vstest Build Test

    microsoft/vstest

    Official

    Build, test, and validate changes in the vstest repository. An agent skill from microsoft/vstest.

    969 GitHub stars~1.9k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Coverage Analysis

    runceel/ReactiveProperty

    Automated, project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects with existing unit tests.

    944 GitHub stars~5.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check: warnings
  • Unit Testing

    OpenCoreMMO/OpenCoreMMO

    Write, fix, or review NeoServer unit tests using xUnit and FluentAssertions.

    481 GitHub stars~1.6k tokensUpdated 15 days ago
    Testing & QAAuto-check passed

More from newrelic/newrelic-dotnet-agent

  • Analyze Dotnet Agent Logs

    newrelic/newrelic-dotnet-agent

    Parse and diagnose New Relic .NET agent logs (newrelicagent.log) and profiler logs (NewRelic.Profiler.<pid.log) from a support ticket.

    117 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Angler Dotnet Release

    newrelic/newrelic-dotnet-agent

    Open an Angler PR that adds the latest .NET agent release to metricnames.txt.

    117 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Build Dotnet Agent

    newrelic/newrelic-dotnet-agent

    Build the New Relic .NET agent locally and validate that code changes compile.

    117 GitHub stars~871 tokensUpdated yesterday
    Auto-check passed
  • Run Integration Tests

    newrelic/newrelic-dotnet-agent

    Run the New Relic .NET agent integration tests locally. An agent skill from newrelic/newrelic-dotnet-agent.

    117 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Update Dotty Docs

    newrelic/newrelic-dotnet-agent

    A skill your agent uses when the user mentions a Dotty PR, dotty (package/dependency) updates, or asks to update the .NET agent compatibility docs / net-agent-compatibility-requirements after tested…

    117 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Triage Integration Test Failures

    newrelic/newrelic-dotnet-agent

    A skill your agent uses when a CI integration, unbounded, or container test job fails intermittently, passes on a rerun, fails identically across every matrix variant, or shows an infra-shaped error…

    117 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Dotnet Unit Test Coverage

What does Dotnet Unit Test Coverage do?

Mandatory unit-test and code-coverage rules for the .NET agent. Dotnet Unit Test Coverage is an agent skill from newrelic/newrelic-dotnet-agent.NET agent.

When should I use Dotnet Unit Test Coverage?

Dotnet Unit Test Coverage fits situations like: writing an implementation plan; modifying unit tests; adding/changing production code in the Core project; the NewRelic.Agent.Extensions project.

How do I install Dotnet Unit Test Coverage in Claude Code?

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

How do I install Dotnet Unit Test Coverage in Codex?

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

Can I use Dotnet Unit Test Coverage 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 newrelic/newrelic-dotnet-agent --skill dotnet-unit-test-coverage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dotnet-unit-test-coverage, .gemini/skills/dotnet-unit-test-coverage, .github/skills/dotnet-unit-test-coverage and .opencode/skills/dotnet-unit-test-coverage in your project.

What does Dotnet Unit Test Coverage need to run?

SKILL.md names no scripts, command-line tools or credentials: Dotnet Unit Test Coverage is instructions for the agent only.

Does Dotnet Unit Test Coverage 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 Dotnet Unit Test Coverage 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. Review the folder before installing.

What licence does Dotnet Unit Test Coverage use?

Dotnet Unit Test Coverage is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dotnet Unit Test Coverage use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dotnet Unit Test Coverage?

Skills that share tags, products or a category with Dotnet Unit Test Coverage: New Event Source (aws/aws-lambda-dotnet, 1.7k stars), ScottPlot Test Runner (ScottPlot/ScottPlot, 6.8k stars), Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars) and Vstest Build Test (microsoft/vstest, 969 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dotnet Unit Test Coverage?

newrelic (a GitHub organization) maintains it in newrelic/newrelic-dotnet-agent, which has 117 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 7, 2026.

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