Agent skill · operations · secondsky

test-quality-analysis

Detect test smells, overmocking, flaky tests, and coverage issues. Analyze test effectiveness, maintainability, and reliability. Use when reviewing tests or improving test quality.

Why this skill is useful

Provides specific guidelines and scripts for detecting and fixing test quality issues that the AI wouldn't reliably generate on its own.

What it needs

Requires bun, pytest installed locally. About 3k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

Test Quality Analysis Expert knowledge for analyzing and improving test quality - detecting test smells, overmocking, insufficient coverage, and testing anti-patterns. Core Dimensions Correctness: Tests verify the right behavior Reliability: Tests are deterministic, not flaky Maintainability: Tests are easy to understand Performance: Tests run quickly Coverage: Tests cover critical code paths Isolation: Tests don't depend on external state Test Smells Overmocking Problem: Mocking too many dependencies makes tests fragile. Detection: More than 3-4 mocks, mocking pure functions, complex mock setup. Fix: Mock only I/O boundaries (APIs, databases, filesystem). Fragile Tests Problem: Tests break with unrelated code changes. Flaky Tests Problem: Tests pass or fail non-deterministically. Poor Assertions Analysis Tools Best Practices Checklist Unit Test Quality (FIRST) [ ] Fast: Tests run in milliseconds [ ] Isolated: No dependencies between tests [ ] Repeatable: Same results every time [ ] Self-validating: Clear pass/fail [ ] Timely: Written alongside code Mock Guidelines [ ] Mock only external dependencies [ ] Don't mock business logic or pure functions [ ] Use real implementations when possible [ ] Limit to 3-4 mocks per test maximum Coverage Goals [ ] 80%+ line coverage for business logic [ ] 100% for critical paths (auth, payment) [ ] All error paths tested [ ] Boundary conditions tested Test Structure (AAA Pattern) Code Review Checklist [ ] Tests verify behavior, not implementation [ ] Assertions are specific and meaningful [ ] No flaky tests (timing, ordering issues) [ ] Proper async/await usage [ ] Test names clearly describe behavior [ ] Minimal code duplication [ ] Critical paths have tests [ ] Both happy path and error cases covered Common Anti-Patterns Testing Implementation Details Mocking Too Much See Also vitest-testing - TypeScript/JavaScript testing playwright-testing - E2E testing mutation-testing - Validate test effectiveness

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/test-quality-analysis

View the source on GitHub

Browse the @skills marketplace