Skip to content
wshaddix avatar

Modern Csharp Coding Standards

Modern C# standards for records, pattern matching, value objects, async/await, and Span<T> in new or refactored code.

CCM score
48 of 100
skills.sh installs
596
GitHub stars
94
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers naming, file layout, code style, access modifiers, and type design, plus performance and API design guidance
  • Includes reference notes on records, readonly record struct value objects, pattern matching, nullable reference types, and Span<T>/Memory<T>
  • Enforces explicit access modifiers, sealed classes by default, and Async suffixes on asynchronous methods
  • Designed for writing new C# code, refactoring existing code, and designing public library or service APIs

Install

$ npx -y skills add wshaddix/dotnet-skills --skill modern-csharp-coding-standards -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Modern C# Coding Standards

When to Use This Skill

Use this skill when:

  • Writing new C# code or refactoring existing code
  • Designing public APIs for libraries or services
  • Optimizing performance-critical code paths
  • Implementing domain models with strong typing
  • Building async/await-heavy applications
  • Working with binary data, buffers, or high-throughput scenarios

Core Principles

  1. Immutability by Default - Use record types and init-only properties
  2. Type Safety - Leverage nullable reference types and value objects
  3. Modern Pattern Matching - Use switch expressions and patterns extensively
  4. Async Everywhere - Prefer async APIs with proper cancellation support
  5. Zero-Allocation Patterns - Use Span<T> and Memory<T> for performance-critical code
  6. API Design - Accept abstractions, return appropriately specific types
  7. Composition Over Inheritance - Avoid abstract base classes, prefer composition
  8. Value Objects as Structs - Use readonly record struct for value objects

Naming Conventions

General Rules

Details

Repository
github.com/wshaddix/dotnet-skills
Category
.NET & C#
First seen
Jun 3, 2026

More from wshaddix/dotnet-skills

All 13

Similar to Modern Csharp Coding Standards

More .NET & C#