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.
Install this agent skill to your Project
npx add-skill https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/api-skills-source/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
{
"overall": 80,
"statements": 80,
"branches": 75,
"functions": 80
}
Output Format
All Thresholds Met
{
"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
{
"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 -- --coveragefirst
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
validate-typescript
Run TypeScript compiler type-checking (tsc --noEmit) to validate type safety and catch type errors. Returns structured output with error counts, categories (type/syntax/import errors), and affected files. Used for quality gates and pre-commit validation.
quality-gate
Comprehensive quality validation for TypeScript/JavaScript projects - runs TypeScript checks, tests, coverage analysis, build validation, and linting with structured JSON results
run-comprehensive-tests
Execute comprehensive test suite (Vitest/Jest) with coverage reporting and failure analysis. Returns structured output with test counts (total/passed/failed), coverage percentage, duration, and detailed failure information. Used for quality gates and CI/CD validation.
validate-build
Run production build validation (npm run build, vite build, tsc) to ensure code compiles and builds successfully. Returns structured output with build status, duration, size metrics, and error details. Used for quality gates and deployment readiness checks.
validate-lint
Run ESLint and Prettier validation to check code style, formatting, and best practices. Returns structured output with error/warning counts, rule violations, and affected files. Used for code quality gates and pre-commit validation.
validate-git-hygiene
Validate git commit messages, branch naming conventions, and repository hygiene. Returns structured output with validation results for commit format (conventional commits), branch naming, and best practices. Used for quality gates and git workflow validation.
Didn't find tool you were looking for?