Improve MSTest skill routing and eval quality (#1054)

* Improve MSTest skill routing and eval

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address MSTest eval review feedback

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bb7d3fa4-c617-4522-ace3-eab65915af34

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bb7d3fa4-c617-4522-ace3-eab65915af34
This commit is contained in:
Amaury Levé
2026-08-25 15:58:28 +02:00
committed by GitHub
parent ba4f404911
commit 5055e54a57
6 changed files with 147 additions and 151 deletions
@@ -1,6 +1,6 @@
---
name: assertion-quality
description: "MANDATORY for reviewing assertion strength, depth, and variety in existing tests. Invoke when the user asks whether individual assertions are weak, shallow, trivial, always true, self-referential, or diverse; asks which tests are assertion-free or rely only on presence/truthiness checks; or requests assertion quality/depth/variety metrics. Polyglot: .NET, Python/pytest, TS/JS/Jest, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. DO NOT USE FOR: writing or fixing tests/assertions (use code-testing-agent or writing-mstest-tests), mutation reasoning (use test-gap-analysis), or a general severity-ranked anti-pattern audit (use test-anti-patterns)."
description: "Produce an assertion-quality report or metrics for existing tests. ALWAYS USE when asked whether assertions are weak, shallow, trivial, always true, self-referential, or diverse; which tests are assertion-free or use only presence/truthiness checks; or for depth/variety metrics. Polyglot. DO NOT USE for direct fixes: use writing-mstest-tests for supplied MSTest assertions, or code-testing-agent when new cases must be designed. Do not use for mutation reasoning (test-gap-analysis) or a general severity-ranked audit (test-anti-patterns)."
license: MIT
---
@@ -1,15 +1,14 @@
---
name: code-testing-agent
description: >-
Generate or add unit tests for existing code, from one function to a complete
project-wide suite. ALWAYS USE when asked to "write unit tests", "add tests",
"generate tests", "cover this untested method", scaffold tests where none
exist, or create comprehensive tests across multiple modules or packages.
Polyglot: C#/.NET, Python/pytest, TS/JS, Go, Rust, Java, Ruby. Handles classic
non-SDK/packages.config MSTest projects, explicit Compile registration, sparse
workspaces, existing-suite extension, and proportional focused work. DO NOT USE
for only running/diagnosing tests, analyzing a coverage report, auditing test
quality, or answering an MSTest API question without writing tests.
Generate or add unit tests for existing code, from one function to a
project-wide suite. ALWAYS USE for "write/add/generate tests", "cover this
untested method", scaffolding tests where none exist, or comprehensive suites.
Polyglot; supports classic packages.config MSTest, sparse workspaces, and
proportional focused work. DO NOT USE for only running/diagnosing tests,
coverage/audits, or correcting supplied MSTest assertions, attributes,
lifecycle, or configuration without designing new cases
(writing-mstest-tests).
license: MIT
---
@@ -1,11 +1,11 @@
---
name: scaffold-dotnet-test-project
description: >-
Create the first .NET test project. USE FOR: "solution has no tests",
xUnit tests, Tests.csproj/ProjectReference, add an omitted test project to
.sln/.slnx/.slnf, central packages, or tests missing from CI. DO NOT USE FOR:
a suitable project already registered in the requested build entry point
(stop) or migration.
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).
license: MIT
---
@@ -1,21 +1,14 @@
---
name: test-anti-patterns
description: >
Audits an existing test file or suite in any language for anti-patterns
and quality issues — produces a severity-ranked report
(Critical/Warning/Info). INVOKE whenever asked to audit or review tests,
find what's wrong with a suite, judge whether tests are any good, or
check for: tests that pass but verify nothing, missing assertions,
swallowed exceptions, self-comparing / tautological assertions,
coverage-touching tests, broad exceptions, flaky or order-dependent tests
(Thread.Sleep, DateTime.Now, shared state), duplicated tests, or magic
values — in .NET, Python/pytest, TS/Jest, Java, Go, Ruby or C++. DO NOT
USE FOR: writing new tests (use code-testing-agent, or writing-mstest-tests
for MSTest); running tests (use
run-tests); migration; assertion-diversity metrics (use assertion-quality);
coverage/CRAP metrics (use coverage-analysis); the testsmells.org academic
catalog (use test-smell-detection); fixing or modernizing MSTest tests,
assertions, attributes, or lifecycle (use writing-mstest-tests).
Audit an existing test file or suite and produce a severity-ranked diagnostic
report. ALWAYS USE for findings about tests that verify nothing, missing or
tautological assertions, swallowed/broad exceptions, flaky or order-dependent
tests, duplication, or magic values. Polyglot. DO NOT USE for direct edits:
use writing-mstest-tests for supplied MSTest assertions, attributes, or
lifecycle, and code-testing-agent for new tests. Do not use for running tests,
migration, assertion metrics (assertion-quality), coverage/CRAP metrics, or
the testsmells.org catalog (test-smell-detection).
license: MIT
---
@@ -31,11 +24,11 @@ Quick, pragmatic analysis of test code in any supported language for anti-patter
- User wants to know why tests are flaky or unreliable
- User asks "are my tests good?" or "what's wrong with my tests?"
- User requests a test audit or test code review
- User wants to improve existing test code
- User wants diagnostic findings before deciding what to improve
## When Not to Use
- User wants to write new tests from scratch (use `code-testing-agent` for any language, or `writing-mstest-tests` for MSTest specifically)
- User wants to write new tests from scratch (use `code-testing-agent`)
- User wants direct implementation fixes rather than a diagnostic review (use the relevant write/edit skill)
- User asks to fix swapped `Assert.AreEqual` argument order in MSTest (use `writing-mstest-tests`)
- User asks to convert MSTest `DynamicData` from `IEnumerable<object[]>` to `ValueTuple` (use `writing-mstest-tests`)
@@ -1,16 +1,16 @@
---
name: writing-mstest-tests
description: >
Review, modernize, fix, or explain MSTest APIs using the installed version,
including classic non-SDK packages.config projects and older MSTest 3.x.
ALWAYS USE to "fix swapped Assert.AreEqual arguments", "replace
ExpectedException with Assert.Throws/ThrowsExactly", choose specific assertions,
fix StringAssert/CollectionAssert/IsInstanceOfType, modernize DataRow or
DynamicData, configure lifecycle/TestContext/cancellation/retry/parallelization,
set up MSTest.Sdk, or fix MSTESTxxxx diagnostics. Preserves FixtureBase,
Moq/NBuilder, project format, and package versions unless migration is requested.
DO NOT USE for generating new tests (code-testing-agent), audits, running tests,
framework migration, xUnit/NUnit/TUnit, or non-.NET.
Fix, modernize, review, or explain supplied MSTest code and MSTest-specific
configuration while honoring installed versions and project style. ALWAYS USE
for direct corrections: expected/actual order; generic/manual assertions;
exception, hard-cast, or object[] patterns; TestContext/lifecycle;
timeout/cancellation; condition/retry/cleanup; parallelization; MSTest.Sdk
setup; or MSTESTxxxx. Use for "review" only when corrected code or edits are
wanted. DO NOT USE for new test-case design (code-testing-agent), report-only
audits/metrics (test-anti-patterns or assertion-quality), creating/wiring a
first test project (scaffold-dotnet-test-project), running tests, migration,
non-MSTest frameworks, or non-.NET.
license: MIT
---