dotnet-webapi
하는 일
이 스킬은 컨트롤러나 미니멀 API를 사용해 ASP.NET Core Web API 엔드포인트를 만들고 바꾸는 과정을 안내합니다. 깔끔한 응답과 문서화된 엔드포인트를 원하는 HTTP API 개발자를 위한 스킬입니다.
사용하는 경우
- ✓ASP.NET Core 프로젝트에서 Web API 엔드포인트를 추가하거나 바꿔야 할 때.
- ✓API에 OpenAPI나 Swagger 문서가 필요할 때.
- ✓일관된 오류 응답을 주는 전역 오류 처리기가 필요할 때.
스킬 링크
https://github.com/dotnet/skills/blob/main/plugins/dotnet-aspnetcore/skills/dotnet-webapi/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“주문을 만들고, 올바른 상태 코드를 반환하며, OpenAPI에 문서화된 Web API 엔드포인트를 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 프로젝트의 기존 API 방식에 맞추고, 올바른 HTTP 상태 코드와 데이터 전송 객체를 갖춘 엔드포인트를 쓰고, OpenAPI 메타데이터를 추가한 뒤, 중앙 오류 처리를 설정합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
ASP.NET Core Web API
Produce well-structured ASP.NET Core Web API endpoints with proper HTTP semantics, OpenAPI documentation, and error handling.
When to Use
Use this skill when working on ASP.NET Core HTTP APIs, including:
- adding or modifying Web API endpoints implemented with controllers or minimal APIs;
- wiring up OpenAPI/Swagger metadata and endpoint documentation;
- defining request/response DTOs and consistent HTTP status code behavior;
- adding
.httpfiles or similar request-based API testing artifacts; - configuring centralized API error handling middleware or exception mapping.
When Not to Use
Do not use this skill for:
- general C# coding style or non-API refactoring;
- EF Core data modeling or query optimization work; use
optimizing-ef-core-queries; - frontend, Razor, or Blazor UI changes;
- gRPC services;
- SignalR hubs or real-time messaging flows.
Inputs / prerequisites
Before applying this skill, gather the project context needed to match the existing API style and wiring:
- the ASP.NET Core entry point, typically
Program.cs; - any existing controllers, especially classes inheriting
ControllerBaseor using[ApiController]; - any existing minimal API registrations such as
app.MapGet,app.MapPost,app.MapPut, orapp.MapDelete; - related DTO, model, validation, and error-handling types already used by the project;
- available build, run, and test commands so changes can be verified.
If the user asks for a new endpoint, inspect the current project structure first so the implementation follows the established conventions rather than mixing styles.
Workflow
Step 1: Determine the API style
Scan the project for existing endpoint patterns before writing any code.
- Search for classes inheriting
ControllerBaseor decorated with[ApiController]. - Search
Program.csor endpoint files forapp.MapGet,app.MapPost, etc. - If the project already uses controllers, continue with controllers.
- If the project already uses minimal APIs, continue with minimal APIs.
- If neither exists (new project), default to minimal APIs unless the user explicitly requests controllers.
Do not mix styles in the same project.
Step 2: Define request and response types
Create dedicated types for API input and output. Never expose EF Core entities directly in request or response bodies.
Use sealed record for all DTOs. Records enforce immutability, provide
value-based equality, and produce concise code. Seal them to prevent unintended
inheritance and enable JIT devirtualization (CA1852).
Naming convention:
| Role | Convention | Example |
|---|---|---|
| Input (create) | Create{Entity}Request |
CreateProductRequest |
| Input (update) | Update{Entity}Request |
UpdateProductRequest |
| Output (single) | {Entity}Response |
ProductResponse |
| Output (list) | {Entity}ListResponse |
ProductListResponse |
XML doc comments on all DTOs: Add <summary> XML doc comments to every
request and response type exposed in the API. These comments are automatically
included in the generated OpenAPI specification, producing richer documentation
without extra metadata calls.
Reference: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/openapi-comments
Date and time values — use DateTimeOffset: When a DTO includes a date or
time property, always use DateTimeOffset instead of DateTime.
DateTimeOffset preserves the UTC offset, avoids ambiguous timezone
conversions, and serializes to ISO 8601 with offset information in JSON — which
is what API consumers expect.
Reference: https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset JSON serialization options — preserve existing behavior by default: For existing APIs, do not introduce stricter serialization/deserialization settings unless the project already uses them or the user explicitly asks for them. Settings such as case-sensitive property matching and strict number handling can break existing clients. For new projects, or when strict JSON handling is explicitly requested, configure options like the following to minimize the potential of processing malicious requests:
// Apply these settings only for new projects, when the existing project already
// uses them, or when the user explicitly requests stricter JSON behavior.
builder.Services.ConfigureHttpJsonOptions(options =>
{
// disallow reading numbers fro
자주 묻는 질문
데이터베이스 쿼리도 다루나요?
아니요. Entity Framework 데이터 접근은 별도의 스킬이 다룹니다.
테스트용 요청 파일을 만들 수 있나요?
네. 엔드포인트를 테스트하는 .http 파일을 추가할 수 있습니다.
gRPC나 SignalR도 되나요?
아니요. 그것들은 이 스킬의 범위 밖입니다.
상세 정보
작성자의 원본 설명
Guides creation and modification of ASP.NET Core Web API endpoints with correct HTTP semantics, OpenAPI metadata, and error handling. USE FOR: adding new API endpoints (controllers or minimal APIs), wiring up OpenAPI/Swagger, creating .http test files, setting up global error handling middleware. DO NOT USE FOR: general C# coding style, EF Core data access or query optimization (use optimizing-ef-core-queries), frontend/Blazor work, gRPC services, or SignalR hubs.
repo: dotnet/skills
인기도
- GitHub 스타
- 5.8k
- 순위
- #14560
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
create-custom-agent
5.8k에이전트가 자체 도구, 지침, 다른 에이전트로의 핸드오프를 가진 VS Code 커스텀 에이전트 파일을 만들도록 돕습니다.
create-skill
5.8k에이전트가 올바른 이름, 명확한 트리거 설명, 표준을 따르는 SKILL.md 파일로 새 에이전트 스킬을 만들도록 돕습니다.
csharp-scripts
5.8k에이전트가 .NET 명령줄 도구로 작은 C# 프로그램을 전체 프로젝트 없이 단일 파일로 실행하도록 돕습니다.
dotnet-pinvoke
5.8k에이전트가 .NET에서 네이티브 C나 C++ 라이브러리를 올바르게 호출하도록 돕습니다. 시그니처, 문자열 처리, 메모리, 안전 핸들을 다룹니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.