csharp-code-standards

Standardize Roslyn analyzer configuration and C#/.NET project tooling.

2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/grimlor/universal-dev-skills --skill csharp-code-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-code-standards
Source: https://github.com/grimlor/universal-dev-skills/tree/main/skills/csharp-code-standards
Command: npx skills add https://github.com/grimlor/universal-dev-skills --skill csharp-code-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents fragile C#/.NET codebases by standardizing compiler strictness, analyzer behavior, style rules, documentation requirements, and test/coverage expectations so issues surface early during build and review.

Core Features & Use Cases

  • Roslyn + .editorconfig standards: Establishes consistent code style and diagnostic severities (including nullable-related guidance) across IDEs and CI builds.
  • Strict build discipline: Enables warning-as-errors, latest-all analysis, and modern C# language settings to reduce defects before they ship.
  • xUnit + FluentAssertions + Moq baseline: Provides a consistent approach for writing expressive tests and measuring coverage.
  • Documentation enforcement: Uses CS1591 to require XML documentation for public APIs to improve maintainability.
  • Pre-commit quality gates: Suggests formatter and build verification hooks for personal workflows.
  • Suppression policy + null fix patterns: Discourages broad pragma suppression and provides safer patterns to resolve nullable warnings.

Quick Start

Configure a new .NET solution by adding Directory.Build.props (nullable + warnings as errors + analyzers), creating a root .editorconfig with the provided C# rules, and setting up an xUnit test project that enforces 100% line coverage.

Frequently Asked Questions about csharp-code-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Roslyn analyzers and .editorconfig to enforce strict C# code quality?

Configure a root .editorconfig to standardize Roslyn analyzer diagnostic severities and C# code style rules, ensuring consistent formatting and nullable-related guidance across IDEs and CI builds.

What's the best way to enforce warnings-as-errors and nullable reference types in .NET 8 projects?

The best way to enforce strict build discipline in .NET 8 is adding a Directory.Build.props file that enables nullable reference types, sets warnings-as-errors, and applies latest-all analysis to reduce defects before shipping.

How do I set up an xUnit test project with FluentAssertions, Moq, and 100% line coverage thresholds?

Set up an xUnit test project baseline integrating FluentAssertions and Moq for expressive tests, then configure a 100% line coverage command and threshold gate to enforce comprehensive test measurement.

Does enforcing XML documentation rules with CS1591 improve C# public API maintainability?

Enforcing XML documentation rules with CS1591 improves C# public API maintainability by requiring XML docs for all public APIs, which surfaces documentation gaps early during build and code review processes.

How do I fix nullable warnings in C# without using broad pragma suppressions?

To fix nullable warnings without broad pragma suppressions, apply safer patterns that resolve the underlying nullability issues directly, avoiding broad suppression policies that mask potential defects in your C# codebase.