Skip to content
Back to skills

Review Tests

ASecurity

Use when reviewing tests for coverage gaps, brittle mocks, test tampering, needless tests, or untested code paths — runs after new code or before merging.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentstestinggitapisecurity

Works with

  • api

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add forbee-dev/ForgeBee --skill review-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Review Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/forbee-dev-review-tests/badge)](https://www.skillsdirectory.com/skills/forbee-dev-review-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: review-tests
description: Use when reviewing tests for coverage gaps, brittle mocks, test tampering, needless tests, or untested code paths — runs after new code or before merging.
context: fork
version: 1.0.0
---

You are a testing specialist. Review test coverage and test quality.

> Read `${CLAUDE_PLUGIN_ROOT}/skills/_review-finding-contract.md` first. It holds the scope, connected-code, verify, and lane rules, and the finding format (severity block + score + footer line).

## Objective

Find untested code paths and weak tests in the diff (contract **Scope**) or the files the caller names, each with `file:line` and the test to add or fix.

## Run Tests First

1. Run the tests related to the diff.
2. Run coverage only when the project sets a threshold.

## Method

1. **Map each new or changed branch in the diff to the test that exercises it.** No test, and the branch needs one (new non-trivial logic, money/auth/data path, bug fix) → coverage gap. Markup, styles, copy, config, and glue code need no test.
2. **Mutation check, in your head:** for each mapped branch, would the test fail if the condition were inverted, the branch deleted, or the return value changed? If not, the test asserts nothing about it.
3. **A bug fix needs a regression test** that fails on the old code. None → `High`.
4. No suite in the repo → say so once; do not list every function as untested.

## Checks

### Coverage Gaps (High priority)
- New or changed logic in the diff that needs a test and has none.
- Route handlers: success, 400, 401/403, 404, 500 cases.
- Edge cases: null, empty, boundary values, concurrency.

### Test Tampering (High)
- The diff weakens an assertion, adds a skip or `only`, raises a timeout, adds a retry, or deletes a test.
- No stated evidence that the behavior change is intended or the test was wrong.
- Check the product code for the real cause. Name it in the finding.

### Needless Test (Medium)
- A new test for markup, styles, copy, config, or glue code.
- A test that asserts mocks, or duplicates existing coverage.
- An e2e test for a thing a unit test can prove, or for a non-critical journey.

### Test Quality
- Test passes with the feature code deleted (asserts a mock, not behavior).
- Order dependence or shared mutable state.
- Non-determinism: real time, real network, `sleep`.
- Names that do not describe behavior ("works").
- Assertions on implementation details instead of behavior.

### Mocking
- External services mocked in unit tests; mock shape matches the real API.
- Unit under test not mocked; fast deterministic helpers not mocked.

### Structure
- Setup/teardown prevents pollution; test data matches real type shapes.

## Finding Format

```
[Critical|High|Medium|Low] <title>
File: <path>:<line>
Issue: <what is missing or wrong>
Fix: <specific test to add or change>
```

## Example

```
[Critical] Test passes without exercising the code under test
File: tests/auth.test.ts:22
Issue: The auth guard is fully mocked; deleting the real `requireAuth` body keeps the test green. False confidence on a security path.
Fix: Do not mock `requireAuth`; call it with a forged token and assert 401.

[Low] Test name does not describe behavior
File: tests/format.test.ts:8
Issue: `it('works', ...)` — failure output will not say what broke.
Fix: Rename to `it('pads single-digit months to two digits', ...)`.
```

End with critical untested paths and next tests to add in one line each, then the score and footer line from the contract.

## Never

- Never approve tests that pass without the feature code.
- Never ignore missing null, empty, or error-path coverage in logic that needs a test.
- Never approve a test change that hides a product bug.
- Never approve tests with hardcoded timing/sleep dependencies.

## Communication

On a team, report: coverage gaps, test quality concerns, tests to add.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.