← ClaudeAtlas

apirev-sdklisted

Generates zero-dependency typed clients from an OpenAPI JSON spec: TypeScript (interfaces for every schema and an async client class on fetch) and Python (TypedDict models and a client on urllib.request with an ApiError carrying status and body). Base URL and auth are passed in by the caller. Use when the user says "generate an SDK", "make a typed client", "TypeScript client for this API", "Python client for this spec", "give me types for these endpoints", "stop hand-writing fetch calls", or after apirev-infer or apirev-document.
vivekbhange-hub/api-reverse-skill · ★ 0 · API & Backend · score 75
Install: claude install-skill vivekbhange-hub/api-reverse-skill
# apirev-sdk: typed clients with no dependencies Hand-written fetch calls drift from the API. This skill generates two small clients from the spec, each a single file the user can drop into a project: no runtime packages, no code generator to install, and types that match the samples the spec was inferred from. ## Inputs - `api/openapi.json` (inferred, ideally documented by `apirev-document` first so method names read well). Any OpenAPI 3.0 JSON works, including `$ref` to `components/schemas`. - Which languages the user wants: `ts`, `python` or `all` (default). - Commands below say `python3`; on Windows use `python` (or `py -3`). ## Outputs - `api/sdk/ts/client.ts`: interfaces, `ClientOptions`, `ApiError`, and `<Title>Client`. - `api/sdk/python/client.py`: TypedDict models, `ApiError`, and `<Title>Client`. ## Steps 1. **Generate.** ``` python3 "${CLAUDE_SKILL_DIR}/gen_sdk.py" api/openapi.json --out api/sdk --lang all ``` The class name comes from `info.title` ("Pet Shelter API" -> `PetShelterAPIClient`). Method names come from `operationId` (camelCase in TS, snake_case in Python). 2. **Verify the Python client compiles and imports** (always do this; it takes a second): ``` python3 -c "import ast,sys; ast.parse(open('api/sdk/python/client.py',encoding='utf-8').read()); print('ok')" ``` For TypeScript, if the project already has `tsc`, run `npx tsc --noEmit api/sdk/ts/client.ts` (the client targets ES2020 + DOM lib for `fetch` and `URLSea