Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-code-coverage-analysisgit clone --depth 1 https://github.com/kevintsengtw/dotnet-testing-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis)<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00175 | $0.02893 |
| Opus 5.5 | $0.00070 | $0.01157 |
| Sonnet 5.5 | $0.00035 | $0.00579 |
| Haiku 4.5 | $0.00017 | $0.00289 |
Grade A, and why
dotnet-testing-code-coverage-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.
程式碼覆蓋率分析指南
Code Coverage 核心概念
程式碼覆蓋率 (Code Coverage) 是一種測量指標,用來統計測試執行時實際執行了多少程式碼。
實際價值: 找出測試盲點、評估測試完整性、輔助重構決策、增加測試信心。
常見誤解:
- 涵蓋率 100% 不代表沒有 Bug — 只代表程式碼有被執行,不代表驗證了正確行為
- 涵蓋率數字越高不一定越好 — 重點是測試的有效性
- 把涵蓋率當作 KPI 會適得其反 — 開發者會為了衝數字而寫沒有 Assert 的測試
覆蓋率工具選擇
| 工具 | 優點 | 適用場景 |
|---|---|---|
| Visual Studio Enterprise | 內建整合,完整 UI | 僅 Enterprise |
| Fine Code Coverage(推薦) | 免費,即時顯示,編輯器直接標示 | VS 所有版本 |
| .NET CLI + Coverlet | 跨平台,CLI 自動化 | CI/CD 流程 |
| VS Code 內建 | 跨平台,無需額外擴充套件 | VS Code 開發 |
Fine Code Coverage 設定
- 安裝方式: Visual Studio 延伸模組管理 → 搜尋 "Fine Code Coverage" → 安裝
- 必要設定: 工具 → 選項 → Fine Code Coverage → Enable:
True、Editor Colouring Line Highlighting:True
VS Code 內建測試覆蓋率
- 安裝 C# Dev Kit 擴充套件
- 開啟測試總管(燒杯圖示)
- 點選「執行涵蓋範圍測試」
- 查看結果:測試涵蓋範圍視圖、編輯器內顯示、檔案總管顯示
執行覆蓋率分析
# .NET CLI(推薦用於 CI/CD)
dotnet test --collect:"XPlat Code Coverage"
dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
# Fine Code Coverage:在 VS 中執行測試後自動顯示
# VS Code:開啟測試總管 → 點選「執行涵蓋範圍測試」
方法說明
| 方法 | 工具 | 操作步驟 |
|---|---|---|
| .NET CLI | Coverlet + CLI | 執行 dotnet test --collect:"XPlat Code Coverage" |
| Fine Code Coverage | VS 擴充套件 | 在 VS 中執行測試後自動顯示 |
| VS Code | C# Dev Kit | 開啟測試總管 → 執行涵蓋範圍測試 |
設定 Coverlet
測試專案需安裝 coverlet.collector 套件,並可透過 runsettings 檔案進行進階設定(排除規則、閾值、報告格式)。
完整 csproj 配置範例請參考 references/coverlet-csproj-config.md
解讀覆蓋率報告
顏色標示: 綠色(已覆蓋)、黃色(部分覆蓋)、紅色(未覆蓋)
覆蓋率指標:
- Line Coverage(行覆蓋率) — 被執行的行數 / 總行數,最基本的指標
- Branch Coverage(分支覆蓋率) — 被執行的分支數 / 總分支數,比行覆蓋率更準確
- Method Coverage(方法覆蓋率) — 被執行的方法數 / 總方法數
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 22d ago Changed · -1 lines · -41 tokens per session 719ae470d19e
- 1mo ago First seen · 214 lines · 216 tokens per session scan A 20ecf6d67b7e
dotnet-testing-code-coverage-analysis is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (30 stars, last pushed 18d ago), licensed MIT. It adds 175 tokens to every session and 2,893 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
author-test
Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.
migrate-mstest-v3-to-v4
Use this skill before answering, planning, or editing any MSTest 3.x-to-4.x upgrade or post-upgrade failure. Triggers include "MSTest v4 breaking changes"; CS0507/CS0103/CS1061/CS1615; ExecuteAsync, CallerInfo, DisplayName, or custom TestMethodAttribute; ClassCleanupBehavior; ContainsKey; ThrowsExactly or…
migrate-xunit-to-mstest
Convert .NET tests from xUnit.net v2/v3 to MSTest v4 while preserving VSTest or MTP. Use for replacing xunit packages, Fact/Theory/InlineData/MemberData, assertions, IClassFixture/ICollectionFixture, ITestOutputHelper, TestContext cancellation, traits/Owner, skips, timeouts, and xUnit parallelization. Also use when a…
migrate-xunit-to-xunit-v3
Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…
csharp-dotnet
Use when writing, reviewing, testing, or shipping C# / .NET code — ASP.NET Core APIs (minimal APIs vs controllers), EF Core data access, async correctness, solution layout in .cs/.csproj/.sln. NOT a Java/Spring backend (that is spring-boot), NOT a Node/TypeScript backend (that is nestjs), NOT framework-neutral REST…
archunitnet
Use the open-source free ArchUnitNET library for architecture rules in .NET tests. Use when a repo needs richer architecture assertions than lightweight fluent rule libraries usually provide. USE FOR: the repo uses or wants ArchUnitNET; architecture testing needs richer modeling than simple dependency checks. DO NOT…