dotnet-patterns

Guide C# and .NET developers in implementing idiomatic patterns and best practices.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill dotnet-patterns-richardnpaul
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-patterns
Source: https://github.com/richardnpaul/everything-vscode-copilot/tree/main/.github/skills/dotnet-patterns
Command: npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill dotnet-patterns-richardnpaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

C# and .NET teams often struggle with inconsistent patterns, boilerplate, and architectural drift. This skill provides a concise set of idiomatic patterns and practices to guide developers toward maintainable, robust code.

Core Features & Use Cases

  • Immutability and value semantics using records and init-only properties.

  • Explicitness in nullability, access modifiers, and intent to reduce bugs.

  • Dependency injection, interface-based design, and clean architecture alignment for scalable apps.

  • Async/await best practices for responsive, scalable code.

  • Use Case: When starting a new .NET project or reviewing existing code, apply the guidelines to improve readability, testability, and maintainability.

Quick Start

Review a .NET project and apply the pattern guidelines to refactor for immutability, explicit nullability, DI, and proper async usage.

Frequently Asked Questions about dotnet-patterns

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

FAQPage Schema
What are the best practices for dependency injection in .NET applications?▼

Dependency injection in .NET uses interface-based design and clean architecture alignment to build scalable, testable applications. This approach reduces tight coupling and ensures consistent code quality across enterprise projects.

How do I refactor C# code to use records and init-only properties for immutability?▼

Refactoring C# code for immutability involves applying records and init-only properties to enforce value semantics. This pattern reduces bugs by making object state explicit and preventing unintended modifications after initialization.

Can I apply these .NET patterns to an existing enterprise codebase?▼

You can apply these .NET patterns to existing enterprise codebases by using them as refactoring guidelines. They target improving readability, testability, and maintainability across typical enterprise scenarios without requiring a full system rewrite.

What is the best way to implement async/await in C# for scalable applications?▼

The best way to implement async/await in C# is following idiomatic patterns for responsive, scalable code. Proper async usage prevents thread blocking and improves application throughput across typical enterprise .NET workloads.

Why should I use explicit nullability in C# and .NET projects?▼

Explicit nullability in C# and .NET projects reduces bugs by making intent clear in your code signatures. Combined with explicit access modifiers, it enforces robust value semantics and prevents common null reference exceptions.