Best for
- Generate unit tests for an entire project or specific files
- Improve test coverage for existing codebases
- Create test files that follow project conventions
dotnet/skills/plugins/dotnet-test/skills/code-testing-agent/SKILL.md
MANDATORY ENTRY POINT for generating or writing tests. Invoke this skill before editing files whenever the user asks to generate tests, write/add unit tests, scaffold a test project or suite, improve/achieve coverage, extend an existing suite to cover an untested method, or test an app, API, service, module, library, or package. Applies to a single function, method or file as much as to a whole project — scope changes how much of the workflow runs, never whether the skill applies. Invoke it when
Decision brief
An AI-powered skill that generates comprehensive, workable unit tests for any programming language using a coordinated multi-agent pipeline.
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/code-testing-agent"Inspect the Agent Skill "code-testing-agent" from https://github.com/dotnet/skills/blob/805a42a675a47f14fdd77a54aa474fcb8e499b9e/plugins/dotnet-test/skills/code-testing-agent/SKILL.md at commit 805a42a675a47f14fdd77a54aa474fcb8e499b9e. 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
Make sure you understand what user is asking and for what scope. When the user does not express strong requirements for test style, coverage goals, or conventions, source the guidelines from unit-test-generation.prompt.md. This prompt provides best practices for discovering conv…
Make sure you understand what user is asking and for what scope. When the user does not express strong requirements for test style, coverage goals, or conventions, source the guidelines from unit-test-generation.prompt.md. This prompt provides best practices for discovering conv…
Match the machinery to the scope. Running the full pipeline on a one-file request costs turns and tool calls without improving the tests.
Start by calling the code-testing-generator agent with your test generation request:
For multi-file requests:
Permission review
The documentation asks the agent to run terminal commands or scripts.
| **Focused** | One function, class, or file; "tests for X only"; extending an existing suite with the missing cases | Skip the `.testagent/` artifacts and the sub-agent fan-out. Keep the requirement checklist in your head (or in the final The documentation asks the agent to read local files, directories, or repositories.
The `code-testing-fixer` agent will attempt to resolve compilation errors. Check `.testagent/plan.md` for the expected test structure. Call the `code-testing-extensions` skill and read the language-specific extension file for error code refEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 92/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 4,922 | 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
An AI-powered skill that generates comprehensive, workable unit tests for any programming language using a coordinated multi-agent pipeline.
Use this skill when you need to:
run-tests skill)writing-mstest-tests)This skill coordinates multiple specialized agents in a Research → Plan → Implement pipeline:
┌─────────────────────────────────────────────────────────────┐
│ TEST GENERATOR │
│ Coordinates the full pipeline and manages state │
└─────────────────────┬───────────────────────────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────────┐
│ RESEARCHER│ │ PLANNER │ │ IMPLEMENTER │
│ │ │ │ │ │
│ Analyzes │ │ Creates │ │ Writes tests │
│ codebase │→ │ phased │→ │ per phase │
│ │ │ plan │ │ │
└───────────┘ └───────────┘ └───────┬───────┘
│
┌─────────┬───────┼───────────┐
▼ ▼ ▼ ▼
┌─────────┐ ┌───────┐ ┌───────┐ ┌───────┐
│ BUILDER │ │TESTER │ │ FIXER │ │LINTER │
│ │ │ │ │ │ │ │
│ Compiles│ │ Runs │ │ Fixes │ │Formats│
│ code │ │ tests │ │ errors│ │ code │
└─────────┘ └───────┘ └───────┘ └───────┘
Make sure you understand what user is asking and for what scope. When the user does not express strong requirements for test style, coverage goals, or conventions, source the guidelines from unit-test-generation.prompt.md. This prompt provides best practices for discovering conventions, parameterization strategies, coverage goals (aim for 80%), and language-specific patterns.
Match the machinery to the scope. Running the full pipeline on a one-file request costs turns and tool calls without improving the tests.
| Scope | What it looks like | How to run it |
|---|---|---|
| Focused | One function, class, or file; "tests for X only"; extending an existing suite with the missing cases | Skip the .testagent/ artifacts and the sub-agent fan-out. Keep the requirement checklist in your head (or in the final table), read only the target and one neighbouring test for conventions, write the tests, run the narrowest test command, review your own assertions inline. |
| Broad | A project, package, or module set; "comprehensive suite"; a coverage threshold to clear across several files | Run the full Research → Plan → Implement pipeline in Step 3, with the .testagent/ artifacts and the completion contract below. |
When in doubt, start focused and escalate only if the request turns out to span several files. Escalating costs one extra pass; running the broad pipeline on a focused request costs several.
Start by calling the code-testing-generator agent with your test generation request:
Generate unit tests for [path or description of what to test], following the [unit-test-generation.prompt.md](unit-test-generation.prompt.md) guidelines. Treat the current workspace as authoritative even when it is sparse, gutted-looking, synthetic, or missing tracked files; never restore or reconstruct it.
The Test Generator will manage the entire pipeline automatically.
If code-testing-generator is unavailable, do not skip the workflow. Execute the
same Research → Plan → Implement sequence inline, create the .testagent/
artifacts described below, and apply the same completion contract.
For multi-file requests:
.testagent/research.md.find-untested-sources once and consume its pairing and suggested-path output; do not repeat that discovery manually.code-testing-extensions only when the repository has no representative tests and the base extension is insufficient.Every scope must satisfy points 3–5 below. Points 1 and 2 are the broad-scope
artifacts: on a focused request the same reasoning happens inline and no
.testagent/ files are written.
Do not report completion until all of these are true:
.testagent/research.md records the bounded target
inventory, existing test conventions, and the acceptance checklist..testagent/plan.md maps each checklist item to a planned
test or an explicit blocker.test-gap-analysis and assertion-quality when available and
record the findings and fixes in .testagent/status.md. On a focused scope,
do the equivalent review inline — re-read each generated assertion against
the source — without spawning extra passes.The final response MUST include a compact Requirement | Evidence table.
Behavioral rows cite exact generated test names. Non-behavioral rows cite the
relevant project file, validation command, or coverage report. A generic list
of tested areas is not a substitute for requirement-by-requirement evidence.
Quote the user's requirement verbatim in each row. When the request names a specific combination — "a case where a composite discount, regional tax, and weight-based shipping all apply", "the difference between summed and chained discounts", "constructor validation for every class" — the row must cite the one test that demonstrates exactly that. A test that merely exercises the same collaborators does not satisfy a requirement about their interaction, and per-class requirements need a citation per class.
Cite a clean run, not an attempt. The commands behind the evidence table must have finished successfully: quote the final passing test summary and, when thresholds were requested, the per-module coverage table from a run that exited 0. If the last coverage run exited non-zero, fix it and re-run before reporting; never infer threshold clearance from a failed or partial run.
Broad-scope runs store pipeline state in the .testagent/ folder. A focused
request does not create these files:
| File | Purpose |
|---|---|
.testagent/research.md | Codebase analysis results |
.testagent/plan.md | Phased implementation plan |
.testagent/status.md | Progress tracking (optional) |
| Agent | Purpose |
|---|---|
code-testing-generator | Coordinates pipeline |
code-testing-researcher | Analyzes codebase |
code-testing-planner | Creates test plan |
code-testing-implementer | Writes test files |
code-testing-builder | Compiles code |
code-testing-tester | Runs tests |
code-testing-fixer | Fixes errors |
code-testing-linter | Formats code |
The code-testing-fixer agent will attempt to resolve compilation errors. Check .testagent/plan.md for the expected test structure. Call the code-testing-extensions skill and read the language-specific extension file for error code references (e.g., dotnet.md for .NET).
Most failures in generated tests are caused by wrong expected values in assertions, not production code bugs:
[Ignore] or [Skip] just to make them passSpecify your preferred framework in the initial request: "Generate Jest tests for..."
Tests that depend on external services, network endpoints, specific ports, or precise timing will fail in CI environments. Focus on unit tests with mocked dependencies instead.
During phase implementation, build only the specific test project for speed. After all phases, run a full non-incremental workspace build to catch cross-project errors.
Alternatives
dotnet/skills
Analyzes test suites in any language and tags each test with standardized traits (positive, negative, critical-path, boundary, smoke, regression, integration, performance, security). Use when the user wants to categorize, audit, or label tests with traits. Works across .NET (MSTest/xUnit/NUnit/TUnit), Python (pytest), TS/JS (Jest/Vitest), Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++ — auto-editing when the framework has canonical tag syntax, otherwise report-only. Do not use for writ
K-Dense-AI/scientific-agent-skills
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.
dotnet/skills
MANDATORY for static requests to find, identify, or list untested source files or modules, sources without tests, source-to-test pairing, test-gap worklists, or suggested test locations. Invoke even for a tiny package; do not substitute manual globbing. Uses Roslyn for C#/.NET and tree-sitter for Python, TS/JS, Go, Java, Rust, and Ruby. DO NOT USE FOR: line/branch coverage, CRAP risk, or grading existing tests.
dotnet/skills
Grades a specified set of test methods individually and produces a concise table mapping each test (fully-qualified name) to a letter grade (A–F), a score band, and a one-line note — designed to be posted as a PR comment. Use when the caller wants per-test feedback on a curated list of methods (for example, the new or modified tests in a pull request), not a suite-wide audit. Polyglot: .NET, Python, TS/JS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. Input is a list of test methods (or