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.
Security Assessment
About validate-coverage-threshold
The 'validate-coverage-threshold' skill is designed to ensure that test coverage meets predefined minimum thresholds, helping teams maintain high-quality code. By analyzing coverage reports from various sources, it validates that the overall and detailed coverage metrics, such as statements, branches, and functions, meet the necessary standards for passing quality assurance checks. This skill helps developers and quality assurance teams quickly identify whether their code meets the required coverage criteria, improving the reliability and maintainability of their codebase.
The skill offers flexibility in coverage validation, with configurable thresholds for various metrics (overall, statements, branches, functions). It parses coverage reports from preferred sources like 'coverage/coverage-summary.json' or fallback to test output text. Upon analysis, the skill returns a structured pass/fail status, accompanied by detailed coverage metrics, identifying files that fall below the specified coverage thresholds. Additionally, it provides a detailed failure report to highlight areas requiring attention. This enables teams to address coverage gaps proactively and maintain code quality at every stage of development.
This skill is particularly valuable in continuous integration (CI) pipelines, pre-commit hooks, and quality gate validation, making it ideal for developers, testers, and DevOps teams. It integrates seamlessly into the development workflow, providing automated coverage validation and ensuring that codebases adhere to quality standards, enhancing the efficiency and reliability of testing processes.
FAQ
What is the default threshold for coverage?
The default thresholds are: 80% overall, 80% for statements, 75% for branches, and 80% for functions.
What type of coverage data sources does this skill support?
The skill supports 'coverage/coverage-summary.json' (preferred, c8/Istanbul) and test output text as fallback sources.
How can I use this skill in my CI/CD pipeline?
This skill can be integrated into your CI/CD pipeline by running it after your test coverage data is generated, typically through a command like 'npm run test -- --coverage'. It validates coverage as part of the pipeline and ensures that it meets the minimum thresholds before proceeding.
What happens if coverage falls below the threshold?
If coverage falls below the threshold, the skill returns a warning status, provides the detailed failed metrics, and lists the uncovered files. It will also indicate whether the process can proceed or if further action is needed.
Is there any configuration needed for this skill?
By default, the skill uses preset thresholds, but you can configure the thresholds as needed to match your project's specific requirements.
Install validate-coverage-threshold
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
BerryKuipers/claude-code-toolkit