dart-collect-coverage

Collect Dart and Flutter test coverage and generate LCOV reports.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/arslan9024/White-Caves --skill dart-collect-coverage-arslan9024
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dart-collect-coverage
Source: https://github.com/arslan9024/White-Caves/tree/main/.agents/skills/dart-collect-coverage
Command: npx skills add https://github.com/arslan9024/White-Caves --skill dart-collect-coverage-arslan9024

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires coverage, test, flutter_test.

What problem does it solve? Measuring test coverage in Dart and Flutter projects requires coordinating the Dart VM service, coverage collection, and LCOV formatting, which is error-prone when done manually. This Skill provides a structured workflow to add the coverage package, run tests, and produce a standard LCOV report. ## Core Features & Use Cases - Automated Coverage Collection: Run the bundled test_with_coverage script to execute tests and generate coverage/lcov.info in one step. - Manual VM Service Workflow: Collect raw JSON coverage via the Dart VM service with optional branch and function-level metrics for granular control. - Coverage Ignore Directives: Exclude lines, blocks, or entire files from metrics using // coverage:ignore-line, // coverage:ignore-start/end, and // coverage:ignore-file comments. - Use Case: A Flutter team preparing a CI quality gate uses this Skill to generate an LCOV report, then uploads it to a coverage dashboard to enforce minimum coverage thresholds. ## Quick Start Ask the AI to add the coverage package as a dev dependency and generate an LCOV coverage report for your Dart or Flutter project.

Frequently Asked Questions about dart-collect-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a test coverage report in Dart?▼

Add the coverage package as a dev dependency with `dart pub add dev:coverage`, then run `dart run coverage:test_with_coverage`. This executes your tests and writes both raw JSON data and a formatted LCOV report to the coverage/ directory.

How to collect Flutter test coverage as LCOV?▼

Add coverage via `flutter pub add dev:coverage` and run the test_with_coverage script to produce coverage/lcov.info. For manual control, run tests with the VM service enabled, collect JSON coverage, and format it with format_coverage.

How do I exclude files from Dart coverage reports?▼

Use inline directives: `// coverage:ignore-line` for a single line, `// coverage:ignore-start` and `// coverage:ignore-end` for blocks, and `// coverage:ignore-file` for entire files. Pass `--check-ignore` when formatting to enforce them.

Does Dart coverage support branch and function coverage?▼

Yes, manual collection supports `--function-coverage` and `--branch-coverage` flags when gathering data from the VM service. These deeper metrics require Dart VM version 2.17.0 or later.

Why is coverage missing for some files in my report?▼

Files only appear in coverage if they are imported and executed by your tests. Ensure the files are exercised by test cases, or add `// coverage:ignore-file` if they are intentionally excluded from metrics.