dotnet-api-quality

Improve ASP.NET Core APIs with validation, ProblemDetails, OpenAPI documentation, and consistent response contracts.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/MartiXDev/ai-dev-strategy --skill dotnet-api-quality-martixdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-api-quality
Source: https://github.com/MartiXDev/ai-dev-strategy/tree/main/plugins/dotnet-api-quality/skills/dotnet-api-quality
Command: npx skills add https://github.com/MartiXDev/ai-dev-strategy --skill dotnet-api-quality-martixdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? ASP.NET Core APIs often ship with inconsistent validation, ad-hoc error formats, and incomplete OpenAPI documentation, making them hard for clients to consume and maintain. This Skill provides structured guidance to standardize validation, error handling, and API contracts across endpoints. ## Core Features & Use Cases - Consistent Input Validation: Apply FluentValidation or data annotations to body, route, and query inputs, returning RFC 9457-compatible ValidationProblemDetails responses. - Centralized Error Handling: Map exceptions to stable HTTP status codes through global middleware and emit safe, non-sensitive ProblemDetails payloads with trace correlation. - OpenAPI Completeness: Document success and error responses, operation names, summaries, and tags so generated API docs stay accurate and discoverable. - Use Case: When building a new ASP.NET Core minimal API with multiple route groups, use this Skill to ensure every endpoint validates inputs, returns typed results, and documents both success and failure responses consistently. ## Quick Start Review my ASP.NET Core API endpoints and apply consistent validation, ProblemDetails error handling, and complete OpenAPI response documentation.

Frequently Asked Questions about dotnet-api-quality

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

FAQPage Schema
How do I add consistent validation to ASP.NET Core APIs?

Use FluentValidation or data annotations on request DTOs to validate body, route, and query inputs uniformly. Return RFC 9457-compatible ValidationProblemDetails responses instead of custom ad-hoc error formats so clients receive predictable validation failures.

How to return ProblemDetails for errors in ASP.NET Core?

Register centralized Problem Details support and use global exception handling middleware or filters to map known exceptions to stable HTTP status codes. Unexpected errors should return safe, non-sensitive ProblemDetails payloads with trace correlation metadata where available.

FluentValidation vs data annotations for ASP.NET Core validation?

Both approaches are supported for validating request DTOs. FluentValidation suits complex rule sets and reusable validators, while data annotations work well for simple declarative constraints; either should produce ValidationProblemDetails responses.

Does this approach work with minimal APIs in .NET?

Yes, the guidance applies to minimal APIs using route groups and typed results such as TypedResults or Results<T>. Endpoints should be organized by feature, keep handlers focused on one use case, and document responses with Produces and ProducesProblem metadata.

Why is my OpenAPI documentation incomplete for error responses?

OpenAPI output is incomplete when endpoints lack explicit response metadata for failure cases. Add ProducesProblem and validation error documentation, plus clear operation names, summaries, and tags, so generated docs describe both success and error behavior.