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.
How do I install this agent skill?
npx skills add https://github.com/proffesor-for-testing/agentic-qe --skill coverage-guardIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill is a development utility designed to monitor test coverage. It uses automated hooks to execute a local script after test commands are run. The script utilizes dynamic execution via Node.js to parse coverage data from the filesystem, which introduces a minor indirect prompt injection surface if the coverage reports are maliciously crafted.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
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:
{
"thresholds": {
"statements": 80,
"branches": 70,
"functions": 75,
"lines": 80
},
"coverageCommand": "npx jest --coverage --coverageReporters=json-summary",
"coverageFile": "coverage/coverage-summary.json"
}
Hook Configuration
{
"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
#!/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 below80%threshold - Branch coverage is typically 10-15% lower than line coverage — set thresholds accordingly
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/proffesor-for-testing/agentic-qe/coverage-guard">View coverage-guard on skillZs</a>