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:
| Skill | What It Does |
|---|---|
| dotnet-clean-architecture | Scaffolds the entire solution structure with proper layer separation and DI configuration |
| cqrs-command-generator | Creates commands, handlers, and validators for write operations |
| cqrs-query-generator | Generates optimized read operations with Dapper and proper DTOs |
| domain-entity-generator | Models entities with value objects and factory methods |
| repository-pattern | Abstracts data access with interfaces and EF Core implementations |
| ef-core-configuration | Sets up Fluent API mappings, relationships, and indexes |
| api-controller-generator | Builds REST endpoints with authorization and versioning |
| result-pattern | Implements explicit error handling without exceptions |
| domain-events-generator | Adds event-driven capabilities with the outbox pattern |
| pipeline-behaviors | Handles 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:
- Overview — What the skill does and when to use it
- Quick Reference — At-a-glance template structure
- Complete Templates — Copy-paste ready code
- Examples — Real-world usage scenarios
- Best Practices — Do's and don'ts
- Anti-patterns — Common mistakes to avoid
- 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
CLAUDEdirectory and mention their location in the mainCLAUDE.mdfile 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! ⚡