Coding prompts · Prompt

Audit test coverage gaps (prompt)

audit-test-coverage-gaps-prompt

A prompt that checks whether the tests on a change actually cover its behaviour - missing tests for branches, validation, error paths, edge and negative cases, async gaps and brittle tests tied to internals - each gap rated 1-10 by risk with the bug it would catch. Use when the user asks if their tests are thorough enough, wants coverage gaps found before merging, or added logic without tests.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/raw' -o ~/'.claude/skills/audit-test-coverage-gaps-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/files/LICENSE.txt' -o ~/'.claude/skills/audit-test-coverage-gaps-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/files/NOTICE.txt' -o ~/'.claude/skills/audit-test-coverage-gaps-prompt/NOTICE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/raw' -o '.cursor/skills/audit-test-coverage-gaps-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/files/LICENSE.txt' -o '.cursor/skills/audit-test-coverage-gaps-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/files/NOTICE.txt' -o '.cursor/skills/audit-test-coverage-gaps-prompt/NOTICE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/raw' -o '.agents/skills/audit-test-coverage-gaps-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/files/LICENSE.txt' -o '.agents/skills/audit-test-coverage-gaps-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-test-coverage-gaps-prompt/files/NOTICE.txt' -o '.agents/skills/audit-test-coverage-gaps-prompt/NOTICE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

A green test run only proves the tests you wrote pass. It does not prove they test the code you changed. This prompt maps each change to the tests that exercise it and finds the gaps that would let a real bug through.

When to use

  • You added logic, validation or parsing and are not sure the tests cover it.
  • Coverage numbers look fine but bugs still reach production.
  • Before you mark a change ready, as a last check on the tests.

When not to use

  • You have no tests yet and want to start test-first. Use test-first-with-tdd.
  • You want the AI to prove a claim with a test run. Use test-before-claiming-done.
  • You want tests written for a framework you already chose. Use write-unit-tests-with-vitest, jest or pytest.

Steps

  1. Commit your work, then open the branch in your AI coding tool.
  2. Paste the prompt below. Change the base branch if yours is not main.
  3. Read the critical gaps first. Each one names the bug a missing test would catch.
  4. Ask for the tests rated 8 to 10 to be written, then run the suite and check each new test fails when you break the code.
  5. Decide on the 5 to 7 items yourself. Skip anything rated below 5 unless it is cheap.

Prompt

Review the tests for this branch's changes (git diff main...HEAD). Judge behaviour covered, not line coverage. Do not write tests yet.

1. Summarise what the change does: new behaviour, changed behaviour, new error paths.
2. Map each behaviour to the tests that exercise it. Say "none" where nothing does.
3. Look for gaps:
   - error and failure paths, especially ones that could fail silently
   - boundary values and edge cases (empty, zero, maximum, unicode, time zones)
   - negative cases for validation: input that must be rejected
   - business rules with several branches
   - async, concurrency, retries and timeouts where they apply
   - integration points such as the database, network or other modules
4. Check test quality: do tests check behaviour or internals? Would they catch a real regression? Would they break on a harmless refactor? Are names and setup clear?
5. Consider whether existing integration or end-to-end tests already cover a gap before suggesting a new test.

Rate each suggestion 1-10: 9-10 data loss, security or outages; 7-8 user-facing errors; 5-6 confusing edge cases; 3-4 completeness; 1-2 optional.
Output: summary; critical gaps (8-10); worth adding (5-7); brittle or misleading tests; what is already well tested.
For each gap: what the test should check, a short sketch of it, and the bug it would catch.
Skip trivial getters and setters. Ask before writing any test.

How to adapt

  • Have team testing rules? Paste them after step 4, such as "no mocks of our own modules".
  • Testing a UI? Add "user flows and accessibility states" to the list in step 3.
  • Not on git? Name the source files and their test files instead of the diff.
  • Want the tests written too? Reply "write the critical gaps as tests, one commit each".

Gotchas

  • 100% line coverage is not the goal. A few tests on risky behaviour beat many on trivial code.
  • A new test that has never failed proves little. Break the code briefly and watch it fail.
  • Do not paste real customer data or secrets into fixtures. Use made-up values.

Portability

Works with any language, test framework and AI coding tool or chat AI. In a chat without repo access, paste the diff and the test files it touches.

Done when

  • Every behaviour in the change maps to at least one test, or has a written reason not to.
  • All gaps rated 8 or higher have tests that fail when the code is broken.
  • Brittle tests flagged in the review are fixed or noted.

Example prompt

"Check the tests on my branch. Map each change to its tests, rate the missing ones 1 to 10 with the bug each would catch, and flag tests that only check internals."

---

Modified from the "pr-test-analyzer" agent in anthropics/claude-plugins-official (pr-review-toolkit, by Anthropic; README credits Daisy). Licensed Apache-2.0 per the LICENSE file at commit a7ba5b9. Original: https://github.com/anthropics/claude-plugins-official/blob/a7ba5b93db0c7c8d17f3f1d25853adca79598a1a/plugins/pr-review-toolkit/agents/pr-test-analyzer.md. Changes by TheSkillVault are listed in the metadata above and in NOTICE.txt. See LICENSE.txt.

Bundled files

Licence

Adapted from Anthropic (anthropics/claude-plugins-official, pr-review-toolkit, pr-test-analyzer; the plugin README credits Daisy, daisy@anthropic.com) (Anthropic (the upstream LICENSE keeps the blank Apache template line 'Copyright [yyyy] [name of copyright owner]'; no other copyright notice at this commit). Apache License 2.0 text in LICENSE.txt, attributions in NOTICE.txt), Apache License 2.0. Modified by TheSkillVault on 2026-11-04: the persona and the Claude Code invocation notes were removed; the analysis process and output format were rewritten as one copy-paste prompt that maps each change to its tests, asks for test sketches rather than coverage numbers and asks before writing tests; added steps, adapt notes, gotchas and done-when. Not the original file.

Licence: Apache License 2.0. Attribution when you reuse it: Based on work by Anthropic (anthropics/claude-plugins-official, pr-review-toolkit, pr-test-analyzer; the plugin README credits Daisy, daisy@anthropic.com) (Anthropic (the upstream LICENSE keeps the blank Apache template line 'Copyright [yyyy] [name of copyright owner]'; no other copyright notice at this commit). Apache License 2.0 text in LICENSE.txt, attributions in NOTICE.txt, Apache License 2.0), https://github.com/anthropics/claude-plugins-official/blob/a7ba5b93db0c7c8d17f3f1d25853adca79598a1a/plugins/pr-review-toolkit/agents/pr-test-analyzer.md; adapted by TheSkillVault, https://theskillvault.ai