test-anti-patterns

Detects anti-patterns in .NET test code and reports severity-ranked findings with fixes.

Updated May 2, 2026
One-click install
npx skills add https://github.com/hdeshev/pi-config --skill test-anti-patterns-hdeshev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-anti-patterns
Source: https://github.com/hdeshev/pi-config/tree/main/agent/skills/test-anti-patterns
Command: npx skills add https://github.com/hdeshev/pi-config --skill test-anti-patterns-hdeshev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Tests that pass but verify nothing, flaky tests, and coupled or duplicated test code silently erode confidence in a .NET test suite. This Skill reviews existing test code and surfaces the anti-patterns that undermine reliability and diagnostic value, with concrete remediation guidance. ## Core Features & Use Cases - Severity-ranked detection: Scans MSTest, xUnit, NUnit, and TUnit tests for Critical issues (no assertions, swallowed exceptions, always-true assertions), High issues (flakiness indicators, ordering dependencies, over-mocking, implementation coupling), and Medium/Low issues (naming, magic values, duplicates, giant tests). - Honest calibration: Re-checks findings against severity rules to avoid false positives, and explicitly reports when tests are well-written instead of inflating issues. - Actionable reporting: Produces a structured report with locations, explanations, before/after fixes, positive observations, and prioritized recommendations. - Use Case: Point the Skill at a test project where tests intermittently fail in CI; it identifies Thread.Sleep synchronization, shared static state, and broad exception assertions, then ranks which to fix first. ## Quick Start Review the tests in my OrderServiceTests project for anti-patterns and tell me which issues to fix first.

Frequently Asked Questions about test-anti-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find anti-patterns in my .NET test code?▼

Provide the test files or project to review, and the Skill scans them against a catalog of anti-patterns grouped by severity. It reports each finding with the file, method, and line, plus a concrete fix for Critical and High issues.

How to investigate flaky tests in MSTest or xUnit?▼

The Skill flags flakiness indicators such as Thread.Sleep or Task.Delay synchronization, unseeded Random usage, DateTime.Now without abstraction, and shared static state across tests. It reports these as High severity with targeted remediation guidance.

Does this test review work with NUnit and TUnit?▼

Yes, the review supports MSTest, xUnit, NUnit, and TUnit. It uses framework-correct terminology such as [Fact]/[Theory] for xUnit, [Test]/[TestCase] for NUnit, and [TestMethod]/[DataRow] for MSTest.

When should I use test-anti-patterns instead of writing-mstest-tests?▼

Use test-anti-patterns for diagnostic reviews of existing tests with severity-ranked findings. Use writing-mstest-tests for writing new tests or direct MSTest implementation fixes like swapped Assert.AreEqual argument order or DynamicData conversions.

Will the review flag well-written tests as problems?▼

No. The Skill calibrates severity honestly and explicitly reports when tests are well-written, leading with positive observations. A result of zero Critical or High findings with only minor Low suggestions is treated as a valid outcome.