dotnet-backend-patterns (wshobson): a Claude skill for C# and .NET backends
A skill from wshobson/agents with C# and .NET backend patterns for APIs, EF Core, Dapper, caching and xUnit tests.
- Installs
- 19.4K
- on skills.sh
- Stars
- 42.1K
- on GitHub
- Files
- 4
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
dotnet-backend-patterns is a reference skill. It loads when you work on .NET Web APIs or MCP servers, review C# code, or design services. Claude follows its patterns: clean architecture folders, dependency injection lifetimes, async/await, IOptions<T> configuration and a result pattern that avoids exceptions for business logic.
It also covers Entity Framework Core, Dapper, a two-level cache with Redis, and unit and integration tests with xUnit, Moq and WebApplicationFactory. It closes with 10 do and 10 don't rules and seven common pitfalls. The folder has 5 files: SKILL.md, two C# templates and two reference guides. It bundles no scripts to run.
Good for
- C# developers building ASP.NET Core Web APIs or .NET MCP servers
- Reviewers checking C# code for quality and performance
- Teams choosing between EF Core and Dapper
Install dotnet-backend-patterns
Claude Code
- 1
Copy this prompt.
Install the dotnet-backend-patterns skill in Claude Code. Run this command: npx skills add https://github.com/wshobson/agents --skill dotnet-backend-patterns Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- When to Use This Skill
- Core Concepts
- 1. Project Structure (Clean Architecture)
- 2. Dependency Injection Patterns
- 3. Async/Await Patterns
- 4. Configuration with IOptions
- 5. Result Pattern (Avoiding Exceptions for Flow Control)
- Data Access Patterns
- Entity Framework Core
- Dapper for Performance
- Caching Patterns
- Multi-Level Cache with Redis
- Testing Patterns
- Unit Tests with xUnit and Moq
- Integration Tests with WebApplicationFactory
- Best Practices
Key facts
- License
- MIT
- Installs on skills.sh
- 19,359 as of 2026-11-02
- Last repo commit
- 2026-10-30
- skills.sh audits
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
What it includes
Clean architecture: Domain, Application, Infrastructure, Api
A folder layout with entities, DTOs, validators, data and caching folders, and an Api entry point.
Try: “Lay out a new .NET 8 Web API using the clean architecture structure.”
Read ·
Project structureScoped, singleton and transient registrations
Shows service registration by lifetime, including a Redis cache service.
Read ·
Dependency injectionAsync all the way, cancellation tokens
Patterns for async code in services, with rules against blocking on tasks.
Read ·
Async/await patternsTyped settings from appsettings sections
Binds configuration sections such as Redis to option classes.
Read ·
Configuration with IOptionsReturn results instead of throwing for business errors
A Result type for flow that would otherwise use exceptions.
Read ·
Result patternWhich to use for which job
EF Core for complex domain models with change tracking, Dapper for read-heavy, performance-critical queries.
Read ·
Entity Framework Core and DapperTwo-level cache, memory then distributed
A multi-level cache pattern with invalidation guidance.
Read ·
Caching with RedisxUnit and Moq units, WebApplicationFactory integration tests
Unit and integration test examples, including swapping Redis for a memory cache in tests.
Read ·
Testing patterns10 DO rules, 10 DON'T rules, 7 pitfalls
Covers blocking on async, async void, AsNoTracking, HttpClient creation, N+1 queries and cache stampedes.
Read ·
Best practices and pitfallsTwo C# templates and two reference guides
repository-template.cs (Dapper and EF Core), service-template.cs, dapper-patterns.md and ef-core-best-practices.md.
Read ·
Bundled templates and guides
From the official docs
Questions
What does dotnet-backend-patterns do?
It gives Claude a set of C# and .NET backend patterns to follow: project structure, dependency injection, async code, configuration, EF Core, Dapper, Redis caching and xUnit testing. It loads when you build or review .NET APIs.
How do I install it?
Use the install box at the top of this page. The skill folder holds SKILL.md plus two C# templates and two reference guides, so keep the folder together.
Does it run code or need a database or Redis?
The skill is guidance and code examples. It bundles no scripts to run. Its examples use SQL Server, Redis and xUnit, so your own project needs whatever you choose to use.
Is it safe to use?
It only changes what Claude writes in your project, so review the generated C# like any other code. Check connection strings and secrets yourself, because the examples read settings such as Redis:Connection from configuration.
Should I use EF Core or Dapper according to the skill?
Its best practices say to prefer Dapper for read-heavy, performance-critical queries and EF Core for complex domain models with change tracking.
Is it for MCP servers?
Its description and when-to-use list name .NET MCP servers next to Web APIs, but its examples are on API patterns such as services, caching and tests.
Information
updated Nov 2, 2026
- Repository
- wshobson/agents
- Folder
plugins/dotnet-contribution/skills/dotnet-backend-patterns
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- SKILL.md · github.com
- repository-template.cs · github.com
- service-template.cs · github.com
- dapper-patterns.md · github.com
- ef-core-best-practices.md · github.com