generating-api-sdks
Generate client SDKs in multiple languages from OpenAPI specifications. Use when generating client libraries for API consumption. Trigger with phrases like "generate SDK", "create client library", or "build API SDK".
What this skill does
# Generating API SDKs
## Overview
Generate type-safe client SDKs in multiple languages (TypeScript, Python, Go, Java) from OpenAPI 3.0+ specifications. Produce idiomatic client libraries with authentication handling, automatic retries, pagination helpers, and comprehensive type definitions that mirror the API contract.
## Prerequisites
- OpenAPI 3.0+ specification file (YAML or JSON) with complete schema definitions
- Target language toolchain installed (Node.js/TypeScript, Python 3.10+, Go 1.21+, or Java 17+)
- OpenAPI Generator CLI or equivalent code generation tool
- Package registry credentials for publishing (npm, PyPI, Maven Central, pkg.go.dev)
- CI pipeline for automated SDK builds on spec changes
## Instructions
1. Read and validate the OpenAPI specification using Read, checking for complete schema definitions, proper `$ref` usage, and response type coverage across all endpoints.
2. Extract all operation IDs, request/response models, and authentication schemes from the specification to build the SDK method inventory.
3. Generate typed model classes for every schema component, including nested objects, enums, and discriminated unions with proper nullability annotations.
4. Create a client class with methods for each API operation, mapping operation IDs to idiomatic method names (e.g., `listUsers`, `get_user`, `CreateUser`).
5. Implement authentication handling with support for Bearer tokens, API keys (header and query), and OAuth2 client credentials flow, configurable at client instantiation.
6. Add automatic retry logic with exponential backoff for 429 and 5xx responses, with configurable max retries and backoff multiplier.
7. Build pagination helpers that abstract cursor-based and offset pagination into iterator/generator patterns native to each target language.
8. Generate comprehensive JSDoc/docstring/Javadoc comments from OpenAPI `description` and `summary` fields for full IDE IntelliSense support.
9. Create a test suite that validates SDK methods against a mock server running the OpenAPI spec, covering authentication, error handling, and pagination.
See `${CLAUDE_SKILL_DIR}/references/implementation.md` for the full implementation guide.
## Output
- `${CLAUDE_SKILL_DIR}/sdk/typescript/src/client.ts` - Main SDK client class with typed methods
- `${CLAUDE_SKILL_DIR}/sdk/typescript/src/models/` - TypeScript interfaces and type definitions
- `${CLAUDE_SKILL_DIR}/sdk/python/client.py` - Python SDK with dataclass models and async support
- `${CLAUDE_SKILL_DIR}/sdk/go/client.go` - Go SDK with struct types and context-based methods
- `${CLAUDE_SKILL_DIR}/sdk/*/README.md` - Per-language installation and usage documentation
- `${CLAUDE_SKILL_DIR}/sdk/*/tests/` - SDK test suites per language
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Schema generation failure | OpenAPI spec contains `$ref` cycles or missing component definitions | Run spec linting with `spectral` first; resolve circular references with `allOf` composition |
| Type mismatch | API response does not match generated model types at runtime | Add runtime response validation option; log schema drift warnings for API provider notification |
| Auth configuration error | SDK instantiated without required credentials for protected endpoints | Throw descriptive error at client construction time listing required auth parameters |
| Pagination exhaustion | Iterator consumes all pages without termination condition | Enforce maximum page count safety limit; detect empty result sets as termination signal |
| Rate limit handling | SDK retry logic conflicts with application-level retry logic | Expose `retryConfig` option to disable built-in retries; emit retry events for observability |
Refer to `${CLAUDE_SKILL_DIR}/references/errors.md` for comprehensive error patterns.
## Examples
**TypeScript SDK for payment API**: Generate a fully typed `PaymentsClient` with methods like `createCharge(amount, currency)` returning `Promise<Charge>`, automatic Bearer token injection, and paginated `listTransactions()` returning an async iterator.
**Python SDK with async support**: Produce both sync (`PaymentsClient`) and async (`AsyncPaymentsClient`) clients using `httpx`, with Pydantic models for request/response validation and `__aiter__` pagination support.
**Multi-language CI pipeline**: On OpenAPI spec change, automatically regenerate SDKs in all target languages, run tests against a mock server, bump semantic versions, and publish to respective package registries.
See `${CLAUDE_SKILL_DIR}/references/examples.md` for additional examples.
## Resources
- OpenAPI Generator: https://openapi-generator.tech/
- Speakeasy SDK generation: https://speakeasy.com/
- Microsoft Kiota for API client generation
- OpenAPI Specification 3.1: https://spec.openapis.org/oas/v3.1.0
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.