modern-csharp-coding-standards

Generate guidance and examples for modern C# 12+ coding standards.

1|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/woutervanranst/Arius7 --skill modern-csharp-coding-standards-woutervanranst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-csharp-coding-standards
Source: https://github.com/woutervanranst/Arius7/tree/main/.agents/skills/csharp-coding-standards
Command: npx skills add https://github.com/woutervanranst/Arius7 --skill modern-csharp-coding-standards-woutervanranst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write modern, high-performance C# code using records, pattern matching, value objects, async/await, Span<T>/Memory<T>, and best-practice API design patterns. Emphasizes functional-style programming with C# 12+ features.

Core Features & Use Cases

  • Immutability by Default - Use record types and init-only properties to model domain data safely.
  • Type Safety & Value Objects - Leverage readonly record struct for value objects and strong typing.
  • Modern Pattern Matching - Employ switch expressions and patterns to express intent clearly.
  • Performance-Centric - Embrace Span<T>/Memory<T> and async APIs for zero-allocation, high-throughput code.
  • API Design - Favor abstractions, clear boundaries, and testable shapes.

Quick Start

Provide a minimal example implementing an immutable DTO using record types and a simple pattern-match method.

Frequently Asked Questions about modern-csharp-coding-standards

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

FAQPage Schema
How do I enforce immutability and value objects in modern C# domain modeling?

Enforce immutability in C# domain modeling by using record types with init-only properties and readonly record struct for value objects. This approach ensures safe, functional-style data handling and strong type safety.

What is the best way to write high-performance async C# code with zero allocations?

Write high-performance async C# code with zero allocations by embracing Span<T> and Memory<T> alongside async APIs. These structures enable high-throughput, memory-efficient processing for performance-sensitive codebases.

How do I use pattern matching and switch expressions in C# 12?

Use pattern matching and switch expressions in C# 12 to express intent clearly and replace complex conditional logic. Modern patterns provide concise, readable type-checking and data extraction workflows.

Does this C# coding standards guidance work for API design?

Yes, this C# coding standards guidance applies to API design by favoring clear abstractions, testable shapes, and distinct boundaries. It ensures clean API patterns suitable for modern software engineering.

When should I not use record types for domain data in C#?

Avoid using record types for domain data in C# when you require highly mutable state or complex inheritance hierarchies. Records enforce immutability by default, which suits value objects but not dynamic state tracking.