.NET Core Expert
.NET 8: minimal APIs, clean architecture, cloud-native microservices.
When to use
.NET 8 minimal APIs; clean architecture; cloud-native microservices; EF Core; CQRS with MediatR; JWT auth; AOT compilation.
Core workflow
- Analyze — solution layout, layers (domain/application/infrastructure/api).
- Design — domain entities, records for DTOs, CQRS commands/queries.
- Implement — minimal API route groups → MediatR handlers → EF Core.
- Secure — JWT bearer auth, authorization policies.
- Test — xUnit +
WebApplicationFactory; Testcontainers for EF.
Key practices
- Clean architecture: domain has no framework deps; dependencies point inward.
- CQRS: minimal API endpoints dispatch MediatR commands/queries; thin handlers.
- EF Core: async,
AsNoTracking() for reads, Include to avoid N+1, migrations.
CancellationToken threaded through all async paths.
- Nullable reference types on; records +
init for immutable DTOs.
- AOT-friendly code where startup/size matters (source generators over reflection).
Constraints
MUST: clean-architecture dependency direction; CQRS via MediatR; async + CancellationToken; AsNoTracking() reads; EF migrations; nullable refs on; integration tests.
MUST NOT: .Result/.Wait() (deadlocks); domain depends on infrastructure; track read-only entities; secrets in source (use config/secrets); reflection-heavy code in AOT paths.
Output
- Domain + DTO records. 2. Minimal API endpoints + MediatR handlers. 3. EF Core context + migrations. 4. xUnit tests. 5. Brief note on architecture decisions.
Knowledge
.NET 8, C# 12, ASP.NET Core minimal APIs, clean architecture, EF Core, MediatR/CQRS, JWT, Native AOT, nullable reference types, xUnit, WebApplicationFactory, Testcontainers.
1---2name: dotnet-core-expert3description: "Use when building .NET 8 apps with minimal APIs, clean architecture, or cloud-native microservices. Invoke for Entity Framework Core, CQRS with MediatR, JWT auth, AOT compilation. Triggers: .NET Core, .NET 8, ASP.NET Core, C# 12, minimal API, Entity Framework Core, microservices .NET, CQRS, MediatR."4version: 1.0.05license: MIT6tags: [dotnet, dotnet8, aspnet-core, minimal-api, ef-core, cqrs, mediatr, microservices]7source: https://github.com/jeffallan/claude-skills/tree/main/skills/dotnet-core-expert8derived_from: awesomeclaude9metadata:10 source: https://skillmd.com/skills/aashutosh396/dotnet-core-expert11---1213# .NET Core Expert1415.NET 8: minimal APIs, clean architecture, cloud-native microservices.1617## When to use1819.NET 8 minimal APIs; clean architecture; cloud-native microservices; EF Core; CQRS with MediatR; JWT auth; AOT compilation.2021## Core workflow22231. **Analyze** — solution layout, layers (domain/application/infrastructure/api).242. **Design** — domain entities, records for DTOs, CQRS commands/queries.253. **Implement** — minimal API route groups → MediatR handlers → EF Core.264. **Secure** — JWT bearer auth, authorization policies.275. **Test** — xUnit + `WebApplicationFactory`; Testcontainers for EF.2829## Key practices3031- Clean architecture: domain has no framework deps; dependencies point inward.32- CQRS: minimal API endpoints dispatch MediatR commands/queries; thin handlers.33- EF Core: async, `AsNoTracking()` for reads, `Include` to avoid N+1, migrations.34- `CancellationToken` threaded through all async paths.35- Nullable reference types on; records + `init` for immutable DTOs.36- AOT-friendly code where startup/size matters (source generators over reflection).3738## Constraints3940MUST: clean-architecture dependency direction; CQRS via MediatR; async + `CancellationToken`; `AsNoTracking()` reads; EF migrations; nullable refs on; integration tests.41MUST NOT: `.Result`/`.Wait()` (deadlocks); domain depends on infrastructure; track read-only entities; secrets in source (use config/secrets); reflection-heavy code in AOT paths.4243## Output44451. Domain + DTO records. 2. Minimal API endpoints + MediatR handlers. 3. EF Core context + migrations. 4. xUnit tests. 5. Brief note on architecture decisions.4647## Knowledge4849.NET 8, C# 12, ASP.NET Core minimal APIs, clean architecture, EF Core, MediatR/CQRS, JWT, Native AOT, nullable reference types, xUnit, WebApplicationFactory, Testcontainers.