{"slug":"dotnet-core-expert","title":"dotnet-core-expert","summary":"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.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-27T18:21:38.002985Z","repo":{"url":"https://github.com/Jeffallan/claude-skills","stars":12412,"forks":1191,"license":"MIT","updatedAt":"2026-11-16T17:30:27Z"},"bodyHtml":"<hr>\n<h2>name: dotnet-core-expert\ndescription: 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.\nlicense: MIT\nmetadata:\nauthor: <a href=\"https://github.com/Jeffallan\">https://github.com/Jeffallan</a>\ncompany: <a href=\"https://synergetic.solutions\">https://synergetic.solutions</a>\nversion: \"1.1.0\"\ndomain: backend\ntriggers: .NET Core, .NET 8, ASP.NET Core, C# 12, minimal API, Entity Framework Core, microservices .NET, CQRS, MediatR\nrole: specialist\nscope: implementation\noutput-format: code\nrelated-skills: fullstack-guardian, microservices-architect, cloud-architect, test-master</h2>\n<h1>.NET Core Expert</h1>\n<h2>Core Workflow</h2>\n<ol>\n<li><strong>Analyze requirements</strong> — Identify architecture pattern, data models, API design</li>\n<li><strong>Design solution</strong> — Create clean architecture layers with proper separation</li>\n<li><strong>Implement</strong> — Write high-performance code with modern C# features; run <code>dotnet build</code> to verify compilation — if build fails, review errors, fix issues, and rebuild before proceeding</li>\n<li><strong>Secure</strong> — Add authentication, authorization, and security best practices</li>\n<li><strong>Test</strong> — Write comprehensive tests with xUnit and integration testing; run <code>dotnet test</code> to confirm all tests pass — if tests fail, diagnose failures, fix the implementation, and re-run before continuing; verify endpoints with <code>curl</code> or a REST client</li>\n</ol>\n<h2>Reference Guide</h2>\n<p>Load detailed guidance based on context:</p>\n<table>\n<thead>\n<tr>\n<th>Topic</th>\n<th>Reference</th>\n<th>Load When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Minimal APIs</td>\n<td><code>references/minimal-apis.md</code></td>\n<td>Creating endpoints, routing, middleware</td>\n</tr>\n<tr>\n<td>Clean Architecture</td>\n<td><code>references/clean-architecture.md</code></td>\n<td>CQRS, MediatR, layers, DI patterns</td>\n</tr>\n<tr>\n<td>Entity Framework</td>\n<td><code>references/entity-framework.md</code></td>\n<td>DbContext, migrations, relationships</td>\n</tr>\n<tr>\n<td>Authentication</td>\n<td><code>references/authentication.md</code></td>\n<td>JWT, Identity, authorization policies</td>\n</tr>\n<tr>\n<td>Cloud-Native</td>\n<td><code>references/cloud-native.md</code></td>\n<td>Docker, health checks, configuration</td>\n</tr>\n</tbody>\n</table>\n<h2>Constraints</h2>\n<h3>MUST DO</h3>\n<ul>\n<li>Use .NET 8 and C# 12 features</li>\n<li>Enable nullable reference types: <code>&lt;Nullable&gt;enable&lt;/Nullable&gt;</code> in the <code>.csproj</code></li>\n<li>Use async/await for all I/O operations — e.g., <code>await dbContext.Users.ToListAsync()</code></li>\n<li>Implement proper dependency injection</li>\n<li>Use record types for DTOs — e.g., <code>public record UserDto(int Id, string Name);</code></li>\n<li>Follow clean architecture principles</li>\n<li>Write integration tests with <code>WebApplicationFactory&lt;Program&gt;</code></li>\n<li>Configure OpenAPI/Swagger documentation</li>\n</ul>\n<h3>MUST NOT DO</h3>\n<ul>\n<li>Use synchronous I/O operations</li>\n<li>Expose entities directly in API responses</li>\n<li>Skip input validation</li>\n<li>Use legacy .NET Framework patterns</li>\n<li>Mix concerns across architectural layers</li>\n<li>Use deprecated EF Core patterns</li>\n</ul>\n<h2>Code Examples</h2>\n<h3>Minimal API Endpoint</h3>\n<pre><code>// Program.cs\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Services.AddEndpointsApiExplorer();\nbuilder.Services.AddSwaggerGen();\nbuilder.Services.AddMediatR(cfg =&gt; cfg.RegisterServicesFromAssembly(typeof(Program).Assembly));\n\nvar app = builder.Build();\napp.UseSwagger();\napp.UseSwaggerUI();\n\napp.MapGet(\"/users/{id}\", async (int id, ISender sender, CancellationToken ct) =&gt;\n{\n    var result = await sender.Send(new GetUserQuery(id), ct);\n    return result is null ? Results.NotFound() : Results.Ok(result);\n})\n.WithName(\"GetUser\")\n.Produces&lt;UserDto&gt;()\n.ProducesProblem(404);\n\napp.Run();\n</code></pre>\n<h3>MediatR Query Handler</h3>\n<pre><code>// Application/Users/GetUserQuery.cs\npublic record GetUserQuery(int Id) : IRequest&lt;UserDto?&gt;;\n\npublic sealed class GetUserQueryHandler : IRequestHandler&lt;GetUserQuery, UserDto?&gt;\n{\n    private readonly AppDbContext _db;\n\n    public GetUserQueryHandler(AppDbContext db) =&gt; _db = db;\n\n    public async Task&lt;UserDto?&gt; Handle(GetUserQuery request, CancellationToken ct) =&gt;\n        await _db.Users\n            .AsNoTracking()\n            .Where(u =&gt; u.Id == request.Id)\n            .Select(u =&gt; new UserDto(u.Id, u.Name))\n            .FirstOrDefaultAsync(ct);\n}\n</code></pre>\n<h3>EF Core DbContext with Async Query</h3>\n<pre><code>// Infrastructure/AppDbContext.cs\npublic sealed class AppDbContext(DbContextOptions&lt;AppDbContext&gt; options) : DbContext(options)\n{\n    public DbSet&lt;User&gt; Users =&gt; Set&lt;User&gt;();\n\n    protected override void OnModelCreating(ModelBuilder modelBuilder)\n    {\n        modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);\n    }\n}\n\n// Usage in a service\npublic async Task&lt;IReadOnlyList&lt;UserDto&gt;&gt; GetAllAsync(CancellationToken ct) =&gt;\n    await _db.Users\n        .AsNoTracking()\n        .Select(u =&gt; new UserDto(u.Id, u.Name))\n        .ToListAsync(ct);\n</code></pre>\n<h3>DTO with Record Type</h3>\n<pre><code>public record UserDto(int Id, string Name);\npublic record CreateUserRequest(string Name, string Email);\n</code></pre>\n<h2>Output Templates</h2>\n<p>When implementing .NET features, provide:</p>\n<ol>\n<li>Project structure (solution/project files)</li>\n<li>Domain models and DTOs</li>\n<li>API endpoints or service implementations</li>\n<li>Database context and migrations if applicable</li>\n<li>Brief explanation of architectural decisions</li>\n</ol>\n<p>Maintained by <a href=\"https://github.com/jeffallan\">@jeffallan</a>, Principal Consultant at <a href=\"https://synergetic.solutions\">Synergetic Solutions</a></p>\n<p><a href=\"https://jeffallan.github.io/claude-skills/skills/backend/dotnet-core-expert/\">Documentation</a></p>\n","files":[{"path":"references/authentication.md","sizeBytes":14968,"isText":true},{"path":"references/clean-architecture.md","sizeBytes":11931,"isText":true},{"path":"references/cloud-native.md","sizeBytes":13998,"isText":true},{"path":"references/entity-framework.md","sizeBytes":12344,"isText":true},{"path":"references/minimal-apis.md","sizeBytes":8348,"isText":true},{"path":"SKILL.md","sizeBytes":5255,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-27T18:22:06.806877Z","sha256":"80D7B2DC35E76EF995B70EAE701237776DA5D80E4F311058CED43B4D2565FC81","sizeBytes":19267},"review":null,"source":{"repositoryUrl":"https://github.com/Jeffallan/claude-skills","path":"skills/dotnet-core-expert","license":"MIT","commit":"67c1961b180dc92cf08983344627109e983e8f51","subtreeSha":"CB4E5851D3731191F61DA303D6142DF5B24B21DA86C4615DA3CD6E5DDD6445E0","lastSyncedAt":"2026-11-17T00:40:15.350492Z"},"reviewedAt":"2026-10-27T18:23:02.554018Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/Jeffallan/claude-skills/tree/main/skills/dotnet-core-expert"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install jeffallan-claude-skills@llmmart"},{"target":"git","command":"git clone https://github.com/Jeffallan/claude-skills.git"}]}