Agent skill

Analyzing Coverage

by TriliumNext in TriliumNext/Trilium

A skill your agent uses when measuring or chasing Vitest/v8 code coverage in the Trilium monorepo — "what's below 100%?", "which files need tests?", "what lines of X are uncovered?", "take <area to…

AGPL-3.0Auto-check passedTesting & QA

Install Analyzing Coverage

skills CLI
$ npx skills add TriliumNext/Trilium --skill analyzing-coverage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TriliumNext/Trilium analyzing-coverage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/analyzing-coverage .claude/skills/analyzing-coverage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
analyzing-coverage
GitHub stars
38k
Token cost
~2k tokens
SKILL.md length
805 words
Files
2
Skills in repo
22
Repo updated
First seen
Licence
AGPL-3.0

At a glance

A skill your agent uses when measuring or chasing Vitest/v8 code coverage in the Trilium monorepo — "what's below 100%?", "which files need tests?", "what lines of X are uncovered?", "take <area to…

  • Chasing Vitest/v8 code coverage in the Trilium monorepo — whats below 100%?
  • SKILL.md covers Two modes, Producing the coverage data and Writing the tests
  • Runs JavaScript scripts from its folder; calls node and pnpm
  • Which files need tests?

What it does

Analyzing Coverage is an agent skill from TriliumNext/Trilium. Use when measuring or chasing Vitest/v8 code coverage in the Trilium monorepo — "what's below 100%?", "which files need tests?", "what lines of X are uncovered?", "take <area to 100%", or feeding coverage gaps to test-writing agents. Provides one reusable analyzer (coverage.mjs) for lcov.info / coverage-summary.json / coverage-final.json, the correct commands to produce that data on Windows, and the known footguns. Pairs with writing-unit-tests.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Testing & QA, covering Unit testing, Test coverage and Monorepo tooling. It works with Vitest. The repository describes itself as: Build your personal knowledge base with Trilium Notes. The licence is AGPL-3.0.

When your agent uses it

  • Chasing Vitest/v8 code coverage in the Trilium monorepo — whats below 100%?
  • Which files need tests?
  • What lines of X are uncovered?
  • Take <area to 100%

Example prompts

  • “s below 100%?”
  • “which files need tests?”
  • “what lines of X are uncovered?”
  • “/analyzing-coverage”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 134a865. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Analyzing Coverage loads about 2k tokens when it runs. Until then it costs about 117 tokens; SKILL.md has 805 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TriliumNext/Trilium at commit 134a865, republished under its AGPL-3.0 licence (© TriliumNext). 805 words, ~1,977 tokens.

Download SKILL.mdSave it as .claude/skills/analyzing-coverage/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
analyzing-coverage
description
Use when measuring or chasing Vitest/v8 code coverage in the Trilium monorepo — "what's below 100%?", "which files need tests?", "what lines of X are uncovered?", "take <area> to 100%", or feeding coverage gaps to test-writing agents. Provides one reusable analyzer (coverage.mjs) for lcov.info / coverage-summary.json / coverage-final.json, the correct commands to produce that data on Windows, and the known footguns. Pairs with writing-unit-tests.

Analyzing coverage in Trilium

There is one coverage analyzer — coverage.mjs in this skill folder. Don't write a new throwaway parser; every past session that did (cov-analyze.mjs, cov-parse.mjs, cov-lines.mjs, cov-gaps.cjs) reinvented the same two operations. Use this instead.

Analyzing existing coverage data is free; producing it is not. A coverage run is a full suite run plus instrumentation — minutes, and normally CI's job. Prefer whatever lcov.info is already on disk, and when you do need fresh numbers, scope the run to the package or path in question rather than running pnpm coverage. Generating repo-wide coverage is an explicit-request activity.

node .claude/skills/analyzing-coverage/coverage.mjs <coverage-file> [summary|gaps] [options]

It auto-detects the format, so point it at whatever Vitest produced:

  • lcov.info — the default lcov reporter, so it's almost always already on disk. Supports both modes.
  • coverage-summary.json — from --coverage.reporter=json-summary. summary only (no per-line detail).
  • coverage-final.json — from --coverage.reporter=json. Supports both modes.

Two modes

summary (default) — list files below a threshold, worst-first, plus aggregate totals over the matched set. This is the "where's the coverage debt?" view.

bash
# trilium-core services below 100%, worst first (measured through the server suite):
node .claude/skills/analyzing-coverage/coverage.mjs \
    apps/server/test-output/vitest/coverage/lcov.info \
    --filter packages/trilium-core/src/services

Options: --threshold N (default 100), --metric lines|branches|functions|any (default any — flag a file if any metric is below), --top N, --json.

gaps — for the file(s) matched by --filter, print the exact uncovered line numbers (statements + functions) and uncovered branch lines, compressed to ranges. This is the "what does my new test have to exercise?" view — feed it straight into a test-writing agent's prompt.

bash
node .claude/skills/analyzing-coverage/coverage.mjs \
    apps/server/test-output/vitest/coverage/lcov.info gaps \
    --filter becca/entities/bnote.ts
# ### packages/trilium-core/src/becca/entities/bnote.ts — lines 78% (...)
#   uncovered lines:        163, 240-257, 266-267, ...
#   uncovered branch lines: 245, 249, ...

--filter takes a path substring; repeat it or comma-separate to match any (--filter src/services,src/entities). --json on either mode emits machine-readable output for workflows.

Producing the coverage data

trilium-core has no runner of its own — its coverage is measured through the apps/server and apps/standalone suites (both set allowExternal: true + a core include glob; see writing-unit-tests). Pick the suite that exercises your file:

Target areaSuite to runlcov lands at
apps/client/src/**clientapps/client/test-output/vitest/coverage/lcov.info
apps/server/src/**, packages/trilium-core/src/**serverapps/server/test-output/vitest/coverage/lcov.info
apps/standalone/src/**, or packages/trilium-core/src/** under the sqlite-wasm runtimestandaloneapps/standalone/test-output/vitest/coverage/lcov.info

packages/trilium-core/src/** is covered by both the server and standalone suites (its specs are pulled into each via the core include glob), so a core file shows two separate lcov entries. They aren't identical: the standalone suite runs core through happy-dom + sqlite-wasm, so a line uncovered there but covered under server (or vice-versa) is a real runtime-specific gap, not noise. Pick the suite matching the runtime you care about; to chase core to 100% everywhere, check both.

Run the suite (or a scoped subset) with coverage, then analyze the lcov:

bash
# Whole package (slow but complete):
pnpm --filter @triliumnext/client test --coverage
pnpm --filter server test --coverage
pnpm --filter @triliumnext/standalone coverage   # core under sqlite-wasm; lcov anchored to apps/standalone/test-output

# Scoped to specific specs (fast iteration). On Windows/sandbox, pnpm exec can
# EPERM — call the hoisted binary in the REPO-ROOT node_modules directly:
cd apps/server
CI=true node ../../node_modules/vitest/vitest.mjs run \
    ../../packages/trilium-core/src/becca/entities/bnote.spec.ts \
    --reporter=dot --coverage --coverage.reporter=lcov \
    --coverage.reportsDirectory=./test-output/cov-bnote
node ../../.claude/skills/analyzing-coverage/coverage.mjs \
    ./test-output/cov-bnote/lcov.info gaps --filter bnote.ts
Show full SKILL.md (406 more words)Show less
Footguns (learned the hard way)
  • Always pass --reporter=dot for scoped runs — the project's configured html/@vitest/ui reporter can crash at end-of-run and abort coverage.
  • The v8 text reporter crashes (PARSE_ERROR remapping unrelated core files) on single-spec --coverage runs. Use lcov/json/json-summary and analyze with this script — never rely on the terminal table for a scoped run.
  • The per-file table row renders blank when a single included file is exactly 100% (cosmetic v8 quirk). This script reads the raw data, so it shows the real number.
  • Multi-file client runs must cd apps/client first. Running multiple specs from the repo root with --root apps/client triggers a vitest "failed to find the runner" crash; a single spec with --root is fine.
  • Isolated vs full-suite gaps: when you run only your spec, lines covered by other specs in the full suite show as uncovered. That's expected — only your assigned lines need to disappear. Don't chase the rest.
  • --coverage.reportsDirectory is relative to --root, so it can double a path prefix — pass a simple relative dir like ./test-output/cov-<slug>.
  • A block if with no else can report a phantom uncovered branch. if (x) { … } can show its fall-through as uncovered even when many tests exercise it — statement hits on the lines after it prove it ran. Don't hunt for a test that cannot exist: rewrite branchlessly, e.g. a latch flag = cond || flag; in place of if (cond) flag = true; (hit in apps/desktop/src/services/security_settings.ts).
  • A cache-once arm can only be reached once per module instance — a coreUtils.isDev() ? dev : prod expression memoized on first call (getPreloadScript() in services/window.ts / printing.ts) runs one arm and never the other, whatever the tests do. Mock the reachable arm and /* v8 ignore next N -- … */ the other with a reason naming what does cover it (the production build).
  • For provably-dead defensive branches, mark with /* v8 ignore next N -- reason */ rather than writing a fake test (sanctioned by writing-unit-tests).

Writing the tests

This skill only measures. To actually raise coverage — fixtures, the real-DB vs mocked-becca decision, import paths, component rendering — use the writing-unit-tests skill. The typical loop: run suite with --coverage → coverage.mjs … summary to pick the worst file → coverage.mjs … gaps --filter <file> to get the line list → write tests → re-run scoped with --coverage → gaps again until your lines are gone.

For a large fan-out (e.g. "take all of becca to 100%"), a Workflow that gives one agent per file its gaps line-list as the assignment works well — see the pattern this skill's analyzer was extracted from.

© TriliumNext, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/analyzing-coverage of TriliumNext/Trilium.

  • SKILL.md
  • coverage.mjs

Open the folder on GitHubat commit 134a865

Compare with similar skills

Analyzing Coverage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Analyzing Coverage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Analyzing Coverage this skillTriliumNext/Trilium38k—~2kAutomated safety check: PassAGPL-3.0
Sanity Visual Regressionsanity-io/sanity6.4k—~3.4kAutomated safety check: PassMIT
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Creating A Packagec15t/c15t1.9k—~913Automated safety check: PassApache-2.0
Caliber Testingcaliber-ai-org/ai-setup1.3k—~3.2kAutomated safety check: PassMIT
Running TestsNangoHQ/nango13k—~876Automated safety check: PassCustom licence

Similar skills

  • Sanity Visual Regression

    sanity-io/sanity

    Official

    Add, review, and maintain Chromatic visual regression coverage in the Sanity monorepo via dev/storybook stories, the vitest browser-mode suite, and Playwright e2e snapshots.

    6.4k GitHub stars~3.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Scaffold a new workspace package in the c15t monorepo. An agent skill from c15t/c15t.

    1.9k GitHub stars~913 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Caliber Testing

    caliber-ai-org/ai-setup

    Writes Vitest tests following project patterns: tests/ directories, vi.mock() for module mocking with vi.hoisted() for test-time factories, global LLM mock from src/test/setup.ts, environment…

    1.3k GitHub stars~3.2k tokensUpdated 13 days ago
    Testing & QAAuto-check passed
  • Running Tests

    NangoHQ/nango

    A skill your agent uses when running tests in the Nango monorepo - knows unit vs integration configs, vitest commands, Docker setup, and common test patterns

    13k GitHub stars~876 tokensUpdated today
    Testing & QAAuto-check passed
  • Coverage Tools

    zkldi/Tachi

    Aggregates Vitest v8/Istanbul coverage across Tachi workspaces via tachi-coverage-tools (manifest, CLI, optional programmatic API).

    237 GitHub stars~580 tokensUpdated 2 days ago
    Testing & QAAuto-check passed

More from TriliumNext/Trilium

All 22 skills in this repo
  • Cutting A Release

    TriliumNext/Trilium

    A skill your agent uses when cutting, preparing, or debugging a Trilium release — bumping the monorepo version, tagging, or diagnosing a failed "Release" workflow run.

    38k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Developing Electron Desktop

    TriliumNext/Trilium

    A skill your agent uses when working on the Trilium Electron desktop app (apps/desktop) — adding or changing an electronApi method / IPC channel, touching preload.ts, main.ts, services/window.ts or…

    38k GitHub stars~5.7k tokensUpdated today
    Auto-check passed
  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Adding Internal API Route

    TriliumNext/Trilium

    A skill your agent uses when adding, moving, or wiring an internal REST endpoint in Trilium (a new /api/ route) — choosing between a core-shared handler (packages/trilium-core/src/routes/index.ts…

    38k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Adding LLM MCP Tools

    TriliumNext/Trilium

    A skill your agent uses when adding, changing, or reviewing an LLM/MCP tool in Trilium (the defineTools definitions under packages/trilium-core/src/services/llm/tools/ —…

    38k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Ckeditor5 Plugin Development

    TriliumNext/Trilium

    Write, extend, and review CKEditor 5 plugins in the Trilium (TriliumNext Notes) monorepo — the rich-text-note editor under packages/ckeditor5, whose plugins live in src/plugins/.

    38k GitHub stars~4.8k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Analyzing Coverage

What does Analyzing Coverage do?

A skill your agent uses when measuring or chasing Vitest/v8 code coverage in the Trilium monorepo — "what's below 100%?", "which files need tests?", "what lines of X are uncovered?", "take <area to…. Analyzing Coverage is an agent skill from TriliumNext/Trilium.", "take <area to 100%", or feeding coverage gaps to test-writing agents.

When should I use Analyzing Coverage?

Analyzing Coverage fits situations like: chasing Vitest/v8 code coverage in the Trilium monorepo — whats below 100%?; which files need tests?; what lines of X are uncovered?; take <area to 100%.

How do I install Analyzing Coverage in Claude Code?

Run `npx skills add TriliumNext/Trilium --skill analyzing-coverage -a claude-code`. Or copy the skill folder (.claude/skills/analyzing-coverage in TriliumNext/Trilium) into .claude/skills/analyzing-coverage in your project. Claude Code loads it when a task matches its description.

How do I install Analyzing Coverage in Codex?

Run `npx skills add TriliumNext/Trilium --skill analyzing-coverage -a codex`. Or copy the skill folder (.claude/skills/analyzing-coverage in TriliumNext/Trilium) into .agents/skills/analyzing-coverage in your project. Codex loads it when a task matches its description.

Can I use Analyzing Coverage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TriliumNext/Trilium --skill analyzing-coverage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/analyzing-coverage, .gemini/skills/analyzing-coverage, .github/skills/analyzing-coverage and .opencode/skills/analyzing-coverage in your project.

What does Analyzing Coverage need to run?

Going by SKILL.md and its folder, Analyzing Coverage needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node and pnpm). Our summary lists: Node.js.

Does Analyzing Coverage access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Analyzing Coverage safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Analyzing Coverage use?

Analyzing Coverage is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Analyzing Coverage use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Analyzing Coverage?

Skills that share tags, products or a category with Analyzing Coverage: Sanity Visual Regression (sanity-io/sanity, 6.4k stars), Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Creating A Package (c15t/c15t, 1.9k stars) and Caliber Testing (caliber-ai-org/ai-setup, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Analyzing Coverage?

TriliumNext (a GitHub organization) maintains it in TriliumNext/Trilium, which has 38,231 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 7, 2026.

Source: TriliumNext/Trilium on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.