Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

dart-test-coverage飞镖测试覆盖率

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

372

周安装

16

GitHub Stars

130

下载量

131
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dart-test-coverage(飞镖测试覆盖率)
来源仓库:https://github.com/kevmoo/dash_skills
仓库路径:skills/dart-test-coverage
安装命令:
npx skills add https://github.com/kevmoo/dash_skills --skill dart-test-coverage
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kevmoo/dash_skills --skill dart-test-coverage

简介

dart-test-coverage 生成并解读 Dart 测试覆盖率报告,识别未覆盖代码区域。

  • 适用于提升测试完整性、满足发布标准或优化关键模块覆盖率的场景。
  • 通过 dart test --coverage=.dart_tool/coverage 收集数据,并用 format_coverage 脚本分析缺失行。
  • 使用前请确保 test 命令支持 coverage 参数,并排除 vendor/ 等非源码目录。
  • 建议设定最低覆盖率阈值(如 80%),并在 CI 中阻断低于标准的合并请求。

SKILL.md

Dart Test Coverage

Guidelines for running and interpreting test coverage in Dart packages.

When to use this skill

  • When asked to "check test coverage" or "improve coverage".
  • When you need to identify which parts of a library are untested.

Discovery

To find areas lacking test coverage:

Run Coverage Analysis

Follow the workflow to generate and interpret coverage data:

  1. Run Tests with Coverage: dart test --coverage=.dart_tool/coverage
  2. Interpret Results: Use the script or format_coverage as described in the Interpreting Results section to identify specific files and missed lines.

How to use this skill (The Workflow)

  1. Ensure tests pass by running dart test.
  2. Collect coverage by running dart test --coverage=.dart_tool/coverage.
  3. Interpret the results using the provided script or standard tools.
  4. Add tests to cover missed lines.

Running Coverage

Run the following command to collect coverage in JSON format:

dart test --coverage=.dart_tool/coverage
[!NOTE] We use .dart_tool/coverage as the output directory because .dart_tool is typically already ignored in .gitignore files.
[!TIP] For projects with complex conditional logic, you can pass the --branch-coverage flag to dart test to collect branch-level coverage.

Interpreting Results

Option 1: Use the custom interpreter script

This repository includes a zero-dependency script that parses the raw JSON output and provides a summary of covered percentage and missed lines.

Run it from the project root (adjust path to script as needed):

dart run .agent/skills/dart-test-coverage/scripts/interpret_coverage.dart .dart_tool/coverage <package_name>

Replace <package_name> with the name from pubspec.yaml.

Example Output:

package:my_pkg/src/file.dart: 50.0% (2/4 lines)
  Missed lines: 3, 4

Option 2: Use package:coverage

If package:test is installed, package:coverage is likely available as a transitive dependency. You can use its format_coverage tool.

To get a human-readable "pretty print" of the coverage:

dart run coverage:format_coverage --in=.dart_tool/coverage --out=stdout --pretty-print --report-on=lib

This will output the file content with hit counts on the left (e.g., 0| for missed lines).

Best Practices for Reporting Results

When presenting coverage results to the user, follow these guidelines:

  1. State the high-level percentage first to give immediate context.
  2. Identify specific files and missed lines clearly.
  3. Translate line numbers to code: Don't just say "lines 3-6 are missed". Look at the source file and tell the user which functions or blocks are untested (e.g., "The divide function is missing coverage").
  4. Propose concrete fixes: Provide example test code that the user can immediately apply to cover the missed lines.
  5. Use tables for multi-file summaries: When reporting on multiple files, use a markdown table with columns for File, Coverage %, and Missed Lines to make the summary easy to scan.

Constraints

  • ALWAYS verify that tests pass before collecting coverage.
  • DO NOT commit the .dart_tool/coverage directory.
  • Focus coverage improvements on lib/ files, not test/ or generated files.

适合场景

01

研究助手

02

事实核查

03

知识库问答

04

带来源的搜索总结

能力概览

能力 1

组合搜索和大模型调用

能力 2

支持多来源检索和总结

能力 3

强调引用来源和事实核查

能力 4

适合研究型 Agent 流程

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.84%
按下载量换算50

Claude

28.72%
按下载量换算38

Cursor

19.84%
按下载量换算26

Gemini CLI

9.1%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills