Overview
Analyze test coverage to find untested code paths, prioritize testing efforts, and track coverage over time. Supports Istanbul/nyc, Jest, Vitest, and Python coverage.py.
Capabilities
- Generate and analyze coverage reports (line, branch, function)
- Identify critical untested code paths
- Prioritize testing by risk (high-traffic, high-change, low-coverage)
- Track coverage trends over time
- Set coverage thresholds and gates
When to Use
Trigger phrases:
"test coverage analyzer"
"testing coverage analyzer"
"Identify untested code paths — coverage reports, gap analysis, and test prioriti"
Before major refactoring — need to know what's tested
Setting up coverage gates in CI
Identifying high-risk untested code
Code review coverage requirements
When NOT to Use
- Task is about deployment, not development (use deploy skills)
- Task is about code review, not writing (use review skills)
- You need to understand existing code first (use research skills)
- Task is about testing only (use test skills)
- Requirements are unclear (clarify first)
- Task is trivially simple (single line fix)
Pseudo Code
The test-coverage-analyzer workflow follows a standard pipeline pattern.
Core flow:
# test-coverage-analyzer primary flow
input = prepare(raw_data)
result = process(input, config={analysis, analyzer, code, coverage, identify})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Coverage Analysis
# JavaScript/TypeScript
npx jest --coverage
npx nyc report --reporter=text
# Python
pytest --cov=src --cov-report=html
coverage report --show-missing
Gap Analysis
def analyze_gaps(coverage_report):
untested = [f for f in coverage_report.files if f.coverage < 50]
high_risk = [f for f in untested if f.change_frequency > 10]
return sorted(high_risk, key=lambda f: f.coverage)
Common Patterns
- 80% line coverage: Minimum threshold for production code
- 100% coverage on critical paths: Auth, payments, data mutations
- Branch coverage > line: Branch coverage catches more bugs than line coverage
- Ratchet, don't drop: Coverage should only go up over time
How to Use
- Understand the requirement and existing codebase patterns
- Design the solution with error handling and testability in mind
- Implement incrementally with tests for each change
- Verify against expected outcomes (manual and automated)
- Document usage, edge cases, and integration points
- Review with team before merging to shared branches
Red Flags
- Skipping tests to ship faster: Untested code breaks in production when you least expect it
- No error handling in production code: Unhandled errors crash services and lose user data
- Hardcoded configuration values: Hardcoded values prevent environment switching and leak secrets
- Ignoring security implications: Missing input validation, auth bypasses, and injection vulnerabilities
- Over-engineering simple solutions: Premature abstraction adds complexity without proportional benefit
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "Tests slow me down" |
Bugs slow you down 10x more. Tests are speed, not overhead. |
| "I will refactor later" |
Technical debt compounds. Refactor as you go. |
| "It works on my machine" |
If it is not in CI, it does not work. Ship proof, not claims. |
1---2name: test-coverage-analyzer3description: Use when identify untested code paths — coverage reports, gap analysis,4 and test prioritization. Use when working with test coverage analyzer.5domain: development6author: oyi777license: Apache-2.08subdomain: software-development9tags:10- analyzer11- coding12- coverage13- software-engineering14- test15- testing16version: 1.0.017category: development18metadata:19 source: https://skillmd.com/skills/oyi77/test-coverage-analyzer20---21222324## Overview2526Analyze test coverage to find untested code paths, prioritize testing efforts, and track coverage over time. Supports Istanbul/nyc, Jest, Vitest, and Python coverage.py.2728## Capabilities2930- Generate and analyze coverage reports (line, branch, function)31- Identify critical untested code paths32- Prioritize testing by risk (high-traffic, high-change, low-coverage)33- Track coverage trends over time34- Set coverage thresholds and gates3536## When to Use37**Trigger phrases:**38- "test coverage analyzer"39- "testing coverage analyzer"40- "Identify untested code paths — coverage reports, gap analysis, and test prioriti"414243- Before major refactoring — need to know what's tested44- Setting up coverage gates in CI45- Identifying high-risk untested code46- Code review coverage requirements4748## When NOT to Use4950- Task is about deployment, not development (use deploy skills)51- Task is about code review, not writing (use review skills)52- You need to understand existing code first (use research skills)53- Task is about testing only (use test skills)54- Requirements are unclear (clarify first)55- Task is trivially simple (single line fix)565758## Pseudo Code5960The test-coverage-analyzer workflow follows a standard pipeline pattern.6162Core flow:63```64# test-coverage-analyzer primary flow65input = prepare(raw_data)66result = process(input, config={analysis, analyzer, code, coverage, identify})67validate(result)68deliver(result)69```7071Error handling:72```73on error:74 log(error_details)75 retry_with_backoff(max=3)76 if still_failing: alert_and_escalate()77```787980### Coverage Analysis81```bash82# JavaScript/TypeScript83npx jest --coverage84npx nyc report --reporter=text8586# Python87pytest --cov=src --cov-report=html88coverage report --show-missing89```9091### Gap Analysis92```python93def analyze_gaps(coverage_report):94 untested = [f for f in coverage_report.files if f.coverage < 50]95 high_risk = [f for f in untested if f.change_frequency > 10]96 return sorted(high_risk, key=lambda f: f.coverage)97```9899## Common Patterns100101- **80% line coverage**: Minimum threshold for production code102- **100% coverage on critical paths**: Auth, payments, data mutations103- **Branch coverage > line**: Branch coverage catches more bugs than line coverage104- **Ratchet, don't drop**: Coverage should only go up over time105106## How to Use1071081. Understand the requirement and existing codebase patterns1092. Design the solution with error handling and testability in mind1103. Implement incrementally with tests for each change1114. Verify against expected outcomes (manual and automated)1125. Document usage, edge cases, and integration points1136. Review with team before merging to shared branches114115## Red Flags116117- **Skipping tests to ship faster**: Untested code breaks in production when you least expect it118- **No error handling in production code**: Unhandled errors crash services and lose user data119- **Hardcoded configuration values**: Hardcoded values prevent environment switching and leak secrets120- **Ignoring security implications**: Missing input validation, auth bypasses, and injection vulnerabilities121- **Over-engineering simple solutions**: Premature abstraction adds complexity without proportional benefit122123## Verification124125- [ ] Skill output matches expected behavior126127## Process1281291. Analyze the task requirements1302. Apply domain expertise1313. Verify output quality132133## Anti-Rationalization Table134135| Rationalization | Reality |136|---|---|137| "Tests slow me down" | Bugs slow you down 10x more. Tests are speed, not overhead. |138| "I will refactor later" | Technical debt compounds. Refactor as you go. |139| "It works on my machine" | If it is not in CI, it does not work. Ship proof, not claims. |