.agents/skills/aspnet-minimal-api/SKILL.md
ASP.NET Core Minimal API endpoints, route groups, filters, and typed results. Covers modern .NET 8+ endpoint patterns. USE WHEN: user mentions "Minimal API", "MapGet", "MapPost", "route groups", "endpoint filters", ".NET minimal", "lambda endpoints" DO NOT USE FOR: Controller-based APIs (use `aspnet-core`), Express.js (use `express`), FastAPI (use `fastapi`)
npx skillsauth add d-subrahmanyam/deno-fresh-microservices aspnet-minimal-apiInstall 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.
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:aspnet-core, topic:minimal-apifor comprehensive documentation.
var app = WebApplication.Create(args);
app.MapGet("/api/users", async (IUserService service) =>
Results.Ok(await service.GetAllAsync()));
app.MapGet("/api/users/{id:int}", async (int id, IUserService service) =>
await service.GetByIdAsync(id) is { } user
? Results.Ok(user)
: Results.NotFound());
app.MapPost("/api/users", async (CreateUserRequest request, IUserService service) =>
{
var user = await service.CreateAsync(request);
return Results.Created($"/api/users/{user.Id}", user);
});
app.MapPut("/api/users/{id:int}", async (int id, UpdateUserRequest request, IUserService service) =>
await service.UpdateAsync(id, request) ? Results.NoContent() : Results.NotFound());
app.MapDelete("/api/users/{id:int}", async (int id, IUserService service) =>
{
await service.DeleteAsync(id);
return Results.NoContent();
});
app.Run();
var users = app.MapGroup("/api/users")
.WithTags("Users")
.RequireAuthorization();
users.MapGet("/", GetAll);
users.MapGet("/{id:int}", GetById);
users.MapPost("/", Create);
// Nested groups
var admin = app.MapGroup("/api/admin")
.RequireAuthorization("AdminOnly");
admin.MapGroup("/users").MapGet("/", GetAllUsers);
// Validation filter
public class ValidationFilter<T> : IEndpointFilter where T : class
{
public async ValueTask<object?> InvokeAsync(
EndpointFilterInvocationContext context,
EndpointFilterDelegate next)
{
var argument = context.Arguments.OfType<T>().FirstOrDefault();
if (argument is null)
return Results.BadRequest("Invalid request body");
var validator = context.HttpContext.RequestServices.GetService<IValidator<T>>();
if (validator is not null)
{
var result = await validator.ValidateAsync(argument);
if (!result.IsValid)
return Results.ValidationProblem(result.ToDictionary());
}
return await next(context);
}
}
// Apply filter
users.MapPost("/", Create).AddEndpointFilter<ValidationFilter<CreateUserRequest>>();
app.MapGet("/api/users/{id:int}", async Task<Results<Ok<UserResponse>, NotFound>> (int id, IUserService service) =>
await service.GetByIdAsync(id) is { } user
? TypedResults.Ok(user)
: TypedResults.NotFound());
| Anti-Pattern | Why It's Bad | Correct Approach |
|--------------|--------------|------------------|
| All endpoints in Program.cs | Hard to maintain | Use route groups and extension methods |
| No validation | Accepts bad input | Use endpoint filters |
| Inline business logic | Not testable | Inject services |
| Not using TypedResults | No OpenAPI metadata | Use TypedResults for typed responses |
| Issue | Likely Cause | Solution |
|-------|--------------|----------|
| Parameter not bound | Wrong type or name | Use explicit [FromRoute] / [FromQuery] |
| Filter not executing | Not registered | Add with AddEndpointFilter<T>() |
| OpenAPI missing types | Using Results.Ok() | Use TypedResults.Ok() |
| Route conflicts | Ambiguous routes | Add route constraints like {id:int} |
development
Guidelines for building high-performance APIs with Fastify and TypeScript, covering validation, Prisma integration, and testing best practices
development
FastAPI modern Python web framework. Covers routing, Pydantic models, dependency injection, and async support. Use when building Python APIs. USE WHEN: user mentions "fastapi", "pydantic", "async python api", "python rest api", asks about "dependency injection python", "python openapi", "python swagger", "async endpoints", "python api validation", "fastapi middleware" DO NOT USE FOR: Django apps - use `django` instead, Flask apps - use `flask` instead, synchronous Python APIs without type hints, GraphQL-only APIs
tools
FastAPI integration testing specialist. Covers synchronous TestClient, async httpx AsyncClient, dependency injection overrides, auth testing (JWT, OAuth2, API keys), WebSocket testing, file uploads, background tasks, middleware testing, and HTTP mocking with respx, responses, and pytest-httpserver. USE WHEN: user mentions "FastAPI test", "TestClient", "httpx async test", "dependency override test", "respx mock", asks about testing FastAPI endpoints, authentication in tests, or HTTP client mocking. DO NOT USE FOR: Django - use `pytest-django`; pytest internals - use `pytest`; Container infrastructure - use `testcontainers-python`
development
Expert in FastAPI Python development with best practices for APIs and async operations