Agent skill

Test Quality Analysis

by secondsky in secondsky/claude-skills

Detect test smells, overmocking, flaky tests, and coverage issues.

MITAuto-check: notesTesting & QA

Install Test Quality Analysis

skills CLI
$ npx skills add secondsky/claude-skills --skill test-quality-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills test-quality-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/test-quality-analysis/skills/test-quality-analysis .claude/skills/test-quality-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-quality-analysis
GitHub stars
227
Token cost
~1.2k tokens
SKILL.md length
248 words
Files
1
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Detect test smells, overmocking, flaky tests, and coverage issues.

  • Reviewing tests
  • SKILL.md covers Core Dimensions, Test Smells, Analysis Tools and Best Practices Checklist, plus 3 more sections
  • Calls bun and uv
  • Improving test quality

What it does

Test Quality Analysis is an agent skill from secondsky/claude-skills. Detect test smells, overmocking, flaky tests, and coverage issues. Analyze test effectiveness, maintainability, and reliability. Use when reviewing tests or improving test quality.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Failing and flaky tests. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Reviewing tests
  • Improving test quality

Example prompts

  • “/test-quality-analysis”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, Edit, Write, Grep, Glob, TodoWrite

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Edit
    • Write
    • Grep
    • Glob
    • TodoWrite

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Quality Analysis loads about 1.2k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 248 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Edit, Write, Grep, Glob, TodoWrite

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 248 words, ~1,194 tokens.

Download SKILL.mdSave it as .claude/skills/test-quality-analysis/SKILL.md (or your agent's skills folder).
name
test-quality-analysis
description
Detect test smells, overmocking, flaky tests, and coverage issues. Analyze test effectiveness, maintainability, and reliability. Use when reviewing tests or improving test quality.
allowed-tools
Bash, Read, Edit, Write, Grep, Glob, TodoWrite
license
MIT

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.

typescript
// ❌ BAD: Overmocked
test('calculate total', () => {
  const mockAdd = vi.fn(() => 10)
  const mockMultiply = vi.fn(() => 20)
  // Testing implementation, not behavior
})

// ✅ GOOD: Mock only external dependencies
test('calculate order total', () => {
  const mockPricingAPI = vi.fn(() => ({ tax: 0.1 }))
  const total = calculateTotal(order, mockPricingAPI)
  expect(total).toBe(38)
})

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.

typescript
// ❌ BAD: Tests implementation details
await page.locator('.form-container > div:nth-child(2) > button').click()

// ✅ GOOD: Semantic selector
await page.getByRole('button', { name: 'Submit' }).click()
Flaky Tests

Problem: Tests pass or fail non-deterministically.

typescript
// ❌ BAD: Race condition
test('loads data', async () => {
  fetchData()
  await new Promise(resolve => setTimeout(resolve, 1000))
  expect(data).toBeDefined()
})

// ✅ GOOD: Proper async handling
test('loads data', async () => {
  const data = await fetchData()
  expect(data).toBeDefined()
})
Poor Assertions
typescript
// ❌ BAD: Weak assertion
test('returns users', async () => {
  const users = await getUsers()
  expect(users).toBeDefined() // Too vague!
})

// ✅ GOOD: Strong, specific assertions
test('creates user with correct attributes', async () => {
  const user = await createUser({ name: 'John' })
  expect(user).toMatchObject({
    id: expect.any(Number),
    name: 'John',
  })
})

Analysis Tools

bash
# Vitest coverage (prefer bun)
bun test --coverage
open coverage/index.html

# Check thresholds
bun test --coverage --coverage.thresholds.lines=80

# pytest-cov (Python)
uv run pytest --cov --cov-report=html
open htmlcov/index.html

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)
typescript
test('user registration', async () => {
  // Arrange
  const userData = { email: 'user@example.com' }

  // Act
  const user = await registerUser(userData)

  // Assert
  expect(user.email).toBe('user@example.com')
})

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
typescript
// ❌ BAD
const spy = vi.spyOn(Math, 'sqrt')
calculateDistance()
expect(spy).toHaveBeenCalled() // Testing how, not what

// ✅ GOOD
const distance = calculateDistance({ x: 0, y: 0 }, { x: 3, y: 4 })
expect(distance).toBe(5) // Testing output
Mocking Too Much
typescript
// ❌ BAD
const mockAdd = vi.fn((a, b) => a + b)

// ✅ GOOD: Use real implementations
import { add } from './utils'
// Only mock external services
const mockPaymentGateway = vi.fn()

See Also

  • vitest-testing - TypeScript/JavaScript testing
  • playwright-testing - E2E testing
  • mutation-testing - Validate test effectiveness

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/test-quality-analysis/skills/test-quality-analysis of secondsky/claude-skills.

Open the folder on GitHubat commit 8837836

Compare with similar skills

Test Quality Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Quality Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Quality Analysis this skillsecondsky/claude-skills227—~1.2kAutomated safety check: NotesMIT
Swig Testswig/swig6.3k—~2.3kAutomated safety check: PassCustom licence
Dynamo Jira TicketDynamoDS/Dynamo2k—~1.1kAutomated safety check: PassApache-2.0
Fix Ready PRsfastrepl/anarlog9.4k—~1.4kAutomated safety check: PassMIT
Trx Analysismicrosoft/vstest969—~1.8kAutomated safety check: PassMIT
Wioworkersio/skills180—~5.8kAutomated safety check: PassMIT

Similar skills

  • Swig Test

    swig/swig

    Run SWIG test suite for specific languages. An agent skill from swig/swig.

    6.3k GitHub stars~2.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Dynamo Jira Ticket

    DynamoDS/Dynamo

    Create structured Jira tickets for Dynamo from bug reports, failing tests, or feature requests.

    2k GitHub stars~1.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Fix Ready PRs

    fastrepl/anarlog

    Inspect every open non-draft PR for CI failures and unresolved Cursor Bugbot findings, then fix them on the existing PR branches.

    9.4k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Trx Analysis

    microsoft/vstest

    Official

    Parse and analyze Visual Studio TRX test result files. An agent skill from microsoft/vstest.

    969 GitHub stars~1.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Wio

    workersio/skills

    Testing workflow skill for finding high-value test candidates, writing focused tests, generating realistic workloads, reviewing test value, and diagnosing test-suite health.

    180 GitHub stars~5.8k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Quicksilver

    UditAkhourii/quicksilver

    Offload bulk judgment calls to Jev (TypeSafe's fast System One model) so Claude doesn't read, and pay for, content it only needs a verdict on.

    101 GitHub stars~2.2k tokensUpdated 12 days ago
    Testing & QAAuto-check: notes

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 9 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 9 days ago
    Auto-check passed

Categories

Questions about Test Quality Analysis

What does Test Quality Analysis do?

Detect test smells, overmocking, flaky tests, and coverage issues. Test Quality Analysis is an agent skill from secondsky/claude-skills. Detect test smells, overmocking, flaky tests, and coverage issues.

When should I use Test Quality Analysis?

Test Quality Analysis fits situations like: reviewing tests; improving test quality.

How do I install Test Quality Analysis in Claude Code?

Run `npx skills add secondsky/claude-skills --skill test-quality-analysis -a claude-code`. Or copy the skill folder (plugins/test-quality-analysis/skills/test-quality-analysis in secondsky/claude-skills) into .claude/skills/test-quality-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Test Quality Analysis in Codex?

Run `npx skills add secondsky/claude-skills --skill test-quality-analysis -a codex`. Or copy the skill folder (plugins/test-quality-analysis/skills/test-quality-analysis in secondsky/claude-skills) into .agents/skills/test-quality-analysis in your project. Codex loads it when a task matches its description.

Can I use Test Quality Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill test-quality-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-quality-analysis, .gemini/skills/test-quality-analysis, .github/skills/test-quality-analysis and .opencode/skills/test-quality-analysis in your project.

What does Test Quality Analysis need to run?

Going by SKILL.md and its folder, Test Quality Analysis needs the command-line tools its instructions call (bun and uv). Its frontmatter pre-approves these tools: Bash, Read, Edit, Write, Grep, Glob, TodoWrite.

Does Test Quality Analysis access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Test Quality Analysis safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Test Quality Analysis use?

Test Quality Analysis is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Quality Analysis use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Quality Analysis?

Skills that share tags, products or a category with Test Quality Analysis: Swig Test (swig/swig, 6.3k stars), Dynamo Jira Ticket (DynamoDS/Dynamo, 2k stars), Fix Ready PRs (fastrepl/anarlog, 9.4k stars) and Trx Analysis (microsoft/vstest, 969 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Quality Analysis?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.