apirev-sdklisted
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