dotnet-webapi

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

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill dotnet-webapi-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-webapi
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/dotnet-webapi
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill dotnet-webapi-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building ASP.NET Core Web APIs involves many decisions—controllers vs minimal APIs, DTO design, status codes, 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 use centralized RFC 7807 error handling. ## Core Features & Use Cases - Endpoint Implementation: Adds or modifies endpoints using controllers or minimal APIs, matching the existing project style and defaulting to minimal APIs for new projects. - DTO and OpenAPI Conventions: Enforces sealed record DTOs with XML doc comments, DateTimeOffset, string-serialized enums, TypedResults, and endpoint metadata for rich OpenAPI output. - Error Handling and Testing: Configures global exception handling with Problem Details, a service layer with interfaces, and .http test files for every endpoint. - Use Case: When asked to add a products CRUD API to an existing ASP.NET Core project, the Skill inspects the current style, creates request/response DTOs, implements endpoints with correct status codes and CancellationToken support, wires OpenAPI, and generates a .http file to verify each route. ## Quick Start Ask the agent to add a new REST endpoint for a resource in your ASP.NET Core project, including DTOs, OpenAPI metadata, 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 and follow that style. Define sealed record request/response DTOs, implement the endpoint with correct status codes and CancellationToken, then add OpenAPI metadata and a .http test request.

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

Match whatever style the project already uses and never mix both in one project. For new projects with no existing endpoints, default to minimal APIs unless controllers are explicitly requested.

Should I use Swashbuckle with .NET 9 or .NET 10 OpenAPI?

No. For .NET 9+ projects use the built-in AddOpenApi() and MapOpenApi() without any Swashbuckle packages, since Swashbuckle has compatibility issues with .NET 9+ OpenAPI types. Swashbuckle remains acceptable for .NET 8 or earlier.

Why does TypedResults cause CS1593 delegate errors in minimal APIs?

Using TypedResults.Ok and TypedResults.NotFound in a ternary fails because Ok<T> and NotFound share no common base type. Annotate the handler with an explicit Results<Ok<T>, NotFound> return type, or fall back to the Results factory.

When should I not use this Web API guidance?

Do not apply it to EF Core query optimization, Blazor or Razor frontend work, gRPC services, or SignalR hubs. It targets HTTP API endpoints only; use optimizing-ef-core-queries for data access concerns.