Communitygithub.com

REST API 설계

REST API 엔드포인트를 위한 리소스 명명, HTTP 메서드 및 상태 코드 의미, 오류 형태, 페이지네이션, 필터링을 설계하고 소비자가 질문 없이 사용할 수 있는 명세서를 제공합니다.

REST API 설계란 무엇인가요?

이 스킬은 REST API 표면 설계에 특화된 AI 어시스턴트로, 일관적이고 소비자 친화적인 API를 만드는 데 집중합니다. 내부 데이터베이스 스키마가 아닌 소비자의 인지 모델을 기반으로 리소스를 명명하고, HTTP 메서드와 상태 코드의 올바른 의미를 할당하며, 머신이 읽을 수 있는 통합 오류 형태와 커서 기반 페이지네이션, 필터링 체계를 제공합니다. 주로 Claude Code나 Cursor와 같은 AI 코딩 에이전트 환경에서 사용되며, 개발자가 "이 엔드포인트는 어떻게 이름을 지어야 할까", "PUT과 PATCH 중 어떤 것을 써야 할까", "페이지네이션은 어떻게 구현할까" 같은 질문을 할 때 적합합니다. 스킬은 입력 수집, 리소스 명명, 메서드 할당, 오류 계약 수정, 페이지네이션 및 필터링, 성능 예산 적용의 6단계 절차를 따르며, 모든 컬렉션 엔드포인트에 동일한 페이지네이션 규약을 적용하고 오류는 단일 형태를 공유합니다. 이 스킬은 외부 소비자에게 출시되기 전 API 리뷰 상황에서 특히 유용하며, 일관성 없는 명명, 잘못된 상태 코드, 성장하는 테이블에 대한 오프셋 페이지네이션 같은 비용이 많이 드는 실수를 방지합니다.

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

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

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

문서

REST API 설계은(는) 무엇을 하나요?

API는 제품입니다. 소비자의 인지 모델이 형태를 결정하며, 데이터베이스 스키마가 아닙니다. 이 스킬이 방지하는 고비용 실수는 일관성 없는 표면(혼합된 명명, 잘못된 상태 코드, 증가하는 테이블에 대한 오프셋 페이지네이션)을 출시하는 것이며, 모든 소비자가 이를 하드코딩하여 통합 후에는 사실상 수정 불가능하게 만듭니다.

운영 절차

다음 순서로 작업하세요. 리소스는 메서드보다 먼저 나와야 합니다. 메서드 의미론은 리소스가 무엇인지에 따라 달라지기 때문입니다. 오류 및 페이지네이션 계약은 명세서가 작성되기 전에 수정해야 합니다. 사후에 수정하면 소비자를 망가뜨리기 때문입니다.

1단계: 입력 수집

설계하기 전에 수집하세요. 모든 가정은 추측으로 표시하세요.

  1. 소비자: 내부 서비스, 퍼스트파티 클라이언트 또는 외부 개발자. 외부 소비자는 일관성 기준을 높입니다. 알 수 없는 경우 기본값은 외부로 설정합니다.
  2. 도메인의 핵심 명사와 명사 간의 소유 관계(중첩을 결정).
  3. 예상 컬렉션 크기 및 성장. 약 10,000행을 초과할 수 있는 목록은 오프셋 페이지네이션을 배제합니다.
  4. 엔드포인트별 읽기/쓰기 비율 및 지연 시간 예상.
  5. 인증 모델(401 대 403 정확성에 영향을 미침).

2단계: 리소스 명명

  • 복수 명사: /users, /orders, /products.
  • 소유권을 위해 한 단계 중첩: /users/{id}/orders. 두 수준 이상 깊게 중첩하지 마세요. 대신 필터로 평탄화하세요(?user_id=...이 /users/{id}/orders/{oid}/items/{iid}보다 낫습니다).
  • 경로에 동사를 사용하지 마세요. HTTP 메서드가 동사입니다. CRUD 동사에 맞지 않는 실제 동작(예: 송장 발송)의 경우 하위 리소스 POST로 모델링하세요: POST /invoices/{id}/send-attempts.
  • 일관된 케이스: 여러 단어 경로 세그먼트는 케밥 케이스(kebab-case), JSON 필드는 스네이크 케이스(snake_case)를 사용하고 한 번 선택하면 모든 곳에 적용하세요.

3단계: 메서드 및 상태 코드 할당

  • GET: 읽기, 멱등, 요청 본문 없음. 200과 본문.
  • POST: 생성. 201과 새 리소스를 가리키는 Location 헤더를 반환합니다. 클라이언트가 후속 GET을 건너뛰도록 생성된 표현을 본문에 반환합니다.
  • PUT: 전체 교체, 멱등. 누락된 필드는 "유지"가 아니라 "지움"을 의미합니다.
  • PATCH: 부분 업데이트(JSON Merge Patch 또는 JSON Patch 중 명세서에 명시).
  • DELETE: 제거, 멱등, 204 반환. 이미 삭제된 리소스를 삭제하면 204 또는 404를 반환합니다. 하나를 선택하고 문서화하세요.
  • 오류: 400(잘못된 입력), 401(누락되거나 유효하지 않은 자격 증명), 403(유효한 자격 증명이지만 권한 없음), 404(존재하지 않는 리소스, 존재 노출이 유출인 경우 403 대신 404 사용), 409(상태 충돌), 422(형식은 올바르지만 의미적으로 유효하지 않은 입력), 429(속도 제한, Retry-After 포함), 500(서버 오류) – 스택 추적이나 내부 식별자를 절대 노출하지 마세요.

4단계: 오류 계약 수정

모든 오류에 대해 하나의 형태, 먼저 기계가 읽을 수 있는 코드:

{
  "error": "validation_error",
  "message": "이메일은 필수입니다",
  "field": "email",
  "request_id": "req_abc123"
}

request_id는 서버 측에 기록되어 지원팀이 상관 관계를 추적할 수 있어야 합니다. 사람이 읽는 메시지는 로그를 읽는 개발자를 위한 것이며, 최종 사용자 표시용이 아닙니다.

5단계: 페이지네이션 및 필터링 수정

  • 성장하는 모든 컬렉션에는 커서 기반 페이지네이션을 사용하세요: 불투명 커서와 has_more 플래그를 반환합니다. 오프셋 페이지네이션은 작고 제한적이며 관리자 전용 목록에만 허용됩니다. 동시 쓰기 시 선형적으로 성능이 저하되고 행을 건너뛰거나 중복합니다.
  • 기본 페이지 크기 25, 최대 100. 최대값을 초과하는 페이지 크기는 400으로 거부하고, 자동으로 조정하지 마세요.
  • 필터링 및 정렬은 쿼리 파라미터를 통해: ?status=active&sort=created_at:desc. 필터링 가능한 필드를 문서화하고, 알 수 없는 필터 파라미터는 무시하지 말고 400으로 거부하세요(무시는 클라이언트 버그를 숨깁니다).

6단계: 성능 및 페이로드 예산 적용

  • p95 지연 시간 예산: 대화형 엔드포인트는 300ms, 보고서/내보내기는 1초. 작업이 1초를 충족할 수 없으면 비동기로 만드세요: 202 Accepted와 폴링할 상태 리소스.
  • 응답 페이로드 예산: 일반 응답은 100KB 미만으로 유지하세요. 1MB를 초과하는 것은 페이지네이션, 필드 선택(?fields=) 또는 전용 내보내기 플로우가 필요합니다.
  • 주요 변경 사항은 URL 경로에 버전을 명시하세요(/v1/). 추가 변경 사항(새로운 선택적 필드)은 버전 범프가 필요하지 않습니다. 지원 중단 타임라인 자체는 api-versioning-strategist에 전달하세요.

작업 대비 예시

나쁜 예:

POST /getUserOrders?userId=42&page=3
→ 200 { "data": [...], "error": null }

경로에 동사, POST에 GET 의미론, 오프셋 페이지네이션, 오류 필드를 래핑하는 200으로 클라이언트가 호출 실패 여부를 알기 위해 본문을 파싱해야 합니다.

좋은 예:

GET /users/42/orders?status=shipped&limit=25&cursor=eyJpZCI6OTh9
→ 200 { "orders": [...], "next_cursor": "eyJpZCI6MTIzfQ", "has_more": true }
→ 404 { "error": "not_found", "message": "사용자 42가 존재하지 않습니다", "request_id": "req_9f2" }

명사 경로, 소유권 중첩, 커서 페이지네이션, 상태 코드가 결과를 전달합니다.

산출물

다음을 포함하는 엔드포인트 명세서를 생성하세요: 리소스 테이블(경로, 메서드, 메서드별 상태 코드), 공유 오류 형태, 페이지네이션 계약(커서 형식, 기본값, 최대값), 필터링 허용 목록, 엔드포인트별 지연 시간 및 페이로드 예산.

하지 말아야 할 것

  • API에 데이터베이스 스키마를 미러링하지 마세요. 소비자가 변경하고 싶은 내부에 결합됩니다.
  • 실패 시 오류 본문과 함께 200을 반환하지 마세요. 클라이언트와 모니터링 모두 상태 코드를 기준으로 합니다.
  • 무제한 컬렉션에 오프셋 페이지네이션을 사용하지 마세요. 쓰기 시 행을 중복하고 건너뛰며 선형적으로 성능이 저하됩니다.
  • 경로를 두 수준 이상 깊게 중첩하지 마세요. 깊은 중첩은 하나의 액세스 경로를 인코딩하고 다른 모든 경로를 금지합니다.
  • 알 수 없는 쿼리 파라미터를 자동으로 무시하지 마세요. 오타가 난 필터가 필터링되지 않은 데이터를 반환하면 데이터 유출 수준의 버그입니다.

품질 기준

  • 소비자가 질문 없이 명세서만으로 클라이언트를 구현할 수 있어야 합니다.
  • 모든 엔드포인트는 오류 사례를 포함한 상태 코드를 명시합니다.
  • 모든 컬렉션 엔드포인트는 하나의 페이지네이션 계약을 공유하고 모든 오류는 하나의 형태를 공유합니다.
  • 동일한 개념은 모든 경로와 페이로드에서 동일한 이름을 가집니다.
  • 각 엔드포인트는 명시적인 지연 시간 예산이 있으며 1초를 초과하는 것은 비동기입니다.

Individual skills in this repo

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

SkillMedev/skills

Produce an accurate, properly timed caption track (SRT or WebVTT) from a video's audio - transcribing or aligning to the voiceover script, timing cues to speech, and enforcing line-length and reading-speed rules so captions are readable and in sync. Use when someone says "generate captions", "make subtitles from the audio", "transcribe and caption this", "export an SRT or VTT", "the captions are out of sync", or "the subtitles flash by too fast to read". Do NOT use to burn-in, style, reframe, or position an existing caption track for a platform (9:16, brand styling, safe areas) - that is social-video-formatter; do NOT use to animate text word-by-word as a motion graphic - that is kinetic-typography; do NOT use to write the spoken script in the first place - that is narration-script.

SkillMedev/skills

Turns data and charts into a decision-driving narrative structured as headline finding, trend, implication, and recommended action - with finding-led chart titles, context for every number, annotation guidance, and honest flags on any conclusion the data cannot support. Use when someone says "turn these numbers into a story", "what's the takeaway from this data", "help me present these results to leadership", or has charts but no narrative. Do NOT use for compressing a long document into a one-pager - use executive-summary instead - or for running the analysis that produces the findings - use eda-playbook instead.

SkillMedev/skills

Use when a task needs live or historical money data - "convert USD to EUR", "current/past exchange rate", "FX rate on this date / over this range", or "current price of Bitcoin/Ethereum, market cap, 24h change". Frankfurter (ECB reference rates, no key) is the FX default; CoinGecko's free keyless tier covers crypto. Do NOT use for stock quotes or equities - no keyless stock API survives verification, say so instead of guessing; do NOT use for country economic indicators like GDP or inflation series - use government-open-data instead; if the request is a vague "I need live data", route through public-data-api-picker.

SkillMedev/skills

Builds a driver-based FP&A operating model linking business inputs to P&L, balance sheet, and cash flow outputs. Use when building an annual plan, preparing investor materials, running scenario analysis, or stress-testing the business.

SkillMedev/skills

Use when a task needs live geographic lookups - "geocode this address", "what's at these coordinates" (reverse geocoding), "lat/lon for this city", "which country/state is this ZIP or postal code in", or "country facts: capital, currency, population, flag". Nominatim (OpenStreetMap) is the geocoding default; Zippopotam for postal codes; APICountries for country facts. All keyless. Do NOT use for weather at a location - use weather-climate instead; do NOT use for country-level statistics over time (GDP, population trends) - use government-open-data instead; if the request is a vague "I need live data", route through public-data-api-picker.

SkillMedev/skills

Runs the full Getting Things Done loop - capture, clarify, organize, reflect, engage - building a trusted system of context lists, a projects list with defined next actions, and a weekly review habit. Use when someone says "I'm overwhelmed and things are slipping through the cracks", "set up GTD for me", "help me do a brain dump and organize it", or "my to-do list is a mess". Do NOT use for just running the weekly review ritual itself - use weekly-review instead - or for clearing an email backlog - use inbox-zero.

SkillMedev/skills

Processes any email backlog to zero using the 4Ds - Delete, Delegate, Defer, Do - with a mass-archive strategy for the obvious, a touch-each-email-once discipline, and a keep-it-clear system of batched processing windows, ruthless unsubscribing, filters, and a minimal folder setup. Use when someone says "I have 5,000 unread emails", "help me get to inbox zero", "email is eating my whole day", or treats their inbox as a to-do list. Do NOT use for drafting the reply emails themselves or prioritization rules for an ongoing support queue - use email-triage instead - or for protecting focus time around the email windows - use deep-work-planner instead.

SkillMedev/skills

Write landing-page copy section by section - hero, social proof, features-as-benefits, objections, CTA - leading with one promise and proving it down the page. Use when someone asks "write my landing page", "improve my hero headline", "what should the homepage say", "turn these features into benefits", or is shipping a new page for a launch or campaign. Do NOT use for testing and optimizing an existing page's conversion rate - use landing-page-cro instead; for the one-line claim itself use positioning-statement; for the full message ladder use messaging-hierarchy.

SkillMedev/skills

Improves an existing landing page's conversion rate through evidence-first CRO - audit heatmaps and recordings, write structured hypotheses, prioritize with ICE scoring, and run one-variable tests to statistical significance. Use when someone asks "why isn't my landing page converting", "audit this page before we scale spend", "which A/B test should we run first", or after a CVR drop or ahead of a paid-traffic push. Do NOT use for writing a new landing page from scratch - use landing-page-copy instead. Do NOT use for auditing the ad accounts sending the traffic - use paid-acquisition-audit instead. Do NOT use for reading the results of a finished experiment - use ab-test-analyzer instead.

SkillMedev/skills

Runs structured coaching sessions using values clarification and the GROW model, ending every session with one committed action, a deadline, and an if-then plan for the likely obstacle. Use when someone says "I feel stuck in my life", "help me figure out what I want", "hold me accountable to my goals", or "coach me through this decision". Do NOT use for building a stress toolkit - use stress-management instead - or a journaling practice - use journal-framework; for a standing goal-tracking system, use goals-accountability. Coaching, not therapy: signs of clinical distress route to a licensed professional.

SkillMedev/skills

Adapts English content for a target language and region - swapping idioms, setting the right formality register, replacing cultural references, converting dates, units, and currency - and delivers the localized text with a notes column explaining each adaptation and flagging what needs a native reviewer. Use when someone asks "localize this copy for the Japanese market", "adapt our marketing copy for the Mexican market", "make this translation sound native instead of literal", or a literal translation reads foreign, stiff, or risky. Do NOT use for auditing in-product UI text quality - use ux-writing-audit instead.

SkillMedev/skills

Turns a natural-language video brief into a complete, ready-to-preview Remotion composition - extracts duration, scenes, brand colors, aspect ratio, and real copy; plans the frame budget; and writes data-driven React/TypeScript using useCurrentFrame, interpolate, spring, AbsoluteFill, and Sequence, registered in Root.tsx. Use when someone says "build a 20-second product demo video", "animate a feature walkthrough", "write the Remotion code for this marketing clip", or wants a scene-by-scene composition they can scrub in Studio. Do NOT use for rendering, iterating, or batching the finished MP4 - use remotion-render instead - or for installing and scaffolding the project - use remotion-setup instead.

SkillMedev/skills

Scaffolds a new Remotion video project wired for Claude Code Agent Skills - Node check, create-video scaffold, skills install, folder conventions, Google Fonts, and a smoke-test render. Use whenever someone wants to start making videos with Remotion and Claude, even just "make product videos with Claude.

SkillMedev/skills

Classifies incident severity (SEV1-4) using impact, scope, and urgency signals and decides who to page. Use when an alert fires or a report comes in and a severity call must be made quickly.

SkillMedev/skills

Use the Skill Me catalog from inside any conversation - discover, install, and manage Claude skills through the Skill Me MCP, and load installed skills automatically each session.

SkillMedev/skills

Write one platform-native caption from a topic and brand voice, with a front-loaded hook, native length, and a single earned CTA. Use when the user gives a topic (and optionally brand voice or a described image/video) and asks for an Instagram, LinkedIn, X/Twitter, or TikTok caption. Do NOT use when the user wants a dedicated standalone LinkedIn post - use linkedin-post-writer instead; or a multi-post X thread - use tweet-thread-builder instead; or to adapt one existing piece of content into versions for several channels - use cross-platform-reformatter instead.

SkillMedev/skills

Reframe and export a finished video for social platforms - 9:16 ↔ 16:9 cropping, burned-in captions, a platform-native first frame, loop design, and per-platform specs (aspect, length, safe areas) for TikTok, Reels, Shorts, X, and LinkedIn. Use when someone says "make this vertical", "crop to 9:16", "format for TikTok/Reels/Shorts", "add captions/subtitles", "why is my video cut off on mobile", "resize for Instagram", or "export for social". Do NOT use when the question is about the storyboard or shot order before any video exists (use video-storyboard); the animation craft of how elements move (use motion-design-principles); animated word-by-word caption styling (use kinetic-typography); palette, contrast, or lighting (use motion-color-and-light); directing the product-demo content and screen choreography (use product-demo-director); or scoring, beat-syncing, or audio (use sound-and-music-sync) - this is the craft layer that decides WHAT to format for the feed, then hands a concrete spec to remotion-compo...

SkillMedev/skills

Writes and tunes PySpark jobs - join strategy and broadcast size limits, shuffle-partition sizing, skew diagnosis and salting, UDF avoidance, caching, and output file layout - with concrete size and skew thresholds. Use when someone asks "why is my Spark job slow", "should I broadcast this join", "one task takes forever while the rest finish", "my job OOMs during a join", or is writing a new PySpark ETL job. Do NOT use for Kafka topic, consumer-group, or streaming-pipeline design - use kafka-pipelines instead; do NOT use for single-machine dataframe work that fits in memory - use pandas-expert instead.

SkillMedev/skills

Builds clean, performant, accessible SwiftUI views with correct state ownership, scoped invalidation, and smooth list scrolling, and reviews existing SwiftUI code against a concrete frame-time and re-render budget. Use when someone asks "why does my SwiftUI list stutter", "should this be @State or @Observable", "my whole screen re-renders when one row changes", "how do I animate this transition", or wants a SwiftUI view built or refactored. Do NOT use for cross-platform React Native apps - use react-native-pro instead; do NOT use for Flutter widget trees - use flutter-widget-architect instead; do NOT use for Android Compose UIs - use jetpack-compose-builder instead.

관련 스킬