Skip to main content
skill CX Codex

qe-coverage-analysis — Claude Code skill: what it does, how to install

qe-coverage-analysis inspects Istanbul, c8, and lcov data to detect untested paths with risk scoring. Useful when prioritizing test efforts or checking PR quality gates.

MIT 127 installs ★ 533 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add proffesor-for-testing/agentic-qe --skill qe-coverage-analysis -a claude-code
Open on GitHub

What qe-coverage-analysis does

This skill guides agent workflows in evaluating test coverage artifacts generated by Istanbul, c8, or lcov. It applies an O(log n) sublinear gap detection algorithm and scores untested paths against several risk signals: cyclomatic complexity over 10, 90-day edit frequency, 180-day bug history, and domain tags like authentication or payments.

Workflows rely on CLI commands like aqe coverage analyze and aqe coverage diff to compare coverage across branches. The skill appends run statistics to run-history.json after execution, which helps spot downward trends across consecutive pull requests.

Initial runs fail roughly 14% of the time due to an 86% initialization success rate in this specific domain, so keep fallback scripts ready. High branch coverage can also mask tests that lack assertions, making mutation verification necessary.

What it helps with

  • locate untested lines and branches across lcov or c8 files
  • rank testing tasks by business criticality and code complexity
  • compare diff coverage between a feature branch and main
  • enforce pull request quality gates on new code additions

Example prompts for the agent

  • Run coverage analysis on src/ and highlight critical untested paths
  • Compare branch coverage between main and current branch with risk weighting
  • Check our coverage quality gates and save run metrics to history

How to install qe-coverage-analysis

1Skills CLI (Vercel)

npx skills add proffesor-for-testing/agentic-qe --skill qe-coverage-analysis -a claude-code

2Manually: put the files in place

~/.claude/skills/qe-coverage-analysis/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/qe-coverage-analysis/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about qe-coverage-analysis

How to install qe-coverage-analysis in Claude Code?

Run npx skills add proffesor-for-testing/agentic-qe --skill qe-coverage-analysis -a claude-code in your terminal.

What test coverage formats are supported?

It processes test coverage outputs from Istanbul, c8, and lcov formats across statements, branches, and functions.

How does the skill prioritize uncovered code?

It applies weights to cyclomatic complexity, 90-day code churn, past bug occurrences, and domain criticality tags.

Source text

SKILL.md · MIT
---
name: "qe-coverage-analysis"
description: "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."
trust_tier: 3
validation:
  schema_path: schemas/output.json
  validator_path: scripts/validate-config.json
  eval_path: evals/qe-coverage-analysis.yaml
---

# QE Coverage Analysis

## Purpose

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.

## Activation

- When analyzing test coverage
- When identifying coverage gaps
- When prioritizing testing effort
- When setting coverage targets
- When assessing code risk

## Quick Start

```bash
# 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
```

## Agent Workflow

```typescript
// 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")
```

## Analysis Strategies

### 1. Sublinear Gap Detection

```typescript
await coverageAnalyzer.detectGaps({
  algorithm: 'sublinear',  // O(log n) complexity
  source: 'src/**/*.ts',
  metrics: ['statement', 'branch', 'function'],
  sampling: {
    enabled: true,
    confidence: 0.95,
    maxSamples: 1000
  }
});
```

### 2. Risk-Weighted Coverage

```typescript
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
  }
});
```

### 3. Differential Coverage

```typescript
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'
  }
});
```

## Coverage Thresholds

```yaml
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"
```

## Coverage Report

```typescript
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

```yaml
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
```

## Run History

After each coverage analysis, append results to `run-history.json` in this skill directory:
```bash
# 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").

## Skill Composition

- **Coverage dropped?** → Use `/coverage-drop-investigator` to trace the cause
- **Need more tests** → Use `/qe-test-generation` to fill gaps
- **Validate quality** → Use `/mutation-testing` to ensure coverage means quality
- **Ship decision** → Feed into `/qe-quality-assessment` for deployment readiness

## Gotchas

- High line coverage does NOT mean good tests — 100% coverage with 0% assertions is common agent output. Use mutation testing to verify
- coverage-analysis domain has 86% success rate — 14% of runs fail on initialization. Always verify results and have fallback plan (e.g. manual coverage tools)
- Self-learning pipeline may silently stop learning (statusline frozen for days) — only human inspection catches this

## Coordination

**Primary Agents**: qe-coverage-specialist, qe-coverage-analyzer, qe-gap-detector
**Coordinator**: qe-coverage-coordinator
**Related Skills**: qe-test-generation, qe-quality-assessment

© proffesor-for-testing · MIT · proffesor-for-testing/agentic-qe

Similar skills

All skills for Testing and QA →

From the same set73

The whole set →
qe-defect-intelligence qe-defect-intelligence identifies high-risk code before bugs escape by analyzing change frequency, complexity metrics, and past defect patterns. Flags risky PRs and runs root cause analysis on test failures. CX Codex +1 129installs risk-based-testing risk-based-testing directs QA effort to high-risk areas using a 1-5 probability and impact scale, adjusting test depth dynamically. CX Codex +1 128installs n8n-trigger-testing-strategies n8n-trigger-testing-strategies — a skill for testing how n8n workflows get triggered: webhooks, cron schedules, service events, polling. Useful when a workflow fires at the wrong moment or not at all. CX Codex +1 128installs n8n-expression-testing n8n-expression-testing is a Claude Code skill that checks n8n expressions against different data contexts, including missing values, while debugging data transformations. CX Codex +1 127installs test-reporting-analytics test-reporting-analytics generates quality dashboards, executive reports, and failure predictions based on code diffs. Useful when tracking CI/CD trends or preparing release gates. CX Codex +1 126installs qe-iterative-loop qe-iterative-loop — a skill that runs autonomous red-green-refactor cycles: the agent fixes failing tests, achieves coverage targets, and passes quality gates on its own. CX Codex +1 126installs xp-practices xp-practices — a skill for pair programming, continuous integration, TDD, and other extreme programming practices in AI coding. CX Codex +1 125installs context-driven-testing context-driven-testing adapts software testing strategies to specific project constraints, risks, and goals instead of blindly applying generic best practices. CX Codex +1 125installs

Project sponsors

Companies that keep this analytics open