C# patterns for nullable types, records, async and HttpClient, locks, unsafe input, and .NET 9 to 11 changes. Load before any edit to a .cs or .csproj file, however small, and for C# questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Csharp Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-csharp-patterns)
---
name: csharp-patterns
description: C# patterns for nullable types, records, async and HttpClient, locks, unsafe input, and .NET 9 to 11 changes. Load before any edit to a .cs or .csproj file, however small, and for C# questions.
---
# C# patterns
Default assumption: C# 15 on .NET 11, per the C# version history and the .NET support policy. .NET 11 (STS) and .NET 10 (LTS) are supported to 2028-11-14; .NET 8 and 9 reached end of support on 2026-11-10.
A C# row applies when the project's `LangVersion`, or the default for its `TargetFramework`, is at least the row's version. A .NET row applies when the `TargetFramework`, or for an SDK or NuGet row the .NET SDK, is at least it.
ASP.NET Core is aspnet-core-patterns.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing C# code, raising `LangVersion` or the target framework, or adding a package | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing C# code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Using `ConfigureAwait`, nullable types, `using` directives, dates, lock files, central package management, or `LangVersion` preview | [reference/practices.md](reference/practices.md) |
| Configuring the .NET SDK analyzers, `dotnet format`, or an analyzer package | [reference/tooling.md](reference/tooling.md) |