MCAF: .NET Coverlet
Trigger On
- the repo uses or wants
coverlet
- CI needs line or branch coverage for .NET tests
- the team needs to choose between
coverlet.collector, coverlet.msbuild, or coverlet.console
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not Use For
- coverage report rendering by itself
- repos that intentionally use a different coverage engine
Inputs
- the nearest
AGENTS.md
- active runner model: VSTest or Microsoft.Testing.Platform
- target test projects
Quick Start
- Read the nearest
AGENTS.md and confirm scope and constraints.
- Run this skill's
Workflow through the Ralph Loop until outcomes are acceptable.
- Return the
Required Result Format with concrete artifacts and verification evidence.
Workflow
- Choose the driver deliberately:
coverlet.collector for VSTest dotnet test --collect
coverlet.msbuild for MSBuild property-driven runs
coverlet.console for standalone scenarios
- Add coverage packages only to test projects.
- Do not mix
coverlet.collector and coverlet.msbuild in the same test project.
- Pair raw coverage collection with
ReportGenerator only when humans need rendered reports.
Bootstrap When Missing
If coverage is not configured yet:
- Detect current state:
rg -n "coverlet\\.(collector|msbuild)|CollectCoverage|XPlat Code Coverage" -g '*.csproj' -g '*.props' -g '*.targets' .
dotnet tool list --local
dotnet tool list --global
command -v coverlet
- Install exactly one driver path:
- VSTest collector:
dotnet add TEST_PROJECT.csproj package coverlet.collector
- MSBuild driver:
dotnet add TEST_PROJECT.csproj package coverlet.msbuild
- Console tool:
dotnet new tool-manifest (if missing) and dotnet tool install coverlet.console
- Record one concrete local and CI command in
AGENTS.md:
- collector:
dotnet test TEST_PROJECT.csproj --collect:"XPlat Code Coverage"
- msbuild:
dotnet test TEST_PROJECT.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
- console:
dotnet tool run coverlet TEST_ASSEMBLY.dll --target "dotnet" --targetargs "test TEST_PROJECT.csproj --no-build"
- Run the chosen command once and return
status: configured or status: improved.
- If another coverage engine already owns coverage for this repo, return
status: not_applicable.
Deliver
- explicit coverage driver selection
- reproducible coverage commands for local and CI runs
Validate
- coverage driver matches the runner model
- coverage files are stable and consumable by downstream reporting
Ralph Loop
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
- Plan first (mandatory):
- analyze current state
- define target outcome, constraints, and risks
- write a detailed execution plan
- list final validation skills to run at the end, with order and reason
- Execute one planned step and produce a concrete delta.
- Review the result and capture findings with actionable next fixes.
- Apply fixes in small batches and rerun the relevant checks or review steps.
- Update the plan after each iteration.
- Repeat until outcomes are acceptable or only explicit exceptions remain.
- If a dependency is missing, bootstrap it or return
status: not_applicable with explicit reason and fallback path.
Required Result Format
status: complete | clean | improved | configured | not_applicable | blocked
plan: concise plan and current iteration step
actions_taken: concrete changes made
validation_skills: final skills run, or skipped with reasons
verification: commands, checks, or review evidence summary
remaining: top unresolved items or none
For setup-only requests with no execution, return status: configured and exact next commands.
Load References
- read
references/coverlet.md first
Example Requests
- "Add Coverlet to this .NET solution."
- "Choose the right Coverlet driver for CI."
1---2name: mcaf-dotnet-coverlet3description: Use the open-source free `coverlet` toolchain for .NET code coverage. Use when a repo needs line and branch coverage, collector versus MSBuild driver selection, or CI-safe coverage commands.4---56# MCAF: .NET Coverlet78## Trigger On910- the repo uses or wants `coverlet`11- CI needs line or branch coverage for .NET tests12- the team needs to choose between `coverlet.collector`, `coverlet.msbuild`, or `coverlet.console`1314## Value1516- produce a concrete project delta: code, docs, config, tests, CI, or review artifact17- reduce ambiguity through explicit planning, verification, and final validation skills18- leave reusable project context so future tasks are faster and safer1920## Do Not Use For2122- coverage report rendering by itself23- repos that intentionally use a different coverage engine2425## Inputs2627- the nearest `AGENTS.md`28- active runner model: VSTest or Microsoft.Testing.Platform29- target test projects3031## Quick Start32331. Read the nearest `AGENTS.md` and confirm scope and constraints.342. Run this skill's `Workflow` through the `Ralph Loop` until outcomes are acceptable.353. Return the `Required Result Format` with concrete artifacts and verification evidence.3637## Workflow38391. Choose the driver deliberately:40 - `coverlet.collector` for VSTest `dotnet test --collect`41 - `coverlet.msbuild` for MSBuild property-driven runs42 - `coverlet.console` for standalone scenarios432. Add coverage packages only to test projects.443. Do not mix `coverlet.collector` and `coverlet.msbuild` in the same test project.454. Pair raw coverage collection with `ReportGenerator` only when humans need rendered reports.4647## Bootstrap When Missing4849If coverage is not configured yet:50511. Detect current state:52 - `rg -n "coverlet\\.(collector|msbuild)|CollectCoverage|XPlat Code Coverage" -g '*.csproj' -g '*.props' -g '*.targets' .`53 - `dotnet tool list --local`54 - `dotnet tool list --global`55 - `command -v coverlet`562. Install exactly one driver path:57 - VSTest collector: `dotnet add TEST_PROJECT.csproj package coverlet.collector`58 - MSBuild driver: `dotnet add TEST_PROJECT.csproj package coverlet.msbuild`59 - Console tool: `dotnet new tool-manifest` (if missing) and `dotnet tool install coverlet.console`603. Record one concrete local and CI command in `AGENTS.md`:61 - collector: `dotnet test TEST_PROJECT.csproj --collect:"XPlat Code Coverage"`62 - msbuild: `dotnet test TEST_PROJECT.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura`63 - console: `dotnet tool run coverlet TEST_ASSEMBLY.dll --target "dotnet" --targetargs "test TEST_PROJECT.csproj --no-build"`644. Run the chosen command once and return `status: configured` or `status: improved`.655. If another coverage engine already owns coverage for this repo, return `status: not_applicable`.6667## Deliver6869- explicit coverage driver selection70- reproducible coverage commands for local and CI runs7172## Validate7374- coverage driver matches the runner model75- coverage files are stable and consumable by downstream reporting7677## Ralph Loop7879Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.80811. Plan first (mandatory):82 - analyze current state83 - define target outcome, constraints, and risks84 - write a detailed execution plan85 - list final validation skills to run at the end, with order and reason862. Execute one planned step and produce a concrete delta.873. Review the result and capture findings with actionable next fixes.884. Apply fixes in small batches and rerun the relevant checks or review steps.895. Update the plan after each iteration.906. Repeat until outcomes are acceptable or only explicit exceptions remain.917. If a dependency is missing, bootstrap it or return `status: not_applicable` with explicit reason and fallback path.9293### Required Result Format9495- `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`96- `plan`: concise plan and current iteration step97- `actions_taken`: concrete changes made98- `validation_skills`: final skills run, or skipped with reasons99- `verification`: commands, checks, or review evidence summary100- `remaining`: top unresolved items or `none`101102For setup-only requests with no execution, return `status: configured` and exact next commands.103104## Load References105106- read `references/coverlet.md` first107108## Example Requests109110- "Add Coverlet to this .NET solution."111- "Choose the right Coverlet driver for CI."