ancoleman/ai-design-components/designing-sdks
Claude Code and agent skill by ancoleman/ai-design-components
- community
Checking that the SKILL.md file is still in the repository.
Design production-ready SDKs with retry logic, error handling, pagination, and multi-language support. Use when building client libraries for APIs or creating developer-facing SDK interfaces.
Install
npx vskill@latest install ancoleman/ai-design-components/designing-sdksSKILL.md
SDK Design
Design client libraries (SDKs) with excellent developer experience through intuitive APIs, robust error handling, automatic retries, and consistent patterns across programming languages.
When to Use This Skill
Use when building a client library for a REST API, creating internal service SDKs, implementing retry logic with exponential backoff, handling authentication patterns, creating typed error hierarchies, implementing pagination with async iterators, or designing streaming APIs for real-time data.
Core Architecture Patterns
Client → Resources → Methods
Organize SDK code hierarchically:
Resource-Based (Stripe style):
Use for APIs <100 methods. Prioritizes developer experience.
Command-Based (AWS SDK v3):
Use for APIs >100 methods. Prioritizes bundle size and tree-shaking.
For detailed architectural guidance, see references/architecture-patterns.md.
Language-Specific Patterns
TypeScript: Async-Only
All methods return Promises. Avoid callbacks.
Python: Dual Sync/Async
Provide both clients. Users choose based on architecture.
Go: Sync with Context
Use context.Context for timeout and cancellation.
Authentication
API Key (Most Common)
Store keys in environment variables, never hardcode.
OAuth Token Refresh
SDK automatically refreshes tokens before expiry.
Bearer Token Per-Request
Use for multi-tenant applications.
See references/authentication.md for OAuth flows, JWT handling, and credential providers.
Retry and Backoff
Exponential Backoff with Jitter
Retry Decision Matrix:
| Error Type | Retry? | Rationale | |
|---|---|---|---|
| 5xx, 429, Network Timeout | ✅ Yes | Transient errors | |
| 4xx, 401, 403, 404 | ❌ No | Client errors won't fix themselves |
Rate Limit Handling
Respect Retry-After header on 429 responses.
See references/retry-backoff.md for jitter strategies, circuit breakers, and idempotency keys.
Error Handling
Typed Error Hierarchy
Error Handling in Practice
Include request ID in all errors for debugging.
See references/error-handling.md for user-friendly messages, validation errors, and debugging support.
Pagination
Async Iterators (Recommended)
TypeScript:
Python:
SDK automatically fetches next page.
Implementation
Manual Pagination
Provide both automatic and manual options.
See references/pagination.md for cursor vs. offset pagination and Go channel patterns.
Streaming
Server-Sent Events
Idempotency Keys
Prevent duplicate operations during retries:
Server deduplicates requests by key.
Versioning
Semantic Versioning
1.0.0→1.1.0: New features (safe)1.1.0→2.0.0: Breaking changes (review)1.0.0→1.0.1: Bug fixes (safe)
Deprecation Warnings
API Version Pinning
See references/versioning.md for migration strategies.
Configuration Best Practices
Provide sensible defaults, require only apiKey.
Quick Reference Tables
Authentication Patterns
| Pattern | Use Case | |
|---|---|---|
| API Key | Service-to-service | |
| OAuth Refresh | User-based auth | |
| Bearer Per-Request | Multi-tenant |
Retry Strategies
| Strategy | Use Case | |
|---|---|---|
| Exponential Backoff | Default retry | |
| Rate Limit | 429 responses | |
| Max Retries | Avoid infinite loops (3-5) |
Pagination Options
| Pattern | Language | Use Case | |
|---|---|---|---|
| Async Iterator | TypeScript, Python | Automatic pagination | |
| Generator | Python | Sync pagination | |
| Channels | Go | Concurrent iteration | |
| Manual | All | Explicit control |
Reference Documentation
Architecture:
references/architecture-patterns.md- Resource vs. command organization
Core Patterns:
references/authentication.md- OAuth, token refresh, credential providersreferences/retry-backoff.md- Exponential backoff, jitter, circuit breakersreferences/error-handling.md- Error hierarchies, debugging supportreferences/pagination.md- Cursor vs. offset, async iteratorsreferences/versioning.md- SemVer, deprecation strategiesreferences/testing-sdks.md- Unit testing, mocking, integration tests
Code Examples
TypeScript:
examples/typescript/basic-client.ts- Simple async SDKexamples/typescript/advanced-client.ts- Retry, errors, streamingexamples/typescript/resource-based.ts- Stripe-style organization
Python:
examples/python/sync-client.py- Synchronous clientexamples/python/async-client.py- Async client with asyncioexamples/python/dual-client.py- Both sync and async
Go:
examples/go/basic-client.go- Simple Go clientexamples/go/context-client.go- Context patternsexamples/go/channel-pagination.go- Channel-based pagination
Best-in-Class SDK Examples
Study these production SDKs:
TypeScript/JavaScript:
- AWS SDK v3 (
@aws-sdk/client-*): Modular, tree-shakeable, middleware - Stripe Node (
stripe): Resource-based, typed errors, excellent DX - OpenAI Node (
openai): Streaming, async iterators, modern TypeScript
Python:
- Boto3 (
boto3): Resource vs. client patterns, paginators - Stripe Python (
stripe): Dual sync/async, context managers
Go:
- AWS SDK Go v2 (
github.com/aws/aws-sdk-go-v2): Context, middleware
Common Pitfalls
Avoid these mistakes:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 92 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/designing-sdks/SKILL.md
Popularity
- Repository stars
- 326
- Repository forks
- 51
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 5 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ancoleman/ai-design-components/designing-sdks)