coverage
Skill400 starsChanged 7 days agoMITView on GitHub
Measure and raise test coverage for a module — toolchain check, baseline against main, a fast per-file llvm-cov loop, reading the numbers without chasing instrumentation noise, and the tactics that close the last gap. Use for "improve coverage of src/X.rs" or a pre-PR coverage check.
- Installs packages
28 other projects use a version of this.
Adopted by
Most recently taken up by
- KadirHarmanc/nazar-skilltheir own version, first seen Nov 8, 2026
- LeanMeanCleanApps/CleanModelContextProtocoltheir own version, first seen Nov 8, 2026
- AsiaOstrich/EngramGraphtheir own version, first seen Nov 8, 2026
- grodowski/undercover-claudetheir own version, first seen Nov 7, 2026
- AsiaOstrich/universal-dev-standardstheir own version, first seen Nov 1, 2026
- mystilleef/spae-frameworktheir own version, first seen Oct 28, 2026
Used with
Projects with it also use scan, lint and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
rajnavakotiSkillscan
Run the AI dashboard scanner and generate the HTML report.
Also in 4 projects that use this
Microsoft AzureSkilllint
Run all linting and spell checking for TypeScript and Rust code. Run this before committing to catch style issues, clippy warnings, and misspellings.
Also in 4 projects that use this
julienamorganSkillprofile
Researches the user's market, competitors, and competitive positioning to build a complete ICP profile. Shows findings for user approval before proceeding. Triggers: /profile, "research my market", "who are my competitors". Reads: ./gtm/company.md, ./gtm/icp.md. Writes: updates ./gtm/icp.md with competitive positioning. Standalone: yes (asks for domain if company.md missing).
Also in 3 projects that use this
asterkinSkilladr
Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.
Also in 4 projects that use this
anombyte93Skilldiscover
Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.
Also in 3 projects that use this
MicrosoftSkillworktree
Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched.
Also in 3 projects that use this
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- FalkorDB/FalkorDB★ 10ksame name
- pydantic/monty★ 8.9ksame name
- LiberatedPixelCup/Universal-LPC-Spritesheet-Character-Generator★ 1.9ksame name
- firedancer-io/firedancer★ 1.6ksame name
- hegeldev/hegel-rust★ 400same name
- nockawa/Typhon★ 253same name
- Amplicode/spring-skills★ 126same name
- AsiaOstrich/universal-dev-standards★ 84same name
- hass-energy/haeo★ 77same name
- drafthq/draft★ 40same name
18 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-tws-featureSkill
- live-probeSkill
- releaseSkill
- shipSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 25 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Like for like: run §3 on main in a detached worktree so your branch stays untouched.
- Very specific: line 98
Test behavior through production code first (exercise production code): the impl Client method with a stubbed bus, the decoder with a …
- Distinctive: line 111
Every added test asserts something a reader would care about.
“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Coverage
Target: $ARGUMENTS. The floor is 90% lines per touched module, and every new pub /
pub(crate) fn has a test (coverage floor).
$S is your scratchpad directory.
1. Toolchain
Coverage runs on nightly (doc-tests only instrument there); build and test stay on the pinned stable toolchain. Two version couplings break it:
| Symptom | Cause | Fix |
rustc …-nightly is not supported by the following packages | Nightly older than a dependency's MSRV (often after a Dependabot bump) | rustup update nightly |
0% for every file while tests pass; or raw profile version mismatch | cargo-llvm-cov older than nightly | cargo install cargo-llvm-cov --locked, then cargo +nightly llvm-cov clean --profraw-only |
0% everywhere is never a real result. Cross-check with stable
cargo llvm-cov --lib --all-features (undercounts doc-tests, but sane).
2. Baseline
A percentage means nothing without main's number for the same file.
- Quick: Coveralls has main's per-file numbers (https://coveralls.io/github/wboayue/rust-ibapi, measured as in §3's CI recipe).
Like for like: run §3 on main in a detached worktree so your branch stays untouched. A fresh worktree is a cold build, several minutes.
git worktree add --detach $S/cov-main origin/main # run §3 there, note the numbers git worktree remove $S/cov-main
(src/proto/decoders.rs once read 85% on a branch, which looked low until main read 41.7%.)
3. Per-file loop
just cover instruments everything and opens a browser. For one file:
# profiles pile up across --no-report runs; start each iteration clean
cargo +nightly llvm-cov clean --profraw-only
# instrument + test, no report (~1 min with a warm build cache)
cargo +nightly llvm-cov --all-features --doctests --no-report --quiet
# summary for the target file
F=src/contracts/types.rs
cargo +nightly llvm-cov report --json | jq -r --arg f "$F" '.data[0].files[]
| select(.filename | endswith($f)) | .summary | to_entries[]
| select(.key | IN("lines","functions","regions"))
| "\(.key): \(.value.percent | floor)% (\(.value.covered)/\(.value.count))"'
# which lines are uncovered
cargo +nightly llvm-cov report --summary-only --show-missing-lines | grep "$F"Feature-gated code. --all-features never compiles #[cfg(not(feature = "async"))] /
not(feature = "sync") blocks, so they read as absent, not uncovered. CI (Coveralls) merges a
sync-only and an async-only run instead; use that when the file has such blocks, or to match
Coveralls:
cargo +nightly llvm-cov clean --workspace
cargo +nightly llvm-cov --no-report --doctests --no-default-features --features sync
cargo +nightly llvm-cov --no-report --doctests --no-default-features --features async
# then the same report commandsFor the line-by-line view, cargo +nightly llvm-cov report --html --output-dir $S/cov and
open $S/cov/html/coverage/<absolute path>.html; red lines carry uncovered-line.
Without the clean step, each run adds to the last: a deleted test still counts, and switching between the two recipes mixes configurations. After each batch of tests, re-run the clean and instrument steps of whichever recipe you used; the report commands (~15s) read what they left.
4. Read the numbers
- Track functions and regions, not lines.
lines.countis instrumented sites: generics, derives and macro expansions move it without the file changing (one module went 241 → 343 → 245 sites across a refactor while its source stayed ~545 lines). - Find gaps in the HTML, not the JSON. The JSON lists per-monomorphization sub-regions as uncovered where the HTML shows the line covered.
- Noise, not gaps (on stable or
--libruns):..Default::default()and doc-comment fence lines. Nightly +--doctestsremoves them. - Not coverage at all: a
const fncalled only fromconstinitializers reads 0%; llvm-cov sees runtime paths only.
5. Close the gap
Test behavior through production code first
(exercise production code): the
impl Client method with a stubbed bus, the decoder with a fixture builder, the error branch
with the frame that triggers it. Then, for what's left:
| Uncovered | Tactic |
derive(Serialize, Deserialize) lines | One serde round-trip per type, through a generic helper (check_serde_round_trip in src/contracts/types_tests.rs), not a macro |
fn new(s: impl Into<String>) | Call it with both &str and String: each argument type is a separate function to llvm-cov. Same for any impl Trait parameter |
A const fn constructor | One runtime call with an assertion |
| A branch on the current time | A clock seam, not a sleep |
| A sync or async side only | The mirror test on the other side; parity gaps hide here |
Every added test asserts something a reader would care about. A test that only executes a line to move a number gets cut in review.
6. Report
In the PR body, per touched file: main's number → yours, for lines and functions, and the
command that produced them. target/llvm-cov-target/ grows large; delete it when done if
disk is tight.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

