validate-coverage-threshold

Validate JavaScript/TypeScript test coverage against configured thresholds from coverage reports.

7|3|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill validate-coverage-threshold
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: validate-coverage-threshold
Source: https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/skills/quality/validate-coverage-threshold
Command: npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill validate-coverage-threshold

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, grep, bc.

What problem does it solve?

Low test coverage can hide critical bugs and make code changes risky, leading to regressions. This Skill automatically checks if your test coverage metrics meet predefined minimum thresholds.

Core Features & Use Cases

  • Comprehensive Coverage Analysis: Parses test coverage reports (from JSON or text output) to extract overall, statement, branch, and function coverage percentages.
  • Configurable Thresholds: Validates current coverage against customizable minimum thresholds (e.g., 80% overall, 75% branches).
  • Uncovered File Identification: Pinpoints specific files or components that fall below coverage targets, helping prioritize test additions.
  • Use Case: Integrate this Skill into your quality gate or CI/CD pipeline to automatically flag insufficient test coverage, ensuring new code is adequately tested.

Quick Start

Validate coverage with default thresholds (80% overall, 80% statements, 75% branches, 80% functions)

Assumes coverage data is available in coverage/coverage-summary.json or .claude/baseline/test-output.txt.

validate-coverage-threshold

Output:

{

"status": "success",

"coverage": {"overall": 87.5, "statements": 88.2},

"thresholds": {"overall": 80, "statements": 80},

"passed": true,

"failures": []

}

Frequently Asked Questions about validate-coverage-threshold

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

FAQPage Schema
How do I validate test coverage against minimum thresholds in CI/CD?

Test coverage validation checks if your codebase meets predefined coverage targets (e.g., 80% overall, 75% branches) by parsing coverage reports. It automatically flags insufficient coverage in CI/CD pipelines, quality gates, or pre-commit checks, identifying specific files below thresholds and blocking progression when targets aren't met.

What coverage metrics does this Skill analyze and report?

The Skill extracts overall, statement, branch, and function coverage percentages from coverage/coverage-summary.json or test output. It compares each metric against configurable thresholds and outputs structured results showing coverage values, threshold targets, pass/fail status, and uncovered files for prioritized testing.

Can I use this with JavaScript and TypeScript projects?

Yes, this Skill is designed for JavaScript/TypeScript projects using standard coverage report formats. It reads from coverage/coverage-summary.json or test output files, making it compatible with common coverage tools in these ecosystems integrated into CI/CD pipelines and QA workflows.

How do I configure custom coverage thresholds?

The Skill accepts configurable minimum thresholds for overall coverage, statements, branches, and functions. Default values are 80% overall, 80% statements, 75% branches, and 80% functions. You customize these targets to match your project's quality standards before validation runs.

What happens when coverage falls below the configured thresholds?

When coverage metrics fail to meet thresholds, the Skill outputs a failure status with the list of uncovered files and specific metrics that didn't pass. The canProceed flag is set to false, preventing pipeline progression and prompting developers to add tests for flagged components.

Does this Skill work as a pre-commit hook or only in CI/CD pipelines?

Coverage validation works in multiple contexts including CI/CD gates, pre-commit checks, and QA pipelines. It parses local coverage data and returns structured results compatible with hook systems, allowing you to block commits when coverage targets aren't met before code reaches the repository.