PlugWiki

dart-collect-coverage Skill for Claude Code: LCOV Reports

Makes your agent add the coverage package to a Dart or Flutter project, run the tests and write an LCOV report.

Installs
18.9K
on skills.sh
Stars
537
on GitHub
Updated
Oct 2026
last repo commit

The skill walks the agent through one fixed routine. It adds coverage as a dev dependency, runs your whole test suite with coverage on, then checks that coverage/coverage.json and coverage/lcov.info exist. If a file is missing from the report, it tells the agent to check that tests import it, or to mark it with an ignore comment.

It loads when you ask to collect test coverage. A second, manual route is there for branch and function coverage. It also teaches the // coverage:ignore-line, ignore-start / ignore-end and ignore-file comments. It bundles no scripts and needs the Dart or Flutter SDK.

Good for

  • Dart package authors who want an LCOV file for CI or an editor
  • Flutter developers checking how much of an app the tests reach
  • Teams in a Dart workspace (monorepo) that test several packages at once

Install dart-collect-coverage

Claude Code

  1. 1

    Copy this prompt.

    Install the dart-collect-coverage skill in Claude Code. Run this command:
    
    npx skills add https://github.com/dart-lang/skills --skill dart-collect-coverage
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Collect coverage using the coverage packge and create an LCOV report

Sections in SKILL.md

  1. Contents
  2. Testing Fundamentals
  3. Coverage Directives
  4. Workflow: Configuring and Generating Coverage Reports
  5. 1. Add Dependencies
  6. 2. Collect Coverage and Generate LCOV
  7. 3. Feedback Loop: Validate Output
  8. Workflow: Advanced Manual Coverage Collection
  9. 1. Run Tests with VM Service
  10. 2. Collect Raw Coverage
  11. 3. Format to LCOV
  12. Examples
  13. Example: pubspec.yaml Configuration
  14. Example: Applying Ignore Directives

Key facts

Installs on skills.sh
18,939 as of 2026-11-02
Last repo commit
2026-10-16

What it includes

  • Adds coverage as a dev dependency

    Runs the pub add command for a dev dependency, in the Dart or Flutter form depending on your project. The skill says never to add it to normal dependencies.

    Try: “Add coverage to this Flutter app and collect test coverage.”

    Runs code · Add the coverage package

  • Runs all tests and writes the LCOV report

    Runs the coverage package script that runs every test, collects the coverage data and formats it into an LCOV report. In a Dart workspace you pass the test folders of each package.

    Runs code · Automated coverage run

  • Checks coverage/ and the two output files

    Confirms the coverage folder exists in the project root and holds coverage.json (raw data) and lcov.info (the report). If a file is missing, it checks that the file is imported by a test.

    Read · Validate the output

  • Three steps for branch and function coverage

    Starts the tests with the Dart VM service on port 8181, collects raw JSON coverage from it, then formats that into LCOV. Optional flags add function and branch coverage and need Dart VM 2.17.0 or newer.

    Runs code · Manual collection

  • Excludes lines, blocks or files from the numbers

    Teaches the three comment forms that exclude a line, a block or a whole file. The formatting step must pass the check-ignore flag for them to count.

    Write · Coverage ignore comments

From the official docs

Permissions

Low risk

It changes your pubspec.yaml and runs your whole test suite, so tests with side effects will run too. The manual route opens a local VM service port with auth codes off, so use it only on your own machine.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It edits pubspec.yaml

    The first step adds a dev dependency to your project. Check the diff before you commit it.

  • Manual route opens a local debug port

    The manual steps start the tests with the Dart VM service on port 8181 and with service auth codes disabled. Use it on your own machine, not on a shared host.

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyNo read-only mode. The skill edits pubspec.yaml and writes the coverage folder.
Talks toAdding the package runs a pub command that fetches it
Scopes
  • Runs dart or flutter pub commands and the coverage scripts in your project

  • Edits pubspec.yaml to add a dev dependency

  • Writes the coverage/ folder in the project root

Questions

What does dart-collect-coverage do?

It makes your agent produce an LCOV test coverage report for a Dart or Flutter project. The agent adds the coverage package, runs your tests with coverage on and checks the output files.

How do I install it?

Use the install box at the top of this page. It lists the options for Claude Code, Codex and other tools.

Does it need an API key or an account?

No. Its SKILL.md names no API key, account or sign-in. It uses the Dart or Flutter tools already on your machine.

Is it safe to run?

It runs your test suite and edits pubspec.yaml, so review the diff after the run. The manual route starts a local debug service on port 8181 with auth codes disabled, which is fine on your own machine but not on a shared one.

Does it work for Flutter apps?

Yes. SKILL.md gives a Flutter form of the dependency command and mentions flutter_test for Flutter tests. The coverage report itself comes from the same coverage script.

Does it write the tests too?

No, it only collects coverage. The same Dart repo lists a separate dart-add-unit-test skill for writing unit tests.

Information

updated Nov 2, 2026

Folder
skills/dart-collect-coverage

dart-lang/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. dart-collect-coverage SKILL.md · github.com
  2. dart-lang/skills README · github.com
  3. dart-collect-coverage on skills.sh · skills.sh
  4. dart-lang/skills · github.com

Updated Nov 2, 2026.