Agent skill · Security

test-anti-patterns

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, Rub

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill test-anti-patterns --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 20 KB
Bundled scripts: none
Path: plugins/dotnet-test/skills/test-anti-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

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); the testsmells.org academic catalog (use test-smell-detection); fixing or modernizing MSTest tests, assertions, attributes, or lifecycle (use writing-mstest-tests).

How it works

  • Identify language and test framework, then load a language-specific extension via the skill workflow to map anti-pattern markers.
  • Gather the test code to analyze, optionally including production code for context.
  • Scan each test file against the anti-pattern catalog, reporting findings grouped by severity (Critical, High, Medium, Low).
  • The catalog includes patterns like no assertions, missing await on async assertions, coverage-touching, self-referential assertions, swallowed exceptions, Assert in catch, always-true assertions, commented-out assertions, flakiness indicators (sleeps, time-based reads), test ordering dependencies, over-mocking, implementation coupling, and broad exception assertions.
  • Provide a calibrate-severity step to ensure findings match per-language nuance and the guidance on when issues are considered not an issue (e.g.,table-driven tests in Go/Rust, pytest bare asserts, etc.).
  • Output a structured report with each finding categorized under the appropriate severity and language context.

When to use it

  • User asks to review test quality or find test smells.
  • 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.

What it can touch

  • The skill analyzes Test code and may reference extension files for language-specific checks. It relies on language-appropriate markers and patterns loaded via the extension file to identify anti-patterns.

Caveats

  • The skill does not perform test execution or code fixes; it provides diagnostic findings and severity-based guidance only.
  • It does not guarantee identification of all possible smells; results depend on the loaded language extension mappings and the provided test inputs.
From the SKILL.md

# Test Anti-Pattern Detection 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**: Call the `test-analysis-extensions` skill to discover available extension files, then read the file matching the target codebase (e.g., `extensions/dotnet.md`, `extensions/python.md`, `extensions/typescript.md`, `extensions/go.md`). The extension file tells you which sleep / time / random / skip / setup-teardown / mystery-guest APIs to look for in that language. ## When to Use - User asks to review test quality or find test smells - 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 ## 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 direct implementation fixes rather than a diagnostic review (use the relevant write/edit skill) - User asks to fix swapped `Assert.AreEqual` a

What's inside
Steps it walks through
  1. When to Use
  2. When Not to Use
  3. Inputs
  4. Workflow
  5. Step 1: Detect language and load extension
  6. Step 2: Gather the test code
  7. Step 3: Scan for anti-patterns
  8. Step 4: Calibrate severity honestly
  9. Step 5: Report findings
  10. Step 6: Prioritize recommendations
  11. Validation
  12. Common Pitfalls
More from skills
All skills →
About this skill
What does the test-anti-patterns skill do?

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, Rub

How do I install it?

Run `npx skills add dotnet/skills --skill test-anti-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going