csharp-patterns

Apply modern C# patterns for async/await, nullable reference types, records, and LINQ.

Updated Jan 25, 2026
One-click install
npx skills add https://github.com/tridentsof/antigravity-dev-kit --skill csharp-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-patterns
Source: https://github.com/tridentsof/antigravity-dev-kit/tree/main/skills/csharp-patterns
Command: npx skills add https://github.com/tridentsof/antigravity-dev-kit --skill csharp-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern C# development often suffers from inconsistent patterns and boilerplate. This skill consolidates best practices for async/await, nullable reference types, records, and pattern matching to improve code quality.

Core Features & Use Cases

  • Async/Await best practices and avoiding .Result/.Wait
  • Nullable reference types and records for safe data modeling
  • Pattern matching and LINQ best practices
  • Clean code organization and maintainability in C# projects

Quick Start

Refactor a sample class to use records, pattern matching, and proper async patterns.

Frequently Asked Questions about csharp-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I avoid deadlocks when using async await in C#?

Avoiding deadlocks in async await requires stopping the use of .Result or .Wait() and applying modern C# async/await best practices throughout the call chain. This ensures clear, maintainable code without thread blocking.

What is the best way to model immutable data in C#?

Modeling immutable data in C# is best done using records and nullable reference types for safe data modeling. This approach provides strong typing and robust error handling for maintainable applications.

How do I use pattern matching and LINQ for cleaner C# code?

Using pattern matching and LINQ for cleaner C# code involves applying modern expressions to replace complex conditional logic and loops. This improves overall code quality, testability, and maintainability.

Do I need nullable reference types for clean architecture in C#?

Nullable reference types are needed for clean architecture in C# to enforce strong typing and safe data modeling. They help prevent null reference exceptions and satisfy robust error handling requirements.

Can I refactor existing C# classes to use records and async patterns?

You can refactor existing C# classes to use records and async patterns by consolidating boilerplate into modern best practices. This improves code organization and maintainability across backend services and desktop apps.