Analyzes coverage reports from Jest/nyc, pytest, Go test, JaCoCo to find untested paths, branch gaps, low-coverage files, and suggest targeted tests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-coverage-analyzer:analyzing-test-coverageThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
!`ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null || echo 'No project manifest found'`
!ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null || echo 'No project manifest found'
!node -v 2>/dev/null || python3 --version 2>/dev/null || echo 'No runtime detected'
Analyze code coverage metrics to identify untested code paths, dead code, and coverage gaps across line, branch, function, and statement dimensions. Supports Istanbul/nyc (JavaScript/TypeScript), coverage.py (Python), JaCoCo (Java), and Go coverage tools.
go test -cover)npx jest --coverage --coverageReporters=json-summary,lcovpytest --cov=src --cov-report=json --cov-report=term-missinggo test -coverprofile=coverage.out ./...if/else blocks where only one branch is tested.switch/case statements with missing case coverage.catch, except) never exercised.|| and && short-circuit conditions..coveragerc, or CI checks).| Error | Cause | Solution |
|---|---|---|
| Coverage report shows 0% | Tests ran but coverage instrumentation was not enabled | Verify --coverage flag is passed; check that source files are not excluded by config |
Coverage includes node_modules | Coverage collection scope too broad | Add collectCoverageFrom in Jest config; set --cov=src in pytest; exclude vendor dirs |
| Branch coverage much lower than line coverage | Conditional logic is only partially tested | Write tests for both truthy and falsy conditions on each branch; focus on edge cases |
| Coverage drops after refactor | New code added without corresponding tests | Set coverageThreshold with global minimums; add --changedSince for incremental checks |
| Flaky coverage numbers between runs | Non-deterministic test execution skipping code paths | Sort tests deterministically; run coverage with --runInBand for consistent results |
Jest coverage configuration with thresholds:
{
"jest": {
"coverageThreshold": {
"global": {
"branches": 70,
"functions": 80,
"lines": 80,
"statements": 80
},
"src/utils/": {
"branches": 90,
"lines": 95
}
},
"collectCoverageFrom": [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts",
"!src/**/index.ts"
]
}
}
Coverage gap analysis output:
Coverage Gaps (sorted by impact):
1. src/auth/oauth.ts Lines: 45% Branches: 30% [Lines 42-67, 89-103 uncovered]
Suggestion: Add tests for token refresh failure and expired session handling
2. src/api/middleware.ts Lines: 62% Branches: 41% [Lines 28-35, 71-80 uncovered]
Suggestion: Test rate limiting edge cases and malformed header handling
3. src/utils/parser.ts Lines: 71% Branches: 55% [Lines 112-130 uncovered]
Suggestion: Test malformed input, empty string, and encoding edge cases
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin test-coverage-analyzerQueries test coverage in Python, Node.js, Rust, Go projects. Identifies uncovered areas/files, analyzes trends, and generates reports before changes or PRs.
Analyzes test coverage reports (lcov, cobertura, istanbul) to identify gaps in lines/branches/functions, map to requirements, recommend tests, and track trends.
Analyzes test coverage to identify untested code paths and suggest test additions. Useful when reviewing code safety or planning refactors.