.claude/skills/qe-coverage-analysis/SKILL.md
Analyzes test coverage data (Istanbul, c8, lcov) to identify uncovered lines, branches, and functions with risk-weighted gap detection. Use when analyzing coverage reports, identifying coverage gaps, comparing coverage between branches, or prioritizing which untested code to cover first.
npx skillsauth add proffesor-for-testing/agentic-qe qe-coverage-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide the use of v3's advanced coverage analysis capabilities including sublinear gap detection algorithms, risk-weighted coverage scoring, and intelligent test prioritization based on code criticality.
# Analyze coverage with gap detection
aqe coverage analyze --source src/ --tests tests/
# Find high-risk uncovered code
aqe coverage gaps --risk-weighted --threshold 80
# Generate coverage report
aqe coverage report --format html --output coverage-report/
# Compare coverage between branches
aqe coverage diff --base main --head feature-branch
// Comprehensive coverage analysis
Task("Analyze coverage gaps", `
Perform O(log n) coverage analysis on src/:
- Calculate statement, branch, function coverage
- Identify uncovered critical paths
- Risk-weight gaps by code complexity and change frequency
- Recommend tests to write for maximum coverage impact
`, "qe-coverage-specialist")
// Risk-based prioritization
Task("Prioritize coverage effort", `
Analyze coverage gaps and prioritize by:
- Business criticality (payment, auth, data)
- Code complexity (cyclomatic > 10)
- Recent bug history
- Change frequency
Output prioritized list of files needing tests.
`, "qe-coverage-analyzer")
await coverageAnalyzer.detectGaps({
algorithm: 'sublinear', // O(log n) complexity
source: 'src/**/*.ts',
metrics: ['statement', 'branch', 'function'],
sampling: {
enabled: true,
confidence: 0.95,
maxSamples: 1000
}
});
await coverageAnalyzer.riskWeightedAnalysis({
coverage: coverageReport,
riskFactors: {
complexity: { weight: 0.3, threshold: 10 },
changeFrequency: { weight: 0.25, window: '90d' },
bugHistory: { weight: 0.25, window: '180d' },
criticality: { weight: 0.2, tags: ['payment', 'auth'] }
},
output: {
riskScore: true,
prioritizedGaps: true
}
});
await coverageAnalyzer.diffCoverage({
base: 'main',
head: 'feature-branch',
requirements: {
newCode: 80, // New code must have 80% coverage
modifiedCode: 'maintain', // Don't decrease existing
deletedCode: 'ignore'
}
});
thresholds:
global:
statements: 80
branches: 75
functions: 85
lines: 80
per_file:
min_statements: 70
critical_paths: 90
new_code:
statements: 85
branches: 80
exceptions:
- path: "src/migrations/**"
reason: "Database migrations"
- path: "src/generated/**"
reason: "Auto-generated code"
interface CoverageAnalysis {
summary: {
statements: { covered: number; total: number; percentage: number };
branches: { covered: number; total: number; percentage: number };
functions: { covered: number; total: number; percentage: number };
};
gaps: {
file: string;
uncoveredLines: number[];
uncoveredBranches: BranchInfo[];
riskScore: number;
suggestedTests: string[];
}[];
trends: {
period: string;
coverageChange: number;
newGaps: number;
closedGaps: number;
};
recommendations: {
priority: 'critical' | 'high' | 'medium' | 'low';
file: string;
action: string;
expectedImpact: number;
}[];
}
quality_gates:
coverage:
block_merge:
- new_code_coverage < 80
- coverage_regression > 5
- critical_path_uncovered
warn:
- overall_coverage < 75
- branch_coverage < 70
metrics:
- track_trends: true
- alert_on_decline: 3 # consecutive PRs
After each coverage analysis, append results to run-history.json in this skill directory:
# Read current history, append new entry, write back
node -e "
const fs = require('fs');
const h = JSON.parse(fs.readFileSync('.claude/skills/qe-coverage-analysis/run-history.json'));
h.runs.push({date: new Date().toISOString().split('T')[0], statements_pct: STATEMENTS, branches_pct: BRANCHES, gaps_found: GAPS});
fs.writeFileSync('.claude/skills/qe-coverage-analysis/run-history.json', JSON.stringify(h, null, 2));
"
Read run-history.json before each run to detect trends (e.g., "coverage dropped 3 consecutive times").
/coverage-drop-investigator to trace the cause/qe-test-generation to fill gaps/mutation-testing to ensure coverage means quality/qe-quality-assessment for deployment readinessPrimary Agents: qe-coverage-specialist, qe-coverage-analyzer, qe-gap-detector Coordinator: qe-coverage-coordinator Related Skills: qe-test-generation, qe-quality-assessment
development
Apply XP practices including pair programming, ensemble programming, continuous integration, and sustainable pace. Use when implementing agile development practices, improving team collaboration, or adopting technical excellence practices.
development
Warehouse Management System testing patterns for inventory operations, pick/pack/ship workflows, wave management, EDI X12/EDIFACT compliance, RF/barcode scanning, and WMS-ERP integration. Use when testing WMS platforms (Blue Yonder, Manhattan, SAP EWM).
testing
Advanced visual regression testing with pixel-perfect comparison, AI-powered diff analysis, responsive design validation, and cross-browser visual consistency. Use when detecting UI regressions, validating designs, or ensuring visual consistency.
development
Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.