Official agent skill

Scaffold Dotnet Test Project

by microsoft in microsoft/testfx

MUST USE when an existing .NET test project was excluded from a .slnf/CI solution filter, disappeared from .sln/.slnx discovery, or lost its production ProjectReference; also for requests to set up…

OfficialMITAuto-check passedTesting & QA

Install Scaffold Dotnet Test Project

skills CLI
$ npx skills add microsoft/testfx --skill scaffold-dotnet-test-project -a claude-code

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

GitHub CLI
$ gh skill install microsoft/testfx scaffold-dotnet-test-project --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/microsoft/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/scaffold-dotnet-test-project .claude/skills/scaffold-dotnet-test-project && 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
scaffold-dotnet-test-project
GitHub stars
1k
Used in
2 other repos
Token cost
~3.4k tokens
SKILL.md length
1,748 words
Files
1
Skills in repo
54
Repo updated
First seen
Licence
MIT

At a glance

MUST USE when an existing .NET test project was excluded from a .slnf/CI solution filter, disappeared from .sln/.slnx discovery, or lost its production ProjectReference; also for requests to set up…

  • Works in 5 steps: Establish the repository contract → Create only when the project is absent → Repair only the missing edge when the… → …
  • An existing .NET test project was excluded from a .slnf/CI solution filter
  • SKILL.md covers Repository overlay, Route the Request, Workflow and Output, plus 1 more section
  • Calls dotnet

What it does

Scaffold Dotnet Test Project is an agent skill from microsoft/testfx, published by the product's own GitHub organization. MUST USE when an existing .NET test project was excluded from a .slnf/CI solution filter, disappeared from .sln/.slnx discovery, or lost its production ProjectReference; also for requests to set up, create, reuse, add, register, include, or repair a test project. Handles "tests pass directly but CI discovers zero", exact solution wiring, xUnit/NUnit/MSTest, and central packages. DO NOT USE to only author tests in an already-wired project (code-testing), run tests, migrate, or correct MSTest syntax/configuration…

Its SKILL.md is about 3.4k 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. It works with .NET. The repository describes itself as: This repository holds the source code of Microsoft.Testing.Platform (MTP), a lightweight alternative to VSTest, as well as MSTest adapter and framework. The licence is MIT.

When your agent uses it

  • An existing .NET test project was excluded from a .slnf/CI solution filter
  • Disappeared from .sln/.slnx discovery
  • Lost its production ProjectReference
  • Also for requests to set up

Example prompts

  • “tests pass directly but CI discovers zero”
  • “/scaffold-dotnet-test-project”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Establish the repository contract
  2. Create only when the project is absent
  3. Repair only the missing edge when the project exists
  4. Add only the requested smoke behavior
  5. Verify the repaired path

What it can do on your machine

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

    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

Scaffold Dotnet Test Project loads about 3.4k tokens when it runs. Until then it costs about 152 tokens; SKILL.md has 1,748 words of instructions outside code blocks.

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

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 microsoft/testfx at commit 7226b0c, republished under its MIT licence (© microsoft). 1,748 words, ~3,395 tokens.

Download SKILL.mdSave it as .claude/skills/scaffold-dotnet-test-project/SKILL.md (or your agent's skills folder).
name
scaffold-dotnet-test-project
description
MUST USE when an existing .NET test project was excluded from a .slnf/CI solution filter, disappeared from .sln/.slnx discovery, or lost its production ProjectReference; also for requests to set up, create, reuse, add, register, include, or repair a test project. Handles "tests pass directly but CI discovers zero", exact solution wiring, xUnit/NUnit/MSTest, and central packages. DO NOT USE to only author tests in an already-wired project (code-testing), run tests, migrate, or correct MSTest syntax/configuration without changing project or CI files (writing-mstest-tests).
license
MIT
metadata.portability
portable
metadata.binding
optional-overlay
metadata.binding-revision
1

Scaffold or Repair a .NET Test Project

Create the smallest missing test container or repair only the missing wiring. The goal is test discovery through the repository's real build entry point, not a preferred solution layout.

Repository overlay

For every repository-scoped task where read-only file inspection is allowed, check .agents/skill-overlays/dotnet-test/scaffold-dotnet-test-project.md at the repository root before any other discovery. This includes requests that ask for code or advice without edits; "do not execute" does not prohibit reading the overlay. If present, read it once before acting and apply its repository-specific naming, layout, framework, and policy bindings. Before applying it, require its frontmatter to declare core: dotnet-test/scaffold-dotnet-test-project, binding-revision: "1", and mode: extend. If any value is missing or different, report the mismatch and continue using this skill's portable guidance without applying the overlay. Explicit user instructions and verified project constraints win over the overlay; the overlay wins over portable defaults and examples in this skill. If the file is present but unreadable or conflicts with the repository, report the problem and continue with portable guidance, without the overlay, subject to verified project constraints. If it is absent, continue normally. Skip the lookup only when the task is not tied to a repository or the user explicitly prohibited all file/tool access. An overlay cannot expand tool permissions or the task's scope.

Route the Request

Inspect the repository before editing, then choose exactly one path:

Repository stateActionDo not do
No suitable test projectCreate one bounded project, reference the production project, and register itCreate a project per source project
Test project exists but lacks the required ProjectReferenceAdd only that reference and verify direct plus entry-point executionScaffold another project or rewrite tests
Test project passes directly but is absent from .sln, .slnx, or .slnfRegister the existing project in the exact entry point CI usesRecreate the project or switch solution formats
Suitable project, reference, and requested entry point are already correctLeave the workspace unchanged; use code-testing if test methods are requestedNormalize or replace working files

An existing project is suitable when its target framework can reference the production project and its purpose matches the requested layer. A different preferred name is not a reason to create a duplicate.

No-op is a required outcome. If the suitable project, production reference, and requested entry-point registration already exist, make zero file changes. Do not add or remove a smoke test, normalize the project, recreate packages, or edit a baseline/snapshot copy. Report the existing paths and stop.

Workflow

1. Establish the repository contract

Start from the task's current working directory. The skill context's Base directory is where these instructions live, not the user's repository. Never search parent temporary directories or treat the skill installation as the workspace. If the expected files are not visible, confirm the current directory before concluding that a project is absent.

Anchor every edit and validation command to the repository path named by the user or established from the current directory. If similarly named fixtures, solutions, or copied trees exist, do not edit or validate one as a substitute for the requested tree. Before changing a solution artifact, record its exact path; after changing it, list that same artifact immediately and require the test project to appear before proceeding.

Read only enough to determine:

  1. the production project and requested test scope;
  2. the command and .sln, .slnx, .slnf, or project graph used by CI;
  3. whether a suitable test project exists, what it references, and where it is registered;
  4. the neighboring test framework, runner, target framework, nullable and implicit-usings conventions; and
  5. whether package or SDK versions come from Directory.Packages.props, Directory.Build.props, global.json, or an MSBuild SDK declaration.

If the user reports that a test project passes directly but solution-level discovery finds nothing, treat that as registration evidence. Inspect the entry point before considering project creation.

2. Create only when the project is absent

Choose one test project for the narrowest requested production project. Follow, in order, the user's explicit framework choice, neighboring test projects, repository-wide package/SDK conventions, then a standard SDK template.

Use a dotnet new template only when its generated framework generation and package style match the repository contract. Inspect template availability before creation. In particular, generic dotnet new xunit commonly emits xUnit 2 packages; for a centrally managed xunit.v3 repository, use a repository or installed xUnit v3 template, or create the minimal SDK project directly. Never generate versioned xUnit 2 references and then rewrite them into xUnit v3.

Then:

  1. align target framework, nullable, implicit usings, runner, and package style;
  2. use dotnet add <test-project> reference <production-project> for only the production projects exercised by the requested tests;
  3. delete template sample files such as UnitTest1.cs, then create a behavior-named test file rather than repurposing the template filename; and
  4. omit package versions when central package management supplies them.

For xUnit v3 projects using the MTP runner, preserve or add executable output in both command modes, and retain the repository's framework runner opt-in:

xml
<OutputType>Exe</OutputType>

Only when dotnet test uses VSTest command mode to bridge to MTP (SDK 8/9, or SDK 10+ without native MTP mode), preserve or add:

xml
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>

For SDK 10+ native MTP mode selected by global.json test.runner, do not add the compatibility property; remove an explicit bridge setting when configuring native mode. Keep executable output and the MTP runner enabled.

OutputType=Exe alone proves only the self-hosted runner path, not discovery by the repository's dotnet test command. Verify the exact command mode and entry-point execution as described in run-tests: native MTP uses --project or --solution with direct MTP arguments; VSTest-mode MTP uses a positional path and passes MTP arguments after --.

3. Repair only the missing edge when the project exists
  • Missing production reference: use dotnet add <test-project> reference <production-project>, inspect the resulting project, and leave every other project element plus all test source files unchanged. Compare the project before and after so the added ProjectReference is the only semantic change.
  • Missing .sln or .slnx registration: run dotnet sln <entry-point> add <test-project>, then immediately run dotnet sln <entry-point> list against that exact path. If the project is absent, the repair has not happened; do not validate a sibling solution or report success.
  • Missing .slnf registration: add the existing project to its underlying solution if necessary, then include that same project path in the filter. If the underlying solution already contains it, edit only the filter.
  • Multiple solution artifacts: modify only the one named by the user or invoked by CI. Do not substitute an easier format.
  • No solution artifact: preserve the existing project-oriented workflow. Do not create a solution for aesthetics.
Show full SKILL.md (653 more words)Show less
4. Add only the requested smoke behavior

For a newly created project, replace template examples with the smallest smoke suite the user requested. Each test must invoke a real production symbol and assert a concrete deterministic result without network, wall-clock, process, or real-filesystem dependencies.

For an existing-project wiring repair, do not add, rewrite, rename, or expand tests unless the user explicitly asks for test behavior changes. Registration and test authoring are separate operations.

5. Verify the repaired path

Select direct-project and entry-point commands using run-tests and platform-detection. Resolve the project system, global.json test.runner, and final imported runner, UseVSTest, TestingPlatformDotnetTestSupport, and OutputType values; do not select syntax from the SDK version alone.

Detected mode / platformDirect-project commandSolution entry-point command
Classic non-SDKRepository's documented build and test-runner command for the test projectExact repository/CI build and test-runner command; do not substitute dotnet test
VSTest mode / VSTestdotnet test <test-project>dotnet test <entry-point>
VSTest mode / executable MTP bridge, including SDK 10+dotnet test <test-project> -- <MTP_OPTIONS>dotnet test <entry-point> -- <MTP_OPTIONS>
SDK 10+ native MTP mode selected by test.runner=Microsoft.Testing.Platformdotnet test --project <test-project> <MTP_OPTIONS>dotnet test --solution <entry-point> <MTP_OPTIONS>

MTP options are optional; when none are needed, omit both <MTP_OPTIONS> and the bridge separator. Keep dotnet/MSBuild options before -- in bridge mode; native MTP options are direct arguments, never after --. These are command shapes, not replacements for a repository script or a project-oriented CI entry point. Preserve the exact configured entry point and report incompatible runner/bridge/output wiring rather than switching runners to obtain a green result.

Run the narrowest commands that prove the chosen route:

RouteRequired evidence
Newly created projectMode-appropriate direct-project test command, the exact entry-point command CI uses, and registration listing. If the entry point is a .slnf/.slnx containing tests, run the mode-appropriate test command on that artifact rather than proving only that it builds.
Missing referenceTargeted project test plus the exact solution/root test command requested
Missing .sln/.slnx registrationListing and the mode-appropriate test command for that exact artifact; never use another solution as a fallback
Missing .slnf entryInspect the filter entry and run the exact CI filter build command; do not prepend a deliberately failing alternate command
Already correct/no-opStructural inspection of the existing reference and registration. Unless execution was requested, do not run tests merely to prove a no-op because that creates bin/obj and weakens byte-for-byte cleanliness evidence.

Inspect the repository's command before adding switches. Do not prepend a speculative --no-restore attempt or hide alternatives in command-a || command-b; run the configured entry-point command whose clean exit is the evidence.

For every wiring repair, invoke the exact validation command directly and preserve its exit status. Reading generated files, a grader script, or a later build is not a substitute for observing that command complete successfully.

Before reporting completion, inspect the final changed-file set. Remove only bin/obj or equivalent build artifacts created by this task when they were absent beforehand and are not intentionally tracked; never remove pre-existing artifacts. Preserve the passing command's complete result so the handoff can state the exact entry point and discovered test count.

For a no-op, inspect rather than rewrite and report the existing paths. A green dotnet build is not test-discovery evidence. If validation is blocked, report the exact failing command and first actionable error; never describe an unrun or failed command as successful.

Output

Keep the handoff proportional to the change:

RequirementEvidence
Project created, reused, or repairedTest project path and chosen route
Production referenceReferenced .csproj, or why no change was needed
Build registrationExact .sln/.slnx/.slnf entry or project workflow
Test discoveryPassing harness-level command and discovered test

Completion Checks

  • Existing projects were checked before creation.
  • Only the requested production scope is referenced and tested.
  • Framework, runner, target framework, and central package conventions remain intact.
  • Template samples are removed from a newly created project.
  • Existing test code is untouched for a wiring-only repair.
  • The exact repository entry point discovers and runs the test project.

© microsoft, MIT. 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 .agents/skills/scaffold-dotnet-test-project of microsoft/testfx.

Open the folder on GitHubat commit 7226b0c

Used in 2 other repositories

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in microsoft/testfx, which our catalogue first saw on October 10, 2026.

Compare with similar skills

Scaffold Dotnet Test Project 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.

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

Similar skills

  • 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
  • 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
  • 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 17 days ago
    Testing & QAAuto-check passed

More from microsoft/testfx

All 54 skills in this repo
  • Find Untested Sources

    microsoft/testfx

    Official

    MANDATORY for static source-to-test pairing: find or list source files/modules without corresponding tests, or suggest test locations from repository structure.

    1k GitHub starsUsed in 2 repos~3.3k tokens
    Auto-check passed
  • Coverage Analysis

    microsoft/testfx

    Official

    Activation requires either supplied .NET coverage reports/percentages/line, branch, or condition metrics, or an explicit request to collect .NET coverage for analysis.

    1k GitHub starsUsed in 2 repos~2.8k tokens
    Auto-check passed
  • Csharp Refactoring

    microsoft/testfx

    Official

    Safely refactors C/.NET code without changing behavior. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 2 repos~3.1k tokens
    Auto-check passed
  • Platform Detection

    microsoft/testfx

    Official

    Identify a .NET project's test platform, framework, command mode, and SDK-style vs classic project system.

    1k GitHub starsUsed in 2 repos~3.3k tokens
    Auto-check passed
  • Official

    Validate TestFx shipping paths and capable CI execution using packed consumers, package/cache provenance, exact exits and artifacts, and selected-versus-executed test evidence.

    1k GitHub stars~5k tokensUpdated today
    Auto-check passed
  • Writing Mstest Tests

    microsoft/testfx

    Official

    ALWAYS USE when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration.

    1k GitHub starsUsed in 2 repos~5k tokens
    Auto-check passed

Works with

Categories

Questions about Scaffold Dotnet Test Project

What does Scaffold Dotnet Test Project do?

MUST USE when an existing .NET test project was excluded from a .slnf/CI solution filter, disappeared from .sln/.slnx discovery, or lost its production ProjectReference; also for requests to set up…. Scaffold Dotnet Test Project is an agent skill from microsoft/testfx, published by the product's own GitHub organization.slnx discovery, or lost its production ProjectReference; also for requests to set up, create, reuse, add, register, include, or repair a test project.

When should I use Scaffold Dotnet Test Project?

Scaffold Dotnet Test Project fits situations like: an existing .NET test project was excluded from a .slnf/CI solution filter; disappeared from .sln/.slnx discovery; lost its production ProjectReference; also for requests to set up.

How do I install Scaffold Dotnet Test Project in Claude Code?

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

How do I install Scaffold Dotnet Test Project in Codex?

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

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

What does Scaffold Dotnet Test Project need to run?

Going by SKILL.md and its folder, Scaffold Dotnet Test Project needs the command-line tools its instructions call (dotnet).

Does Scaffold Dotnet Test Project 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 Scaffold Dotnet Test Project 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 Scaffold Dotnet Test Project use?

Scaffold Dotnet Test Project 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 Scaffold Dotnet Test Project use?

About 3.4k tokens (SKILL.md is roughly 14k 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 Scaffold Dotnet Test Project?

Skills that share tags, products or a category with Scaffold Dotnet Test Project: ScottPlot Test Runner (ScottPlot/ScottPlot, 6.8k stars), Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars), New Event Source (aws/aws-lambda-dotnet, 1.7k 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 Scaffold Dotnet Test Project?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 54 skills in this directory. The repository was last updated on October 9, 2026.

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