modern-csharp-coding-standards

Enforce modern C# patterns for .NET 12+ codebases.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/tientt010/Dotnet-JiraLite-Microservices --skill modern-csharp-coding-standards-tientt010
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-csharp-coding-standards
Source: https://github.com/tientt010/Dotnet-JiraLite-Microservices/tree/main/.github/skills/csharp-coding-standards
Command: npx skills add https://github.com/tientt010/Dotnet-JiraLite-Microservices --skill modern-csharp-coding-standards-tientt010

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing modern, high-performance C# code that leverages records, pattern matching, value objects, async/await, Span<T>/Memory<T>, and API-design best practices.

Core Features & Use Cases

  • Immutability and records for DTOs and domain models
  • Value objects as readonly structs for performance and correctness
  • Advanced pattern matching and async programming patterns
  • Guidance on zero-allocation APIs using Span<T> and Memory<T>
  • API design principles emphasizing composition over inheritance

Quick Start

Create a small domain model that uses records, value objects, and pattern matching to demonstrate modern C# patterns.

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 write high-performance C# code using records and value objects?

To write high-performance C# code, use records for immutable DTOs and domain models, and implement value objects as readonly structs. This combination ensures correctness while minimizing memory allocations in performance-critical paths.

What is the best way to implement zero-allocation APIs in .NET 12+?

The best way to implement zero-allocation APIs in .NET 12+ is by leveraging Span<T> and Memory<T>. These structures provide fine-grained control over memory buffers without the overhead of traditional heap allocations.

How do I use pattern matching for domain modeling in modern C#?

Use advanced pattern matching in modern C# to express domain logic concisely alongside records and value objects. This approach codifies complex state transitions and domain rules directly into the type system for safer, more readable code.

Should I use composition over inheritance for API design in C#?

Yes, you should use composition over inheritance for API design in C#. Modern coding standards favor composing small, focused behaviors rather than relying on deep inheritance hierarchies, resulting in more flexible and maintainable APIs.

Does this modern C# coding approach work for refactoring existing .NET codebases?

Yes, this modern C# coding approach works perfectly for refactoring existing .NET codebases. It provides frontmatter-driven guidance to systematically migrate legacy code toward records, pattern matching, and async patterns in .NET 12+ environments.

When should I use async patterns with Span<T> and Memory<T> in C#?

Use async patterns with Span<T> and Memory<T> when building performance-critical paths that require asynchronous processing. This combination allows you to handle high-throughput I/O operations without blocking threads or generating unnecessary garbage collection overhead.