# test-coverage-auditor

> Your CI dashboard shows 78% line coverage. Your CTO calls it "good enough.

test-coverage-auditor is a free AI agent skill on Agensi by Timoranjes, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Timoranjes](https://www.agensi.io/creators/zicheng-liao)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Uses: 16
- Version: 1.0
- Last updated: 2026-05-25
- Security: scan passed (2026-05-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/test-coverage-auditor
- Tags: code-quality, software-architecture, testing

## About this skill

### The Problem

Your CI dashboard shows 78% line coverage. Your CTO calls it "good enough." But that 78% doesn't tell you that the payment processing module at `src/payments/refund.ts` has zero tests, that the auth token validator at `src/auth/validateToken()` has a test that only checks `toBeDefined()`, and that the CSV parser at `src/utils/parse.ts` has tests but none cover null input. The coverage number looks fine. The untested critical paths are a time bomb.

### What You Get

- **Detect your testing framework** automatically — Jest, Vitest, Pytest, Go testing, Rust `#[test]`, Mocha — so you get language-appropriate mapping rules without configuration
- **Map every source file to its test files** using framework-specific naming conventions (`login.ts` → `login.test.ts`, `test_login.py`, `store_test.go`) and flag files with zero test coverage
- **Categorize untested exports by risk** — Critical (auth, payments, data persistence), Warning (utilities, transformations), Info (constants, types) — so you write tests for what matters first
- **Identify tested-but-incomplete coverage** — files that have test files but miss null/empty/boundary/error-state edge cases, which static coverage tools report as "covered"
- **Detect weak assertions** — tests that pass without asserting meaningful outcomes (`expect(result).toBeDefined()`, bare function calls with no assert), inflating confidence without verifying behavior
- **Generate a prioritized remediation plan** — top 3 highest-risk untested functions, quick-win pure functions testable in under 5 minutes, and framework recommendations when no testing infrastructure exists

### Why This Beats Prompting It Yourself

Running `jest --coverage` gives you a percentage and a per-file heat map. It doesn't tell you that the 3 untested files are all in your payments directory, that the "tested" file only exercises one of four exported functions, or that the test for your token validator uses a mock that bypasses the actual validation logic. This skill reads both source and test files, matches actual function calls against exports, and produces a risk-weighted gap map — the difference between "we have coverage" and "we have coverage of what matters."

### Example Session

You: "Audit test coverage for this Node.js project before we start the testing sprint"

Agent:

```
TEST COVERAGE AUDIT REPORT
══════════════════════════

CRITICAL — PUBLIC API WITH ZERO TESTS
─────────────────────────────────────
File                       Function                Lines   Risk
─────────────────────────  ──────────────────────  ──────  ────────────────────
src/payments/refund.ts     refundOrder()           30-88   Handles money
src/payments/refund.ts     validateRefundAmount()  90-112  Financial validation
src/auth/validateToken.ts  verifyJWT()             15-42   Authentication

WARNING — TESTED BUT MISSING EDGE CASES
───────────────────────────────────────
File                Function    Missing Cases
──────────────────  ──────────  ────────────────────────────────────────
src/utils/parse.ts  parseCSV()  null input, empty string, malformed rows

TESTED BUT WEAK ASSERTIONS
──────────────────────────
File                  Test             Problem
────────────────────  ───────────────  ──────────────────────────────
tests/export.test.ts  "runs exporter"  No assertion on output content

TOP 3 PRIORITIES
────────────────
1. validateRefundAmount() — auth bypass risk on refund edge cases
2. verifyJWT() — current test mocks away actual verification
3. parseCSV() — null/empty input
```
### Use Cases

- Planning a test-writing sprint — get a prioritized queue of what needs tests before you start
- Pre-deployment risk assessment — identify untested critical paths before go-live
- Inheriting an unknown codebase — map the test debt landscape in 5 minutes
- QA risk concentration analysis — find where untested code overlaps with money/auth paths
- Validating that coverage tool numbers match reality — pair with this audit to catch inflated metrics
- Team sprint planning — assign test-writing tasks based on risk priority, not file order

### Known Limitations

This is static source-to-test mapping — it cannot execute tests or measure runtime coverage percentages. Go/Rust colocated tests require checking same-directory patterns, not just `tests/` folders. Generated code, vendored dependencies, and ORM migrations may produce false "untested" flags if exclusions aren't configured. For runtime coverage numbers, pair with `pytest --cov` or `jest --coverage`.

### Upgrade to Pro
Free maps the coverage gaps. **Test Coverage Auditor Pro ($5)** closes them: framework-aware test generation, edge-case matrices, mutation testing, and CI coverage trending. Upgrade when hand-writing tests is the bottleneck — [Pro version](https://www.agensi.io/skills/test-coverage-auditor-pro).

## Requires

- Python

## Known limitations

This is static source-to-test mapping — it cannot execute tests or measure runtime coverage percentages. Go/Rust colocated tests require checking same-directory patterns, not just `tests/` folders. Generated code, vendored dependencies, and ORM migrations may produce false "untested" flags if exclusions aren't configured. For runtime coverage numbers, pair with `pytest --cov` or `jest --coverage`.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the test-coverage-auditor skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this auditor differ from standard coverage tools like Istanbul or Cobertura?

While standard tools provide a total percentage, this skill performs semantic analysis to prioritize untested code by risk level (like auth or APIs) and suggests specific edge cases you might have missed.

### Which environments and programming languages are supported?

The skill works with any agent capable of file-system access or GitHub integration, and it automatically detects frameworks for JavaScript, TypeScript, Python, Go, and Rust.

### What is required to set up the Test Coverage Auditor?

The skill is designed to run within your existing AI agent environment; simply provide it with access to your repository or specific source files to begin the audit.

### What exactly am I receiving with this purchase?

Your purchase includes the full skill logic, instructions for your AI agent, and access to all future version updates to ensure compatibility with evolving testing frameworks.

### Can I use this on a project with a non-standard file structure or custom testing scripts?

Yes, the auditor can handle custom naming conventions and directory structures by specifying your unique file patterns during the initial rollout.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
