Test review

From mbwsims/claude-universe · View interactive version

Test review is an AI agent skill from the GitHub repository mbwsims/claude-universe. This skill should be used when the user asks to "review my tests", "are these tests good", "check my test quality", "audit these tests", "grade my tests", "test quality check", "are these tests testing the right things", "test coverage quality", mentions "/test-review", or wants to evaluate the qual

How to use this skill

Skill file

Test Review

Evaluate existing tests for quality issues that let bugs through. Grades test files on six

dimensions and produces a scorecard with specific, actionable findings — not generic advice.

This is not about code style or formatting. It is about whether the tests actually catch bugs.

Workflow

0. Deterministic Analysis (if available)

Call testkit_analyze with the target test file. If available, use the structured metrics

(shallow assertion count, error coverage ratio, mock health, name quality) as the foundation

for dimension scoring in step 3. Supplement with semantic analysis for dimensions the tool

cannot measure (input coverage, independence).

If testkit_analyze is unavailable, perform full manual analysis as described below.

Note to the user: "Running without testkit-mcp — analysis is based on code reading.

Install testkit-mcp (npm install -g testkit-mcp) for precise metrics."

1. Identify Target

If a test file was specified, read it. Otherwise, discover test files using Glob:

**/*.test.*, **/*.spec.*, **/__tests__/**.

If multiple test files are found and none was specified, review the most recently modified

test file. Use ls -t or equivalent to determine modification order. Do not ask the user

to choose — pick the most recent one and note it: "Reviewing {filename} (most recently

modified test file). Specify a file to review a different one."

2. Read the Test and Its Source

Read both:

  1. The review target spec
  2. The code under test (infer from imports, file naming, or directory structure)

Understanding the source code's contract is essential for evaluating whether the tests

cover the right things.

3. Evaluate Six Dimensions

Score each dimension using letter grades (A through F, with + and - for fine-grained

distinctions). Consult references/smell-catalog.md for detection patterns and

references/scoring-rubric.md for calibration.

Dimension 1: Assertion Depth

Dimension 2: Input Coverage

adversarial. Each parameter should have test coverage for at least the "must" categories

(canonical + empty + boundary + one error case).

Dimension 3: Error Testing

Dimension 4: Mock Health

Dimension 5: Specification Clarity

Dimension 6: Independence

3b. Compare Against Plan (if available)

If a /test-plan was produced for this code earlier in the conversation:

"Missing from plan: {category} — {input} → {expected}"

This catches the gap between "what we planned to test" and "what we actually tested."

4. Produce the Scorecard

Report format:

## Test Review — {test-file-name}

**Grade: {letter}** — {one-line summary}

| Dimension | Score | Finding |
|-----------|-------|---------|
| Assertion depth | {A-F} | {specific finding with count} |
| Input coverage | {A-F} | {what's missing} |
| Error testing | {A-F} | {count of gaps} |
| Mock health | {A-F} | {assessment} |
| Specification clarity | {A-F} | {assessment} |
| Independence | {A-F} | {assessment} |

### Priority Fixes

1. **{file}:{line}** — {specific issue}
   {What to change and why — what bugs this would catch}

2. **Missing: {category}** — {what tests don't exist}
   {Specific test cases to add}

3. ...

5. Suggest Missing Tests

After the scorecard, list the most important tests that don't exist yet. These should be

concrete — specific input values, specific expected outputs, specific error types. Not

"add more edge case tests" but "add a test for empty email that expects ValidationError."

Guidelines

A-grade test suites are rare.

Don't invent problems.

but has gaps that could let bugs through."

Related Skills

Additional Resources

patterns, fixes, and before/after examples

each grade level

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.