
Csharp Developer
Scaffold ASP.NET Core Minimal APIs with EF Core, route groups, auth middleware, and Swagger using opinionated C# patterns in agent-driven builds.
Overview
C# Developer is an agent skill for the Build phase that teaches ASP.NET Core Minimal API patterns with EF Core, route groups, and Swagger-ready HTTP pipelines.
Install
npx skills add https://github.com/jeffallan/claude-skills --skill csharp-developerWhat is this skill?
- Minimal API bootstrap in Program.cs with DbContext, scoped services, Swagger, and middleware ordering
- Route groups under /api/products with WithTags, RequireAuthorization, and named endpoints
- REST surface: list, get by id, create, and update with typed Produces and 404/201/validation responses
- Repository + service layering (IProductRepository, ProductService) for testable domain logic
- HTTPS redirection, authentication, and authorization hooks in the default pipeline
Adoption & trust: 2.8k installs on skills.sh; 9.7k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps generating inconsistent ASP.NET Core APIs without shared DI, route groups, or OpenAPI-friendly endpoint metadata.
Who is it for?
Indie developers building SQL-backed REST APIs on .NET 6+ with agent assistance and wanting Swagger-documented endpoint groups.
Skip if: Greenfield mobile clients, Blazor-only frontends, or teams standardized on MVC controllers without Minimal APIs.
When should I use this skill?
User implements or refactors ASP.NET Core Minimal APIs, EF Core data access, or authorized /api route groups in C#.
What do I get? / Deliverables
You get a repeatable Minimal API skeleton—services, repositories, grouped routes, and middleware—that you can extend feature by feature.
- Program.cs service and middleware bootstrap
- Extension-mapped endpoint groups with typed HTTP responses
Recommended Skills
Journey fit
Build is the primary journey phase because the skill teaches implementation patterns for live backend services rather than ideation, launch SEO, or production incident response. Backend subphase matches Program.cs service registration, SQL-backed repositories, endpoint mapping, and HTTP pipeline concerns.
How it compares
Use this procedural pattern skill instead of ad-hoc single-file Program.cs snippets that omit auth, Produces metadata, and repository layering.
Common Questions / FAQ
Who is csharp-developer for?
Solo and small-team .NET builders using coding agents to stand up ASP.NET Core Minimal API backends quickly.
When should I use csharp-developer?
During Build/backend work when wiring DbContext, product-style CRUD route groups, Swagger in Development, and authorization on /api routes.
Is csharp-developer safe to install?
Review the Security Audits panel on this Prism page; the skill is instructional C# only, but generated code still needs your secret handling and auth review.
SKILL.md
READMESKILL.md - Csharp Developer
# ASP.NET Core Patterns ## Minimal API Setup ```csharp // Program.cs using Microsoft.EntityFrameworkCore; var builder = WebApplication.CreateBuilder(args); // Services builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("Default"))); builder.Services.AddScoped<IProductRepository, ProductRepository>(); builder.Services.AddScoped<ProductService>(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); // Middleware pipeline if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseAuthentication(); app.UseAuthorization(); // Map endpoints app.MapProductEndpoints(); app.Run(); ``` ## Minimal API Endpoints with Route Groups ```csharp public static class ProductEndpoints { public static void MapProductEndpoints(this IEndpointRouteBuilder app) { var group = app.MapGroup("/api/products") .WithTags("Products") .RequireAuthorization(); group.MapGet("/", GetAllProducts) .WithName("GetProducts") .Produces<List<ProductDto>>(); group.MapGet("/{id:int}", GetProductById) .WithName("GetProduct") .Produces<ProductDto>() .Produces(404); group.MapPost("/", CreateProduct) .Produces<ProductDto>(201) .ProducesValidationProblem(); group.MapPut("/{id:int}", UpdateProduct) .Produces(204) .Produces(404); group.MapDelete("/{id:int}", DeleteProduct) .Produces(204) .Produces(404); } private static async Task<IResult> GetAllProducts( ProductService service, CancellationToken ct) { var products = await service.GetAllAsync(ct); return Results.Ok(products); } private static async Task<IResult> GetProductById( int id, ProductService service, CancellationToken ct) { var product = await service.GetByIdAsync(id, ct); return product is not null ? Results.Ok(product) : Results.NotFound(); } private static async Task<IResult> CreateProduct( CreateProductRequest request, ProductService service, CancellationToken ct) { var product = await service.CreateAsync(request, ct); return Results.CreatedAtRoute("GetProduct", new { id = product.Id }, product); } } ``` ## Endpoint Filters ```csharp // Validation filter public class ValidationFilter<T> : IEndpointFilter where T : class { public async ValueTask<object?> InvokeAsync( EndpointFilterInvocationContext context, EndpointFilterDelegate next) { var request = context.Arguments.OfType<T>().FirstOrDefault(); if (request is null) return Results.BadRequest("Invalid request"); // Validate using FluentValidation or custom logic var validator = context.HttpContext.RequestServices .GetService<IValidator<T>>(); if (validator is not null) { var result = await validator.ValidateAsync(request); if (!result.IsValid) return Results.ValidationProblem(result.ToDictionary()); } return await next(context); } } // Usage group.MapPost("/", CreateProduct) .AddEndpointFilter<ValidationFilter<CreateProductRequest>>(); ``` ## Dependency Injection Patterns ```csharp // Service registration public static class ServiceCollectionExtensions { public static IServiceCollection AddApplicationServices( this IServiceCollection services) { // Transient: new instance per request services.AddTransient<IEmailService, EmailService>(); // Scoped: one instance per HTTP request services.AddScoped<IProductRepository, ProductRepository>(); services.AddScoped<Produc