Write, run, or repair .NET tests that use TUnit. An agent skill from managedcode/dotnet-skills.

MITAuto-check passedTesting & QA

Install Tunit

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

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

GitHub CLI
$ gh skill install managedcode/dotnet-skills tunit --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/TUnit/skills/tunit .claude/skills/tunit && 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
tunit
GitHub stars
486
Token cost
~2.1k tokens
SKILL.md length
844 words
Files
6 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Write, run, or repair .NET tests that use TUnit. An agent skill from managedcode/dotnet-skills.

  • Works in 10 steps: Confirm the project really uses TUnit… → Read the repo's real test command from… → Keep the TUnit execution model intact → …
  • A repo uses TUnit
  • SKILL.md covers Trigger On, Do Not Use For, Inputs and Workflow, plus 8 more sections
  • Calls dotnet and rg

What it does

Tunit is an agent skill from managedcode/dotnet-skills. Write, run, or repair .NET tests that use TUnit. Use when a repo uses TUnit, TUnit.Playwright, [Test], [Arguments], ClassDataSource, SharedType.PerTestSession, or Microsoft.Testing.Platform-based execution. Preserve TUnit's parallel-by-default model and constrain only destructive shared-state collisions. DO NOT USE FOR: xUnit projects; MSTest projects.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `manifest.json`, `references/integration-testing.md` and `references/migration.md`).

It sits in Testing & QA, covering Unit testing. It works with .NET and Playwright. 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

  • A repo uses TUnit
  • TUnit.Playwright
  • ClassDataSource
  • SharedType.PerTestSession

Example prompts

  • “/tunit”

Workflow steps

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

  1. Confirm the project really uses TUnit and not a different MTP-based framework.
  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 TUnit execution model intact
  4. Choose the fixture level deliberately
  5. Reuse expensive fixtures with ClassDataSource(Shared = SharedType.PerTestSession) instead of booting distributed infrastructure per test…
  6. Keep tests and test modules parallel. Do not add --max-parallel-test-modules 1, TUNIT_MAX_PARALLEL_TESTS=1, [assembly: NotInParallel], a…
  7. Use keyed [NotInParallel("collision-domain")] only on the smallest tests that perform destructive changes to the same shared state and can…
  8. Run the narrowest useful scope first with dotnet test ... --treenode-filter "..." on .NET 10. Use the older -- separator only when the…
  9. Follow Test Output Budget: show bounded root-error evidence and link coverage, Playwright screenshots, and HTML artifacts; never dump host…
  10. Use [Test], [Arguments], hooks, and dependencies only when they make the scenario clearer, not because the framework allows it.

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.

Context cost

Tunit loads about 2.1k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 93 tokens; SKILL.md has 844 words of instructions outside code blocks.

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

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). 844 words, ~2,069 tokens.

Download SKILL.mdSave it as .claude/skills/tunit/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
tunit
description
Write, run, or repair .NET tests that use TUnit. Use when a repo uses `TUnit`, `TUnit.Playwright`, `[Test]`, `[Arguments]`, `ClassDataSource`, `SharedType.PerTestSession`, or Microsoft.Testing.Platform-based execution. Preserve TUnit's parallel-by-default model and constrain only destructive shared-state collisions. DO NOT USE FOR: xUnit projects; MSTest projects.

TUnit

Trigger On

  • the repo uses TUnit
  • you need to add, run, debug, or repair TUnit tests
  • the repo uses Microsoft.Testing.Platform-based test execution
  • the repo uses ClassDataSource<...>(Shared = SharedType.PerTestSession), TUnit.Playwright, or --treenode-filter

Do Not Use For

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

Inputs

  • the nearest AGENTS.md
  • the test project file and package references
  • the repo's current TUnit execution command

Workflow

  1. Confirm the project really uses TUnit and not a different MTP-based framework.
  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 TUnit execution model intact:
    • tests are source-generated at build time
    • tests run in parallel by default
    • on .NET 10, test modules also run in parallel by default up to Environment.ProcessorCount
    • built-in analyzers should remain enabled
  4. Choose the fixture level deliberately:
    • plain TUnit tests for isolated logic
    • shared AppHost/Aspire fixtures for HTTP, SignalR, SSE, or UI flows
    • WebApplicationFactory layered over shared Aspire infra when tests need Host DI services, IGrainFactory, or other runtime internals
  5. Reuse expensive fixtures with ClassDataSource<Fixture>(Shared = SharedType.PerTestSession) instead of booting distributed infrastructure per test. Fixture reuse does not serialize consumers: keep the fixture concurrency-safe and give each test unique mutable state.
  6. Keep tests and test modules parallel. Do not add --max-parallel-test-modules 1, TUNIT_MAX_PARALLEL_TESTS=1, [assembly: NotInParallel], a class-wide [NotInParallel], or an equivalent global restriction.
  7. Use keyed [NotInParallel("collision-domain")] only on the smallest tests that perform destructive changes to the same shared state and can corrupt one another. A shared read-only fixture, expensive startup, module boundary, or vague CI-stability concern is not a reason to limit parallelism.
  8. Run the narrowest useful scope first with dotnet test ... --treenode-filter "..." on .NET 10. Use the older -- separator only when the repository is pinned to an SDK that requires it.
  9. Follow Test Output Budget: show bounded root-error evidence and link coverage, Playwright screenshots, and HTML artifacts; never dump host logs.
  10. Use [Test], [Arguments], hooks, and dependencies only when they make the scenario clearer, not because the framework allows it.

Test Output Budget

  • Keep native runner progress and ANSI enabled (--progress on --ansi on for supported MTP/TUnit runners); use a PTY locally. Do not replay progress redraws into model context. Use the detected runner's flags, not MTP switches on VSTest.
  • Show warnings and errors plus one final summary (counts, duration, exit code). Configure test-owned console logging at Warning; keep Information/Debug/Trace, successful-test output, and expected negative-test noise out of context. Quiet build verbosity alone does not filter application logs.
  • On failure, crash, startup error, or timeout, show the failing test/resource, root exception, and relevant stack frames. Deduplicate; cap each diagnostic tool response at 80 lines / 8 KiB, whichever comes first. Never automatically dump stdout/stderr, host logs, browser console history, DOM/HTML, TRX, or crash artifacts.
  • Keep necessary diagnostics in size-bounded or rotating artifacts and link them. Search by exact failure/correlation; read bounded excerpts, never whole logs. Capture/filter noisy output before tool delivery, preserve the real exit code, and disclose truncation. Monitor actual activity; silence alone does not prove a hang.
Show full SKILL.md (333 more words)Show less

Bootstrap When Missing

If TUnit is requested but not configured yet:

  1. Detect current state:
    • rg -n "TUnit|Microsoft\\.Testing\\.Platform" -g '*.csproj' -g 'Directory.Build.*' .
  2. Add the minimal package set to the test project:
    • dotnet add TEST_PROJECT.csproj package TUnit
    • do not add Microsoft.NET.Test.Sdk to a current TUnit project; it selects the VSTest path and conflicts with the normal Microsoft.Testing.Platform setup
  3. Keep the runner model explicit in AGENTS.md and CI:
    • record that the repo uses Microsoft.Testing.Platform-compatible execution for this test project
    • record the exact dotnet test TEST_PROJECT.csproj command the repo will use
  4. Add one small executable test using [Test].
  5. Run dotnet test TEST_PROJECT.csproj and return status: configured or status: improved.
  6. If the repo intentionally standardizes on xUnit or MSTest, return status: not_applicable unless migration is explicitly requested.

Deliver

  • TUnit tests that respect source generation and parallel execution
  • commands that work in local and CI runs
  • framework-specific verification guidance for the repo
  • a fixture strategy that matches the actual test scope: logic-only, AppHost/API, Host DI/grains, or Playwright UI

Validate

  • the command matches the repo's TUnit runner style
  • focused runs use --treenode-filter rather than VSTest-style --filter
  • .NET 10 runs pass MTP options directly without a -- separator
  • no global or assembly-wide single-thread setting has been introduced
  • any keyed non-parallel group is limited to tests with a named destructive shared-state collision
  • shared distributed fixtures use SharedType.PerTestSession or an equivalent reuse pattern
  • fixture and shared infrastructure are safe for concurrent consumers; mutable data is isolated per test
  • built-in TUnit analyzers remain active
  • coverage tooling matches Microsoft.Testing.Platform if coverage is enabled
  • UI failures link artifacts and server-side failures expose bounded root-error excerpts to avoid blind reruns

Test Harness

mermaid
flowchart LR
  A["TUnit task"] --> B{"What does the test need?"}
  B -->|"Single component only"| C["Plain TUnit test"]
  B -->|"HTTP / SignalR / resource graph"| D["Shared Aspire/AppHost fixture"]
  B -->|"Host DI / grains / runtime services"| E["Shared Aspire/AppHost fixture + WebApplicationFactory"]
  B -->|"Browser automation"| F["Shared Aspire/AppHost fixture + Playwright"]
  C & D & E & F --> G["Run focused with --treenode-filter"]
  G --> H["Show bounded errors and link artifacts"]

Load References

Running Tests

TUnit uses Microsoft.Testing.Platform. Use --treenode-filter for filtering, not VSTest --filter. On .NET 10, pass MTP switches directly; older SDKs may require --.

bash
# Run all tests
dotnet test --solution MySolution.sln

# Run one test project
dotnet test --project tests/MyProject.Tests/MyProject.Tests.csproj

# Filter by class
dotnet test --project tests/MyProject.Tests/MyProject.Tests.csproj --treenode-filter "/*/*/CalculatorTests/*"

# Filter by category
dotnet test --project tests/MyProject.Tests/MyProject.Tests.csproj --treenode-filter "/*/*/*/*[Category=Integration]"

# Coverage on Microsoft.Testing.Platform
dotnet test --solution MySolution.sln --coverage --coverage-output coverage.cobertura.xml --coverage-output-format cobertura

# Raw runner help when the repo needs direct TUnit app switches
dotnet run --project tests/MyProject.Tests/MyProject.Tests.csproj -- --help

Filter syntax: /<Assembly>/<Namespace>/<Class>/<Test> with * wildcards. See references/patterns.md for full examples.

Example Requests

  • "Run this TUnit project correctly."
  • "Fix our TUnit CI command."
  • "Add a regression test in TUnit without breaking parallelism."

© 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 5 other files (references) in catalog/Testing/TUnit/skills/tunit of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/integration-testing.md
  • references/migration.md
  • references/patterns.md
  • references/tunit.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

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

Tunit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tunit this skillmanagedcode/dotnet-skills486—~2.1kAutomated safety check: PassMIT
Aspire Integration TestingDevBetterCom/DevBetterWeb1572 repos~2.3kAutomated safety check: PassNone
Dotnet Testingnovotnyllc/dotnet-artisan233—~972Automated safety check: PassMIT
Dotnet Testingmacalbert/envilder138—~1.6kAutomated safety check: PassMIT
Debug Playwright Prowquay/quay2.8k—~2.2kAutomated safety check: PassApache-2.0
Quay Prow Triagequay/quay2.8k—~2.9kAutomated safety check: PassApache-2.0

Similar skills

  • 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
  • Dotnet Testing

    novotnyllc/dotnet-artisan

    Defines .NET test strategy and implementation patterns across xUnit v3 (Facts, Theories, fixtures, IAsyncLifetime), integration testing (WebApplicationFactory, Testcontainers), Aspire testing…

    233 GitHub stars~972 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Dotnet Testing

    macalbert/envilder

    Mandatory testing conventions for .NET (xUnit, AwesomeAssertions).

    138 GitHub stars~1.6k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Deep-dive diagnosis of a Playwright test failure already isolated to one Quay Prow/OpenShift CI run: downloads its GCS artifacts (results.json, JUnit, build/pod logs, Jaeger traces), classifies real…

    2.8k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Diagnose any Quay Prow job failure end to end: prowjob.json - top-level build log - JUnit - resolved failing step - Playwright results.json when the failing step is Playwright, continuing through…

    2.8k GitHub stars~2.9k 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

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

Categories

Questions about Tunit

What does Tunit do?

Write, run, or repair .NET tests that use TUnit. An agent skill from managedcode/dotnet-skills. Tunit is an agent skill from managedcode/dotnet-skills.NET tests that use TUnit.

When should I use Tunit?

Tunit fits situations like: A repo uses TUnit; TUnit.Playwright; classDataSource; sharedType.PerTestSession.

How do I install Tunit in Claude Code?

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

How do I install Tunit in Codex?

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

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

What does Tunit need to run?

Going by SKILL.md and its folder, Tunit needs the command-line tools its instructions call (dotnet and rg).

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

Tunit 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 Tunit use?

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

What are the alternatives to Tunit?

Skills that share tags, products or a category with Tunit: Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars), Dotnet Testing (novotnyllc/dotnet-artisan, 233 stars), Dotnet Testing (macalbert/envilder, 138 stars) and Debug Playwright Prow (quay/quay, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tunit?

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.