csharp-scripts
Run file-based C# apps with the .NET CLI when the user explicitly wants C#/.NET code without creating a project. Use for C#…
Audit a test file or suite; produce a severity-ranked diagnostic report. ALWAYS USE for tests that verify nothing, missing/tautological assertions, swallowed/broad exceptions, flaky/order-dependent tests, duplication, or magic values. Polyglot. DO NOT USE for direct edits:
Claude Code
$ npx -y skills add dotnet/skills --skill test-anti-patterns --agent claude-code
Codex
$ npx skills add dotnet/skills --skill test-anti-patterns -a codex -y
Cursor
$ npx skills add dotnet/skills --skill test-anti-patterns -a cursor -y
Gemini CLI
$ npx skills add dotnet/skills --skill test-anti-patterns -a gemini-cli -y
GitHub Copilot
$ npx skills add dotnet/skills --skill test-anti-patterns -a github-copilot -y
OpenCode
$ npx skills add dotnet/skills --skill test-anti-patterns -a opencode -y
Windsurf
$ npx skills add dotnet/skills --skill test-anti-patterns -a windsurf -y
name: test-anti-patterns description: > Audit a test file or suite; produce a severity-ranked diagnostic report. ALWAYS USE for tests that verify nothing, missing/tautological assertions, swallowed/broad exceptions, flaky/order-dependent tests, duplication, or magic values. Polyglot. DO NOT USE for direct edits: writing-mstest-tests owns supplied MSTest assertions/attributes/lifecycle; code-testing owns new tests. Exclude running tests, migration, assertion metrics (assertion-quality), raw .NET coverage collection (run-tests), non-.NET coverage collection/analysis (native tooling), project-wide .NET coverage/CRAP (coverage-analysis), named-target .NET CRAP (crap-score), behavioral/pseudo-mutation gaps (test-gap-analysis), test-mix/ happy-vs-error classification and trait distributions (test-tagging), or the testsmells.org catalog (test-smell-detection). license: MIT
Quick, pragmatic analysis of test code in any supported language for anti-patterns and quality issues that undermine test reliability, maintainability, and diagnostic value.
> **Language-specific guidance**: Read the caller-provided or runtime-listed > `test-analysis-extensions` catalog and its matching language file when needed. > Do not invoke the reference-only > helper. If its files are absent, use the built-in framework rules below.
| Input | Required | Description | |-------|----------|-------------| | Test scope | No | Test files, classes, directory, or project to analyze. Discover from the current workspace when omitted. | | Production code | No | The code under test, for context on what tests should verify | | Specific concern | No | A focused area like "flakiness" or "naming" to narrow the review |
Resolve the named test path from the current workspace before asking for input. When no path is supplied, discover test files under the current directory using the repository manifests and conventional test markers. The skill context's `Base directory` is documentation storage, not the user's workspace; never resolve target files relative to it.
If one reader says a path is missing but a workspace glob/search finds it, normalize that exact path and retry. Use a shell text reader (`sed`/`cat` on Unix, `Get-Content` on PowerShell) only for a confirmed reader availability, transport, or path-normalization failure and only after verifying the canonical path remains inside the current workspace. Stop on content-exclusion, permission/policy, workspace-boundary, or unknown failures. Audit any discovered file that a permitted reader can access; never ask the user to paste it. If every permitted reader fails, report the exact blocker without bypassing security boundaries.
Identify the language and framework. Read the matching bundled reference when needed, resolving its filename relative to the supplied catalog. Check only that known reference directory, never installation directories. If unavailable, use the catalog below and report the reference limitation.
Inventory the resolved scope before reading bodies. For one file or class, read that scope directly. For a project or suite, discover test files once, batch independent reads where tools allow, and stop when every discovered test and class-level fixture has a ledger disposition.
Use extension discovery markers when loaded; otherwise use the built-in markers in this skill (attributes such as `[TestClass]`/`[Fact]`/`[Test]`, `test_*.py`, `*.test.*`, `*_test.go`, `*_spec.rb`, `#[test]`, `*.Tests.ps1`, `TEST(...)`, and `TEST_CASE(...)`).
Do not read unrelated production code wholesale. Open the production symbol corresponding to every suspicious test needed to decide whether an assertion, transformation, identity contract, or adjacent gap is real. For a systematic facade/surface-area pattern, every invoked member is relevant: read the entire small production type or inspect each invoked member, then map each weak test to the exact observable result, exception, state change, or boundary it should verify.
Check each test file against the anti-pattern catalog below. Report findings grouped by severity. Use extension mappings when loaded; otherwise use the cross-framework examples in the catalog.
Before drafting the report, make a private completeness ledger with one row for every test method and every class-level fixture/resource. R
This repository contains the .NET team's curated set of portable skills and host-specific custom agents for coding agents. For information about the Agent Skills standard, see agentskills.io.
Run file-based C# apps with the .NET CLI when the user explicitly wants C#/.NET code without creating a project. Use for C#…
Correctly call native (C/C++) libraries from .NET using P/Invoke and LibraryImport. Covers function signatures, string…
Set up NuGet trusted publishing (OIDC) on a GitHub Actions repo — replaces long-lived API keys with short-lived tokens. USE FOR:…
Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives,…
Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET,…
Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.