PlugWiki

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. 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. 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

  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
  15. Integration Tests with WebApplicationFactory
  16. Best Practices

Key facts

License
MIT
Installs on skills.sh
19,359 as of 2026-11-02
Last repo commit
2026-10-30

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 structure

  • Scoped, singleton and transient registrations

    Shows service registration by lifetime, including a Redis cache service.

    Read · Dependency injection

  • Async all the way, cancellation tokens

    Patterns for async code in services, with rules against blocking on tasks.

    Read · Async/await patterns

  • Typed settings from appsettings sections

    Binds configuration sections such as Redis to option classes.

    Read · Configuration with IOptions

  • Return results instead of throwing for business errors

    A Result type for flow that would otherwise use exceptions.

    Read · Result pattern

  • Which 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 Dapper

  • Two-level cache, memory then distributed

    A multi-level cache pattern with invalidation guidance.

    Read · Caching with Redis

  • xUnit and Moq units, WebApplicationFactory integration tests

    Unit and integration test examples, including swapping Redis for a memory cache in tests.

    Read · Testing patterns

  • 10 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 pitfalls

  • Two 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

wshobson/agentsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. SKILL.md · github.com
  2. repository-template.cs · github.com
  3. service-template.cs · github.com
  4. dapper-patterns.md · github.com
  5. ef-core-best-practices.md · github.com

Updated Nov 2, 2026.