# 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.

- **Type:** Skill
- **Install:** `agentstack add skill-proffesor-for-testing-agentic-qe-coverage-guard`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [proffesor-for-testing](https://agentstack.voostack.com/s/proffesor-for-testing)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [proffesor-for-testing](https://github.com/proffesor-for-testing)
- **Source:** https://github.com/proffesor-for-testing/agentic-qe/tree/main/.claude/skills/coverage-guard
- **Website:** https://agentic-qe.dev/

## Install

```sh
agentstack add skill-proffesor-for-testing-agentic-qe-coverage-guard
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [proffesor-for-testing](https://github.com/proffesor-for-testing)
- **Source:** [proffesor-for-testing/agentic-qe](https://github.com/proffesor-for-testing/agentic-qe)
- **License:** MIT
- **Homepage:** https://agentic-qe.dev/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-proffesor-for-testing-agentic-qe-coverage-guard
- Seller: https://agentstack.voostack.com/s/proffesor-for-testing
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
