dotnet-core-expert
jeffallan/claude-skills
Build .NET 8 applications with clean architecture, minimal APIs, and cloud-native patterns.
What is dotnet-core-expert?
Expert guidance for .NET 8 and C# 12 development using modern patterns like minimal APIs, clean architecture, CQRS with MediatR, and Entity Framework Core. Use this skill when designing microservices, implementing authentication, or optimizing for AOT compilation and cloud deployment.
- Design and implement minimal APIs with proper routing, middleware, and OpenAPI documentation
- Build clean architecture solutions with CQRS, MediatR handlers, and dependency injection
- Configure Entity Framework Core with async queries, migrations, and proper DbContext patterns
- Implement JWT authentication and authorization policies
- Write integration tests using xUnit and WebApplicationFactory
- Enable AOT compilation and cloud-native patterns with health checks and configuration
How to install dotnet-core-expert
npx skills add https://github.com/jeffallan/claude-skills --skill dotnet-core-expert- .NET 8 SDK installed
- C# 12 language features enabled in project file
- Basic understanding of async/await and dependency injection
How to use dotnet-core-expert
- 1.Analyze your requirements and identify the architecture pattern (minimal API, clean architecture, microservices)
- 2.Load the relevant reference guide (minimal-apis.md, clean-architecture.md, entity-framework.md, authentication.md, or cloud-native.md) based on your context
- 3.Design your solution following clean architecture principles with proper layer separation
- 4.Implement endpoints, handlers, and database context using the provided code examples
- 5.Run `dotnet build` to verify compilation and fix any errors before proceeding
- 6.Write integration tests with xUnit and WebApplicationFactory, then run `dotnet test` to confirm all tests pass
- 7.Configure OpenAPI/Swagger documentation and verify endpoints with curl or a REST client
Use cases
- Building a microservice with minimal APIs and MediatR query/command handlers
- Designing a multi-layer application with clean architecture and proper separation of concerns
- Implementing JWT-based authentication and role-based authorization in ASP.NET Core
- Setting up Entity Framework Core with async operations and database migrations
- Writing integration tests that verify API endpoints and business logic
- Backend developers building .NET 8 applications
- Architects designing microservices and cloud-native systems
- Teams adopting clean architecture and CQRS patterns
- Developers implementing secure APIs with JWT authentication
dotnet-core-expert FAQ
Use this skill when building .NET 8 applications with minimal APIs, clean architecture, microservices, Entity Framework Core, CQRS with MediatR, JWT authentication, or AOT compilation scenarios.
.NET 8 with C# 12 features. The skill enforces modern patterns and requires nullable reference types enabled in the project file.
Not always. Use MediatR for complex applications with clear command/query separation. For simpler APIs, minimal APIs with direct service injection may be sufficient.
Use Entity Framework Core migrations with `dotnet ef migrations add` and `dotnet ef database update`. The skill provides DbContext patterns and configuration guidance in the entity-framework.md reference.
Write integration tests using xUnit and WebApplicationFactory to test endpoints and business logic end-to-end. Run `dotnet test` to verify all tests pass before deployment.
Full instructions (SKILL.md)
Source of truth, from jeffallan/claude-skills.
name: dotnet-core-expert description: Use when building .NET 8 applications with minimal APIs, clean architecture, or cloud-native microservices. Invoke for Entity Framework Core, CQRS with MediatR, JWT authentication, AOT compilation. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: backend triggers: .NET Core, .NET 8, ASP.NET Core, C# 12, minimal API, Entity Framework Core, microservices .NET, CQRS, MediatR role: specialist scope: implementation output-format: code related-skills: fullstack-guardian, microservices-architect, cloud-architect, test-master
.NET Core Expert
Core Workflow
- Analyze requirements — Identify architecture pattern, data models, API design
- Design solution — Create clean architecture layers with proper separation
- Implement — Write high-performance code with modern C# features; run
dotnet buildto verify compilation — if build fails, review errors, fix issues, and rebuild before proceeding - Secure — Add authentication, authorization, and security best practices
- Test — Write comprehensive tests with xUnit and integration testing; run
dotnet testto confirm all tests pass — if tests fail, diagnose failures, fix the implementation, and re-run before continuing; verify endpoints withcurlor a REST client
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Minimal APIs | references/minimal-apis.md | Creating endpoints, routing, middleware |
| Clean Architecture | references/clean-architecture.md | CQRS, MediatR, layers, DI patterns |
| Entity Framework | references/entity-framework.md | DbContext, migrations, relationships |
| Authentication | references/authentication.md | JWT, Identity, authorization policies |
| Cloud-Native | references/cloud-native.md | Docker, health checks, configuration |
Constraints
MUST DO
- Use .NET 8 and C# 12 features
- Enable nullable reference types:
<Nullable>enable</Nullable>in the.csproj - Use async/await for all I/O operations — e.g.,
await dbContext.Users.ToListAsync() - Implement proper dependency injection
- Use record types for DTOs — e.g.,
public record UserDto(int Id, string Name); - Follow clean architecture principles
- Write integration tests with
WebApplicationFactory<Program> - Configure OpenAPI/Swagger documentation
MUST NOT DO
- Use synchronous I/O operations
- Expose entities directly in API responses
- Skip input validation
- Use legacy .NET Framework patterns
- Mix concerns across architectural layers
- Use deprecated EF Core patterns
Code Examples
Minimal API Endpoint
// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Program).Assembly));
var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
app.MapGet("/users/{id}", async (int id, ISender sender, CancellationToken ct) =>
{
var result = await sender.Send(new GetUserQuery(id), ct);
return result is null ? Results.NotFound() : Results.Ok(result);
})
.WithName("GetUser")
.Produces<UserDto>()
.ProducesProblem(404);
app.Run();
MediatR Query Handler
// Application/Users/GetUserQuery.cs
public record GetUserQuery(int Id) : IRequest<UserDto?>;
public sealed class GetUserQueryHandler : IRequestHandler<GetUserQuery, UserDto?>
{
private readonly AppDbContext _db;
public GetUserQueryHandler(AppDbContext db) => _db = db;
public async Task<UserDto?> Handle(GetUserQuery request, CancellationToken ct) =>
await _db.Users
.AsNoTracking()
.Where(u => u.Id == request.Id)
.Select(u => new UserDto(u.Id, u.Name))
.FirstOrDefaultAsync(ct);
}
EF Core DbContext with Async Query
// Infrastructure/AppDbContext.cs
public sealed class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
public DbSet<User> Users => Set<User>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
}
}
// Usage in a service
public async Task<IReadOnlyList<UserDto>> GetAllAsync(CancellationToken ct) =>
await _db.Users
.AsNoTracking()
.Select(u => new UserDto(u.Id, u.Name))
.ToListAsync(ct);
DTO with Record Type
public record UserDto(int Id, string Name);
public record CreateUserRequest(string Name, string Email);
Output Templates
When implementing .NET features, provide:
- Project structure (solution/project files)
- Domain models and DTOs
- API endpoints or service implementations
- Database context and migrations if applicable
- Brief explanation of architectural decisions
Related skills
More from jeffallan/claude-skills and the wider catalog.

embedded-systems
Firmware development for microcontrollers, RTOS, and real-time systems with power optimization.

fastapi-expert
Expert async Python API development with FastAPI, Pydantic V2, and production-grade patterns.

feature-forge
Structured requirements workshops that produce feature specs, user stories, and acceptance criteria.

fine-tuning-expert
Expert guidance for fine-tuning LLMs with LoRA, QLoRA, and parameter-efficient methods.

flutter-expert
Senior Flutter engineer for cross-platform apps with Riverpod, Bloc, GoRouter, and performance optimization.

fullstack-guardian
Security-focused full-stack web development—frontend, backend, and database with integrated auth, validation, and output encoding.