csharp-advanced-patterns

Implement advanced C# patterns and .NET 10 features for clean code.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/alexsandrocruz/DominusLeads --skill csharp-advanced-patterns-alexsandrocruz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-advanced-patterns
Source: https://github.com/alexsandrocruz/DominusLeads/tree/main/backend/Sapienza.Leads/.claude/skills/csharp-advanced-patterns
Command: npx skills add https://github.com/alexsandrocruz/DominusLeads --skill csharp-advanced-patterns-alexsandrocruz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write elegant, high-performance C# code by mastering advanced patterns, records, and .NET 10 features.

Core Features & Use Cases

  • Advanced pattern matching: switch expressions, property patterns, and list patterns to express complex logic concisely.
  • Immutable data with records: design DTOs that are naturally thread-safe and easy to compare.
  • Performance-first techniques: Span<T>/Memory<T>, ArrayPool, and zero-allocation patterns to reduce allocations.
  • Modern async patterns: proper use of async/await, ValueTask, and primary constructors for clean architecture.
  • Practical use: refactor a legacy C# codebase to modern idioms with minimal behavioral changes.

Quick Start

Install the .NET 10 SDK and a modern IDE, open this skill, and begin by modeling a simple DTO with a record, then replace a class with a primary constructor and apply a switch expression to a sample status handler. Finally, refactor a parsing routine to use Span<T> for zero-allocation parsing.

Frequently Asked Questions about csharp-advanced-patterns

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

FAQPage Schema
How do I use Span<T> and Memory<T> in C# for zero-allocation parsing?

Use Span<T> and Memory<T> in C# to process memory regions without allocating new arrays, enabling zero-allocation parsing routines. This skill demonstrates refactoring parsing logic to leverage these structs for minimal memory overhead.

What are the best ways to implement advanced pattern matching in C#?

Implement advanced pattern matching in C# using switch expressions, property patterns, and list patterns. This skill shows how to apply these features to express complex state-handling logic concisely across typical enterprise scenarios.

How do I refactor a legacy C# codebase to use records and primary constructors?

Refactor a legacy C# codebase to modern idioms by replacing traditional classes with records for thread-safe DTOs and utilizing primary constructors. This skill guides minimal behavioral changes while upgrading to modern C# syntax.

Do I need the .NET 10 SDK to use modern async patterns and ValueTask?

Yes, you need the .NET 10 SDK and a modern IDE to enable modern async patterns, ValueTask, and primary constructors. This skill requires the .NET 10 SDK to implement performance-oriented techniques and clean architecture.

When should I use ArrayPool and collection expressions for C# performance optimization?

Use ArrayPool and collection expressions in C# when you need performance-first techniques to reduce memory allocations. This skill covers applying these features alongside records and LINQ optimizations for high-performance .NET applications.