LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

modern-csharp-coding-standards

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.

1,086stars99forksUpdated 7/29/2026
Developer Tools#csharp#performance#api-design#dotnet#code-conventions

Security Assessment

Safe(96/100)
Security Score96/100

About modern-csharp-coding-standards

Modern C# Coding Standards is a reference-and-guidance skill that teaches an agent (or developer) how to write idiomatic, high-performance C# using recent language features. It addresses the common problem of legacy, allocation-heavy, inheritance-driven C# by codifying a set of opinionated principles: immutability by default, strong type safety, extensive pattern matching, async everywhere, and zero-allocation patterns for hot paths. The material is framed as best-practice conventions applied when writing new code, refactoring, designing public APIs, or optimizing performance-critical paths.

The skill is organized around a SKILL.md overview plus four focused reference files. It covers records for immutable DTOs and domain entities, value objects modeled as `readonly record struct` with validation-at-construction (OrderId, Money, EmailAddress, AbsoluteUrl and similar constraint-enforcing types), switch-expression and property/relational/list pattern matching, nullable reference types, `Span<T>`/`Memory<T>` usage and API-design principles, composition over inheritance with a Result type for error handling, and an explicit catalogue of anti-patterns including reflection avoidance. Every recommendation is accompanied by concrete C# 9-12 code examples.

It targets .NET library authors, backend and service developers, and teams standardizing on modern C# idioms, especially those building domain models, high-throughput or buffer-heavy code, and async-first applications. It is a pure knowledge asset (`invocable: false`) with no scripts to execute, so it functions as a style guide and code-review companion rather than an automated tool.

FAQ

What C# version does this assume?

It targets modern C#, with examples spanning C# 8 through 12 (records, switch expressions, list patterns, relational patterns). It also assumes nullable reference types are enabled in the project.

Does the skill run any code or tools?

No. It is marked invocable: false and consists of SKILL.md plus reference markdown files. It provides patterns and code examples to follow, not executable scripts.

When should I apply these standards?

When writing or refactoring C#, designing public library/service APIs, implementing strongly-typed domain models, or optimizing performance-critical, allocation-sensitive code paths.

Why does it recommend readonly record struct for value objects?

For value semantics (content-based equality), stack allocation to reduce GC pressure, immutability, and clean interaction with pattern matching. It also advises validating at construction and avoiding implicit conversions to preserve type safety.

Is it tied to a specific framework?

No. The guidance is language-level and framework-agnostic, applicable to any modern .NET codebase.

All Files

5 files
value-objects-and-patterns.md12.3 KB
View
SKILL.md10.4 KB
View
anti-patterns-and-reflection.md8.6 KB
View
performance-and-api-design.md10.0 KB
View
composition-and-error-handling.md7.9 KB
View

Install modern-csharp-coding-standards

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

aaronontheweb/dotnet-skills

Related Skills

research

448

secops-detection-engineering

21,346

qdrant-monitoring

259

project-architecture

3