milad-ahmd/agent-skills/api-to-sdk

Claude Code and agent skill by milad-ahmd/agent-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Generates a clean, typed, idiomatic client SDK (TypeScript, Python, Go, or Dart) from an OpenAPI/Swagger spec, Postman collection, or existing backend routes, with auth, errors, retries, pagination, docs, and tests. Use when the user asks to generate an API client, SDK, or typed fetch layer, or to wrap a REST API.

Install

npx vskill@latest install milad-ahmd/agent-skills/api-to-sdk

SKILL.md

The same SKILL.md was published earlier as milad-ahmd/agent-skills/api-to-sdk.

API to SDK

A client SDK that developers enjoy using, not 10,000 lines of generated noise.

1. Find the source of truth

In priority order: an OpenAPI 3.x/Swagger file (openapi.yaml, swagger.json, a /docs-json endpoint) → a Postman collection → the backend route definitions in the repo (Express, NestJS, FastAPI, Django, Go handlers) → the docs the user provides. Validate the spec and list any problems you find (missing operationIds, untyped responses).

2. Choose the approach

  • A generator exists and fits (openapi-typescript + openapi-fetch, orval, openapi-python-client, oapi-codegen): use it, then add a thin hand-written ergonomic layer on top.
  • Small API (≤ 30 endpoints) or no spec: hand-write a small client.
  • Match the language, HTTP library and style already in the project (fetch/axios/ky, httpx/requests, dio).

3. SDK design

ts
const client = new AcmeClient({ apiKey, baseUrl, timeoutMs: 10_000, maxRetries: 2 });
const user = await client.users.get("u_123"); // resource-grouped methods
for await (const order of client.orders.list({ status: "paid" })) { ... } // auto-pagination
  • Types for every request and response model, with enums as unions or literal types, and dates documented.
  • Auth: API key, bearer token or OAuth token provider. Never log the credentials.
  • Errors: a typed error hierarchy (ApiError carrying status, code, requestId, body, with NotFoundError, RateLimitError...).
  • Retries with exponential backoff and jitter, but only for idempotent methods and 429/5xx responses. Respect Retry-After.
  • Timeouts, cancellation (AbortSignal, context) and a configurable base URL and headers.
  • Pagination helpers (cursor or page) exposed as async iterators.
  • Zero or minimal runtime dependencies.

4. Deliver

  • The SDK source, a README with install, auth, examples for 3–5 core operations, error handling and pagination, plus JSDoc or docstrings taken from the spec descriptions.
  • Tests with a mocked HTTP layer (msw, respx, httptest) covering success, error mapping, retries and pagination.
  • If the spec changes often, a regenerate script (npm run generate:sdk).

Rules

  • Don't invent endpoints or fields that aren't in the spec or code. Mark any gaps.
  • Keep generated code separate from the hand-written layer (for example src/generated/) so it can be regenerated safely.
  • Run the type-check and tests before reporting that the work is done.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
5
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/milad-ahmd/agent-skills/api-to-sdk/badge)](https://verified-skill.com/skills/milad-ahmd/agent-skills/api-to-sdk)

Something wrong with this skill or its page? Tell us.