Use a repo-root `.editorconfig` to configure free .NET analyzer and style rules.
.NET Quality CI
Set up or refine open-source .NET code-quality gates for CI: formatting, `.editorconfig`, SDK analyzers, third-party analyzers, coverage, mutation testing, architecture tests, and security scanning. Use when a .NET repo needs an explicit quality stack in `AGENTS.md`, docs, or pipeline YAML.
Trigger On
- adding or tightening .NET code-quality gates in CI
- choosing analyzers, coverage, mutation, or architecture-test tooling for a .NET repo
- standardizing
.editorconfig,dotnet format, and warning policy
Workflow
- Start with the repo-native baseline:
- repo-root .editorconfig - dotnet format --verify-no-changes - SDK analyzers with explicit EnableNETAnalyzers, AnalysisLevel, and warning policy
- Add third-party analyzers only where they close a real gap:
- StyleCopAnalyzers - Roslynator - Meziantou.Analyzer - framework analyzers such as xUnit, MSTest, or TUnit analyzers
- Separate quality gates by purpose:
- formatting and style - correctness and static analysis - coverage and reports - architecture rules - security scanning - mutation testing
- For complexity, use a composite approach:
- CA1502 thresholding - maintainability limits in AGENTS.md - architecture tests - coverage and mutation where risk justifies it
- Make ownership explicit in
AGENTS.mdand CI:
- which command formats - which command analyzes - which command measures coverage - which runner model the tests use
- After any .NET code change, the repo's quality pass must be runnable by agents:
- format - build - analyze - focused tests - broader tests - coverage and report generation when configured - extra configured gates only when the repo actually enabled them
- Route tool-specific setup through dedicated skills where possible:
- format - code-analysis - analyzer-config - analyzer-pack skills such as stylecop-analyzers, roslynator, and meziantou-analyzer - frontend asset quality skills in mixed .NET plus Node repos such as eslint, stylelint, htmlhint, webhint, biome, sonarjs, metalint, and chous - coverage/reporting skills such as coverlet and reportgenerator - architecture/security skills such as netarchtest, archunitnet, and codeql
- Avoid overlapping tools with conflicting ownership. If you add an opinionated formatter, define whether it replaces or complements
dotnet format.
Deliver
- a documented .NET quality baseline
- CI commands that are explicit and reproducible
- analyzer and coverage choices that match the repo's runner model
- a documented post-change quality pass for agents and CI
- tool selection that stays open-source and free by default, with caveats called out explicitly
Validate
- repo-root
.editorconfigis the default source of truth for per-rule severity - formatting, analyzer, and coverage commands are runner-compatible
- added tools cover distinct gaps instead of duplicating each other
- complexity and architecture policy are explicit, not implied
- .NET code changes are expected to pass more than tests alone when quality gates are configured
- any licensing or hosting caveat is documented before the tool becomes a default gate
Load References
references/editorconfig-and-ci.mdreferences/quality-toolchain.mdreferences/workflows.mdreferences/checklist.md
Related skills
Use the open-source free `CSharpier` formatter for C# and XML.
Use Chous in .NET repositories that ship sizeable frontend codebases and want file-structure linting, naming convention enforcement, and folder-layout policy as a CLI gate.
Related agents
.NET Review
Review orchestration agent for .NET changes across bugs, regressions, analyzers, architecture, tests, and maintainability.
Also works: dotnet agents install review
.NET Build
Build-focused orchestration agent for .NET restore, build, test, packaging, CI failures, diagnostics, and environment drift.
Also works: dotnet agents install build