generating-api-sdks
Installation
SKILL.md
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
- Read and validate the OpenAPI specification using Read, checking for complete schema definitions, proper
$refusage, and response type coverage across all endpoints. - Extract all operation IDs, request/response models, and authentication schemes from the specification to build the SDK method inventory.
- Generate typed model classes for every schema component, including nested objects, enums, and discriminated unions with proper nullability annotations.
- Create a client class with methods for each API operation, mapping operation IDs to idiomatic method names (e.g.,
listUsers,get_user,CreateUser).
Related skills