Agent skill

validate-coverage-threshold

Validate test coverage meets minimum thresholds (default 80% overall, 80% statements, 75% branches, 80% functions). Parses coverage reports from coverage/coverage-summary.json or test output. Returns pass/fail status with detailed metrics and identifies uncovered files.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/validate-coverage-threshold

SKILL.md

Validate Coverage Threshold

Parses test coverage reports and validates that coverage meets minimum thresholds for quality assurance.

Usage

This skill checks test coverage data against configurable thresholds and returns structured validation results.

Default Thresholds

json
{
  "overall": 80,
  "statements": 80,
  "branches": 75,
  "functions": 80
}

Output Format

All Thresholds Met

json
{
  "status": "success",
  "coverage": {
    "overall": 87.5,
    "statements": 88.2,
    "branches": 84.1,
    "functions": 89.3
  },
  "thresholds": {
    "overall": 80,
    "statements": 80,
    "branches": 75,
    "functions": 80
  },
  "passed": true,
  "failures": [],
  "canProceed": true
}

Below Threshold

json
{
  "status": "warning",
  "coverage": {
    "overall": 75.3,
    "statements": 76.1,
    "branches": 72.8,
    "functions": 78.2
  },
  "thresholds": {
    "overall": 80,
    "statements": 80,
    "branches": 75,
    "functions": 80
  },
  "passed": false,
  "failures": [
    "overall:75.3%<80%",
    "statements:76.1%<80%"
  ],
  "uncoveredFiles": [
    {"file": "src/utils/helpers.ts", "coverage": 45.2}
  ],
  "canProceed": false,
  "details": "Coverage below threshold: 4 metric(s) failed"
}

When to Use

  • Quality gate validation (Conductor Phase 3)
  • After running tests with coverage
  • Pre-commit checks
  • CI/CD pipeline validation

Coverage Data Sources

  • coverage/coverage-summary.json (preferred - c8/Istanbul)
  • Test output text (fallback)

Requirements

  • Coverage data generated by test run
  • Run npm run test -- --coverage first

Didn't find tool you were looking for?

Be as detailed as possible for better results