Write, run, or repair .NET tests that use xUnit with the right package, CLI, and runner guidance.

MITAuto-check passedTesting & QA

Install Xunit

skills CLI
$ npx skills add managedcode/dotnet-skills --skill xunit -a claude-code

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

GitHub CLI
$ gh skill install managedcode/dotnet-skills xunit --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/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Testing/xUnit/skills/xunit .claude/skills/xunit && 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
xunit
GitHub stars
486
Token cost
~1.6k tokens
SKILL.md length
742 words
Files
5 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Write, run, or repair .NET tests that use xUnit with the right package, CLI, and runner guidance.

  • Works in 3 steps: Read the nearest AGENTS.md and confirm… → Run this skill's Workflow through the… → Return the Required Result Format with…
  • XUnit v3 projects
  • SKILL.md covers Diagnostic Output Budget, Trigger On, Value and Do Not Use For, plus 9 more sections
  • Calls dotnet and rg

What it does

Xunit is an agent skill from managedcode/dotnet-skills. Write, run, or repair .NET tests that use xUnit with the right package, CLI, and runner guidance. USE FOR: xUnit v2 or xUnit v3 projects; adding, running, debugging, or repairing xUnit tests; choosing between VSTest and Microsoft.Testing.Platform. DO NOT USE FOR: TUnit projects; MSTest projects. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `manifest.json`, `references/anti-patterns.md` and `references/patterns.md`). Compatibility notes: Requires a .NET solution or project with xUnit packages; respects the repo's AGENTS.md commands first.

It sits in Testing & QA, covering Unit testing. It works with .NET. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • XUnit v3 projects
  • Repairing xUnit tests
  • Choosing between VSTest and Microsoft.Testing.Platform
  • : TUnit projects

Example prompts

  • “/xunit”

Requirements

  • Compatibility (from SKILL.md): Requires a .NET solution or project with xUnit packages; respects the repo's `AGENTS.md` commands first.

Workflow steps

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

  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.

What it can do on your machine

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

    Shell commands in SKILL.md call:

    • dotnet
    • rg

    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.

  • Compatibility

    Requires a .NET solution or project with xUnit packages; respects the repo's `AGENTS.md` commands first.

    From compatibility in the SKILL.md frontmatter.

Context cost

Xunit loads about 1.6k tokens when it runs, and up to ~8.9k if it reads all its reference files. Until then it costs about 112 tokens; SKILL.md has 742 words of instructions outside code blocks.

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

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 managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 742 words, ~1,576 tokens.

Download SKILL.mdSave it as .claude/skills/xunit/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
xunit
description
Write, run, or repair .NET tests that use xUnit with the right package, CLI, and runner guidance. USE FOR: xUnit v2 or xUnit v3 projects; adding, running, debugging, or repairing xUnit tests; choosing between VSTest and Microsoft.Testing.Platform. DO NOT USE FOR: TUnit projects; MSTest projects. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
compatibility
Requires a .NET solution or project with xUnit packages; respects the repo's `AGENTS.md` commands first.

xUnit.net

Diagnostic Output Budget

Keep native test progress and ANSI visible; use the detected runner's supported flags (--progress on --ansi on for MTP/TUnit), not MTP switches on VSTest. Keep console logs at Warning or higher and one concise final summary. Do not replay progress redraws, successful-test output, or Information/Debug/Trace logs into model context. On failure/crash, show only the failing test/resource, root error, and relevant stack frames; deduplicate and cap each diagnostic response at 80 lines / 8 KiB. Never dump entire console/host/browser logs, HTML, TRX, or crash artifacts. Keep necessary artifacts size-bounded outside context, link them, and inspect exact bounded excerpts. Preserve the runner exit code through capture/filtering; disclose truncation. Silence alone does not establish a hang.

Trigger On

  • the repo uses xUnit v2 or xUnit v3
  • you need to add, run, debug, or repair xUnit tests
  • the team is unsure whether a project is using VSTest or Microsoft.Testing.Platform

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

  • TUnit projects
  • MSTest projects
  • generic test strategy with no xUnit-specific mechanics

Inputs

  • the nearest AGENTS.md
  • the test project file and package references
  • the active runner model for the test project

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. Detect the active xUnit model before changing commands:
    • xunit usually means v2
    • xunit.v3 means v3
    • xunit.runner.visualstudio plus Microsoft.NET.Test.Sdk usually means VSTest compatibility is enabled
    • TestingPlatformDotnetTestSupport or UseMicrosoftTestingPlatformRunner means Microsoft.Testing.Platform is in play
  2. Read the repo's real test command from AGENTS.md. If the repo has no explicit command yet, start with dotnet test PROJECT_OR_SOLUTION.
  3. Keep the runner model consistent:
    • xUnit v2 usually runs through VSTest
    • xUnit v3 can run as a standalone executable with dotnet run
    • xUnit v3 can also integrate with Microsoft.Testing.Platform
    • do not mix VSTest-only switches into Microsoft.Testing.Platform runs
  4. Run the narrowest useful scope first:
    • one project
    • one class
    • one trait
    • one method
  5. Prefer [Theory] for stable data-driven coverage and [Fact] for single-path invariant checks.
  6. Keep xunit.analyzers enabled when present. Fix analyzer findings instead of muting them casually.

Bootstrap When Missing

If xUnit is requested but not configured:

  1. Detect current framework first:
    • rg -n "xunit(\\.v3)?|xunit\\.runner\\.visualstudio|TestingPlatformDotnetTestSupport|UseMicrosoftTestingPlatformRunner|TUnit|MSTest" -g '*.csproj' .
  2. If the repo currently uses TUnit or MSTest, do not auto-migrate. Return status: not_applicable unless migration is explicitly requested.
  3. For explicit xUnit adoption, add packages to the target test project:
    • dotnet add TEST_PROJECT.csproj package xunit.v3
    • optional VSTest bridge: dotnet add TEST_PROJECT.csproj package xunit.runner.visualstudio
  4. Add repo test commands and runner notes to AGENTS.md.
  5. Run dotnet test TEST_PROJECT.csproj or repo-defined xUnit command and return status: configured or status: improved.
Show full SKILL.md (261 more words)Show less

Deliver

  • xUnit tests that match the repo's active xUnit version and runner
  • commands that work in local and CI runs
  • focused verification before broader suite execution

Validate

  • the chosen CLI matches the active runner model
  • test filters or focused runs are valid for that runner
  • tests use deterministic inputs and assertions
  • xUnit-specific analyzers remain active unless the repo documents an exception

Ralph Loop

Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.

  1. Plan first (mandatory):
    • analyze current state
    • define target outcome, constraints, and risks
    • write a detailed execution plan
    • list final validation skills to run at the end, with order and reason
  2. Execute one planned step and produce a concrete delta.
  3. Review the result and capture findings with actionable next fixes.
  4. Apply fixes in small batches and rerun the relevant checks or review steps.
  5. Update the plan after each iteration.
  6. Repeat until outcomes are acceptable or only explicit exceptions remain.
  7. If a dependency is missing, bootstrap it or return status: not_applicable with explicit reason and fallback path.
Required Result Format
  • status: complete | clean | improved | configured | not_applicable | blocked
  • plan: concise plan and current iteration step
  • actions_taken: concrete changes made
  • validation_skills: final skills run, or skipped with reasons
  • verification: commands, checks, or review evidence summary
  • remaining: top unresolved items or none

For setup-only requests with no execution, return status: configured and exact next commands.

Load References

Example Requests

  • "Run this xUnit suite correctly."
  • "Fix our xUnit v3 test command."
  • "Add an xUnit regression test and keep CI compatible."

© managedcode, 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 4 other files (references) in catalog/Testing/xUnit/skills/xunit of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/anti-patterns.md
  • references/patterns.md
  • references/xunit.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

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

Xunit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Xunit this skillmanagedcode/dotnet-skills486—~1.6kAutomated safety check: PassMIT
Mcaf Dotnet Netarchtestmanagedcode/Storage138—~936Automated safety check: PassMIT
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

Similar skills

  • Mcaf Dotnet Netarchtest

    managedcode/Storage

    Use the open-source free NetArchTest.Rules library for architecture rules in .NET unit tests.

    138 GitHub stars~936 tokensUpdated today
    Testing & QAAuto-check passed
  • 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 today
    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

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Questions about Xunit

What does Xunit do?

Write, run, or repair .NET tests that use xUnit with the right package, CLI, and runner guidance. Xunit is an agent skill from managedcode/dotnet-skills.NET tests that use xUnit with the right package, CLI, and runner guidance.

When should I use Xunit?

Xunit fits situations like: XUnit v3 projects; repairing xUnit tests; choosing between VSTest and Microsoft.Testing.Platform; : TUnit projects.

How do I install Xunit in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill xunit -a claude-code`. Or copy the skill folder (catalog/Testing/xUnit/skills/xunit in managedcode/dotnet-skills) into .claude/skills/xunit in your project. Claude Code loads it when a task matches its description.

How do I install Xunit in Codex?

Run `npx skills add managedcode/dotnet-skills --skill xunit -a codex`. Or copy the skill folder (catalog/Testing/xUnit/skills/xunit in managedcode/dotnet-skills) into .agents/skills/xunit in your project. Codex loads it when a task matches its description.

Can I use Xunit 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 managedcode/dotnet-skills --skill xunit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xunit, .gemini/skills/xunit, .github/skills/xunit and .opencode/skills/xunit in your project.

What does Xunit need to run?

Going by SKILL.md and its folder, Xunit needs the command-line tools its instructions call (dotnet and rg). Compatibility (from SKILL.md): Requires a .NET solution or project with xUnit packages; respects the repo's `AGENTS.md` commands first..

Does Xunit 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 Xunit 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 Xunit use?

Xunit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Xunit use?

About 1.6k tokens (SKILL.md is roughly 6.3k 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 7.4k tokens, read only when the agent opens those files.

What are the alternatives to Xunit?

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

Who maintains Xunit?

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

Source: managedcode/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.