Agent skill · Backend & API

dotnet-backend-patterns

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.

Seth Hobson38,331★ · +219/wk · 1 repos on radarProfile →
claude-codecodexcopilotcursorMIT
Install
npx skills add wshobson/agents --skill dotnet-backend-patterns --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 5
SKILL.md size: 26 KB
Bundled scripts: none
Path: plugins/dotnet-contribution/skills/dotnet-backend-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 38,479 · +148 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

A skill that instructs an AI coding agent on implementing and reviewing C#/.NET backend patterns, covering project structure, dependency injection, async/await usage, configuration with IOptions, data access with EF Core and Dapper, result handling, caching patterns, and multi-level caching, plus testing approaches.

How it works

  • Provides a full project layout (Domain, Application, Infrastructure, Api) as a pattern for clean architecture.
  • Demonstrates dependency injection setup with various lifetimes (Scoped, Singleton, Transient), options pattern registrations, factory-based and keyed services, and usage in consumer classes.
  • Shows correct and incorrect async practices, including awaiting, WhenAll usage, ConfigureAwait, ValueTask for cached paths, and guidance against blocking on async calls.
  • Details configuration patterns via IOptions, IOptionsSnapshot, and IOptionsMonitor, including example options classes and their registration/usage.
  • Introduces a generic Result<T> type for flow-control without exceptions, including mapping helpers and usage in services and endpoints.
  • Outlines data access patterns with EF Core (DbContext, configurations, repositories) and Dapper (queries, parameter handling, multi-mapping).
  • Illustrates caching strategies, including multi-level caching with Memory Cache and Distributed Cache, and patterns for cache keys and invalidation (partial content shown in excerpt).

When to use it

  • When developing new .NET Web APIs or MCP servers
  • When reviewing C# code for quality and performance
  • When designing service architectures with dependency injection
  • When implementing caching strategies with Redis
  • When writing unit and integration tests
  • When optimizing database access with EF Core or Dapper
  • When configuring applications with IOptions pattern
  • When handling errors and implementing resilience patterns

What it can touch

  • Tools listed: claude-code, codex, copilot, cursor
  • Code examples appear in C# (.NET 6+/8+) alongside configuration and DI usage
  • File structure references such as src/ and specific classes like AppDbContext, ProductRepository, DapperProductRepository, and various option classes are shown explicitly in the instructions

Caveats

  • The skill demonstrates advanced patterns and requires an environment supporting C#/.NET, EF Core, and Dapper; actual runtime behavior depends on concrete project setup.
  • Licensing noted as MIT; usage should comply with repository license terms.
From the SKILL.md

# .NET Backend Development Patterns Master C#/.NET patterns for building production-grade APIs, MCP servers, and enterprise backends with modern best practices (2024/2025). ## When to Use This Skill - Developing new .NET Web APIs or MCP servers - Reviewing C# code for quality and performance - Designing service architectures with dependency injection - Implementing caching strategies with Redis - Writing unit and integration tests - Optimizing database access with EF Core or Dapper - Configuring applications with IOptions pattern - Handling errors and implementing resilience patterns ## Core Concepts ### 1. Project Structure (Clean Architecture) ``` src/ ├── Domain/ # Core business logic (no dependencies) │ ├── Entities/ │ ├── Interfaces/ │ ├── Exceptions/ │ └── ValueObjects/ ├── Application/ # Use cases, DTOs, validation │ ├── Services/ │ ├── DTOs/ │ ├── Validators/ │ └── Interfaces/ ├── Infrastructure/ # External implementations │ ├── Data/ # EF Core, Dapper repositories │ ├── Caching/ # Redis, Memory cache │ ├── External/ # HTTP clients, third-party APIs │ └── DependencyInjection/ # Service registration └── Api/ # Entry point ├── Controllers/ # Or MinimalAPI endpoints ├── Middle

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Core Concepts
  3. 1. Project Structure (Clean Architecture)
  4. 2. Dependency Injection Patterns
  5. 3. Async/Await Patterns
  6. 4. Configuration with IOptions
  7. 5. Result Pattern (Avoiding Exceptions for Flow Control)
  8. Data Access Patterns
  9. Entity Framework Core
  10. Dapper for Performance
  11. Caching Patterns
  12. Multi-Level Cache with Redis
  13. Testing Patterns
  14. Unit Tests with xUnit and Moq
Ships with 4 files
  • assets/repository-template.cs
  • assets/service-template.cs
  • references/dapper-patterns.md
  • references/ef-core-best-practices.md
More from agents
All skills →
About this skill
What does the dotnet-backend-patterns skill do?

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.

How do I install it?

Run `npx skills add wshobson/agents --skill dotnet-backend-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From wshobson/agents, a repository with 38,479 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going