본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)18k · #10696

openapi-expert

하는 일

이 스킬은 API의 경로, 스키마, 보안, 응답을 설명하는 OpenAPI 명세를 쓰는 방법을 안내합니다. 다른 개발자를 위한 명확한 계약을 원하는 백엔드 및 API 설계자를 위한 스킬입니다.

사용하는 경우

  • ✓코딩 전에 명확한 계약이 필요한 새 API를 설계할 때.
  • ✓기존 API를 OpenAPI 형식으로 문서화해야 할 때.
  • ✓CI에서 명세의 오류나 호환되지 않는 변경을 점검하고 싶을 때.

스킬 링크

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/openapi-expert/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/openapi-expert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“버전이 붙은 경로, 재사용 가능한 스키마, 명확한 설명을 포함한 주문 API의 OpenAPI 명세를 작성해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 코드보다 명세를 먼저 쓰고, 참조를 통해 스키마를 재사용하고, API에 버전을 붙이고, 린트 도구로 명세를 검증하라고 권장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

OpenAPI Expert

An API design architect with deep expertise in the OpenAPI Specification, RESTful API conventions, and the tooling ecosystem for validation, documentation, and code generation. This skill provides guidance for designing clear, consistent, and evolvable API contracts using OpenAPI 3.0 and 3.1, covering schema composition, security definitions, versioning strategies, and developer experience optimization.

Key Principles

  • Design the API specification before writing implementation code; the spec serves as the contract between frontend, backend, mobile, and third-party consumers
  • Use $ref extensively to define reusable schemas, parameters, and responses in the components section; duplication across paths leads to inconsistency and maintenance burden
  • Version your API explicitly through URL path prefixes (/v1/, /v2/) or custom headers; never break existing consumers by changing response shapes without a version boundary
  • Write meaningful descriptions for every path, parameter, schema property, and response; the spec doubles as your API documentation and should be understandable without reading source code
  • Validate the spec in CI using linting tools to catch breaking changes, missing descriptions, inconsistent naming, and schema errors before they reach production

Techniques

  • Structure the OpenAPI document with info (title, version, contact), servers (base URLs per environment), paths (endpoints), and components (schemas, securitySchemes, parameters, responses)
  • Compose schemas using allOf for inheritance (base object + extension), oneOf for polymorphism (exactly one match), and anyOf for flexible unions (at least one match)
  • Provide request and response examples at both the schema level and the media type level; tools like Swagger UI and Redoc render these prominently for developer reference
  • Define security schemes (Bearer JWT, API key, OAuth2 flows) in components/securitySchemes and apply them globally or per-operation with the security field
  • Distinguish path parameters (/users/{id}), query parameters (?page=2&limit=20), and header parameters for different use cases; path parameters identify resources, query parameters filter or paginate
  • Implement consistent pagination with limit/offset or cursor-based patterns, documenting the pagination metadata schema (total, next_cursor, has_more) in a reusable component
  • Generate server stubs and client SDKs using openapi-generator with language-specific templates; customize templates for your coding conventions

Common Patterns

  • Error Response Schema: Define a reusable error object with code (machine-readable string), message (human-readable), and details (array of field-level errors) applied consistently across all error responses
  • Polymorphic Responses: Use discriminator with oneOf to model responses that can be different types (e.g., a notification that is either an EmailNotification or PushNotification) with a type field
  • Pagination Envelope: Wrap list responses in a standard envelope with data (array of items), pagination (cursor or offset metadata), and optional meta (total count, timing)
  • Webhook Definitions: Use the webhooks section (OpenAPI 3.1) to document callback payloads your API sends to consumers, specifying the event schema and expected acknowledgment

Pitfalls to Avoid

  • Do not use additionalProperties: true by default; it makes schemas permissive and hides unexpected fields that may cause client parsing issues
  • Do not define inline schemas for every request and response body; extract them to components/schemas with descriptive names for reuse and clarity
  • Do not mix naming conventions (camelCase and snake_case) within the same API; pick one convention and enforce it with a linter rule
  • Do not skip providing enum descriptions; raw enum values like "PENDING", "ACTIVE", "SUSPENDED" need documentation explaining what each state means and what transitions are valid
자주 묻는 질문

왜 코드보다 명세를 먼저 쓰나요?

명세는 프런트엔드, 백엔드, 그 밖의 사용자 사이의 계약 역할을 하므로, 모두가 먼저 형태에 합의할 수 있습니다.

API 버전은 어떻게 붙여야 하나요?

URL 경로나 헤더에 명시적인 버전을 붙여서, 변경으로 기존 클라이언트가 깨지지 않게 하라고 스킬은 제안합니다.

명세에는 엔드포인트 말고 무엇이 필요한가요?

모든 경로, 매개변수, 속성, 응답에 대한 설명이 있어야 명세가 읽을 수 있는 문서가 됩니다.

상세 정보

작성자의 원본 설명

OpenAPI/Swagger expert for API specification design, validation, and code generation

repo: RightNow-AI/openfang

인기도

GitHub 스타
18k
순위
#10696
라이선스
Apache-2.0
업데이트
2026. 7. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬