| name | dotnet-enterprise |
| description | Generate and maintain .NET 10 enterprise repositories with Clean Architecture, DDD, CQRS, MassTransit, and cloud-native patterns. Use when user says "create a new .NET project", "set up microservices", "add DDD patterns", "configure MassTransit", "set up RabbitMQ", "add OpenTelemetry", "implement distributed caching", "set up Docker", or asks for "enterprise .NET", "CQRS architecture", "Clean Architecture", "event-driven microservices". Do NOT use for simple scripts or console apps without architecture needs. |
| metadata | {"author":"Claude-DotNet-Ultimate","version":"2.1.0","category":"enterprise-architecture"} |
.NET 10 Enterprise Repository Generator
Purpose
Creates and maintains production-ready .NET 10 enterprise solutions with Domain-Driven Design, CQRS, event-driven architecture, and modern cloud-native patterns.
Key Principles
1. Immutability by Default
- Use records for DTOs, events, value objects
- Use readonly record struct for strongly-typed IDs and performance-critical value types
- Prefer init setters over set
2. Type Safety First
- Use strongly-typed IDs (
readonly record struct OrderId(Guid Value))
- Enable nullable reference types
- Use Result instead of exceptions for flow control
3. Composition Over Inheritance
- Use sealed classes by default
- Prefer interfaces and records
- Use primary constructors for DI
4. Performance-Aware
- Use Span and ReadOnlySpan for parsing hot paths
- Use ValueTask where appropriate
- Never use
.Result or .Wait() on async
5. No Magic
- No AutoMapper — use manual mapping or Mapster
- No reflection in hot paths
- Explicit DI — no service locator
Solution Structure
Solution/
├── src/
│ ├── Core/ # Domain layer (zero external deps)
│ │ ├── Common/ # BaseEntity, AggregateRoot, ValueObject, Result<T>
│ │ └── Domain/ # Entities, Value Objects, Events
│ ├── Application/ # Use cases, CQRS handlers
│ │ ├── Common/Interfaces/ # IMessageBus, ICacheService, IRepository
│ │ ├── Features/ # Vertical slices (Commands/Queries)
│ │ └── Behaviors/ # MediatR pipeline behaviors
│ ├── Infrastructure/ # External concerns
│ │ ├── Messaging/ # MassTransit + RabbitMQ
│ │ ├── Caching/ # HybridCache (L1 Memory + L2 Redis)
│ │ ├── Logging/ # OpenTelemetry + Serilog
│ │ └── Persistence/ # EF Core + PostgreSQL
│ ├── Api/ # Minimal API endpoints
│ └── Aspire/ # .NET Aspire orchestration
└── tests/
├── Unit/ # xUnit + Moq + FluentAssertions
└── Integration/ # Testcontainers
Project Requirements Survey
When creating a new project, gather answers on:
- Project name and target .NET version (10.0/9.0/8.0)
- Database: PostgreSQL / SQL Server / MySQL / MongoDB
- ORM: EF Core / Dapper / Both
- Messaging: RabbitMQ / Azure Service Bus / Kafka / None
- Caching: HybridCache (Redis+Memory) / Redis only / Memory only / None
- API Style: Minimal APIs (default for this template) / MVC+Razor (opt-in) / Both — if answer is Minimal APIs or "API only", do not apply
dotnet-mvc unless the user later adds a separate MVC app
- Authentication: JWT / OAuth 2.0 / None
- Observability: OpenTelemetry + Serilog (recommended)
- Containerization: Docker / Docker Compose / Kubernetes
- Orchestration: .NET Aspire / Docker Compose / Kubernetes
- Testing: xUnit + Moq + Testcontainers (recommended)
- Architecture: DDD + CQRS + Clean Architecture (recommended)
Skill Routing
For specific topics, use the dedicated skill:
| Topic | Skill | When |
|---|
| DDD entities | dotnet-ddd-entity | Creating entities, aggregates, value objects |
| CQRS features | dotnet-cqrs-feature | Adding commands, queries, vertical slices |
| API endpoints | dotnet-api-endpoint | Creating Minimal API routes (this solution) — default for HTTP |
| MVC / Razor | dotnet-mvc | Only if user chose MVC/Razor or a separate web UI project — never for API-only work |
| Testing | dotnet-integration-test | Writing unit/integration tests |
| Domain events | dotnet-domain-event | Events + MassTransit consumers |
| EF Core | dotnet-ef-migration | Migrations, configurations |
| Caching | dotnet-hybrid-cache | HybridCache implementation |
| Code review | dotnet-code-review | Reviewing PRs and code quality |
| Deployment | dotnet-docker-deploy | Docker, Aspire, CI/CD |
| Observability | dotnet-observability | Tracing, metrics, logging |
C# 13+ Standards
- Primary Constructors:
public class Service(IRepo repo, ILogger<Service> logger)
- File-Scoped Namespaces:
namespace Orders.Entities;
- Collection Expressions:
string[] names = ["Alice", "Bob"];
- Pattern Matching: Extended patterns, relational, parenthesized
- Enhanced Lock:
private readonly Lock _lock = new();
- Params Collections:
params ReadOnlySpan<T> items
Python Scripts
Scaffold New Project
python .claude/skills/dotnet-enterprise/scripts/scaffold_project.py --name MyProject --output ./output
Analyze Code Quality
python .claude/skills/dotnet-enterprise/scripts/analyze_code.py ./src --format html --output report.html
Migrate .NET Version
python .claude/skills/dotnet-enterprise/scripts/migrate_dotnet.py ./src --from net8.0 --to net10.0
Additional Resources
For detailed patterns and architecture, consult:
| Reference | Content |
|---|
references/ARCHITECTURE.md | Clean Architecture, layer responsibilities |
references/PATTERNS.md | Design patterns, SOLID, GRASP, anti-patterns |
references/EXAMPLES.md | Complete code examples for all patterns |
Build & Run
dotnet build
dotnet test
dotnet run --project src/Api/ClaudeDotNetUltimate.Api.csproj
dotnet run --project src/Aspire/AppHost/ClaudeDotNetUltimate.AppHost.csproj
docker-compose up -d