api-to-sdk
Skill5 starsChanged 15 days agoMITView on GitHub
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.
In this repository56 other files it gives its agents.
- docs/llms.txtllms.txt
- a11y-fixerSkill
- ad-copy-generatorSkill
- agent-guardrailsSkill
- agent-memory-keeperSkill
- ai-slop-detectorSkill
- app-store-optimizerSkill
- architecture-doctorSkill
- brand-voice-guideSkill
- bug-detectiveSkill
- changelog-from-gitSkill
- codebase-explainerSkill
- codebase-time-machineSkill
- commit-craftSkill
- competitor-spySkill
- content-repurposerSkill
- cost-cutterSkill
- demo-recorderSkill
- dependency-doctorSkill
- dockerize-anythingSkill
- durable-agent-workflowsSkill
- e2e-flow-testerSkill
- email-campaign-writerSkill
- env-secrets-guardSkill
- gh-actions-auditorSkill
- hook-generatorSkill
- incident-commanderSkill
- influencer-outreachSkill
- instagram-growth-managerSkill
- landing-page-roasterSkill
- launch-post-writerSkill
- meeting-notes-to-ticketsSkill
- merge-conflict-resolverSkill
- migration-wizardSkill
- plan-grillerSkill
- prompt-injection-scannerSkill
- pr-reviewer-proSkill
- readme-glow-upSkill
- roast-my-githubSkill
- screenshot-to-componentSkill
- seo-blog-writerSkill
- skill-creator-proSkill
- skill-finderSkill
- skills-doctorSkill
- social-analytics-reporterSkill
- social-media-calendarSkill
- social-media-managerSkill
- sql-optimizerSkill
- startup-idea-validatorSkill
- tdd-loopSkill
- terse-modeSkill
- test-gap-hunterSkill
- tiktok-viral-creatorSkill
- ui-tasteSkill
- youtube-script-writerSkill
- youtube-seo-optimizerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 41
If the spec changes often, a regenerate script (npm run generate:sdk).
- Distinctive: line 45
Don't invent endpoints or fields that aren't in the spec or code.
- Very specific: line 46
Keep generated code separate from the hand-written layer (for example src/generated/) so it can be regenerated safely.
- Distinctive: line 47
Run the type-check and tests before reporting that the work is done.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
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 (
ApiErrorcarryingstatus,code,requestId,body, withNotFoundError,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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

