coverage-guard
/coverage-guard
Use when you want to prevent coverage regressions during development. Activate with /coverage-guard to warn when coverage drops below threshold after code changes.
- Author
- proffesor-for-testing ↗
- Repository
- agentic-qe ↗
- Licence
- MIT
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/check-coverage.sh
What it does and when to use it
Use when you want to prevent coverage regressions during development. Activate with /coverage-guard to warn when coverage drops below threshold after code changes.
Original author description
Use when you want to prevent coverage regressions during development. Activate with /coverage-guard to warn when coverage drops below threshold after code changes.
How it works
- What It Does
- Activation
- Configuration
- Hook Configuration
- Enforcement Logic
- Gotchas
SKILL.md preview
---
name: coverage-guard
description: "Use when you want to prevent coverage regressions during development. Activate with /coverage-guard to warn when coverage drops below threshold after code changes."
user-invocable: true
---
# Coverage Guard Mode
When activated, checks coverage after test runs and warns if it drops below the configured threshold.
## What It Does
After any test execution (via Bash tool), compares coverage to the threshold in config.json. Warns (doesn't block) if coverage decreased.
## Activation
```
/coverage-guard
```
## Configuration
Edit `config.json` in this skill directory to set thresholds:
```json
{
"thresholds": {
"statements": 80,
"branches": 70,
"functions": 75,
"lines": 80
},
"coverageCommand": "npx jest --coverage --coverageReporters=json-summary",
"coverageFile": "coverage/coverage-summary.json"
}
```
## Hook Configuration
```json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hook": ".claude/skills/coverage-guard/scripts/check-coverage.sh",
"condition": "command contains 'jest' OR command contains 'vitest' OR command contains 'npm test'"
}
]
}
}
```
## Enforcement Logic
```bash
#!/bin/bash
# check-coverage.sh
COVERAGE_FILE="coverage/coverage-summary.json"
THRESHOLD=80
if [ -f "$COVERAGE_FILE" ]; then
STATEMENTS=$(jq '.total.statements.pct' "$COVERAGE_FILE")
BRANCHES=$(jq '.total.branches.pct' "$COVERAGE_FILE")
if (( $(echo "$STATEMENTS < $THRESHOLD" | bc -l) )); then
echo "WARNING: Statement coverage ($STATEMENTS%) below threshold ($THRESHOLD%)"
echo "Coverage dropped — check which files lost coverage."
fi
if (( $(echo "$BRANCHES < 70" | bc -l) )); then
echo "WARNING: Branch coverage ($BRANCHES%) below 70%"
fi
fi
```
## Gotchas
- Coverage check runs AFTER the test command — if tests crash, no coverage report is generated
- Coverage-summary.json must be configured as a reporter — default Jest config may not include it
- Threshold comparisons use floating point — `79.999%` will trigger below `80%` threshold
- Branch coverage is typically 10-15% lower than line coverage — set thresholds accordingly
Files in this package (2)
- SKILL.md 2 KB
- scripts/check-coverage.sh 1 KB
Versions
The database has no other skills named coverage-guard.
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 3f6ce908cc18 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90Coverage Guard
Use when the user wants to check test coverage, enforce 100% coverage, find uncovered code, add missing tests, or increase code coverage. Works with vitest, jest, react-scripts, and other test runners. Also for 'coverage', 'test coverage', 'cover', 'untested', 'uncovered', 'add… - 100test-coverage
Use when test coverage falls below target or a new module has no tests — identifies untested code paths and writes targeted unit or integration tests to close the coverage gap. - 90test-coverage-improver
Measure JS SDK coverage or address measured coverage gaps. Use for coverage audits and metric regressions, not routine test additions. - 100analyzing-test-coverage
Analyze code coverage metrics and identify untested code paths. Use when analyzing untested code or coverage gaps. Trigger with phrases like "analyze coverage", "check test coverage", or "find untested code". - 100analyzing-test-coverage
Analyze code coverage metrics and identify untested code paths. Use when analyzing untested code or coverage gaps. Trigger with phrases like "analyze coverage", "check test coverage", or "find untested code". - 100codecov-coverage
Fetch and analyze code coverage from Codecov API for the linkml project. Use when checking coverage before making a PR, analyzing coverage changes, or finding low-coverage files.