incremental-coverage

incremental-coverage is a skill for Claude Code from ZTE-AICloud/Co-OmniSpec. It costs 117 tokens per session (5,301 once invoked), scanned C, original, MIT.

A coverage report focused only on newly added or changed source files. Code coverage measures which parts of the code are exercised by tests, rather than checking the whole project.

In plain words
What is it for?
Use it after implementing a feature or before merging a pull request to collect coverage evidence for changed C/C++, Java, Python, Go, JavaScript, TypeScript, or Rust files.
Why use it?
It avoids the cost and noise of measuring an entire codebase when the immediate question is whether new changes are tested well.

Skill for Claude Code

Written for Claude Code: context: fork in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./build-cov/test_binary --gtest_filter=ChangedSuite.*.

Part of the omni-dsdd plugin — 40 skills, 16 agents, 1 hook shipped together

Good fit Use it after implementing a feature or before merging a pull request to collect coverage evidence for changed C/C++, Java, Python, Go, JavaScript, TypeScript, or Rust files.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/ZTE-AICloud/Co-OmniSpec
agentmods
npx agentmods add skills/zte-aicloud/co-omnispec/incremental-coverage

Made for: Claude Code.

Or install omni-dsdd, the plugin that ships this one along with the rest of its 40 skills, 16 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for incremental-coverage

README.md
[![agentmods](https://agentmods.dev/badge/skills/zte-aicloud/co-omnispec/incremental-coverage.svg)](https://agentmods.dev/skills/zte-aicloud/co-omnispec/incremental-coverage)
Your own site
<a href="https://agentmods.dev/skills/zte-aicloud/co-omnispec/incremental-coverage"><img src="https://agentmods.dev/badge/skills/zte-aicloud/co-omnispec/incremental-coverage.svg" alt="Measured on agentmods" height="20"></a>
Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,301 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00117 $0.05301
Opus 5 $0.00059 $0.02651
Sonnet 5 $0.00023 $0.01060
Haiku 4.5 $0.00012 $0.00530

Measured 8d ago against content hash 06f3131c56f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

incremental-coverage scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf build-cov && cmake -S . -B build-cov -DENABLE_COVERAGE=ON
omni-dsdd/skills/incremental-coverage/SKILL.md · 503 lines

How it starts

The opening of the file, as written. The whole thing — 503 lines — stays where its author put it; the contents beside it link to each section on GitHub.

增量代码覆盖率 (Agent Skill)

仅针对当前开发周期(分支、提交范围或工作区)中变更的文件收集、过滤并报告代码覆盖率。 通过将范围限定为增量变更,避免全量覆盖率的成本和噪声。

适用场景

  • 功能实现后验证测试覆盖率(TDD 第 7 步)
  • 为 Pull Request 或代码评审提供覆盖率证据
  • 检查新增/修改代码是否有充分的测试覆盖
  • implement 技能完成后或 springboot-verification 中作为质量门禁
  • 合并功能分支前验证覆盖率达标

不适用场景

  • 为项目搭建初始覆盖率工具链(应使用 cpp-testingpython-testinggolang-testingrust-testing
  • 运行全量项目覆盖率基线(本技能仅关注增量范围)
  • 调试失败的测试(应使用对应语言的测试技能)
  • 没有测试基础设施的项目

核心概念

  • 增量范围:仅与基准引用(默认 origin/masterorigin/main)相比新增或修改的文件。
  • 流水线模型:识别 → 插桩 → 测试 → 提取 → 报告。每步独立,可单独重跑。
  • 语言适配器:流水线对所有语言通用,仅工具命令按语言切换。
  • 覆盖率阈值:增量文件默认 80% 行覆盖率,可配置。
  • 源文件过滤:收集全量运行数据后,过滤仅展示增量源文件(排除测试文件本身)。

流水线步骤

步骤 1:识别增量文件

确定哪些源文件(非测试文件)被新增或修改。

# 确定基准引用
BASE=$(git merge-base HEAD origin/master 2>/dev/null || git merge-base HEAD origin/main 2>/dev/null)

# 收集变更的源文件(排除测试文件和生成文件)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM "$BASE" HEAD | \
  grep -E '\.(cpp|cxx|cc|c|h|hpp|java|py|go|ts|js|tsx|jsx|rs)$' | \
  grep -v -E '(test|spec|_test|_spec|Test|Spec)' | \
  grep -v -E '(vendor|node_modules|build|dist|__pycache__|target|\.generated\.)')

# 同时包含未跟踪的新文件
UNTRACKED=$(git ls-files --others --exclude-standard | \
  grep -E '\.(cpp|cxx|cc|c|h|hpp|java|py|go|ts|js|tsx|jsx|rs)$' | \
  grep -v -E '(test|spec|_test|_spec|Test|Spec)')

# 合并去重
ALL_CHANGED=$(echo -e "${CHANGED_FILES}\n${UNTRACKED}" | sort -u | sed '/^$/d')

echo "增量源文件:"
echo "$ALL_CHANGED"
echo "---"
echo "合计:$(echo "$ALL_CHANGED" | wc -l) 个文件"

决策点:若 ALL_CHANGED 为空,输出"未检测到增量源文件,覆盖率检查不适用"并正常退出。

步骤 2:检测语言并选择适配器

检测项目的主要编程语言,选择对应的覆盖率工具。

识别标志 语言 覆盖率工具 插桩方式
CMakeLists.txt*.cmake C/C++ (GCC) gcov + lcov -DENABLE_COVERAGE=ON--coverage
CMakeLists.txt + clang++ C/C++ (Clang) llvm-cov -fprofile-instr-generate -fcoverage-mapping
pom.xmlbuild.gradle Java JaCoCo Maven: jacoco-maven-plugin;Gradle: jacoco 插件
setup.pypyproject.tomlrequirements.txt Python pytest-cov pytest --cov
go.mod Go go test -coverprofile go test -coverprofile=coverage.out
package.json(含 jestvitest JS/TS Jest/Vitest --coverage --coverage --coverageReporters=text
Cargo.toml Rust cargo-llvm-cov cargo llvm-cov

Read the full file on GitHub · 503 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 503 lines · 117 tokens per session scan C 06f3131c56f7

Subscribe to this mod's changes

incremental-coverage is a skill published in the GitHub repository ZTE-AICloud/Co-OmniSpec (54 stars, last pushed 1mo ago), licensed MIT. It adds 117 tokens to every session and 5,301 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.