Skip to main content
command CX Codex

speckit.companion.living-coverage — Claude Code command

speckit.companion.living-coverage — a command that reports which living-spec requirements have mapped tests and which remain uncovered. It runs read-only and never halts your workflow.

MIT ★ 110 updated 2026-10-19

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/speckit.companion.living-coverage.md
Open on GitHub

What speckit.companion.living-coverage does

The command scans your capability spec file (.spec.md) and its sibling coverage map (.coverage.md), extracts requirement IDs like FR-NNN or NFR-NNN, and checks whether each appears in the coverage file alongside a test reference (a .test.* or .spec.* path, a tests/... entry, or a file::TestCase nodeid). Covered requirements are flagged; uncovered ones stand out. Requires Python 3 — if it is not available, the command warns and exits cleanly.

Coverage is a signal, not a gate. For each uncovered requirement, you can add a test and update the map, or accept the gap for now. The command does not block your pipeline and runs independently of other checks.

What it helps with

  • identify spec requirements without mapped tests
  • update a capability's test coverage map
  • audit a single component for coverage gaps
  • export coverage data in machine-readable format

Example prompts for the agent

  • Show requirement coverage across all capabilities
  • Check which requirements in the billing component lack tests
  • Output the coverage report as JSON

How to install speckit.companion.living-coverage

Manually: put the files in place

.claude/commands/speckit.companion.living-coverage.md

Call it with /speckit.companion.living-coverage. For all projects use ~/.claude/commands/

Questions about speckit.companion.living-coverage

How do I install speckit.companion.living-coverage in Claude Code?

Add speckit.companion.living-coverage.md to the .claude/commands/ directory in your repository.

What does speckit.companion.living-coverage do?

It checks each requirement in your living spec to see whether a test is mapped in the coverage file. It reports which requirements are covered and which are open.

What if a capability has no .coverage.md file?

All its requirements will show as uncovered. This is not an error — the command always succeeds. Either add tests and create the coverage map, or leave it for later.

Source text

speckit.companion.living-coverage.md · MIT
---
description: "Report living-spec requirement→test coverage — per requirement, whether its coverage tier maps a test (opt-in, read-only, never halts)"
---

# Spec Coverage

Show, for each living-spec capability, which of its requirements have a test mapped in the capability's coverage-tier sibling (the `*.coverage.md` next to its spec — `spec.coverage.md` for a centralized `capabilities/<name>/<name>.spec.md`, or `<base>.coverage.md` for a colocated spec) and which are still uncovered. A living spec's requirements file says **what** the area must do; its coverage tier says **which test proves each one**. This command reads both and reports the gap. **Read-only** — it never edits anything — and it **never fails** (always exits success). It's the conformance on-ramp, a signal you act on, not a gate that blocks you (the same contract as `speckit.companion.living-drift`).

This is **opt-in**. With living specs disabled (or no config), it reports nothing and exits clean. A capability that ships only a `.spec.md` with no `.coverage.md` sibling reports every requirement uncovered — never an error.

## Prerequisites

- Verify Python is available by running `python3 --version`.
- If `python3` is not available, warn the user and skip:
  `[companion] Warning: python3 not detected; skipped coverage`.
  Do not fail the host command.

## Execution

Run the coverage checker from the repository root:

```bash
python3 .specify/extensions/companion/scripts/check-coverage.py
```

The script reads the capability registry (`living-specs.yml`), reuses the
resolver for the capability and tier paths, extracts each requirement id
(`FR-NNN` / `NFR-NNN`) from the capability's `.spec.md`, and looks each id up in
its `.coverage.md` map. A requirement is **covered** when its id appears in the
coverage file on a line that also names at least one test (a `.test.` / `.spec.`
path, a `tests/...` reference, or a `file::TestCase` nodeid); otherwise it's
**uncovered**.

Restrict to one capability by name, or get a machine-readable object:

```bash
python3 .specify/extensions/companion/scripts/check-coverage.py --capability billing
python3 .specify/extensions/companion/scripts/check-coverage.py --json
```

## What to do with the report

Coverage is a signal, not an error. For each uncovered requirement, either add a
test and map it in the capability's `.coverage.md`, or accept the gap for now. The
command never blocks the pipeline on its own.

© alfredoperez · MIT · alfredoperez/speckit-companion

Similar slash commands

All slash commands for Testing and QA →

From the same set83

The whole set →
speckit.companion.after-specify speckit.companion.after-specify — a command for Claude Code and Codex that writes the current spec-kit step to .spec-context.json for the Companion GUI. Runs from the repository root after the specify stage completes. CX Codex +1 ★ 110repo stars speckit.companion.after-implement speckit.companion.after-implement — a command that writes implement step progress from tasks.md into .spec-context.json for the Companion GUI. CX Codex +1 ★ 110repo stars speckit.companion.after-tasks speckit.companion.after-tasks records task completion in .spec-context.json for Companion GUI. Intended to run from the repository root right after completing tasks. CX Codex +1 ★ 110repo stars speckit.companion.before-step The speckit.companion.before-step command records a spec-kit step’s start in .spec-context.json for the Companion GUI. Run it before specify, plan, tasks, or implement. CX Codex +1 ★ 110repo stars bench-sync bench-sync — a command for Claude Code and Codex that bakes benchmark cells and measures the current spec-kit and Companion extension versions. Use it to track how performance changes as tools are updated. CX Codex +1 ★ 110repo stars speckit.companion.living-show speckit.companion.living-show is a Claude Code command that prints requirement headings, one complete requirement, or rules tied to a file. Run it to inspect a specific part of a living spec without opening the whole document. CX Codex +1 ★ 110repo stars speckit.companion.status speckit.companion.status — a command for Claude Code and Codex reads .spec-context.json and reports the active spec’s step, status, decisions, and next action. It is read-only. CX Codex +1 ★ 110repo stars speckit.plan speckit.plan runs an implementation planning workflow from a feature spec, generating research.md, data models, and API contracts. CX Codex GP ChatGPT ★ 110repo stars

Project sponsors

Companies that keep this analytics open