generating-typescript-types-from-apis
Generates TypeScript interfaces from API responses or OpenAPI schemas. Use when the user asks about typing API responses, creating interfaces from JSON, parsing Swagger/OpenAPI, or keeping types in sync with backend.
npx skills add majiayu000/claude-skill-registry --skill api-typescript-generator-wesleysmits-agent-skills-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API Response → TypeScript Types ## When to use this skill - User asks to type an API response - User has JSON and needs TypeScript interfaces - User mentions OpenAPI or Swagger schemas - User wants to generate types from endpoints - User asks about keeping frontend/backend types in sync ## Workflow - [ ] Identify API source (JSON response, OpenAPI, endpoint) - [ ] Parse response structure - [ ] Generate TypeScript interfaces - [ ] Handle nested objects and arrays - [ ] Add JSDoc comments - [ ] Export types to appropriate location ## Instructions ### Step 1: Identify Source Type | Source | Approach | | --------------- | --------------------- | | JSON response | Parse and infer types | | OpenAPI/Swagger | Use generator tool | | GraphQL | Use codegen | | Live endpoint | Fetch and parse | ### Step 2: Parse JSON Response **Sample API response:** ```json { "id": 123, "name": "John Doe", "email": "john@example.com", "isActive": true, "roles": ["admin", "user"], "profile": { "avatar": "https://example.com/avatar.jpg", "bio": null, "socialLinks": [ { "platform": "twitter", "url": "https://twitter.com/john" } ] }, "createdAt": "2026-01-18T10:00:00Z", "metadata": {} } ``` **Generated TypeSc
- When to use this skill
- Workflow
- Instructions
- Step 1: Identify Source Type
- Step 2: Parse JSON Response
- Step 3: Type Inference Rules
- Step 4: Handle Arrays
- Step 5: Handle Optional Fields
- Step 6: API Response Wrappers
- Step 7: OpenAPI/Swagger Generation
- Step 8: Fetch and Generate Script
- Step 9: Keep Types in Sync
- Output Location
- Validation
npm install -D openapi-typescript From URL npx openapi-typescript https://api.example.com/openapi.json -o types/api.ts From local file npx openapi-typescript ./openapi.yaml -o types/api.ts Watch mode npx openapi-typescript ./openapi.yaml -o types/api.ts --watch npm install openapi-fetch git add types/api.ts Validate generated types
What does the generating-typescript-types-from-apis skill do?
Generates TypeScript interfaces from API responses or OpenAPI schemas. Use when the user asks about typing API responses, creating interfaces from JSON, parsing Swagger/OpenAPI, or keeping types in sync with backend.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-typescript-generator-wesleysmits-agent-skills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
