| name | mcaf-dotnet |
| description | Primary entry skill for C# and .NET tasks. Detect the repo's language version, test runner, quality stack, and architecture rules; route to the right .NET subskills; and run the repo-defined post-change quality pass after any code change. Use when the user asks to implement, debug, review, or refactor .NET code, or asks which .NET skill or toolchain should apply. |
| compatibility | Requires a .NET solution or project; respects root and local `AGENTS.md` first. |
MCAF: .NET
Trigger On
- writing, reviewing, debugging, or refactoring C# or .NET code
- deciding which .NET skill should be used for a task
- modernizing a .NET codebase while keeping language and runtime compatibility
- verifying .NET changes with analyzers, formatting, tests, and coverage
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
- non-.NET repositories
- a single-tool task where one exact .NET tool skill already covers the whole request
Inputs
- the nearest
AGENTS.md
- solution and project files
Directory.Build.* files
- the repo-root
.editorconfig and any nested .editorconfig files that apply
- target
TFM, LangVersion, SDK version, test packages, and analyzer packages
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
- Detect the real stack before changing code or commands:
TFM or TFMs
- explicit
LangVersion or the default implied by the SDK and target framework
- test framework: xUnit, TUnit, or MSTest
- runner model:
VSTest or Microsoft.Testing.Platform
- installed analyzers, formatters, coverage tools, and architecture-test libraries
- Route framework mechanics through exactly one matching test skill:
mcaf-dotnet-xunit
mcaf-dotnet-tunit
mcaf-dotnet-mstest
- Route quality and policy through the matching skill:
mcaf-dotnet-quality-ci
mcaf-dotnet-analyzer-config
mcaf-dotnet-complexity
- tool-specific skills such as
mcaf-dotnet-format, mcaf-dotnet-roslynator, mcaf-dotnet-stylecop-analyzers, mcaf-dotnet-meziantou-analyzer, mcaf-dotnet-coverlet, mcaf-dotnet-reportgenerator, mcaf-dotnet-resharper-clt, mcaf-dotnet-netarchtest, mcaf-dotnet-archunitnet, mcaf-dotnet-codeql, mcaf-dotnet-csharpier, and mcaf-dotnet-stryker
- Route design and structure through:
mcaf-solid-maintainability for SOLID, SRP, cohesion, and maintainability limits
mcaf-architecture-overview when system or module boundaries, contracts, or architecture docs need work
mcaf-dotnet-features when modern C# feature selection or language-version compatibility matters
- Write or review code using the newest stable C# features the repo actually supports.
- After any .NET code change, run the repo-defined post-change quality pass from narrow to broad:
format
build
analyze
- focused
test
- broader
test
coverage and report generation when configured
- extra configured gates such as Roslynator, StyleCop, Meziantou, ReSharper CLT, NetArchTest, ArchUnitNET, CodeQL, CSharpier, or Stryker
- If the repo does not define these commands clearly, tighten
AGENTS.md before continuing so later agents stop guessing.
- Do not introduce preview language features unless the repo explicitly opts into preview in project or MSBuild settings.
Bootstrap When Missing
When a requested .NET gate or tool is missing in this repo, do not stop at "not configured":
- Detect whether the tool is already present in project files, tool manifests, or CI.
- If the tool is optional and repo policy is unclear, ask whether to enable it as a default gate.
- If approved or already required by policy, install and wire it through the matching tool skill.
- Update
AGENTS.md so future agents have exact commands and stop guessing.
- Run one verify pass and return
status: configured or status: improved.
- If the tool is intentionally out of scope for this repo, return
status: not_applicable with reason and route.
Deliver
- .NET changes that use the right framework and tool skills
- version-compatible modern C# code
- a completed post-change verification pass, not only green tests
Validate
- only the skills relevant to the current .NET task were opened
VSTest and Microsoft.Testing.Platform assumptions were not mixed
- the language features used are supported by the repo's real
TFM and LangVersion
- format, analyzers, tests, and any configured extra gates were all considered before completion
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/skill-routing.md first
- read
references/task-flow.md when the task includes implementation, refactoring, or review
Example Requests
- "Work on this .NET feature and use the right skills."
- "Which .NET skills should open for this repo?"
- "Refactor this C# code and run the full quality pass after."