dotnet-webapi

Creates ASP.NET Core Web API endpoints with OpenAPI metadata and error handling.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/adinj00/player-performance --skill dotnet-webapi-adinj00
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-webapi
Source: https://github.com/adinj00/player-performance/tree/main/.agents/skills/dotnet-webapi
Command: npx skills add https://github.com/adinj00/player-performance --skill dotnet-webapi-adinj00

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building ASP.NET Core Web APIs involves many decisions—HTTP status codes, DTO design, OpenAPI wiring, and error handling—that are easy to get wrong or inconsistent. This Skill guides the creation and modification of Web API endpoints so they follow correct HTTP semantics, produce rich OpenAPI documentation, and handle errors uniformly with RFC 7807 Problem Details. ## Core Features & Use Cases - Endpoint Implementation: Adds or modifies endpoints using controllers or minimal APIs, matching the project's existing style and using TypedResults with correct status codes (201 with Location, 204 for deletes, etc.). - DTO & OpenAPI Conventions: Defines sealed record request/response types with XML doc comments, DateTimeOffset, string-serialized enums, and built-in .NET 9+ OpenAPI support instead of Swashbuckle. - Error Handling & Testing: Sets up global exception handling middleware returning Problem Details, a service layer with interfaces, and .http test files for every endpoint. - Use Case: Ask the assistant to add a CRUD products endpoint to your ASP.NET Core project, and it will create the DTOs, minimal API or controller endpoints, OpenAPI metadata, exception handler, service layer, and a .http file—then verify with dotnet build. ## Quick Start Add a new REST endpoint for managing products to my ASP.NET Core project, including DTOs, OpenAPI documentation, error handling, and a .http test file.

Frequently Asked Questions about dotnet-webapi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new endpoint to an ASP.NET Core Web API?

First detect whether the project uses controllers or minimal APIs, then follow that style. Define sealed record request/response DTOs, implement the endpoint with correct status codes and CancellationToken, add OpenAPI metadata, and verify with dotnet build.

Should I use controllers or minimal APIs in ASP.NET Core?

Match the existing project style—never mix both in one project. For new projects, default to minimal APIs unless controllers are explicitly requested, organizing endpoints by resource in static Map methods.

Should I use Swashbuckle or built-in OpenAPI in .NET 9?

For .NET 9+ projects, use the built-in AddOpenApi() and MapOpenApi() support—do not add any Swashbuckle packages, which have compatibility issues with .NET 9+ OpenAPI types. Swashbuckle remains acceptable for .NET 8 or earlier.

Why does TypedResults cause CS1593 in minimal APIs?

Using TypedResults.Ok and TypedResults.NotFound in a bare ternary fails because Ok<T> and NotFound share no common base type. Annotate the handler with an explicit Task<Results<Ok<T>, NotFound>> return type so the compiler can infer correctly.

When should I not use this Web API guidance?

Do not apply it to EF Core query optimization, general C# style, frontend or Blazor work, gRPC services, or SignalR hubs. It covers only HTTP Web API endpoints, OpenAPI, and API error handling.