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.
git clone --depth 1 https://github.com/ZTE-AICloud/Co-OmniSpecnpx agentmods add skills/zte-aicloud/co-omnispec/incremental-coverageWrote 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.
[](https://agentmods.dev/skills/zte-aicloud/co-omnispec/incremental-coverage)<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>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.
| Model | Per session | Once 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 |
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 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-testing、python-testing、golang-testing或rust-testing) - 运行全量项目覆盖率基线(本技能仅关注增量范围)
- 调试失败的测试(应使用对应语言的测试技能)
- 没有测试基础设施的项目
核心概念
- 增量范围:仅与基准引用(默认
origin/master或origin/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.xml 或 build.gradle |
Java | JaCoCo | Maven: jacoco-maven-plugin;Gradle: jacoco 插件 |
setup.py、pyproject.toml、requirements.txt |
Python | pytest-cov | pytest --cov |
go.mod |
Go | go test -coverprofile | go test -coverprofile=coverage.out |
package.json(含 jest 或 vitest) |
JS/TS | Jest/Vitest --coverage |
--coverage --coverageReporters=text |
Cargo.toml |
Rust | cargo-llvm-cov | cargo llvm-cov |
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.
- 8d ago First seen · 503 lines · 117 tokens per session scan C 06f3131c56f7
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.
Other skills, from other repositories
engram-testing-coverage
TDD and coverage standards for Engram. Trigger: When implementing behavior changes in any package.
nw-fp-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec.
strict-tdd
Strict RED->GREEN->REFACTOR test-driven development with enforcement. Never write production code before a failing test. Atomic commits per TDD cycle.
mobiai-mobile-tdd
You MUST use this before writing any implementation code for a mobile feature, bug fix, refactor, or behavior change. Tests come before implementation — no exceptions.
tdd
This skill should be used when the user wants to implement features or fix bugs using test-driven development. Enforces the RED-GREEN-REFACTOR cycle with vertical slicing, context isolation between test writing and implementation, human checkpoints, and auto-test feedback loops. Uses multi-agent orchestration with the…
conductor-implement
Execute tasks from a track's implementation plan following TDD workflow.