kiln-coverage

Enforce an 80% line and branch coverage gate for changed files.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/yoshisada/ai-repo-template --skill kiln-coverage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kiln-coverage
Source: https://github.com/yoshisada/ai-repo-template/tree/main/plugin-kiln/skills/kiln-coverage
Command: npx skills add https://github.com/yoshisada/ai-repo-template --skill kiln-coverage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Verify that the codebase meets the 80% test coverage requirement from the constitution.

Core Features & Use Cases

  • Automated coverage enforcement: checks line and branch coverage for changed files against an 80% threshold.
  • On-demand tool provisioning: installs a coverage tool (e.g., @vitest/coverage-v8, c8, istanbul) if missing.
  • Targeted evaluation: runs tests with coverage, parses reports, and reports per-file and overall results for the changed files only.
  • Output-driven decisions: emits a pass when both line and branch coverage meet or exceed 80%, otherwise fails and lists uncovered files.
  • Changed-file focus: uses git diff main...HEAD --name-only to identify touched files; handles cases with no tests gracefully.

Quick Start

Run the kiln-coverage workflow on the current branch to assess 80% coverage for changed files.

Frequently Asked Questions about kiln-coverage

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

FAQPage Schema
How do I enforce an 80% test coverage gate for changed files in a feature branch?

To enforce an 80% test coverage gate, the Skill evaluates line and branch coverage for files touched since main using git diff. It runs tests, parses coverage reports, and fails if thresholds are not met.

How does test coverage evaluation work when there are no new tests for changed code?

Test coverage evaluation handles cases with no tests gracefully by evaluating the changed files identified through git diff main...HEAD. It generates per-file and overall results, reporting pass or fail against the 80% threshold.

Do I need to install a coverage tool before running tests against the 80% threshold?

You do not need to install a coverage tool beforehand. The Skill provides on-demand tool provisioning, automatically installing a tool like @vitest/coverage-v8, c8, or istanbul if one is missing.

What is the difference between line and branch coverage when gating code changes?

Line coverage checks if executed statements are tested, while branch coverage verifies code paths. The Skill evaluates both metrics for changed files against an 80% threshold, emitting a pass only when both meet requirements.

Why does my code change fail the coverage check even though overall project coverage is high?

Your code change fails because the Skill applies a targeted evaluation, enforcing the 80% threshold strictly on changed files identified by git diff main...HEAD, rather than measuring the overall project coverage.