Skip to content
Skills Library
Programming · Testing

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.

Repository
agentic-qe ↗
Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 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

  1. What It Does
  2. Activation
  3. Configuration
  4. Hook Configuration
  5. Enforcement Logic
  6. Gotchas
Original SKILL.md headings · 78 lines, 247 words
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.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.