skills/openapi-typescript-sdk-generator/SKILL.md
Generate a production TypeScript SDK from an OpenAPI 3.0/3.1 spec (URL or local file), with human-friendly method names, interactive confirmation, and deterministic output. Use when the user wants a type-safe, fetch-based SDK or a drop-in client. Do not use for streaming/SSE/WebSockets or interactive OAuth flows.
npx skillsauth add timbenniks/timbenniks-agent-skills openapi-typescript-sdk-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a production-quality TypeScript SDK from an OpenAPI specification. Behave like a real SDK generator, not a thin OpenAPI wrapper.
If the user provides JSON, treat it as prefilled answers. Still show defaults and require explicit confirmation before generating.
Example prefill:
{
"openapi_url": "https://api.example.com/openapi.yaml",
"openapi_path": "C:/specs/openapi.yaml",
"output_mode": "standalone_package | folder_only",
"output_path": "sdk",
"package_name": "@example/api-sdk",
"client_name": "ExampleClient",
"runtime_target": "node_and_browser",
"node_version": "22",
"auth_method": "bearer"
}
Either openapi_url or openapi_path must be provided or collected.
Before asking any questions, the agent must:
info.title → for package/client naminginfo.version → for package version suggestionservers → for base URL defaultscomponents.securitySchemes → for auth method defaultssecurity (global and per-operation) → for auth method analysisDo not generate code until the user explicitly confirms.
Ask these questions in a single block and show defaults proposed from the OpenAPI spec analysis.
SDK identity
info.title (sanitized, lowercased, kebab-case), or openapi-sdk if unavailable
Example: "Pet Store API" → @pet-store/api-sdk or pet-store-api-sdkinfo.title (sanitized, PascalCase + "Client"), or ApiClient if unavailable
Example: "Pet Store API" → PetStoreClientOutput
folder_only or standalone_packagefolder_onlysdk/Spec source
Base URL
serversNaming style
listPlants, getPlant)plantsList, plantsGet)Runtime target
node_only, browser_only, or node_and_browsernode_and_browser22Primary authentication method
security and components.securitySchemes to propose the most common/primary auth method, or none if none exist
Integration tests
Before generation:
sdk-decisions.md.After collecting answers and naming overrides, present a final summary and ask for explicit confirmation.
Example:
Here is what I am going to generate:
openapi-sdkApiClientfolder_onlysdk/https://api.example.comReply with:
confirm to proceedDo not generate code until the user confirms.
After confirmation, write:
sdk-decisions.md
Record all final decisions and whether each one was explicit or default.
Example:
- package_name: openapi-sdk (default, confirmed)
- client_name: ApiClient (default, confirmed)
- output_mode: folder_only (explicit)
- output_path: sdk/ (default, confirmed)
- naming_style: verb-first (default, confirmed)
- runtime_target: node_and_browser (default, confirmed)
- node_version: 22 (default, confirmed)
- integration_tests: false (default, confirmed)
Generate a minimal SDK folder suitable for copying into an existing codebase.
sdk/
├── index.ts
├── client.ts
├── operations.ts
├── errors.ts
├── types/
├── utils/
├── openapi-report.md
└── sdk-decisions.md
Generate a full, publishable SDK project.
<package>/
├── package.json
├── tsconfig.json
├── tsdown.config.ts
├── README.md
├── src/
│ ├── index.ts
│ ├── client.ts
│ ├── operations.ts
│ ├── errors.ts
│ ├── types/
│ └── utils/
├── examples/
├── tests/
├── openapi-report.md
└── sdk-decisions.md
Do not use raw OpenAPI operationId values.
Derive names deterministically from context.
/v1 or /api.Examples:
/plants → plants/plants/{id}/events → primary plants, secondary events| Method | Path shape | Action | | ------ | ---------- | ------ | | GET | collection | list | | GET | item | get | | POST | collection | create | | PUT | item | update | | PATCH | item | update | | DELETE | item | remove |
Verb-first:
listPlantsgetPlantupdatePlantremovePlantlistPlantEventscreatePlantEventResource-first:
plantsListplantsGetplantEventsListgetPlant over getPlantspeople → person, children → child)getPlantById, getPlantBySlug)__get, __post)openapi-report.mdValidate the spec and tolerate non-blocking issues.
Generate:
openapi-report.md
Include:
operationId (if present)fetchGenerate a typed ApiError with:
Throw ApiError for all non-2xx responses, except 304 handled by cache.
Retry-AfterIf enabled:
If disabled:
Each operation exports a flat async function:
listPlants(params, options?): Promise<Plant[]>
Options allow:
sdk-decisions.mdOutput is correct only if:
openapi-report.md and sdk-decisions.md existThe agent must analyze the OpenAPI spec and propose intelligent defaults:
info.title (sanitized, kebab-case), fallback to openapi-sdkinfo.title (sanitized, PascalCase + "Client"), fallback to ApiClientservers array, or empty string with warning if nonesecurity and components.securitySchemes to propose primary method (prefer: Bearer > API Key > OAuth2 > Basic > None)Always show the reasoning behind each proposed default based on the spec analysis.
tools
Audit an API surface (OpenAPI 3.0/3.1, GraphQL schema, or REST docs) for SDK readiness and developer experience. Use when asked to evaluate whether an API is SDK friendly, produce a readiness scorecard, list concrete refactors, describe "if we shipped an SDK today" pain points, or suggest OpenAPI fixes and x-* extensions to improve client generation.
tools
Generate a DevEx-grade PRD from messy intent or fuzzy goals. Use when asked to turn raw ideas into a structured PRD focused on developer experience (DX/DevEx), SDKs, APIs, CLIs, tooling, onboarding, or platform adoption; include problem framing, developer journey impact, non-goals, success metrics, API/SDK/docs implications, and a rollout/adoption plan.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------