coverage-check

Lightweight test coverage analysis using git and file system heuristics. Identifies source files with no corresponding test file. No coverage tools required — works on any project by pattern matching. The CHECK skill for testing, analogous to validate-docs for documentation.

23 stars

Best use case

coverage-check is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Lightweight test coverage analysis using git and file system heuristics. Identifies source files with no corresponding test file. No coverage tools required — works on any project by pattern matching. The CHECK skill for testing, analogous to validate-docs for documentation.

Teams using coverage-check should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/coverage-check/SKILL.md --create-dirs "https://raw.githubusercontent.com/christophacham/agent-skills-library/main/skills/ai-ml/coverage-check/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/coverage-check/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How coverage-check Compares

Feature / Agentcoverage-checkStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Lightweight test coverage analysis using git and file system heuristics. Identifies source files with no corresponding test file. No coverage tools required — works on any project by pattern matching. The CHECK skill for testing, analogous to validate-docs for documentation.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Skill: Coverage Check

## What This Skill Does

Performs a fast, lightweight coverage check by matching source files against test files using naming conventions. No coverage tools, no test execution, no source file reads — just file system patterns.

Answers: "Which source files have no corresponding test file?"

## When to Use

- At session start (via `smart-start`) to assess test health
- Before `add-tests` to know where to focus
- As a quick health check: "how's our test coverage?"

Do NOT use this for detailed coverage analysis — use actual coverage tools for that. This is a fast heuristic.

## Execution Model

- **Always**: the primary agent runs this skill directly.
- **Token budget**: ~1-2k tokens. This is intentionally minimal.
- **Output**: chat-based coverage report.

## Workflow

### Step 1: Detect Test Patterns

Identify how the project names test files:

```bash
# Find test files and extract naming pattern
find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" | head -5
```

Common patterns:

| Pattern | Convention |
|---------|-----------|
| `src/foo.ts` → `src/foo.test.ts` | Co-located |
| `src/foo.ts` → `tests/foo.test.ts` | Separate directory |
| `src/foo.ts` → `__tests__/foo.test.ts` | Jest convention |
| `src/foo.py` → `tests/test_foo.py` | Python convention |
| `src/foo.go` → `src/foo_test.go` | Go convention |

### Step 2: Map Source to Tests

For each source file, check if a corresponding test file exists:

```bash
# Example for Python
for src in $(find src -name "*.py" ! -name "__init__.py" ! -path "*/test*"); do
    base=$(basename "$src" .py)
    if ! find tests -name "test_${base}.py" | grep -q .; then
        echo "UNCOVERED: $src"
    fi
done
```

### Step 3: Generate Report

```markdown
## Coverage Check

| Metric | Value |
|--------|-------|
| Source files | N |
| Test files | N |
| Coverage ratio | N% |

### Uncovered Files (no test file found)

| File | Module | Risk |
|------|--------|------|
| src/auth/login.ts | auth | High (handles user input) |
| src/utils/format.ts | utils | Low (pure utility) |

### Well-Covered Modules
- api/ (8/8 files have tests)
- models/ (5/5 files have tests)

### Recommendation
Focus `add-tests` on: auth/login.ts, data/repository.ts
```

## Rules

1. **No test execution**: this skill never runs tests. It only checks file existence.
2. **Heuristic, not precise**: file-based matching is approximate. A test file existing doesn't mean it has good coverage. Flag this in the report.
3. **Fast**: should complete in under 5 seconds. No source file reads.
4. **Convention-aware**: detect the project's test naming convention before matching. Don't assume.
5. **No built-in explore agent**: do NOT use the built-in `explore` subagent type.

Related Skills

tpscheck-automation

23
from christophacham/agent-skills-library

Automate Tpscheck tasks via Rube MCP (Composio). Always search tools first for current schemas.

mailcheck-automation

23
from christophacham/agent-skills-library

Automate Mailcheck tasks via Rube MCP (Composio). Always search tools first for current schemas.

identitycheck-automation

23
from christophacham/agent-skills-library

Automate Identitycheck tasks via Rube MCP (Composio). Always search tools first for current schemas.

pytest-coverage

23
from christophacham/agent-skills-library

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.

coverage-analysis

23
from christophacham/agent-skills-library

Coverage analysis measures code exercised during fuzzing. Use when assessing harness effectiveness or identifying fuzzing blockers.

genderapi-io-automation

23
from christophacham/agent-skills-library

Automate Genderapi IO tasks via Rube MCP (Composio). Always search tools first for current schemas.

gender-api-automation

23
from christophacham/agent-skills-library

Automate Gender API tasks via Rube MCP (Composio). Always search tools first for current schemas.

fred-economic-data

23
from christophacham/agent-skills-library

Query FRED (Federal Reserve Economic Data) API for 800,000+ economic time series from 100+ sources. Access GDP, unemployment, inflation, interest rates, exchange rates, housing, and regional data. Use for macroeconomic analysis, financial research, policy studies, economic forecasting, and academic research requiring U.S. and international economic indicators.

fidel-api-automation

23
from christophacham/agent-skills-library

Automate Fidel API tasks via Rube MCP (Composio). Always search tools first for current schemas.

fastapi-templates

23
from christophacham/agent-skills-library

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

fastapi-router-py

23
from christophacham/agent-skills-library

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or add...

fastapi-pro

23
from christophacham/agent-skills-library

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns.