---
name: test-review
description: Audit test quality using multiple lenses. Analyzes for flakiness, tautologies, structure, and mocking anti-patterns. Distinct from running tests (verify-work).
---

# Test Review Skill (The Auditor)

Run focused analysis on test files to ensure they are robust and meaningful.

## When to Use

Invoke this skill when:
- "Review these tests"
- "Audit my test suite"
- "Are these tests brittle?"
- "Check for test anti-patterns"

## Available Lenses

Lenses are located in `skills/test-review/lenses/`:

| Lens | Focus |
|------|-------|
| `flakiness.md` | Timing issues, sleeps, global state, race conditions |
| `lies.md` | Tautologies, meaningless assertions, swallowed errors |
| `structure.md` | Arrange-Act-Assert violations, single-action check |
| `mocking.md` | "Don't mock what you don't own", implementation vs behavior |

## Workflow

### Phase 1: Target Selection
1. Identify test files to review (e.g., `*.test.ts`, `test_*.py`).
2. Show file list to user for confirmation.

### Phase 2: Lens Execution
For each lens, analyze the target test files:
1. Apply the lens criteria.
2. Collect findings (Severity: HIGH/MED/LOW).

### Phase 3: Synthesis
1. Deduplicate findings.
2. Group related issues.
3. Present summary report.

### Phase 4: Interactive Review
Ask: "Which findings should I file as issues?"

## Guidelines

1. **Behavior Over Implementation:** Ensure tests verify what the code *does*, not how it *looks*.
2. **Dynamic vs Static:** Remind user that this is a quality audit. Use `verify-work` to confirm if they actually *pass*.
3. **No Flakiness:** Be ruthless about `sleep` and `setTimeout`.

## Integration

- **Issue Tracking:** Uses `bd create` for beads issues.
- **Verification:** Works as part of the Triad (Verify -> Test-Review -> Code-Review).