modern-csharp-coding-standards

Provides guidelines for modern C# coding standards and performance optimization techniques.

Updated May 31, 2026
One-click install
npx skills add https://github.com/nicolashuber/opencode-config --skill modern-csharp-coding-standards-nicolashuber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-csharp-coding-standards
Source: https://github.com/nicolashuber/opencode-config/tree/main/skills/csharp-coding-standards
Command: npx skills add https://github.com/nicolashuber/opencode-config --skill modern-csharp-coding-standards-nicolashuber

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps developers write modern, high-performance C# code by providing guidelines and best practices for coding standards, performance optimization, and error handling.

Core Features & Use Cases

  • Modern Coding Standards: Emphasizes functional-style programming with C# 12+ features like records, pattern matching, and async/await.
  • Performance Optimization: Offers techniques for optimizing performance using Span<T>/Memory<T> and best-practice API design patterns.
  • Error Handling: Demonstrates how to use the Result type pattern for expected errors and avoid reflection-based metaprogramming.
  • Use Case: Ideal for developers looking to refactor existing C# code, design public APIs, or optimize performance-critical code paths.

Quick Start

Use the modern-csharp-coding-standards skill to learn about modern C# coding standards and best practices.

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 use Span<T> and Memory<T> for C# performance optimization?

Use Span<T> and Memory<T> for C# performance optimization to minimize allocations in critical code paths. These structures provide safe, efficient memory access over contiguous regions without copying data.

What is the Result type pattern for C# error handling?

The Result type pattern for C# error handling represents expected errors as explicit return values instead of throwing exceptions. This functional approach avoids reflection-based metaprogramming and improves predictable code flow.

How do I write high-performance C# code using modern records and pattern matching?

Write high-performance C# code using modern records and pattern matching by applying functional-style programming with C# 12+ features. This ensures immutable data models and concise, maintainable branching logic.

Does this modern C# coding standards approach support async/await best practices?

Modern C# coding standards fully support async/await best practices for high-performance, maintainable code. The guidelines emphasize proper asynchronous API design patterns to prevent common pitfalls like deadlocks.

What's the best way to refactor existing C# code to functional-style programming?

The best way to refactor existing C# code to functional-style programming involves adopting C# 12+ features like records and pattern matching. This transition improves code quality, immutability, and overall maintainability.

When should I avoid reflection-based metaprogramming in C# API design?

Avoid reflection-based metaprogramming in C# API design when building high-performance systems, as it introduces runtime overhead. Instead, use the Result type pattern and modern language features for safer, faster execution.