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

api-patterns

하는 일

프로그램들이 서로 소통할 때 사용하는 API라는 ‘언어’를 만들 때 중요한 결정을 내리도록 돕는 가이드입니다. 최선의 스타일(REST나 GraphQL 등)을 고르고, 데이터가 어떻게 보내지고 받아지는지 정의하는 방법을 가르쳐 줍니다.

사용하는 경우

  • ✓REST, GraphQL 또는 다른 통신 방식을 쓸지 결정할 때.
  • ✓프로그램이 데이터를 반환하는 방식을 정의할 때.
  • ✓시스템이 많은 접근이나 업데이트를 어떻게 처리할지 계획할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-patterns/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-patterns/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 응답을 사용자 친화적이고 안전하게 설계하려면 어떻게 해야 하나요?”

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

작동 방식

이 가이드는 각 API 유형과 규칙에 대한 올바른 정보를 찾도록 돕는 ‘지도’를 제공합니다. 결정을 내리기 전에 API 사용자의 필요를 생각하도록 유도합니다.

기술 내용 (원본 SKILL.md)

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

API Patterns

API design decisions tied to the consumers and deployment constraints. Learn to THINK, not copy fixed patterns.

🎯 Selective Reading Rule

Read ONLY files relevant to the request! Check the content map, find what you need.


📑 Content Map

File Description When to Read
api-style.md REST vs GraphQL vs tRPC decision tree Choosing API type
rest.md Resource naming, HTTP methods, status codes Designing REST API
response.md Envelope pattern, error format, pagination Response structure
graphql.md Schema design, when to use, security Considering GraphQL
trpc.md TypeScript monorepo, type safety TS fullstack projects
versioning.md URI/Header/Query versioning API evolution planning
auth.md JWT, OAuth, Passkey, API Keys Auth pattern selection
rate-limiting.md Token bucket, sliding window API protection
documentation.md OpenAPI/Swagger best practices Documentation
security-testing.md OWASP API Top 10, auth/authz testing Security audits

🔗 Related Skills

Need Skill
API implementation @[skills/backend-architect]
Data structure @[skills/database-design]
Security details @[skills/api-security-best-practices]

✅ Decision Checklist

Before designing an API:

  • Asked user about API consumers?
  • Chosen API style for THIS context? (REST/GraphQL/tRPC)
  • Defined consistent response format?
  • Planned versioning strategy?
  • Considered authentication needs?
  • Planned rate limiting?
  • Documentation approach defined?

❌ Anti-Patterns

DON'T:

  • Default to REST for everything
  • Use verbs in REST endpoints (/getUsers)
  • Return inconsistent response formats
  • Expose internal errors to clients
  • Skip rate limiting

DO:

  • Choose API style based on context
  • Ask about client requirements
  • Document thoroughly
  • Use appropriate status codes

Script

Script Purpose Command
scripts/api_validator.py Local heuristic source scan (not schema validation) python3 skills/api-patterns/scripts/api_validator.py <project_path>

When to Use

Use when defining a new endpoint contract, selecting REST/GraphQL/tRPC for known consumers, or changing pagination, errors, authentication or compatibility behavior. For a bug inside an existing contract, preserve that contract unless the task authorizes a change.

Inputs and procedure

Record consumers and deployed versions, expected payload size, access rules, compatibility obligations and one concrete operation. Read the relevant files in the map, compare the realistic choices, then specify request/response examples and rejection cases. Types shared at build time do not ensure that independently deployed clients remain compatible.

Worked example

Input: a public order list changes while clients page through it. Choose a bounded page size and cursor over a stable (created_at, id) order. Define the next-cursor format, authorization filter and behavior for a removed record or invalid cursor. Test two equal timestamps and an insertion between pages. Expected: no duplicate IDs within the promised snapshot semantics; document whether newly inserted rows can appear.

Limitations

  • The Python helper scans at most 15 matching files using regular expressions and shallow JSON/YAML checks. Its output is a triage hint, not OpenAPI validation, an authorization audit or deployment approval.
  • GraphQL query shape, tRPC inference and HTTP method names do not enforce resource authorization or backwards compatibility.
  • Rate limiting cannot alone prevent all resource exhaustion; size, concurrency, time and provider-cost bounds depend on the operation.
  • Perform security checks only against authorized local/test targets with isolated accounts and a defined scope.
자주 묻는 질문

API란 무엇인가요?

API는 식당의 메뉴와 같습니다. 어떤 요리(정보 또는 작업)가 있고 어떻게 주문하는지 알려 주며, 주방(프로그램)이 어떻게 작동하는지는 알 필요가 없습니다.

REST, GraphQL, tRPC 중 무엇을 골라야 하나요?

각각 장점이 있습니다. REST는 흔하고 단순하며, GraphQL은 특정 데이터를 가져오는 데 유연하고, tRPC는 타입 안전성이 필요한 TypeScript 프로젝트에 좋습니다.

API 버전 관리가 왜 중요한가요?

버전 관리는 API의 미래 변경이 이미 사용 중인 프로그램을 깨뜨리지 않도록 보장합니다. 앱의 새 버전을 내놓으면서도 예전 기능을 망가뜨리지 않는 것과 같습니다.

상세 정보

작성자의 원본 설명

API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#3776
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬