modern-csharp-coding-standards

Installation
Summary

Modern C# coding standards covering records, pattern matching, value objects, async/await, and high-performance patterns.

  • Use record types for immutable DTOs and domain entities; readonly record struct for value objects with zero-allocation semantics
  • Leverage pattern matching with switch expressions, nullable reference types, and composition over inheritance for cleaner, type-safe code
  • Apply async/await throughout with mandatory CancellationToken parameters; use Span<T>, Memory<T>, and ArrayPool<T> for performance-critical paths
  • Handle expected business errors with Result<T, TError> types; reserve exceptions for unexpected system failures
  • Avoid reflection-based metaprogramming (AutoMapper, Mapster) in favor of explicit mapping and composition patterns
SKILL.md

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

Reference Files

Related skills
Installs
1.3K
GitHub Stars
923
First Seen
Jan 28, 2026