Best for
- A .NET solution or project has production code but no suitable test project.
- A user asks to "set up tests" or "add a test project" from a vague starting point.
- Tests pass when the new .csproj is targeted directly but CI cannot discover it.
dotnet/skills/plugins/dotnet-test/skills/scaffold-dotnet-test-project/SKILL.md
Create and wire the first .NET test project. USE FOR: "solution has no tests", Tests.csproj/ProjectReference, solution registration, central packages, or tests missing from CI. DO NOT USE when a suitable project exists, for migration, or for MSTest API/attribute/MSTest.Sdk/parallelization advice without a request to create and wire files (writing-mstest-tests).
Decision brief
Create the smallest test project that fits the repository's existing build and test conventions, wire it to the correct production project and build entry point, and prove solution-level test discovery sees it. This skill scaffolds the container for tests; it does not invent a s…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/dotnet/skills --skill "plugins/dotnet-test/skills/scaffold-dotnet-test-project"Inspect the Agent Skill "scaffold-dotnet-test-project" from https://github.com/dotnet/skills/blob/1b896e91feb0f613cb54a914f1efd2897810ae02/plugins/dotnet-test/skills/scaffold-dotnet-test-project/SKILL.md at commit 1b896e91feb0f613cb54a914f1efd2897810ae02. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Inspect only the files needed to answer these questions:
Inspect only the files needed to answer these questions:
Default to one test project per production project, named according to repository convention (Foo.Tests, Foo.UnitTests, and so on). For a vague multi-project request, start with the project that owns the user-visible behavior or has the highest-value untested logic; do not creat…
Use the matching dotnet new template (xunit, nunit, or mstest) rather than hand-writing template boilerplate. Then make only the repository-specific edits:
Creating a .csproj is not enough. Add it to the exact solution artifact used by the repository:
Permission review
The documentation asks the agent to read local files, directories, or repositories.
references. Inspect the resulting project file before continuing.The documentation asks the agent to run terminal commands or scripts.
| Creating a project that CI never sees | Register it with the exact solution/filter used by CI and run that command |The documentation asks the agent to run terminal commands or scripts.
| Treating a green build as test discovery | Run the harness-level test command and observe the test |Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 5,248 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Create the smallest test project that fits the repository's existing build and test conventions, wire it to the correct production project and build entry point, and prove solution-level test discovery sees it. This skill scaffolds the container for tests; it does not invent a solution-wide test architecture.
.csproj is targeted directly but CI cannot discover it.code-testing-agent.writing-mstest-tests after the project exists.| Input | Required | Description |
|---|---|---|
| Repository or solution path | No | Discover from the current workspace when omitted |
| Production project | No | Infer the narrowest project in the requested scope |
| Test framework | No | Use an explicit choice; otherwise infer repository convention |
| Build entry point | No | Existing .sln, .slnx, .slnf, or project graph used by CI |
Inspect only the files needed to answer these questions:
Directory.Packages.props,
Directory.Build.props, global.json, or an MSBuild SDK declaration?Treat a test project as suitable only when its target framework can reference the production project and its purpose matches the requested layer. Do not create a second test project merely because its name differs from your preferred name.
No-op stop condition: when a suitable project already exists and is registered in the requested build entry point, do not repair, normalize, convert, or replace the solution. If the user did not ask for tests yet, report the existing project path and stop with the workspace byte-for-byte unchanged.
Default to one test project per production project, named according to repository
convention (Foo.Tests, Foo.UnitTests, and so on). For a vague multi-project
request, start with the project that owns the user-visible behavior or has the
highest-value untested logic; do not create one test project per source project
without evidence that the repository wants that layout.
Match, in order:
Never mix frameworks in one test project. Never add package versions directly when central package management supplies them.
Use the matching dotnet new template (xunit, nunit, or mstest) rather than
hand-writing template boilerplate. Then make only the repository-specific edits:
ProjectReference to each production project directly exercised by
the planned tests. Do not reference every project in the solution.For xUnit v3 projects that the repository runs through dotnet test, preserve or
add both:
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
OutputType=Exe alone makes the self-hosted runner work with dotnet run; it is
not evidence that the repository's dotnet test command can discover the tests.
Prefer dotnet add <test-project> reference <production-project> for project
references. Inspect the resulting project file before continuing.
Creating a .csproj is not enough. Add it to the exact solution artifact used by
the repository:
.sln or .slnx: dotnet sln <solution> add <test-project>.slnf: add the project to the underlying solution and include it in the
filter used by the requested/CI test command.Do not substitute a different solution file because it is easier to edit.
Replace template examples with the smallest smoke suite requested. The tests must:
These tests prove the project reference and discovery path. Stop after every
behavior explicitly named by the user is covered; extra boundary permutations
are out of scope here and belong to code-testing-agent.
Run, in this order:
dotnet test <test-project> to isolate scaffolding failures.If the direct command passes but the harness-level command discovers no new
test, the scaffolding is incomplete. Fix registration before reporting success.
Do not claim success from dotnet build alone.
Report a compact table:
| Requirement | Evidence |
|---|---|
| Test project created/reused | Project path |
| Production reference | Referenced .csproj path |
| Build registration | .sln/.slnx/.slnf entry or project-oriented command |
| Test discovery | Passing harness-level command and discovered test |
If validation is blocked, report the exact failing command and first actionable error. Do not describe an unrun command as successful.
| Pitfall | Corrective action |
|---|---|
| Creating a project that CI never sees | Register it with the exact solution/filter used by CI and run that command |
| Picking a favorite framework | Infer the repository convention before using a default |
| Adding package versions under CPM | Add versionless references and keep versions in Directory.Packages.props |
| Referencing the whole solution | Reference only projects whose APIs the tests compile against |
Keeping UnitTest1 | Replace it with a concrete test of repository behavior |
| Creating parallel unit/integration projects from a vague ask | Start with one bounded project; expand only for a demonstrated boundary |
| Treating a green build as test discovery | Run the harness-level test command and observe the test |
Frequently asked questions
Create the smallest test project that fits the repository's existing build and test conventions, wire it to the correct production project and build entry point, and prove solution-level test discovery sees it. This skill scaffolds the container for tests; it does not invent a s…
The source record exposes this install command: npx skills add https://github.com/dotnet/skills --skill "plugins/dotnet-test/skills/scaffold-dotnet-test-project". Inspect the command and pinned source before running it.
Static rules flagged read-files, exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
vipshop/cache-dit
High-level guide for integrating a new DiT model into cache-dit: Cache (BlockAdapter/ForwardPattern), Context Parallelism, Tensor Parallelism, Text Encoder Parallelism (TE-P), VAE Parallelism (VAE-P), generate CLI, installation, testing workflow, and detailed references. Use when adding support for a new diffusion transformer model in cache-dit.