uniswap/ai-toolkit/analyze-test-coverage
Claude Code and agent skill by uniswap/ai-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Analyze test coverage gaps and prioritize what to test next. Use this skill whenever the user says "analyze test coverage", "what's our test coverage", "find gaps in test coverage", "which code isn't tested", "improve test coverage", "show me a coverage report", "coverage analysis", "where are we missing tests", "what's untested", "test coverage audit", or asks about coverage percentages or uncovered files. Also trigger when the user asks which areas to focus testing efforts on, or when they wa…
Install
npx vskill@latest install uniswap/ai-toolkit/analyze-test-coverageSKILL.md
Test Coverage Analyzer
Measure where tests are missing, identify high-impact coverage gaps, and produce a prioritized action list — so the next test-writing session targets the code that matters most.
When to Activate
- User asks about test coverage or coverage percentages
- User wants to know which code isn't tested
- User wants to find the highest-priority testing gaps
- User is planning a testing sprint and needs direction
- User asks what to pass to the test-writer agent
Step 1: Detect Project Setup
Scan the project to identify language, test framework, and coverage tooling:
Language / framework detection (check in order):
| Signal file | Stack | Coverage command | |
|---|---|---|---|
vitest.config.* or vite.config.* with test key | TypeScript/JS + Vitest | npx vitest run --coverage | |
jest.config.* or "jest" in package.json | TypeScript/JS + Jest | npx jest --coverage --coverageReporters=json-summary,text | |
pyproject.toml with [tool.pytest] or pytest.ini | Python + pytest | python -m pytest --cov --cov-report=term-missing --cov-report=json | |
go.mod | Go | go test ./... -coverprofile=coverage.out && go tool cover -func=coverage.out | |
pom.xml | Java + Maven/JaCoCo | mvn test jacoco:report -q | |
build.gradle | Java + Gradle | ./gradlew test jacocoTestReport |
If multiple frameworks are detected (monorepo), scan for the subpackages and handle each separately.
Check for existing coverage reports before running tools — they may be fresh:
.coverage,coverage.json,coverage-summary.json,lcov.info,coverage.outin common locations
Step 2: Run Coverage
Run the coverage command detected in Step 1. If you can't determine the command, check package.json scripts for a coverage, test:coverage, or test:cov target and run that.
Important: Run from the directory that contains the test config, not necessarily the repo root.
If the coverage run fails (compilation error, missing deps, no tests), report the failure clearly with the exact error — don't silently skip. A project with zero passing tests is itself a critical finding.
Step 3: Parse the Report
Extract file-level coverage data from whichever output format was produced:
- JSON summary (
coverage-summary.json): Readtotaland per-filestatements,branches,functions,linespercentages - LCOV (
lcov.info): ParseDA:(line hit/missed) andBRH:(branch hit/missed) records - Go text output: Parse
func coverage: X%per package - Terminal text (pytest
--cov-report=term-missing): Extract file paths and uncovered line ranges from theMISScolumn
Build a table of files with their line coverage %, branch coverage %, and uncovered line ranges.
Step 4: Score and Rank Coverage Gaps
Score every file that produced coverage data. Do not drop files by a coverage threshold before scoring — the whole point of the criticality signals below is to surface the 85%-covered file whose uncovered lines are the auth-failure branch. A pre-filter would delete exactly that finding before it could be ranked. If --min-coverage is supplied, apply it to the ranked list at the end of Step 5, and report how many files it removed.
Don't sort by raw line count. Sort by criticality of what's untested:
Criticality signals (check each uncovered file/function for these):
- Public API surface — exported functions, class methods, REST/GraphQL handlers, CLI entry points. These are contracts that callers depend on.
- Error-handling branches —
catchblocks, error returns, fallback paths. Untested error paths are where production incidents hide. - Business logic density — files in
src/,lib/,domain/, orcore/with conditionals and state transformations. High cyclomatic complexity + low coverage = high risk. - Data boundaries — input parsers, validators, serializers/deserializers. Untested boundary code produces silent corruption.
- Security-adjacent code — auth, permissions, rate-limiting, token handling.
Scoring heuristic (per file):
- Start with
(100 - line_coverage) * 0.5 + (100 - branch_coverage) * 0.5as a base gap score - Multiply by 2× if the file exports public symbols
- Multiply by 1.5× if the file contains
catch,error, orfallbackhandlers - Multiply by 1.5× if the file path matches
auth,security,permission,token,payment - Sort descending by final score
Step 5: Report
Output two sections:
Coverage Summary
Include a small table of the 10 worst-covered files (by raw line coverage), as context.
Prioritized Gap List
For the top 10 files by criticality score, output:
Adjust the "why it matters" explanation based on the criticality signals found in Step 4.
If any file has 0% coverage and is in the public API or business logic layer, call it out prominently at the top as a critical gap regardless of its ranked position.
Step 6: Optional — Delegate to Test Writer
If the user asks to also generate tests (e.g., "and write the tests" or "fix the top 3"), invoke the test-writer agent for the top N files from the prioritized list:
Pass the agent:
- The file path
- The uncovered lines/branches identified above
- The "why it matters" context
- A note to focus on the error paths and branching scenarios, not just happy-path coverage
Options
| Flag | Description | |
|---|---|---|
--target <path> | Limit analysis to a subdirectory or file | |
--min-coverage <N> | Drop files at or above N% from the final list (default: off) | |
--top <N> | How many files to include in the prioritized list (default: 10) | |
--fix | After reporting, invoke test-writer for the top 3 gaps | |
--skip-run | Skip running coverage tools; parse existing reports only |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/plugins/development-codebase-tools/skills/analyze-test-coverage/SKILL.md
Popularity
- Repository stars
- 42
- Repository forks
- 12
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/uniswap/ai-toolkit/analyze-test-coverage)