Tooluck logoTooluck
SKILL.md

openapi-to-typescript

Agent skill fromsoftaworks/agent-toolkit

Converts OpenAPI 3.0 JSON/YAML to TypeScript interfaces and type guards. This skill should be used when the user asks to generate types from OpenAPI, convert schema to TS, create API interfaces, or generate TypeScript types from an API specification.

How to install openapi-to-typescript

install openapi-to-typescript
# install the agent-toolkit pack with the skills CLI
npx skills add softaworks/agent-toolkit

# or add only this skill to Claude Code: copy the folder

skills/openapi-to-typescript/

# into

~/.claude/skills/openapi-to-typescript/ (all projects)

.claude/skills/openapi-to-typescript/ (one project)

skills/openapi-to-typescript/SKILL.md

MITFull file
1# OpenAPI to TypeScript
2
3Converts OpenAPI 3.0 specifications to TypeScript interfaces and type guards.
4
5**Input:** OpenAPI file (JSON or YAML)
6**Output:** TypeScript file with interfaces and type guards
7
8## When to Use
9
10- "generate types from openapi"
11- "convert openapi to typescript"
12- "create API interfaces"
13- "generate types from spec"
14
15## Workflow
16
171. Request the OpenAPI file path (if not provided)
182. Read and validate the file (must be OpenAPI 3.0.x)
193. Extract schemas from `components/schemas`
204. Extract endpoints from `paths` (request/response types)
215. Generate TypeScript (interfaces + type guards)
226. Ask where to save (default: `types/api.ts` in current directory)
237. Write the file
24
25## OpenAPI Validation
26
27Check before processing:
28
29```
30- Field "openapi" must exist and start with "3.0"
31- Field "paths" must exist
32- Field "components.schemas" must exist (if there are types)
33```
34
35If invalid, report the error and stop.
36
37## Type Mapping
38
39### Primitives
40
41| OpenAPI | TypeScript |
42|-------------|--------------|
43| `string` | `string` |
44| `number` | `number` |
45| `integer` | `number` |
46| `boolean` | `boolean` |
47| `null` | `null` |
48
49### Format Modifiers
50
51| Format | TypeScript |
52|---------------|-------------------------|
53| `uuid` | `string` (comment UUID) |
54| `date` | `string` (comment date) |
55| `date-time` | `string` (comment ISO) |
56| `email` | `string` (comment email)|
57…

Excerpt shown under the repository's MIT license.

More skills in agent-toolkit

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

pbakaus /

impeccable
108k

The design vocabulary for your coding agent. Steer with polish and bolder, review with critique and audit, catch AI slop before it ships.

2 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates