modern-csharp-coding-standards

Guides developers in writing modern, high-performance C# code using records, nullable reference types, Span<T>, and async/await.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/vorluno/Vorluno-Planilla --skill modern-csharp-coding-standards-vorluno
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-csharp-coding-standards
Source: https://github.com/vorluno/Vorluno-Planilla/tree/main/.agents/skills/modern-csharp-coding-standards
Command: npx skills add https://github.com/vorluno/Vorluno-Planilla --skill modern-csharp-coding-standards-vorluno

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write more efficient, maintainable, and modern C# code by leveraging advanced language features and best practices.

Core Features & Use Cases

  • Immutability: Encourages the use of record types and init-only properties for safer data handling.
  • Type Safety: Promotes the use of nullable reference types and value objects for robust code.
  • Performance: Guides on using Span<T>, Memory<T>, and async/await for optimized execution.
  • Use Case: Refactor legacy C# code to use record struct for value objects, improving performance and clarity, and adopt pattern matching for cleaner conditional logic.

Quick Start

Apply the modern C# coding standards to refactor the provided C# code snippet.

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 refactor legacy C# code to use modern features like records and pattern matching?

To refactor legacy C# code, apply modern coding standards by replacing mutable classes with `record` types for immutability and adopting pattern matching for cleaner conditional logic. This refactoring process improves both execution performance and code maintainability.

What's the best way to optimize C# performance using Span<T> and Memory<T>?

The best way to optimize C# performance is using `Span<T>` and `Memory<T>` to minimize memory allocations during data processing. These structures enable high-performance execution by providing safe, managed access to contiguous memory regions without copying.

How do I implement immutability and type safety in C# 12?

You implement immutability and type safety in C# 12 by utilizing `record` types with `init`-only properties for safer data handling, enabling nullable reference types, and creating value objects. This functional-style approach ensures robust, predictable application behavior.

Does modern C# coding standards support async/await patterns for high-performance applications?

Modern C# coding standards fully support `async/await` patterns to optimize execution in high-performance applications. Properly implemented asynchronous patterns prevent thread blocking, maximizing throughput and responsiveness during I/O operations.

When should I use record struct versus record types for value objects in C#?

Use `record struct` for value objects when you need value-type semantics and allocation-free performance in performance-critical paths. Use reference-type `record` for larger objects or when sharing immutable data across scopes to avoid unnecessary memory copying.