test-coverage

Analyze test coverage gaps, generate missing pytest tests, and enforce coverage thresholds.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/ByronWilliamsCPA/plugin --skill test-coverage-byronwilliamscpa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-coverage
Source: https://github.com/ByronWilliamsCPA/plugin/tree/main/plugins/wff-code/skills/test-coverage
Command: npx skills add https://github.com/ByronWilliamsCPA/plugin --skill test-coverage-byronwilliamscpa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Codebases often have hidden test coverage gaps that let bugs ship to production, and manually finding uncovered functions, writing tests for them, and keeping coverage tooling configured is slow and error-prone. ## Core Features & Use Cases - Coverage Gap Analysis: Runs pytest with branch coverage, parses coverage.json, and ranks uncovered functions by criticality, recency, and complexity. - Automated Test Generation: Spawns writer and reviewer subagents to generate idiomatic pytest tests with iterative refinement until they pass quality review. - Threshold Enforcement & Codecov Audit: Enforces aggregate and optional per-file coverage gates, audits codecov.yaml flags, components, and Test Analytics, and maps OWASP Top 10 categories to existing security tests. - Use Case: Before merging a large PR, run the enforce mode to verify the project meets the 80% line and 70% branch gate, then generate tests for the worst-covered module and audit the Codecov configuration in one workflow. ## Quick Start Ask the agent to analyze test coverage for your project and generate tests for the lowest-coverage module.

Frequently Asked Questions about test-coverage

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

FAQPage Schema
How do I find which functions lack test coverage in pytest?▼

Run pytest with --cov=src --cov-report=json --cov-branch, then parse coverage.json to list files below the threshold. AST analysis of each source file identifies specific uncovered functions with their missing line ranges, ranked by criticality and complexity.

How to enforce a minimum coverage threshold in pytest?▼

Use pytest --cov-fail-under=80 to make the test run exit non-zero when overall coverage drops below 80 percent. Per-file floors are opt-in via the per_file_floor config key, since an aggregate gate alone can mask individual low-coverage files.

Does this coverage analysis support JavaScript or TypeScript projects?▼

Yes, the skill supports Vitest for JS/TS projects in addition to pytest for Python. It auto-detects the framework by checking pyproject.toml, pytest.ini, or package.json before running coverage measurement.

Why does my project pass 80% coverage while some files are below 50%?▼

The default enforcement only checks the aggregate project gate, not per-file floors, so high-coverage files can mask low ones. Set the per_file_floor key in the test-coverage-agent configuration to fail on any individual file below your chosen minimum.

What does the Codecov audit check in codecov.yaml?▼

The audit validates that each test directory has a matching flag with a status check, each source directory has a component, critical modules have 90% overrides, patch target is 90%, and CI uploads use matching flags plus JUnit XML for Test Analytics.