coverage-analysis

Measure test coverage and enforce ratcheting thresholds in CI.

64|12|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/petrkindlmann/qa-skills --skill coverage-analysis-petrkindlmann
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coverage-analysis
Source: https://github.com/petrkindlmann/qa-skills/tree/main/skills/coverage-analysis
Command: npx skills add https://github.com/petrkindlmann/qa-skills --skill coverage-analysis-petrkindlmann

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Measure and improve test coverage meaningfully. Covers Istanbul/V8/c8/coverage.py configuration, coverage gap analysis methodology, coverage-as-ratchet in CI (never let it decrease), PR coverage diff checks, and distinguishing meaningful from vanity coverage. Use when: "code coverage," "coverage gap," "Istanbul," "coverage threshold," "coverage report," "branch coverage." Related: unit-testing, ci-cd-integration, qa-metrics, ai-qa-review.

Core Features & Use Cases

  • Measure and report coverage across languages and tooling, including line and branch coverage.
  • Enforce a ratchet pattern to ensure coverage never decreases and increases over time.
  • Provide PR-level diffs, per-directory thresholds, and actionable gaps to prioritize fixes.

Quick Start

Run your coverage workflow to generate a report and identify gaps, then enforce the ratchet threshold in CI.

Frequently Asked Questions about coverage-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce a code coverage threshold that never decreases in CI?

Enforce a coverage ratchet threshold in CI to prevent coverage decreases. This approach tracks your current coverage baseline, fails pull requests that lower it, and ensures your test coverage metrics only increase over time.

How do I identify and fix test coverage gaps in a Node.js project?

Identify test coverage gaps by running Istanbul or V8 coverage reports in your Node.js project. This process highlights untested lines and branches, providing actionable insights to prioritize which specific code areas need new tests.

Can I set per-directory coverage thresholds for JavaScript and TypeScript projects?

Yes, you can set per-directory coverage thresholds for JavaScript and TypeScript projects. This allows you to enforce different coverage requirements for various folders, ensuring critical modules meet higher coverage standards than others.

Does this coverage analysis approach work with both Vitest and pytest?

This coverage analysis works with both Vitest and Istanbul for JavaScript/TypeScript Node.js projects, as well as pytest for Python. It configures the respective coverage providers to generate reports and enforce ratcheting thresholds.

What is a PR coverage diff check and how does it improve test coverage?

A PR coverage diff check analyzes code changes in a pull request to ensure new lines are adequately tested. It prevents untested code from merging by comparing the coverage report against the specific diff.

How do I distinguish meaningful test coverage from vanity coverage?

Distinguish meaningful test coverage from vanity coverage by analyzing branch coverage and enforcing a ratcheting threshold in CI. This methodology prioritizes actionable gap analysis over simply chasing high line coverage percentages.