Analyzes coverage reports from Jest/nyc, pytest, Go test, JaCoCo to find untested paths, branch gaps, low-coverage files, and suggest targeted tests.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin test-coverage-analyzerThis skill is limited to using the following tools:
!`ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null || echo 'No project manifest found'`
Queries test coverage in Python, Node.js, Rust, Go projects. Identifies uncovered areas/files, analyzes trends, and generates reports before changes or PRs.
Runs coverage tools like pytest-cov and istanbul/c8 via Bash to analyze test coverage, identify gaps, and provide actionable test recommendations.
Analyzes test coverage to identify untested code paths and suggests test additions. Activates on queries about coverage gaps, untested code, or missing tests.
Share bugs, ideas, or general feedback.
!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