Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
Generates TypeScript interfaces from REST API responses by parsing JSON or XML payloads and inferring type structures. Produces formatted, compilable TypeScript code alongside Storybook-style documentation for exploring and sharing types. Supports CLI, programmatic, and agent workflow usage.
Removes the manual round-trip between fetching an API response and writing matching TypeScript, eliminating drift between actual response shapes and declared types.
When to use it
- Converting a third-party API response into typed interfaces before writing client code
- Batch-processing multiple endpoints to keep a shared types file in sync
- Generating interactive type documentation for an internal API
- Validating that existing TypeScript interfaces match current API response shapes
- Automating interface generation in a CI pipeline after API schema changes
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: Generate TypeScript interfaces from this API response: {"id":1,"user":{"name":"Alice","roles":["admin"]},"active":true}
- 1Parse the JSON payload and recursively traverse its structure
- 2Infer types for each field: primitives, nested objects, arrays, and unions
- 3Generate a formatted TypeScript interface file with readonly modifiers and proper union types
- 4Validate the output against the TypeScript compiler API
- 5Render a Storybook CSF documentation file with collapsible type explorer
A compilable types.ts file with inferred interfaces and an accompanying Storybook HTML doc showing the type hierarchy with example values