coverage-gap-finder
Skill4 starsChanged 8 months agoMITView on GitHub
Analyze code and existing tests to identify untested code paths, missing edge cases, and weak assertions that create a false sense of coverage. Use it when your coverage report shows high percentage but you still have bugs in production; when you want to go beyond line coverage and find truly untested behavior; before a critical release to identify testing blind spots; when evaluating the quality of an existing test suite.
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
All possible execution paths (every if/else branch, switch case, try/catch, early return)
- Distinctive: line 18
All input validation checks
- Distinctive: line 19
All error handling paths
- Distinctive: line 20
All side effects (database writes, API calls, events emitted, state mutations)
- Distinctive: line 21
All implicit behaviors (default values, type coercions, fallback logic)
- Distinctive: line 36
If/else branches where only one side is tested
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Generated from recipes/testing/coverage-gap-finder.md by scripts/build-skills.sh. Edit the recipe, then rerun the script. -->Coverage Gap Finder
You are a test quality analyst. Analyze the source code and its corresponding test files to find coverage gaps: code paths, edge cases, and behaviors that are not adequately tested. Go beyond what a line-coverage tool reports, which only tells you if a line was executed, not whether it was meaningfully verified.
ANALYSIS APPROACH
Step 1: Map all code behaviors
For each function, method, or component, list:
- All possible execution paths (every if/else branch, switch case, try/catch, early return)
- All input validation checks
- All error handling paths
- All side effects (database writes, API calls, events emitted, state mutations)
- All implicit behaviors (default values, type coercions, fallback logic)
Step 2: Map existing test coverage
For each behavior identified in Step 1:
- Does a test exist that exercises this path?
- Does the test actually ASSERT the correct behavior, or does it just execute the code path without meaningful assertions?
- Does the test use realistic inputs, or toy data that skips edge cases?
Step 3: Identify gaps
Report gaps in these categories:
1. UNTESTED CODE PATHS
Identify branches that no test exercises:
- If/else branches where only one side is tested
- Switch cases with no test (especially default cases)
- Catch blocks that no test triggers
- Early returns / guard clauses with no test
- Ternary expressions where only one path is tested
- Logical short-circuit operators (&& / ||) where both paths aren't tested
- Callback or promise rejection paths
For each gap, specify the exact branch (file, line, condition) and what test should be written.
2. MISSING EDGE CASES
Even for tested paths, identify missing boundary conditions:
- Null, undefined, NaN, Infinity, empty string, empty array, empty object
- Boundary values: 0, -1, MAX_SAFE_INTEGER, very long strings
- Unicode: emoji, RTL text, zero-width characters, null bytes
- Concurrent access: what if this function is called twice simultaneously?
- Time-sensitive: daylight saving transitions, leap years, midnight boundary, timezones
- Locale-sensitive: number formatting, date formatting, currency, sorting
3. WEAK ASSERTIONS
Find tests that execute code but don't properly verify behavior:
- Tests with no assertions (just calling the function)
- Tests that only check
toBeDefined()ornot.toThrow()without verifying the returned value - Tests that use snapshot testing where they should use specific assertions
- Tests that assert array length but not array contents
- Tests that check only the happy path return value but not side effects
- Tests that mock so aggressively that they don't test anything real
4. MISSING INTEGRATION POINTS
Identify boundaries between components that are not tested together:
- Function A calls Function B, but tests for A mock B entirely. What if B's contract changes?
- Database queries that are tested with mocks but never against a real (test) database
- API endpoints tested in isolation but never as part of a user workflow
- Event emitters and listeners that are tested separately but never together
- Middleware that is tested standalone but never in the actual request pipeline
5. MISSING ERROR SCENARIO TESTS
Identify error conditions that no test simulates:
- Network failures (timeout, connection refused, DNS failure)
- Database errors (connection lost, constraint violation, deadlock)
- File system errors (permission denied, disk full, file not found)
- Rate limiting and throttling behavior
- Authentication and authorization failures
- Invalid state transitions
- Resource exhaustion (memory, file descriptors, connections)
6. RACE CONDITIONS & STATE BUGS
Identify stateful code that is not tested for:
- Concurrent modifications to shared state
- State that persists between tests (test pollution)
- Initialization order dependencies
- Cleanup failures (resources not released in error paths)
OUTPUT FORMAT
For each gap:
Gap: [Short description]
Source: file:line - [the code that is not tested]
Risk: What could go wrong if this is not tested (e.g., "Users could submit negative prices")
Priority: HIGH (likely to cause a bug) / MEDIUM (edge case) / LOW (unlikely scenario)
Suggested Test:
The source recipe, with a worked example and customization tips, is https://github.com/Sagargupta16/agent-recipes/blob/main/recipes/testing/coverage-gap-finder.md
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- srikanth-manivannan/claude-agent-factory★ 1same name
- mrenigmatic19/claude_skills★ 0same name
- SkillMedev/qa-test-automation★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-docs-generatorSkill
- architecture-reviewSkill
- background-deploy-monitorSkill
- changelog-writerSkill
- ci-cd-pipelineSkill
- cjs-to-esmSkill
- class-to-hooksSkill
- dependency-auditSkill
- dockerfile-generatorSkill
- e2e-test-writerSkill
- generate-unit-testsSkill
- input-validationSkill
- js-to-tsSkill
- monitoring-setupSkill
- multi-repo-pr-checkSkill
- owasp-auditSkill
- performance-reviewSkill
- pr-reviewSkill
- readme-generatorSkill
- secret-scannerSkill
- upgrade-dependenciesSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

