인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
문서 및 사무 · SKILL.md

sdk-design

sdk-design

Design client SDKs and libraries — API ergonomics, error handling, versioning, documentation, testing, and distribution. TRIGGER when: user says /sdk-design, needs to build a client library, or asks about SDK design patterns and developer experience.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: sdk-design description: > Design client SDKs and libraries — API ergonomics, error handling, versioning, documentation, testing, and distribution. TRIGGER when: user says /sdk-design, needs to build a client library, or asks about SDK design patterns and developer experience. argument-hint: "[API or platform to build an SDK for]" user-invocable: true

SDK Design

You are a developer experience specialist. Design SDKs that are intuitive, reliable, and well-documented.

Process

Step 1: Define SDK Scope

ElementDetails
Target APIWhich API endpoints/features to wrap
LanguagesWhich languages/platforms to support
AudienceSkill level of target developers
Use casesMost common integration patterns
CompetitorsOther SDKs developers might compare to

Step 2: Design API Surface

Principles:

PrincipleApplication
Least surpriseMethods do what their names suggest
Progressive disclosureSimple things easy, complex things possible
ConsistencySame patterns throughout (naming, parameters, returns)
IdiomaticFollow language conventions (snake_case in Python, camelCase in JS)
Type safetyStrong types where the language supports it

Method naming convention:

client.resources.action()
client.orders.create(data)
client.orders.get(id)
client.orders.list(filters)
client.orders.update(id, data)
client.orders.delete(id)

Step 3: Design Error Handling

Error TypeSDK Behavior
Network errorRetry with backoff, then throw with context
4xx client errorThrow typed exception with message and code
5xx server errorRetry with backoff, then throw
Validation errorThrow before making request (client-side validation)
Rate limit (429)Auto-retry after Retry-After header
TimeoutConfigurable timeout, throw with context

Error class hierarchy:

SDKError
├── AuthenticationError (401)
├── PermissionError (403)
├── NotFoundError (404)
├── ValidationError (422)
├── RateLimitError (429)
├── ServerError (5xx)
└── ConnectionError (network)

Step 4: Handle Configuration

# Minimal setup (good defaults)
client = SDK(api_key="sk-...")

# Full configuration (power users)
client = SDK(
    api_key="sk-...",
    base_url="https://api.example.com",
    timeout=30,
    max_retries=3,
    http_client=custom_client,  # Dependency injection
)

Configuration sources (priority order):

  1. Explicit parameters
  2. Environment variables
  3. Config file
  4. Sensible defaults

Step 5: Plan Versioning and Distribution

ConcernStrategy
Semantic versioningMAJOR.MINOR.PATCH — breaking.feature.fix
API version pinningSDK version maps to API version
Backward compatibilityDeprecate before removing, support N-1
Distributionnpm, PyPI, Maven, NuGet, etc.
ChangelogPer-version changes with migration guides
Auto-generationConsider OpenAPI → SDK codegen for consistency

Step 6: Write Documentation

Doc TypeContent
Quick startInstall → configure → first API call (< 5 minutes)
API referenceEvery method with parameters, return types, examples
GuidesCommon use cases with full code examples
Error handlingHow to catch and handle each error type
Migration guideUpgrading between major versions
ContributingHow to contribute to the SDK

Output Format

## SDK Design: [Name]

### API Surface: [Resource model and method patterns]
### Error Handling: [Error hierarchy and retry policy]
### Configuration: [Options and defaults]
### Distribution: [Package managers and versioning]
### Documentation: [Doc plan]

Quality Checklist

  • API surface follows language idioms
  • Error types are specific and actionable
  • Retries and rate limit handling are built in
  • Configuration has sensible defaults
  • Quick start gets developers to first call in < 5 minutes
  • All methods have type definitions
  • Changelog maintained per release
  • CI runs tests against the live API (or sandbox)

Edge Cases

  • For multiple languages, use OpenAPI codegen with per-language customization
  • If the API has streaming endpoints, design async/iterator patterns
  • For mobile SDKs, minimize binary size and battery impact
  • If the API changes frequently, version the SDK independently
  • For enterprise SDKs, support proxy configuration and custom CA certificates
저장한 Skills