/aspnet-core:aspnet-corefrom aspnet-core
Builds and reviews ASP.NET Core HTTP apps: minimal APIs and controllers, DTOs, validation, ProblemDetails, OpenAPI, middleware order, auth wiring, .http files, CRUD endpoints written without scaffolders. Use for Program.cs endpoint or middleware work, "add an endpoint", OpenAPI setup, or global error handling in a .NET web project.
Ships in aspnet-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Match the project's existing style and target framework first; most mistakes here are mixing styles or using an API the TFM doesn't have.
Not for: Blazor components (blazor), EF Core queries and migrations (ef-core), API contract policy such as versioning and pagination conventions (api-rest-design), choosing an auth design (app-auth), gRPC contract design (api-grpc), general C# (csharp), tests (dotnet-testing, which covers WebApplicationFactory).
Program.cs, the .csproj (TargetFramework, Microsoft.NET.Sdk.Web, package refs), appsettings*.json, Properties/launchSettings.json, and two or three existing endpoints.ControllerBase or marked [ApiController] mean controllers; app.MapGet/MapPost/MapGroup means minimal APIs. Continue in that style; never mix. A new project defaults to minimal APIs unless the user asks for controllers.search_graph, trace_path), else the C# language server (csharp-ls) or Grep.AddValidation() and XML-comment OpenAPI need .NET 10+. For library APIs use Context7 (resolve-library-id, query-docs) or Microsoft Learn.sealed record: positional for responses, required + init properties with data annotations for requests. Names Create{Entity}Request, Update{Entity}Request, {Entity}Response. DateTimeOffset for timestamps. <summary> comments on API-facing types (they flow into OpenAPI on .NET 10 with <GenerateDocumentationFile>true</GenerateDocumentationFile>).[ApiController] validate automatically. Minimal APIs on .NET 10+: builder.Services.AddValidation(); (returns a 400 validation problem; per-endpoint opt-out .DisableValidation()). It discovers types only in the assembly that calls it. Before .NET 10, validate explicitly in a filter or handler.Map{Resource}(this IEndpointRouteBuilder app) extension that uses app.MapGroup("/api/products").WithTags("Products"). Return TypedResults, and declare Results<Ok<T>, NotFound> when a handler has several outcomes. A bare ternary between TypedResults.Ok(x) and TypedResults.NotFound() without that declared return type fails to compile (CS1593).Location (TypedResults.Created($"/api/products/{id}", body) or CreatedAtAction); PUT/PATCH 200 or 204; DELETE 204; 400 validation, 409 conflict. Contract-level conventions belong to api-rest-design.CancellationToken and passes it to every async call (services, EF Core, HttpClient).sealed implementation registered AddScoped), not a DbContext directly, unless the project already does otherwise.builder.Services.AddOpenApi(); and app.MapOpenApi(); (document at /openapi/v1.json, OpenAPI 3.1 by default on .NET 10). Don't add Swashbuckle to a .NET 9+ project; keep it where it already exists. Metadata: .WithName(), .WithSummary(), .WithDescription(), .Produces<T>(), .ProducesProblem(), .ProducesValidationProblem(). .WithOpenApi() is deprecated in .NET 10 (ASPDEPR002): remove it, and use .AddOpenApiOperationTransformer(...) for per-operation edits.ConfigureHttpJsonOptions(o => o.SerializerOptions.Converters.Add(new JsonStringEnumConverter())) for minimal APIs, AddControllers().AddJsonOptions(...) for MVC. Stricter reading (NumberHandling = Strict, PropertyNameCaseInsensitive = false, AllowDuplicateProperties = false on .NET 10) only for new APIs or on request, since it breaks existing clients..http file. One request per new endpoint with realistic bodies and an error case; base URL from launchSettings.json; create parent records before children.Read references/web-api.md for complete controller and minimal API examples, the exception handler and service layer code. Read references/crud-scaffolding.md when asked to scaffold CRUD pages, views, components or endpoints for a model.
builder.Services.AddProblemDetails();
builder.Services.AddExceptionHandler<ApiExceptionHandler>(); // optional: map domain exceptions
app.UseExceptionHandler();
app.UseStatusCodePages();
No try/catch in individual handlers for cross-cutting errors. An IExceptionHandler that returns true has handled the exception; log it there, and never copy exception.Message into the response body. On .NET 10 the middleware no longer writes diagnostics for exceptions an IExceptionHandler handled. Put handler classes where the project keeps middleware (for example Middleware/).
Middleware order decides behavior. The usual order is exception handler, HSTS, HTTPS redirection, static files, routing, CORS, authentication, authorization, rate limiter, then endpoints. Read references/middleware-and-auth.md when you change the pipeline, add authentication or authorization, CORS, rate limiting, output or hybrid caching, health checks, options validation, SignalR or gRPC.
dotnet build with no new warnings (-warnaserror if the repo uses it).dotnet run --launch-profile https if that profile exists) and load /openapi/v1.json; confirm the new operations appear..http request (or curl) in dependency order and check status codes, Location headers and ProblemDetails bodies.dotnet-testing for the command form).AddValidation() silently validates nothing for endpoint types declared in another assembly; call it from that assembly too.[ApiController], JSON minimal APIs, TypedResults) return 401/403 instead of redirecting to the login page.UseCors must sit after UseRouting and before UseAuthorization (and before response caching) or endpoint CORS policies don't apply.AllowAnyOrigin() with AllowCredentials() is rejected at runtime; list origins.RejectionStatusCode = StatusCodes.Status429TooManyRequests.PipeReader; a custom JsonConverter that ignores Utf8JsonReader.HasValueSequence can break.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin aspnet-core