Analyze code coverage metrics and identify untested code paths. Use when analyzing untested code or coverage gaps. Trigger with phrases like "analyze coverage", "check test coverage", or "find untested code".
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
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.
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
Guides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
4plugins reuse this skill
First indexed Jul 11, 2026
npx claudepluginhub ktiseos-nyx/claude-code-plugins-plus-skills --plugin test-coverage-analyzer