code-testing
What it does
This skill writes new tests, fixes broken or flaky tests, and adds regression tests for existing code. It is for developers who need better test coverage without setting it up by hand.
When to use it
- ✓When you need new tests for code that has none, or a test that stops a bug from coming back.
- ✓When existing tests fail, are flaky or need stronger checks.
- ✓When you want coverage gaps filled in a project that uses a supported test framework.
Skill link
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/code-testing/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Add tests for my payment service, including a regression test for the refund bug we fixed last week.”
5 new skills a week. 1 minute to read.
How it works
The agent reads the code and existing tests, chooses the right style for the framework, writes the cases, and runs them. Broad work is planned in stages first.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Code Testing Skill
The reliable implicit entry point for generating, repairing, and strengthening
tests. It handles focused work directly and invokes the public test-engineer
agent for broad or multi-stage requests.
Non-negotiable execution contract
Check pipeline ownership first. If the active agent is
test-engineer (including a plugin-qualified name such as
dotnet-test:test-engineer), or the caller assigned you a phase of
that pipeline, do not delegate to another generator. Continue the assigned
work inline. This guard takes precedence over every broad-scope delegation
instruction below, even if this skill was loaded automatically.
Classify scope before editing:
- Broad (a project/package-wide suite, or multiple production
files/modules): create
research.mdandplan.mdin a resolved non-stageable<TESTAGENT_DIR>before implementation, thenstatus.mdthere after the final test-quality review. Whentest-engineeris available, invoke that named custom agent before implementing; do not replace it with a generic subagent carrying the same label or implement the broad request inline. If the state files are absent, the broad workflow is incomplete. - Focused (the user explicitly limits work to one function/class/file or one missing method): do not create intermediate state files or fan out to multiple agents. A sparse project-wide request remains broad even when only one source module is present.
For either scope, run the narrowest relevant test command to a clean exit.
Always apply Report-safe test names and result validation,
including when the caller supplies conventions. Pass this contract to delegated
implementers/testers; preserve edge-case data and validate configured reports,
not just console output.
Keep the handoff proportional: for one to three focused requirements, use a
compact bullet list under a Requirement coverage label that names the tests
and successful command; for broader or multi-requirement work, use a
Requirement | Evidence table. Each requested behavior must cite an exact test
name.
Before sending a broad-scope final response, check that the response itself
contains | Requirement | Evidence | and exact test names for every behavioral
row. A table in a child report or internal plan is not enough. Do not summarize
away those names into module-level bullets or an Area | Tests table.
Intermediate state files are internal working data, never deliverables. Keep
<TESTAGENT_DIR> non-stageable, never place it or its files in
version-controlled workspace content, and never modify .gitignore to hide
them.
Treat completeness as a requirement matrix, not a test-count target. Give every independently requested state, boundary, error path, or interaction its own concrete assertion. Combine cases only when one execution genuinely proves the whole requested combination; do not let a parameterized happy-path case stand in for an empty state, invalid discriminator, or before/at/after boundary. For broad requests that name several production modules or layers, give each named module direct tests for its non-trivial public behavior. Cross-module tests prove composition, but do not substitute for the requested module-level coverage. Judge breadth by the behavior matrix, never by matching or exceeding a raw test count.
At the public entry point, delegate broad work to test-engineer
once. Research, plan, implementation, and review remain required, but they
need not be separate sub-agent calls.
Use only capabilities available in the current runtime. Do not retry a missing
skill under aliases or use another agent to retry a policy-denied operation.
Read language guidance directly from the caller-provided or runtime-listed
code-testing-extensions catalog and its matching language file. It is reference-only,
not an invocable skill. If the bundle is absent, use manifests and representative
tests and report the missing reference rather than searching installation dirs.
If scratch storage is denied, keep the research and plan in context, continue
permitted test edits, and report the missing state artifacts. If execution is
denied, continue permitted static review and report tests as unrun, never passed.
Neither blocker authorizes modifying production code or weakening requirements.
For a broad or comprehensive request, the explicit matrix is the floor, not the
FAQ
Does it only run tests?
No. It writes and repairs tests. Running tests on their own is a separate skill.
Will it plan large jobs first?
Yes. Broad or multi-stage work is planned and recorded before the tests are written.
Which frameworks does it support?
It works with xUnit, MSTest, NUnit, pytest, Jest, Vitest, Go and other frameworks.
Details
Original description by the author
ALWAYS USE for test work that requires changes: write, add, generate, repair, or strengthen tests for existing code in xUnit, MSTest, NUnit, pytest, Vitest/Jest, Go, or another framework. Includes regression cases, failing or flaky tests, coverage-driven additions, and audit-then-fix requests. Focused work stays direct; broad or multi-stage work invokes test-engineer. DO NOT USE for only running tests, analysis-only audits, framework/platform migrations, a test blocked on a missing production seam (testability-obstacle), or MSTest API/configuration corrections that do not design new cases (wri
repo: dotnet/skills
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14624
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
create-custom-agent
5.8kHelps your agent create VS Code custom agent files with their own tools, instructions and handoffs to other agents.
create-skill
5.8kHelps your agent create a new agent skill with a valid name, a clear trigger description and a SKILL.md file that follows the standard.
csharp-scripts
5.8kHelps your agent run a small C# program as a single file with the .NET command line tool, without creating a full project.
dotnet-pinvoke
5.8kHelps your agent call native C or C++ libraries from .NET correctly, covering signatures, string handling, memory and safe handles.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.