| name | code-test-quality |
| description | Analyze test quality: smells, empty assertions, flaky patterns, coverage gaps. Use when tests are unreliable, coverage is misleading, or after major refactors. |
| args | [PATH] [--focus <smells|coverage|flaky|all>] |
| argument-hint | path to test directory or specific test file |
| allowed-tools | Bash(npx vitest *), Bash(npx jest *), Bash(pytest *), Bash(cargo test *), Read, Grep, Glob, TodoWrite |
| created | "2026-04-10T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-04-10T00:00:00.000Z" |
/code:test-quality
Analyze test suite for quality issues and reliability.
When to Use This Skill
| Use this skill when... | Use something else when... |
|---|
| Test suite passes but bugs still ship | Setting up test framework → /configure:tests |
| Coverage numbers are high but quality feels low | Setting up coverage thresholds → /configure:coverage |
| Tests are flaky or timing-dependent | Looking for code anti-patterns → /code:antipatterns |
| After major refactor, need test health check | Running tests → /test:run |
Context
- Test files: !
find . -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*.py" -o -name "*_test.py" -o -name "*_test.go" -o -name "*_test.rs" \) -not -path "*/node_modules/*"
- Test config: !
find . -maxdepth 2 \( -name "vitest.config.*" -o -name "jest.config.*" -o -name "pytest.ini" -o -name "pyproject.toml" -o -name "conftest.py" \) -type f
Parameters
$1: Path to analyze (defaults to current directory)
--focus: Analysis focus — smells (default), coverage, flaky, or all
Execution
Execute this test quality analysis:
Step 1: Discover test suite
Scan the target path for test files. Categorize by:
- Unit tests
- Integration tests
- E2E tests
Count total test files and estimate test-to-source ratio.
Step 2: Detect test smells
Scan test files for these anti-patterns:
Empty tests (Critical):
- Test bodies with no assertions
- Tests that only call the function without checking results
expect() or assert never called
Weak assertions (High):
expect(result).toBeTruthy() on objects (always passes)
assert result without specific value checks
assertEqual(len(result), len(result)) (tautologies)
- Snapshot tests without meaningful structure checks
Test duplication (Medium):