---
name: test-suite-audit
description: "Audits a test suite for tests that cost more than they protect and for missing coverage that matters, reporting findings without changing any code. Use when a team has a slow, flaky, or bloated test suite and wants to know which tests to cut and which flows lack protection, without any edits. Do not use for writing new tests or fixing a specific failing test. Related topics: coding, technical."
---

# Test Suite Audit

Audits a test suite for tests that cost more than they protect and for missing coverage that matters, reporting findings without changing any code.

## When to use

Use this skill when a team has a slow, flaky, or bloated test suite and wants to know which tests to cut and which flows lack protection, without any edits. Do not use it for writing new tests or fixing a specific failing test.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Read the tests and group them by area, noting runtime and flakiness evidence.
3. Score each group on cost signals against protection signals.
4. List tests that cost more than they protect with a recommendation to delete, merge, or rewrite.
5. Map the critical flows to existing tests and rank the gaps by damage if they fail.
6. Close with five prioritised actions and the estimated run time saved, making no code changes.

## Inputs

- **Project and language** (free text, e.g. "Python web API")
- **Test location and command** (free text, e.g. "Folder and run command")
- **Suite pain points** (longer free text)
- **Run time of the full suite** (free text, e.g. "Minutes")
- **Most critical user flows** (longer free text)
- **Report detail** (choose one: Summary, Detailed)

## Output

A report with a cost versus protection table, a list of tests to delete merge or rewrite, a ranked gap list for critical flows, and five prioritised actions.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Test Suite Audit

Audit my test suite and report; do not edit anything.

- Project and language: {{Project and language}}
- Test location and command: {{Test location and command}}
- Suite pain points: {{Suite pain points}}
- Run time of the full suite: {{Run time of the full suite}}
- Most critical user flows: {{Most critical user flows}}
- Report detail: {{Report detail}}

Read the tests and score each group on cost against protection. Cost signals: slow runtime, flakiness, heavy mocking that mirrors the implementation, duplicated setup, assertions on private details, and failures that need hours to diagnose. Protection signals: catches real regressions, checks behaviour rather than structure, covers a critical flow. List the tests that cost more than they protect and say whether to delete, merge, or rewrite each. Then map the critical flows to tests and name the gaps that matter: untested money paths, auth, data migrations, error handling. Rank gaps by the damage of a failure there, not by line coverage. Report only. Close with five actions in priority order and the estimated run time saved.

## Pitfalls

- Using line coverage as the measure, which rewards trivial tests.
- Recommending deletion of slow tests that guard a critical flow.
- Editing files during an audit that was meant to be read-only.
