// Use when creating REST API clients, SDK wrappers, or HTTP service integrations. Generates type-safe client code with retry logic, error handling, rate limiting, and comprehensive tests. Triggered by requests to integrate external APIs, build SDK clients, or create service wrappers.
| name | api-client-generator |
| description | Use when creating REST API clients, SDK wrappers, or HTTP service integrations. Generates type-safe client code with retry logic, error handling, rate limiting, and comprehensive tests. Triggered by requests to integrate external APIs, build SDK clients, or create service wrappers. |
| maturity | stable |
| version | 2.0.0 |
Generates production-ready API clients with type safety, error handling, and testing.
When to use:
Announce: "I'm using the api-client-generator skill to create a type-safe API client"
Check for API documentation:
# Look for OpenAPI/Swagger spec
find . -name "*.yaml" -o -name "*.yml" | grep -E "(openapi|swagger)"
# Check for API docs
ls -la docs/api/ 2>/dev/null
If OpenAPI spec exists, use scripts/parse-openapi.sh to generate types.
Use the template generator:
scripts/generate-client.sh <service-name> <language>
This creates:
For each API endpoint:
Example from template:
async getUser(id: string): Promise<User> {
return this.request<User>({
method: 'GET',
path: `/users/${id}`,
retryable: true,
timeout: 5000
});
}
Use templates/integration-test.tpl to create tests:
templates/apply-template.sh integration-test.tpl > tests/integration.test.ts
scripts/generate-docs.sh > API_CLIENT.md
Issue: Rate limit errors
Issue: Type mismatches
Issue: Network timeouts
scripts/parse-openapi.sh - Parse OpenAPI spec to TypeScript/Python typesscripts/generate-client.sh - Generate client boilerplatescripts/generate-docs.sh - Create markdown documentationtemplates/client-class.tpl - Base client class templatetemplates/integration-test.tpl - Integration test templatereference/best-practices.md - API client best practices