.claude/skills/gen-minimal-api-endpoint/SKILL.md
Use when scaffolding a new Minimal API endpoint or route group. Generates request/response records, FluentValidation validators, and handler wiring following the one-concern-per-group rule. Also invoke when the user mentions: new endpoint, new route, minimal API, MapGroup, add HTTP endpoint. Domain: Code Generation, API. Level: Intermediate.
npx skillsauth add klod68/littlerae gen-minimal-api-endpointInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a Minimal API endpoint group for resource: ${1:ResourceName}.
${2:MyApp}${3|GET,POST,PUT,DELETE,GET+POST,GET+POST+PUT+DELETE|}${4:ResourceNameHandler} (already exists — wire to it)${5:/api/resource-name}${6:RequireAuthorization("PolicyName") or AllowAnonymous}${2}.Api.Endpoints.${1}Endpoints.cs
internal sealed class implementing IEndpointDefinition (or equivalent extension method pattern used in this codebase).MapGroup("${5}") with explicit ${6}.IResult using Results<T1, T2> union for OpenAPI correctness.${2}.Api.Endpoints.Models.${1}{Verb}Request.cs
init-only properties.[AsParameters] for route/query; body param typed separately.${2}.Api.Endpoints.Models.${1}Response.cs
init-only properties.${2}.Api.Validators.${1}{Verb}RequestValidator.cs
internal sealed class extending AbstractValidator<T>.Show where to call the endpoint definition registration in Program.cs or the app's IEndpointDefinition scan.
POST → 201 Created + Results.CreatedAtRoutePUT / PATCH → 204 No ContentDELETE → 204 No Content or 404 Not FoundGET (collection) → 200 OK with paged resultGET (single) → 200 OK or 404 Not FoundResults.Problem (RFC 7807)ef-core.instructions.md if applicable.tools
Use when cross-cutting concerns (logging, metrics, validation, authorization) are tangled into command handlers or service methods, when building database command pipelines with reorderable concerns, or when HTTP client pipelines or message handlers need composable, independently-replaceable processing stages. Covers ICommandInterceptor interface, InterceptorPipeline with reverse-chain construction, zero-cost Empty sentinel to skip overhead when no interceptors are registered, and ConfigureAwait(false) discipline for library code. Domain: Architecture, Cross-Cutting Concerns. Level: Intermediate. Tags: interceptor, pipeline, middleware, decorator, cross-cutting-concerns.
development
Use when writing integration tests for Razor Pages, MVC, or Minimal API applications to validate routing, middleware, page rendering, and HTTP behavior without a browser or live server, or when adding fast smoke tests to a CI pipeline. Covers WebApplicationFactory<Program> setup with public partial class Program, in-memory test server, AngleSharp HTML parsing, CSS selector assertions, redirect and status code testing, and a shared static fixture pattern for minimal per-test startup overhead. Domain: Testing, ASP.NET Core. Level: Intermediate. Tags: integration-testing, webapplicationfactory, razor-pages, anglesharp, http-testing.
development
Use when designing indexes for new tables, diagnosing slow queries that are not using indexes efficiently, reviewing index fragmentation and maintenance, or when the current indexing strategy results in key lookups, table scans, or missing index warnings. Covers clustered index key selection (narrow, unique, ever-increasing), non-clustered index design for query patterns, covering indexes with INCLUDE columns, filtered indexes for subset queries, composite index column ordering, DMV-based monitoring for missing and unused indexes, and rebuild vs reorganize maintenance thresholds. Domain: Database, Performance. Level: Intermediate. Tags: index, sql-server, covering-index, filtered-index, performance, dmv, maintenance.
development
Use when building a searchable in-memory catalog or registry for documentation sites, admin panels, or type/API browsers where you need keyword matching, fuzzy search, and ranked results without an external search engine or database. Covers RegistryService with weighted scoring across name, description, keywords, and method names; Levenshtein fuzzy matching; synonym expansion; category and subcategory filtering; and singleton DI registration for datasets of hundreds to low thousands of items. Domain: Search, Data Access Patterns. Level: Intermediate. Tags: search, registry, fuzzy-matching, in-memory, catalog, filtering.