Compétences api-design-principles
📦

api-design-principles

Sûr

직관적이고 확장 가능한 API 설계

Également disponible depuis: wshobson

일관된 설계 원칙 없이 API를 구축하면 혼란스러운 인터페이스와 낮은 개발자 경험으로 이어집니다. 이 스킬은 검증된 REST 및 GraphQL 패턴을 제공하여 유지 관리가 쉽고 잘 문서화된 API를 만들 수 있게 해줍니다.

Prend en charge: Claude Codex Code(CC)
🥈 78 Argent
1

Télécharger le ZIP du skill

2

Importer dans Claude

Allez dans Paramètres → Capacités → Skills → Importer un skill

3

Activez et commencez à utiliser

Tester

Utilisation de "api-design-principles". Design endpoints for an e-commerce product catalog

Résultat attendu:

  • GET /api/v1/products - List products with pagination
  • GET /api/v1/products/{id} - Get product details
  • POST /api/v1/products - Create product (admin only)
  • PUT /api/v1/products/{id} - Replace product (admin only)
  • PATCH /api/v1/products/{id} - Update product fields (admin only)
  • DELETE /api/v1/products/{id} - Remove product (admin only)
  • GET /api/v1/products/{id}/reviews - List product reviews
  • GET /api/v1/categories/{id}/products - List products by category

Utilisation de "api-design-principles". What HTTP status codes for common scenarios?

Résultat attendu:

  • 200 OK - Successful GET, PUT, PATCH requests
  • 201 Created - Successful POST with resource creation
  • 204 No Content - Successful DELETE or empty response
  • 400 Bad Request - Malformed JSON or invalid syntax
  • 401 Unauthorized - Missing or expired authentication
  • 403 Forbidden - Valid auth but insufficient permissions
  • 404 Not Found - Resource does not exist
  • 409 Conflict - Resource conflict (e.g., duplicate key)
  • 422 Unprocessable Entity - Validation errors
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - Unexpected server failure

Audit de sécurité

Sûr
v1 • 2/24/2026

Static analysis flagged 201 patterns that are all false positives. The skill contains only documentation and educational content about API design. Markdown code blocks (backticks) were incorrectly identified as shell execution. Cryptographic references appear in security checklists, not actual implementations. URL and IP references are documentation examples for API endpoints. No executable code or security risks present.

6
Fichiers analysés
1,886
Lignes analysées
0
résultats
1
Total des audits
Aucun problème de sécurité trouvé
Audité par: claude

Score de qualité

55
Architecture
100
Maintenabilité
87
Contenu
50
Communauté
100
Sécurité
91
Conformité aux spécifications

Ce que vous pouvez construire

Greenfield API 설계

구현이 시작되기 전에 적절한 리소스 모델링, 엔드포인트 구조 및 문서화 표준을 사용하여 새로운 REST 또는 GraphQL API를 처음부터 설계하세요.

API 검토 및 리팩토링

설계 원칙에 대해 기존 API 엔드포인트를 평가하여 불일치를 식별하고, 명명 규칙을 개선하며, 마이그레이션 전략을 계획하세요.

팀 표준 문서화

팀 정렬을 위해 버전 관리, 오류 처리, 인증 패턴 및 응답 형식을 포함하는 조직 전체의 API 설계 가이드라인을 수립하세요.

Essayez ces prompts

기본 REST 엔드포인트 설계
I need to design REST endpoints for a blog system with authors, posts, and comments. Help me structure the URL hierarchy, HTTP methods, and response formats following REST best practices.
GraphQL 스키마 검토
Review my GraphQL schema for a user management system. Check for proper use of non-null types, interface implementations, and suggest improvements for query efficiency and avoid N+1 problems.
API 버전 관리 전략
My API has breaking changes coming. Compare URL path versioning, header versioning, and query parameter approaches for my use case. Include deprecation timeline recommendations.
오류 처리 설계
Design a consistent error response format for my REST API. Include field-level validation errors, error codes for programmatic handling, and appropriate HTTP status codes for common scenarios.

Bonnes pratiques

  • 리소스 컬렉션에는 복수 명사를 사용하고 URL 계층 구조를 얕게 유지하세요 (최대 2-3단계 중첩)
  • 문서화된 페이지 크기 제한과 함께 일관된 페이지네이션을 구현하고 응답에 전체 수량 메타데이터를 포함하세요
  • URL 경로 또는 헤더 버전 관리를 사용하여 시작부터 API를 버전 관리하고 이전 버전에 대한 명확한 폐기 정책을 유지하세요

Éviter

  • 리소스 명사에 대한 적절한 HTTP 메서드 대신 /createUser 또는 /getUserById과 같은 엔드포인트에서 동사 사용
  • 유사한 ���드포인트에서 다른 응답 형식 또는 필드 이름을 반환하여 클라이언트 기대치 위반
  • 리소스를 너무 긴밀하게 결합하는 /users/{id}/orders/{orderId}/items/{itemId}/reviews와 같은 깊게 중첩된 URL

Foire aux questions

새 API에 REST 또는 GraphQL을 사용해야 하나요?
명확한 리소스 ���계가 있고 강력한 캐싱이 필요하거나 간단한 CRUD 작업을 제공하는 경우 REST를 선택하세요. 클라이언트가 유연한 데이터 가져오기가 필요하고 복잡한 관계가 있거나 모바일 클라이언트가 요청을 최소화해야 하는 경우 GraphQL을 선택하세요.
기존 클라이언트를 중단하지 않고 API 버전 관리를 어떻게 처리하나요?
런칭 시 v1부터 버전 관리를 시작하세요. 주요 변경 사항의 경우 v1과 함께 v2를 만드세요. 폐기 타임라인을 문서화하세요 (일반적으로 6-12개��). 클라이언트에 향후 제거를 알리기 위해 sunset 헤더를 사용하세요. 충분한 통지 없이 버전을 제거하지 마세요.
대규모 데이터 세트에는 어떤 페이지네이션 접근 방식을 사용해야 하나요?
10만 개 미만의 레코드가 있는 간단한 사용 사례에는 오프셋 기반 페이지네이션 (page/page_size)을 사용하세요. 일관성이 중요한 대규모 데이터 세트 또는 실시간 데이터에는 커서 기반 페이지네이션을 사용하세요. 남용을 방지하기 위해 항상 최대 페이지 크기를 강제 적용하세요.
개발자가 실제로 사용할 수 있는 오류 응답을 어떻게 설계하나요?
기계가 읽을 수 있는 오류 코드, 사람이 읽�� 수 있는 메시지 및 선택적 필드 수준 세부 정보를 포함하세요. 모든 엔드포인트에서 일관된 구조를 사용하세요. API 참조에 모든 오류 코드를 문서화하세요. 필드별 메시지와 함께 유효성 검사 오류를 422로 반환하세요.
어떤 속도 제한 전략을 구현해야 하나요?
API 키 또는 IP당 분당 요청 수로 시작하세요. 속도 제한 헤더 (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)를 포함하세요. 초과 시 Retry-After 헤더와 함께 429 상태를 반환하세요. 인증 수준에 따라 계층화된 제한을 고려하세요.
API 설계에서 인증을 어떻게 처리하나요?
대부분의 API에는 Authorization 헤더의 Bearer 토큰 (JWT 또는 불투명)을 사용하세요. 서버 간 통신에는 API 키를 고려하세요. URL 매개변수에서 자격 증명을 받지 마세요. 토큰 새로고침 흐름을 명확하게 문서화하세요. 인증 실패에는 401을, 권한 부여 실패에는 403을 반환하세요.