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".
Best use case
generating-api-sdks is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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".
Teams using generating-api-sdks should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/generating-api-sdks/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How generating-api-sdks Compares
| Feature / Agent | generating-api-sdks | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# 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.0Related Skills
generating-unit-tests
Test automatically generate comprehensive unit tests from source code covering happy paths, edge cases, and error conditions. Use when creating test coverage for functions, classes, or modules. Trigger with phrases like "generate unit tests", "create tests for", or "add test coverage".
generating-test-reports
Generate comprehensive test reports with metrics, coverage, and visualizations. Use when performing specialized testing. Trigger with phrases like "generate test report", "create test documentation", or "show test metrics".
generating-test-doubles
Generate mocks, stubs, spies, and fakes for dependency isolation. Use when creating mocks, stubs, or test isolation fixtures. Trigger with phrases like "generate mocks", "create test doubles", or "setup stubs".
generating-test-data
Generate realistic test data including edge cases and boundary conditions. Use when creating realistic fixtures or edge case test data. Trigger with phrases like "generate test data", "create fixtures", or "setup test database".
generating-security-audit-reports
Generate comprehensive security audit reports for applications and systems. Use when you need to assess security posture, identify vulnerabilities, evaluate compliance status, or create formal security documentation. Trigger with phrases like "create security audit report", "generate security assessment", "audit security posture", or "PCI-DSS compliance report".
generating-compliance-reports
Generate comprehensive compliance reports for security standards. Use when creating compliance documentation. Trigger with 'generate compliance report', 'compliance status', or 'audit compliance'.
generating-conventional-commits
Execute generates conventional commit messages using AI. It analyzes code changes and suggests a commit message adhering to the conventional commits specification. Use this skill when you need help writing clear, standardized commit messages, especially a... Use when managing version control. Trigger with phrases like 'commit', 'branch', or 'git'.
generating-infrastructure-as-code
Execute use when generating infrastructure as code configurations. Trigger with phrases like "create Terraform config", "generate CloudFormation template", "write Pulumi code", or "IaC for AWS/GCP/Azure". Produces production-ready code for Terraform, CloudFormation, Pulumi, ARM templates, and CDK across multiple cloud providers.
generating-helm-charts
Execute use when generating Helm charts for Kubernetes applications. Trigger with phrases like "create Helm chart", "generate chart for app", "package Kubernetes deployment", or "helm template". Produces production-ready charts with Chart.yaml, values.yaml, templates, and best practices for multi-environment deployments.
generating-smart-commits
Execute use when generating conventional commit messages from staged git changes. Trigger with phrases like "create commit message", "generate smart commit", "/commit-smart", or "/gc". Automatically analyzes changes to determine commit type (feat, fix, docs), identifies breaking changes, and formats according to conventional commit standards.
generating-docker-compose-files
Execute use when you need to work with Docker Compose. This skill provides Docker Compose file generation with comprehensive guidance and automation. Trigger with phrases like "generate docker-compose", "create compose file", or "configure multi-container app".
generating-stored-procedures
Use when you need to generate, validate, or deploy stored procedures for PostgreSQL, MySQL, or SQL Server. Creates database functions, triggers, and procedures with proper error handling and transaction management. Trigger with phrases like "generate stored procedure", "create database function", "write SQL procedure", "add trigger to table", or "create CRUD procedures".