designing-sdks

Design client SDKs with retry logic, typed errors, pagination, and multi-language support.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/masermediagroup-stack/maser-media --skill designing-sdks-masermediagroup-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: designing-sdks
Source: https://github.com/masermediagroup-stack/maser-media/tree/main/.cursor/skills/community/ai-design-components/skills/designing-sdks
Command: npx skills add https://github.com/masermediagroup-stack/maser-media --skill designing-sdks-masermediagroup-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a client library for an API involves many subtle decisions—retry behavior, error hierarchies, pagination, authentication, and versioning—that are easy to get wrong and painful to fix after release. This Skill provides proven patterns and working code so your SDK delivers a consistent developer experience from day one. ## Core Features & Use Cases - Architecture Patterns: Choose between resource-based (Stripe-style) and command-based (AWS SDK v3) organization with a decision framework based on API surface size. - Resilience Built In: Implement exponential backoff with jitter, rate limit handling via Retry-After headers, idempotency keys, and circuit breakers. - Multi-Language Guidance: Get idiomatic patterns for TypeScript (async-only), Python (dual sync/async), and Go (sync with context), including pagination via async iterators and channels. - Use Case: You are wrapping your company's REST API for external developers. Use this Skill to scaffold a TypeScript SDK with typed errors, automatic retries, cursor-based pagination, and streaming support, then mirror it in Python and Go. ## Quick Start Ask the agent to design a TypeScript SDK client for your REST API with retry logic, typed error handling, and automatic pagination.

Frequently Asked Questions about designing-sdks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design an SDK for a REST API?▼

Organize the SDK as a client containing resource classes with CRUD methods, following the Stripe-style resource-based pattern for APIs under 100 methods. Add a central request method handling authentication, retries with exponential backoff, and typed error conversion.

Resource-based vs command-based SDK architecture, which should I use?▼

Use resource-based organization (like Stripe) for APIs under 100 methods where developer experience matters most. Choose command-based organization (like AWS SDK v3) for large APIs where bundle size and tree-shaking are critical, such as browser SDKs.

How do I implement retry logic with exponential backoff in an SDK?▼

Retry only transient errors: 5xx statuses, 429 rate limits, and network timeouts. Calculate delay as base delay times 2 to the power of the attempt number, capped at a maximum, plus random jitter to prevent thundering herd.

Should my Python SDK support both sync and async clients?▼

Yes, provide both a synchronous client and an async client so users can choose based on their architecture. Python developers expect dual support, with async iterators for pagination in the async variant.

How do I handle API rate limits in a client library?▼

Respect the Retry-After header on 429 responses and raise a RateLimitError exposing the retry delay. Optionally track rate limit budget from response headers and pause requests proactively when the budget is exhausted.

When should I use idempotency keys in API requests?▼

Attach idempotency keys to mutating operations (POST, PATCH, PUT) so retries cannot create duplicate resources. Generate a UUID automatically or let callers supply their own key for operations like payment charges.