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
npx skills add dotnet/skills --skill test-anti-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
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.
# 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
- When to Use
- When Not to Use
- Inputs
- Workflow
- Step 1: Detect language and load extension
- Step 2: Gather the test code
- Step 3: Scan for anti-patterns
- Step 4: Calibrate severity honestly
- Step 5: Report findings
- Step 6: Prioritize recommendations
- Validation
- Common Pitfalls
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.
