Building Enterprise .NET APIs with Claude Code Skills: A Clean Architecture Toolkit

Published on: January 26, 2026

If you've ever spent hours scaffolding a new .NET project, writing boilerplate CQRS handlers, or setting up the same repository patterns for the hundredth time, this collection is for you.

I've put together 22 Claude Skills that serve as comprehensive templates and best practices for building .NET applications following Clean Architecture, CQRS, and Domain-Driven Design patterns. Think of them as your pair programmer who never forgets the patterns.

Why Claude Skills for .NET Architecture?

Every enterprise .NET project I've worked on follows similar patterns: Clean Architecture layers, MediatR for CQRS, FluentValidation for input validation, EF Core for writes, Dapper for optimized reads. Yet every time, we end up rewriting the same boilerplate.

These skills encode battle-tested patterns into reusable templates that Claude can apply consistently. No more:

  • Forgetting to add validation to a command handler
  • Inconsistent repository implementations across entities
  • Missing audit trails or domain events
  • Reinventing the outbox pattern for reliable messaging

The Skills Collection

Core Architecture (Skills 1-10)

The foundation of any Clean Architecture project:

SkillWhat It Does
dotnet-clean-architectureScaffolds the entire solution structure with proper layer separation and DI configuration
cqrs-command-generatorCreates commands, handlers, and validators for write operations
cqrs-query-generatorGenerates optimized read operations with Dapper and proper DTOs
domain-entity-generatorModels entities with value objects and factory methods
repository-patternAbstracts data access with interfaces and EF Core implementations
ef-core-configurationSets up Fluent API mappings, relationships, and indexes
api-controller-generatorBuilds REST endpoints with authorization and versioning
result-patternImplements explicit error handling without exceptions
domain-events-generatorAdds event-driven capabilities with the outbox pattern
pipeline-behaviorsHandles cross-cutting concerns like logging and transactions

Validation & Security (Skills 11-13)

Because every enterprise app needs proper validation and auth:

  • fluent-validation — Input validation with custom validators and async support
  • jwt-authentication — JWT Bearer auth with refresh tokens
  • permission-authorization — Fine-grained permission-based access control

Infrastructure (Skills 14-18)

The plumbing that makes production systems reliable:

  • outbox-pattern — Reliable messaging with idempotency guarantees
  • quartz-background-jobs — Scheduled jobs with cron expressions
  • email-service — Email integration with SendGrid and templating
  • health-checks — Dependency monitoring for PostgreSQL, HTTP endpoints, and custom checks
  • audit-trail — Change tracking with soft delete support

Data Access & Testing (Skills 19-22)

Optimized reads and comprehensive testing:

  • dapper-query-builder — Multi-mapping, pagination, and CTEs for complex queries
  • specification-pattern — Composable, reusable query logic
  • unit-testing — xUnit with NSubstitute and FluentAssertions
  • integration-testing — WebApplicationFactory with Testcontainers and Respawn

Architecture at a Glance

Here's how the skills map to Clean Architecture layers:

┌─────────────────────────────────────────────────────────────────┐
│                          API Layer                              │
│  Controllers • DTOs • Middleware • JWT Auth • Permissions       │
├─────────────────────────────────────────────────────────────────┤
│                      Application Layer                          │
│  Commands • Queries • Validators • Pipeline Behaviors • Events  │
├─────────────────────────────────────────────────────────────────┤
│                    Infrastructure Layer                         │
│  Repositories • EF Core • Dapper • Outbox • Jobs • Email        │
├─────────────────────────────────────────────────────────────────┤
│                       Domain Layer                              │
│  Entities • Value Objects • Domain Events • Specifications      │
└─────────────────────────────────────────────────────────────────┘

Technology Stack

These skills are built around a modern .NET stack:

  • .NET 8+ — Latest framework features
  • MediatR 12+ — CQRS implementation
  • FluentValidation 11+ — Request validation
  • Entity Framework Core 8+ — ORM for write operations
  • Dapper 2+ — Micro ORM for optimized reads
  • PostgreSQL 15+ — Primary database
  • Quartz.NET 3+ — Background job scheduling
  • Serilog 3+ — Structured logging
  • xUnit + NSubstitute + Testcontainers — Testing stack

How to Use

Each skill contains a SKILL.md file with:

  1. Overview — What the skill does and when to use it
  2. Quick Reference — At-a-glance template structure
  3. Complete Templates — Copy-paste ready code
  4. Examples — Real-world usage scenarios
  5. Best Practices — Do's and don'ts
  6. Anti-patterns — Common mistakes to avoid
  7. Related Skills — What pairs well together

Where should you place these skills?

To use a skill with Claude Code you have some options

  • For personal skills available across all projects, you can place them in ~/.claude/skills/
  • Or just in ./skills/ in your project
  • Personally I like to place them inside the project's git repo, inside a CLAUDE directory and mention their location in the main CLAUDE.md file in the root of the repo.

Then ask Claude to apply the patterns to your specific use case.

Get Started

The full collection is available on GitHub: HERE

Clone it, point Claude at the skills directory, and start building. Whether you're scaffolding a greenfield project or adding features to an existing codebase, these patterns will keep your architecture consistent and your code clean.


Have suggestions or want to contribute? Open an issue or PR on GitHub. Let's make .NET Clean Architecture accessible to everyone.


Happy coding! ⚡


AIDDDSoftware ArchitectureClean Code