coverage-gate

Enforce merged coverage thresholds and behavioral test quality across test lanes.

10|7|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/xiaolai/tdd-guardian-for-claude --skill coverage-gate-xiaolai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coverage-gate
Source: https://github.com/xiaolai/tdd-guardian-for-claude/tree/main/skills/tdd-guardian/coverage-gate
Command: npx skills add https://github.com/xiaolai/tdd-guardian-for-claude --skill coverage-gate-xiaolai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Raw coverage percentages can pass while tests assert nothing meaningful, and multi-lane coverage reports can silently undercount or double-count lines. This Skill gates commits and pushes on both accurate merged coverage and real behavioral assertions. ## Core Features & Use Cases - Multi-lane coverage merging: Merges reports from every contributing lane using exact per-line union when formats allow, or a flagged weighted approximation when they do not. - Flexible threshold modes: Supports absolute thresholds and a no-decrease mode that compares against a per-branch baseline, plus stricter per-glob critical-path thresholds. - Test quality enforcement: Fails wiring-only tests that assert only mock calls, and audits unreliable v8 ignore next coverage directives. - Use Case: A team with unit, integration, and e2e lanes wants to block a push when the payments module drops below 100% line coverage or when a new test only verifies a mock was called. ## Quick Start Ask the assistant to run the coverage gate for the current trigger and report any threshold, critical-path, or wiring-only test failures.

Frequently Asked Questions about coverage-gate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce coverage thresholds across multiple test lanes?

Run every lane bound to the trigger, collect reports from lanes with coverage set to include, and merge them into one total. Thresholds apply to the merged result, using an exact per-line union when all reports carry line detail.

What is the difference between absolute and no-decrease coverage modes?

Absolute mode requires all metrics to meet configured thresholds. No-decrease mode records a per-branch baseline on first run and only blocks when coverage drops below that baseline, while critical-path thresholds stay fixed in both modes.

Why does my coverage report show 100% but the gate fails?

A report with zero measurable lines scores 100% under the 0/0 convention, so the gate treats it as a failure. Also check that each lane writes its own coverageSummaryPath, since shared paths cause silent undercounting.

How are wiring-only tests detected in coverage gating?

Each test's assertions are classified by level: behavioral checks like return values and state rank Level 1-5, while mock call and argument checks rank Level 6-7. A test whose assertions are all Level 6-7 fails the quality gate.

Does the gate handle metrics a coverage format cannot measure?

Unmeasured metrics are treated as null, producing a warning rather than a failure. For example, coverage.py reports no functions and go-cover reports no branches, so those thresholds should be set to 0.

Why should I avoid v8 ignore next comments for coverage?

The v8 ignore next directive silently fails on nullish coalescing, ternaries, catch bodies, and short-circuit operators. The gate flags these and requires v8 ignore start and stop range pairs instead.