dotnet-minimal-api-endpoints
Generates Minimal API endpoints following Microsoft's recommended approach. Creates fast, testable HTTP APIs with minimal code using MapGet/MapPost/MapPut/MapDelete. Preferred over controller-based APIs for new projects.
npx skills add majiayu000/claude-skill-registry --skill 07-2-dotnet-minimal-api-endpoints --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Generates Minimal API endpoints following Microsoft's recommended approach for new projects. Creates HTTP APIs with minimal boilerplate using MapGet/MapPost/MapPut/MapDelete, and structures them under a feature-based Endpoint folder layout. It emphasizes testability and uses typed results for responses.
How it works
- Provides a ready-to-use template for Complete CRUD endpoints including MapGroup-based wiring, standard HTTP mappings (Get by id, Get all, Create, Update, Delete).
- Includes handler methods GetById, GetAll, Create, Update, Delete that interact with MediatR via an ISender to dispatch queries/commands and return TypedResults (e.g., Ok, Created, NoContent, NotFound, BadRequest).
- Demonstrates endpoint registration in Program.cs via Map{Feature}Endpoints(), and shows how to structure Request DTOs (RequestCreate{Entity}}, RequestUpdate{Entity}) and their usage in CRUD handlers.
- Shows examples of authorization patterns, API versioning via MapGroup, and validation via a ValidationFilter<T> endpoint filter.
- Includes templates for standard CRUD, complex endpoints with MapGroup, and usage notes for API documentation (OpenAPI/Swagger).
When to use it
- When starting a new .NET 8+ project that aims to use Minimal APIs instead of controllers.
- When following Microsoft's recommended Minimal API patterns and wanting a structured, testable endpoint setup with MediatR integration.
What it can touch
- Endpoints are wired as extension methods on IEndpointRouteBuilder via Map{Feature}Endpoints.
- It references MediatR (ISender) and FluentValidation in validation flows.
- It includes usage of TypedResults for typed, testable responses and OpenAPI metadata generation.
Caveats
- Dependencies required: MediatR, FluentValidation.
- Exposes examples with authorization and permissions; real projects must supply Permissions.{Entities}Write and related policies.
- License: MIT
# Minimal API Endpoints Generator ## Overview **Microsoft's recommended approach for new projects.** Minimal APIs provide a simplified, high-performance way to build HTTP APIs with less boilerplate than controllers. ### Benefits Over Controllers - ✅ **Simpler syntax** - Less code, more productivity - ✅ **Better performance** - Reduced overhead - ✅ **Easier testing** - Testable handler methods - ✅ **Modern approach** - Latest .NET features - ✅ **Less ceremony** - No controller classes needed ## Quick Reference | HTTP Method | Extension Method | Use Case | |-------------|------------------|----------| | `MapGet` | Read single/list | `app.MapGet("/users/{id}", ...)` | | `MapPost` | Create | `app.MapPost("/users", ...)` | | `MapPut` | Update (full) | `app.MapPut("/users/{id}", ...)` | | `MapDelete` | Delete | `app.MapDelete("/users/{id}", ...)` | --- ## Endpoint Structure ``` /API/Endpoints/ ├── {Feature}/ │ ├── {Feature}Endpoints.cs │ └── Request{Action}{Entity}.cs └── ... ``` --- ## Template: Complete CRUD Endpoints ```csharp // src/{name}.api/Endpoints/{Feature}/{Feature}Endpoints.cs using {name}.application.{feature}.Create{Entity}; using {name}.application.{feature}.Delete{Entity}
- Overview
- Benefits Over Controllers
- Quick Reference
- Endpoint Structure
- Template: Complete CRUD Endpoints
- Template: Request DTOs
- Template: Program.cs Registration
- Template: Complex Endpoints with MapGroup
- Template: Endpoint Filters (Validation)
- Template: Authorization
- Template: API Versioning with MapGroup
- TypedResults Pattern
- Benefits of TypedResults
- Testing Minimal API Endpoints
What does the dotnet-minimal-api-endpoints skill do?
Generates Minimal API endpoints following Microsoft's recommended approach. Creates fast, testable HTTP APIs with minimal code using MapGet/MapPost/MapPut/MapDelete. Preferred over controller-based APIs for new projects.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill 07-2-dotnet-minimal-api-endpoints --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
