# Kcov debug

> Kcov debug is an open-source agent skill for developer tools. Diagnoses and fixes kcov bash and pytest coverage failures in ClaudeSec CI. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/Twodragon0/claudesec/tree/main/.claude/skills/kcov-debug
- **Repository:** https://github.com/twodragon0/claudesec
- **GitHub stars:** 14
- **License:** MIT
- **Skill name:** kcov-debug
- **Collection:** https://github.com/Twodragon0/claudesec
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill is a troubleshooting playbook for the coverage checks in the ClaudeSec project. It sorts a failing or stalled coverage job into a category, such as a hang, a missing merged coverage.json, zero bash coverage, or a result below the bash or Python floor, and then points to the fix for that case.

The guidance centers on a few known causes. Live GitHub API calls made by the dashboard generator can make tests run for minutes, so the playbook says to set an offline environment variable before anything else. It also explains that kcov v42 writes merged output into a nested directory, so file paths should be found rather than hard-coded, and it covers instrumentation pitfalls such as tracing the script instead of the interpreter. Floor changes are treated as a one-way ratchet, and the playbook says to add tests rather than lower thresholds.

It expects a ClaudeSec checkout with its lint workflow, bash and kcov v42, pytest, and the offline mode variable, and it includes local commands for re-running the Python gate and a shell test under kcov.

## When your agent uses it

> Diagnose and fix ClaudeSec coverage failures — kcov bash coverage (scanner-shell-coverage job), pytest scanner/lib gate, hangs, "no coverage.json found", and floor-below-threshold errors. Use when a coverage CI job fails, hangs, reports 0%/missing coverage, or when raising a coverage floor.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/Twodragon0/claudesec/tree/HEAD/.claude/skills/kcov-debug)
- [License: MIT](https://github.com/Twodragon0/claudesec/tree/HEAD/.claude/skills/kcov-debug)

## Features

- **Failure triage decision tree:** Maps a red or slow coverage job to the most likely cause and the section that addresses it.
- **Offline dashboard guard:** Explains why hung tests usually need the offline environment variable and how CI sets it.
- **Merged coverage path discovery:** Shows how to locate the merged kcov JSON with find instead of a fixed path.
- **kcov instrumentation pitfalls:** Covers tracing the script rather than bash and using filename-based include patterns.
- **Coverage floor guidance:** Describes when a bash or Python floor may be raised and why tests should be added instead of lowering thresholds.
- **Local verification commands:** Lists offline commands for running the Python gate, a single kcov test, and reading the merged percentage.

## Good for

- Fix a scanner-shell-coverage CI job that hangs or times out
- Find why the coverage gate reports no coverage.json file
- Investigate bash coverage that suddenly drops below the 90% floor
- Reproduce a slow coverage test locally in offline mode
- Decide whether a coverage floor can safely be raised

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/kcov-debug` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Twodragon0/claudesec.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/kcov-debug &&
cp -R "$tmp/.claude/skills/kcov-debug" ~/.claude/skills/kcov-debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/kcov-debug` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/kcov-debug` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Twodragon0/claudesec.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/kcov-debug &&
cp -R "$tmp/.claude/skills/kcov-debug" ~/.agents/skills/kcov-debug &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/kcov-debug` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/kcov-debug` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Twodragon0/claudesec.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/kcov-debug &&
cp -R "$tmp/.claude/skills/kcov-debug" ~/.cursor/skills/kcov-debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/kcov-debug` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/Twodragon0/claudesec.git --path .claude/skills/kcov-debug
```

Or copy the folder to `~/.gemini/skills/kcov-debug` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/kcov-debug`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Twodragon0/claudesec.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/kcov-debug &&
cp -R "$tmp/.claude/skills/kcov-debug" ~/.copilot/skills/kcov-debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/kcov-debug` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/Twodragon0/claudesec.git
```

Then copy `claudesec/.claude/skills/kcov-debug` into your agent's skills folder as `kcov-debug`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Kcov debug trigger?

It is meant for cases where a coverage CI job fails, hangs, reports 0% or missing coverage, or where a coverage floor is being raised.

### What is the most common cause of a hanging coverage job?

According to the playbook, un-gated live GitHub API calls in the dashboard generator, which is fixed by exporting CLAUDESEC_DASHBOARD_OFFLINE=1.

### Does Kcov debug recommend lowering the coverage floor when a check fails?

No. It says to add or extend tests covering the uncovered code and not to relax the gate.

### Which tools does Kcov debug need?

It references kcov v42, pytest with coverage, bash, and the ClaudeSec lint workflow, and includes local commands for them.

### How do I install Kcov debug in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/kcov-debug to use it in all your projects, or to .claude/skills/kcov-debug in one project.

### Does Kcov debug run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Kcov debug?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Kcov debug?

The closest alternatives to Kcov debug are Ci, Fix ci, Ci config guard claudesec, Ci and Systematic Debugging.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Ci](https://ai-powered.com/skills/ci-maxwell2732): Ci is an open-source agent skill for developer tools.
- [Fix ci](https://ai-powered.com/skills/fix-ci): Fix ci is an open-source agent skill for developer tools.
- [Ci config guard claudesec](https://ai-powered.com/skills/ci-config-guard-claudesec): Ci config guard claudesec is an open-source agent skill for developer tools.
- [Ci](https://ai-powered.com/skills/ci-chachamaru127): Ci is an open-source agent skill for developer tools.
- [Systematic Debugging](https://ai-powered.com/skills/systematic-debugging-joaoariedi): Systematic Debugging is an open-source agent skill for developer tools.
- [GitHub actions public ci diagnostics](https://ai-powered.com/skills/github-actions-public-ci-diagnostics): GitHub actions public ci diagnostics is an open-source agent skill for developer tools.
- [Figure it out](https://ai-powered.com/skills/figure-it-out): Figure it out is an open-source agent skill for developer tools.
- [Coverage loop](https://ai-powered.com/skills/coverage-loop): Coverage loop is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/kcov-debug
