dev-loop-api-client-generator
Use when the user asks to generate an API client or SDK from OpenAPI/Swagger, run openapi-generator or orval, create typed REST clients, or turn requests into…
от j4flmao★ 47 звёзд на GitHub
Установить dev-loop-api-client-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
API Client Generator
Purpose
Generate type-safe, idiomatic API client SDKs from OpenAPI/Swagger specifications, GraphQL schemas, or gRPC protobuf definitions. Automated client generation eliminates manual HTTP code, ensures type safety, and keeps clients synchronized with API changes.
Agent Protocol
Trigger
Exact user phrases: "generate API client", "OpenAPI client", "Swagger codegen", "API SDK generation", "client generator", "auto-generate client", "OpenAPI TypeScript", "openapi-generator", "NSwag", "kiota".
Input Context
- API specification format (OpenAPI 3.x, Swagger 2.0, GraphQL, gRPC protobuf)
- Target language/framework (TypeScript, C#, Python, Java, Go, Rust, Kotlin)
- HTTP client library (fetch, axios, HttpClient, httpx, reqwest)
- Authentication method (Bearer token, API key, OAuth2, mTLS, custom header)
- Existing API spec location (URL, file path, registry URL)
- Generation tool preferences (openapi-generator, NSwag, kiota, or custom)
- Customization needs (naming conventions, package structure, error handling)
Output Artifact
Generated API client with typed models, service methods, authentication, error handling, and generated code configuration.
Response Format
Spec: {path/url} ({OpenAPI 3.x|GraphQL|proto}) — validated: {yes/no}
Generator: {tool + version pin} -> {language}, output {dir}
Auth: {bearer|api key|oauth2} via {interceptor/middleware}
Errors: {typed error model}
Regenerate: `{command}` (CI step: {job})
Completion Criteria
- API spec validated and loaded
- Generation tool selected and configured
- Client code generated in target language
- Models/entities typed according to spec schemas
- Service methods for all API endpoints
- Authentication configured (bearer token, API key, OAuth2)
- Error handling and response parsing
- Request/response interceptors or middleware configured
- Package/namespace structure defined
- Generation config committed (can regenerate)
- Tests for generated client
- CI regeneration step configured
Max Response Length
250 lines.
Framework/Methodology
Client Generation Decision Tree
What is the API format?
├── OpenAPI 3.x (REST) → openapi-generator, NSwag, kiota
│ ├── TypeScript → openapi-generator (typescript-fetch, typescript-axios)
│ ├── C# → NSwag, kiota, openapi-generator (csharp)
│ ├── Python → openapi-generator (python), kiota
│ ├── Java → openapi-generator (java, spring), kiota
│ ├── Go → openapi-generator (go), oapi-codegen
│ └── Rust → openapi-generator (rust), octorust, paperclip
├── GraphQL → graphql-codegen
│ ├── TypeScript → @graphql-codegen/typescript
│ └── Any → graphql-client (Apollo, urql, Relay)
└── gRPC → protoc + language plugin
├── Go → protoc-gen-go-grpc
├── C# → Grpc.Tools
├── Python → grpcio-tools
└── Rust → tonic-build
Generation Workflow
API Spec (openapi.yaml / schema.graphql / .proto)
↓
Generator Config (language, naming, auth, output dir)
↓
Code Generation (openapi-generator CLI, graphql-codegen, protoc)
↓
Generated Artifacts (models, API clients, enums, interceptors)
↓
Integration (install as package, commit generated code, or build step)
↓
CI Validation (diff check, spec change triggers regeneration)
Workflow
Step 1: Configure OpenAPI Generator
# openapi-generator-config.yaml
generatorName: typescript-fetch
inputSpec: ./api/openapi.yaml
outputDir: ./src/generated/api
additionalProperties:
npmName: "@myorg/api-client"
npmVersion: "1.0.0"
supportsES6: true
withInterfaces: true
useSingleRequestParameter: true
modelPropertyNaming: camelCase
enumPropertyNaming: UPPERCASE
ensureUniqueParams: true
allowUnicodeIdentifiers: false
prependFormOrBodyParameters: true
Step 2: Generate Client
# OpenAPI Generator CLI
npx @openapitools/openapi-generator-cli generate \
-g typescript-fetch \
-i ./api/openapi.yaml \
-o ./src/generated/api \
-c openapi-generator-config.yaml
# NSwag (C#)
nswag openapi2csclient /input:openapi.yaml \
/classname:MyApiClient \
/namespace:MyApp.Api.Client \
/output:ApiClient.cs
# Kiota (Microsoft)
kiota generate -l typescript \
-d openapi.yaml \
-o ./src/generated/api \
-n @myorg/api-client
Step 3: Wrap Generated Client
// src/api/client.ts - Typed wrapper around generated client
import { Configuration, DefaultApi, type Item, type CreateItemRequest } from '../generated/api';
export interface ApiClientConfig {
baseUrl: string;
tokenProvider: () => Promise<string | null>;
onError?: (error: Error) => void;
}
export class ApiClient {
private client: DefaultApi;
constructor(private config: ApiClientConfig) {
const apiConfig = new Configuration({
basePath: config.baseUrl,
accessToken: async () => (await config.tokenProvider()) ?? '',
middleware: [{
post: async (context): Promise<Response | void> => {
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/api-client-examples.md
- references/api-client-generator-advanced.md
- references/api-client-generator-customization.md
- references/api-client-generator-fundamentals.md
- references/client-test-patterns.md
- references/client-test-strategies.md
- references/codegen-comparison.md
FAQ
Что делает скилл dev-loop-api-client-generator?
Use when the user asks to generate an API client or SDK from OpenAPI/Swagger, run openapi-generator or orval, create typed REST clients, or turn requests into curl commands. Produces generated clients with auth, retries and tests. Not for designing the API itself (use backend-api-design) or writing the OpenAPI spec (use backend-openapi-documentation).
Как установить скилл dev-loop-api-client-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dev-loop-api-client-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…