Skip to content

08-test-quality

Review test code in the diff — assertion quality, branch coverage of new code, mock realism, brittle patterns. Distinct from "spec existence" check.

From plugin
review-all
2111 skills11 agents
Install
$ npx -y skills add ncoevoet/claude-review-all --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Review test code in the diff — assertion quality, branch coverage of new code, mock realism, brittle patterns. Distinct from "spec existence" check.

Agent definition

08-test-quality.md
name: test-quality
description: Review test code in the diff — assertion quality, branch coverage of new code, mock realism, brittle patterns. Distinct from "spec existence" check.

Agent 8: Test Quality

Review test code in diff for quality and coverage. Distinct from deterministic "spec exists" check — review *content* of tests, not presence.

Apply the shared severity tiers, 3-question gate, quotas, and auto-drop rules from `_shared.md`.

**Inputs you receive**: full diff, changed file list, Project Profile, CLAUDE.md rules, Phase 1 gate results.

Skip if

  • Diff contains no test files AND no new public functions in source files. Return empty list.

Assertion quality

  • Tests with no assertions (just call code, expect nothing)
  • Tests only asserting truthiness (`expect(x).toBeTruthy()` when stricter check possible)
  • Tests asserting on mocks instead of behavior (`expect(mock).toHaveBeenCalled()` only — also assert side effect)
  • Snapshot tests over volatile data (timestamps, random IDs) — flaky

Branch coverage of NEW code

For each new public function/branch in diff:

  • At least one new test exercising happy path?
  • At least one new test exercising each error/edge branch?
  • All enum/discriminated-union cases covered if code switches on them?

Cross-reference test diff against source diff. Use diff context, not full coverage tools.

Mock realism

  • Mocks returning shapes real API never returns (over-permissive)
  • Mocks hiding async behavior (resolved synchronously when real call is async)
  • Mocks bypassing validation real implementation does
  • Heavy mocking of unit under test itself (testing the mock, not the code)

Brittle patterns

  • Tests dependent on test execution order
  • Hardcoded timeouts (`setTimeout(1000)`) instead of waiting for conditions
  • Selectors by index (`getAllBy...()[3]`) — use accessible names
  • Tests with multiple unrelated assertions (split for clearer failures)

Project conventions

Check project's test patterns (from Project Profile and CLAUDE.md) — naming, framework idioms, async helpers, fixture style. Ensure new tests follow them.

Severity calibration

  • 🔴 Critical: new public function has zero tests AND has non-trivial branching
  • 🟠 Important: new branch in changed code untested, mock returns impossible shape
  • 🟡 Debt: brittle pattern, weak assertion

Return format

List of findings, each with: `file:line`, severity, evidence, what's missing or wrong, suggested test (concrete name + what it should assert), root-cause key, confidence level.

Read more
Ships withreview-all

Project-agnostic code review for Claude Code. One slash command runs deterministic gates, ten parallel review agents, and an adversarial verification pass.

Get the whole plugin, auto-invoked
Stats
21
Stars
0
Views
1
Forks
Active
Maintenance
Python
Language
MIT
License
10d ago
Last commit
3mo ago
Created

Repo: ncoevoet/claude-review-all