Communitygithub.com

YepAPI/skills

Zod 스키마로부터 OpenAPI 3.1 스펙을 생성하고, Swagger/Scalar를 통한 대화형 문서, 버저닝, 모든 엔드포인트에 대한 예제 요청을 제공합니다.

skills란 무엇인가요?

이 스킬은 Zod 스키마를 사용하여 OpenAPI 3.1 스펙을 자동 생성하는 방법을 알려줍니다. `zod-openapi` 또는 `@asteasolutions/zod-to-openapi`와 같은 라이브러리를 활용하여 코드에서 직접 API 문서를 생성함으로써, 수동 작성으로 인한 문서와 구현 간의 불일치를 방지합니다. Scalar 또는 Swagger UI와 같은 대화형 문서 도구를 `/docs` 경로에 제공하여 개발자와 사용자가 API를 쉽게 탐색하고 테스트할 수 있습니다. 모든 엔드포인트에는 요약, 설명, 요청 본문 스키마, 그리고 실제 데이터를 사용한 예제 응답이 포함되어야 하며, URL 경로 기반 버저닝(`/api/v1/`, `/api/v2/`)을 통해 호환성이 깨지는 변경을 관리합니다. 또한 인증 방식과 일관된 오류 응답 형식을 문서화하여 API의 사용성과 유지보수성을 높입니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/api-documentation

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

API 문서화

규칙

  • OpenAPI 3.1 스펙을 단일 진실 공급원으로 사용 — 코드에서 생성하고, 수동으로 작성하지 않음
  • Zod 스키마를 OpenAPI로 변환: zod-openapi 또는 @asteasolutions/zod-to-openapi 사용 — 한 번 정의하고 검증 및 문서화
  • 대화형 문서: Scalar(현대적, 빠름) 또는 Swagger UI — /docs 또는 /api-docs에서 제공
  • 모든 엔드포인트에는 다음이 포함되어야 함: 요약, 설명, 요청 본문 스키마, 모든 응답 코드와 예제
  • 모든 엔드포인트에 대한 예제 요청/응답 — 실제 데이터 사용, "string"과 같은 플레이스홀더 사용 금지
  • 버저닝 전략: 호환성이 깨지는 변경을 위해 URL 경로 사용(/api/v1/, /api/v2/) — 헤더 버저닝보다 간단함
  • 오류 응답: 모든 오류 형태를 일관되게 문서화 — { error: string, code: string, details?: object }
  • 인증: 보안 스키마 섹션에서 인증 방식(Bearer 토큰, API 키) 문서화
  • 엔드포인트를 리소스별로 그룹화: /users, /products, /orders — 문서 UI에서 그룹화를 위해 태그 사용

패턴

// Hono/Express와 함께 zod-to-openapi 사용
import { z } from "zod";
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
extendZodWithOpenApi(z);

const UserSchema = z.object({
  id: z.string().uuid().openapi({ example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }),
  name: z.string().openapi({ example: "Jane Smith" }),
  email: z.string().email().openapi({ example: "[email protected]" }),
}).openapi("User");

const CreateUserSchema = UserSchema.omit({ id: true }).openapi("CreateUser");

// 엔드포인트 등록
registry.registerPath({
  method: "post",
  path: "/api/v1/users",
  summary: "사용자 생성",
  request: { body: { content: { "application/json": { schema: CreateUserSchema } } } },
  responses: {
    201: { description: "사용자 생성됨", content: { "application/json": { schema: UserSchema } } },
    400: { description: "유효성 검사 오류" },
  },
});

지양할 것

  • OpenAPI YAML을 수동으로 작성하지 말 것 — Zod 스키마 또는 라우트 정의에서 생성
  • 오류 응답 문서화를 누락하지 말 것 — 400, 401, 403, 404, 500 문서화
  • "string" 또는 0과 같은 일반적인 예제를 사용하지 말 것 — 실제 데이터의 형태를 보여주는 현실적인 값 사용
  • 구현과 동떨어진 문서를 만들지 말 것 — 검증에 사용되는 동일한 스키마로 스펙 생성

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬