# Skill Coverage Audit

Trace codepaths in diffs, map against tests, auto-generate missing coverage, use...

- Repository: https://github.com/nyldn/claude-octopus (4351 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add nyldn/claude-octopus --skill skill-coverage-audit -g -a claude-code -y`
Codex: `npx skills add nyldn/claude-octopus --skill skill-coverage-audit -g -a codex -y`
Cursor: `npx skills add nyldn/claude-octopus --skill skill-coverage-audit -g -a cursor -y`
Gemini CLI: `npx skills add nyldn/claude-octopus --skill skill-coverage-audit -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add nyldn/claude-octopus`

## Description

Trace codepaths in diffs, map against tests, auto-generate missing coverage, use before shipping PRs

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Test Coverage Audit

## Artifact consistency before implementation

When invoked at a spec/plan/tasks boundary, use the feature boundary adapter rather than this skill's code-test generation mode. It automatically runs bounded deterministic checks for coverage, declared paths, stable IDs, explicit terminology/enums/counts and verified policy references. A single artifact skips analysis; a clean pass costs no seat. Reports are advisory and quote the original sources. Escalation uses at most one independent seat, and unavailable or failed semantic review leaves the deterministic results usable.

## Overview

Trace every codepath in a diff, map each path against existing tests, visualize coverage gaps, and auto-generate tests for uncovered paths.

**Core principle:** Trace codepaths in changed files -> Map against existing tests -> Score coverage quality -> Generate tests for gaps -> Report before/after counts.

---

## Caps and Limits

These hard limits prevent runaway analysis:

- **30 code paths max** per audit. If a diff yields more than 30, prioritize by complexity and risk (error paths, security-sensitive branches, public API surfaces first).
- **20 tests generated max** per audit. Focus on highest-impact gaps first.
- **2-minute per-test exploration cap.** If understanding a single test path takes longer than 2 minutes, mark it as "needs manual review" and move on.

---

## Phase 1: Codepath Tracing

### Step 1: Identify Changed Files

Determine the diff scope. Use the most relevant source:

```bash
# PR diff
git diff --name-only main...HEAD

# Staged changes
git diff --name-only --cached

# Last commit
git diff --name-only HEAD~1..HEAD
```

Filter to source code files only (exclude configs, docs, generated files).

### Step 2: Trace Data Flow Through Every Branch

For each changed file, you MUST trace:

The rest: https://github.com/nyldn/claude-octopus/blob/HEAD/.claude/skills/skill-coverage-audit/SKILL.md
