Skip to content
affaan-m avatar

Dotnet Patterns

Idiomatic C# and .NET conventions covering immutability, dependency injection, async/await, and common application patterns.

CCM score
71 of 100
skills.sh installs
10.9K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers records and init-only models, explicit nullability and access modifiers, and interface-based service boundaries registered through DI
  • Includes async/await guidance with CancellationToken propagation, concurrent Task.WhenAll loads, the Options pattern, and a Result type for expected failures
  • Enforces avoidance of blocking calls such as .Result on async methods, which can deadlock
  • Designed for developers writing or reviewing C# and ASP.NET Core code, including EF Core repositories and Minimal API endpoints

Install

$ npx -y skills add affaan-m/ecc --skill dotnet-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

.NET Development Patterns

Idiomatic C# and .NET patterns for building robust, performant, and maintainable applications.

When to Activate

  • Writing new C# code
  • Reviewing C# code
  • Refactoring existing .NET applications
  • Designing service architectures with ASP.NET Core

Core Principles

1. Prefer Immutability

Use records and init-only properties for data models. Mutability should be an explicit, justified choice.

// Good: Immutable value object
public sealed record Money(decimal Amount, string Currency);

// Good: Immutable DTO with init setters
public sealed class CreateOrderRequest
{
    public required string CustomerId { get; init; }
    public required IReadOnlyList<OrderItem> Items { get; init; }
}

// Bad: Mutable model with public setters
public class Order
{
    public string CustomerId { get; set; }
    public List<OrderItem> Items { get; set; }
}

2. Explicit Over Implicit

Be clear about nullability, access modifiers, and intent.

// Good: Explicit access modifiers and nullability
public sealed class UserService
{
    private readonly IUserRepository _repository;
    private readonly ILogger<UserService> _logger;

Details

Repository
github.com/affaan-m/ecc
Categories
.NET & C#, Backend & APIs
First seen
Jul 14, 2026

Questions

What does the dotnet-patterns skill do?

It gives the agent idiomatic C# and .NET patterns for writing and reviewing code, covering dependency injection, async and await, and general conventions. The skill is meant for building robust, maintainable .NET applications.

How do I install the dotnet-patterns skill?

Run npx -y skills add affaan-m/ecc --skill dotnet-patterns -y in your project. After that, the agent can apply the skill's C# and .NET patterns when you write or review code.

Where does dotnet-patterns rank in the .NET and C# category?

It ranks in the top 10 of the .NET and C# category on Claude Marketplaces. Its patterns cover immutable models, interface-based dependencies, async usage with CancellationToken, the Options pattern, and EF Core repositories.

When should I use dotnet-patterns?

Use it when writing new C# code, reviewing C# code, or refactoring a .NET application. It also helps when designing service architectures with ASP.NET Core.

More from affaan-m/ecc

All 257

Similar to Dotnet Patterns

More .NET & C#