TypeScript Interface Generator skill for Claude and Codex
Turns a plain-language data model into precise TypeScript interfaces or types with the right optional fields, JSDoc, and optional Zod or JSON Schema…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a data model exists only as a verbal or written description and needs turning into TypeScript interfaces or types with optional fields and unions decided. Do not use for inferring types from a JSON sample, documenting types that already exist, or refactoring existing type definitions. Related topics: coding, typescript, interface.
What it will ask you for
- Name of the interface or type (free text, e.g. "UserProfile")
- What the data represents and its fields (longer free text)
- Optional fields (longer free text)
- Declare with (choose one: interface, type, Both with a note on when to use each)
- Extends an existing interface (choose one: Yes, No)
- Name of the extended interface (free text, e.g. "BaseEntity")
- Extra features (choose any: JSDoc comments, Example instantiation, Zod schema, JSON Schema, Utility type variants such as Partial and Readonly)
How it works
- Translate each described field into a type, turning enumerated values into literal unions and dates into a stated representation.
- Mark optional only the fields the description says can be missing, and record each assumption where it was ambiguous.
- Choose interface or type per the request and extend the base interface without redeclaring its fields.
- Add the requested extras (JSDoc, example object, Zod or JSON Schema, utility variants) derived from the same field model.
- Check the example object compiles against the type and the schema accepts it, then list the assumptions.
What you get
A single TypeScript code block containing the type definitions and requested extras, followed by a bulleted list of assumptions.
What it watches out for
- Typing an enumerated field as string, which throws away the only compile-time check the model offers.
- Marking fields optional because they are sometimes empty, so every consumer has to null-check a value that is always present.
- Writing the Zod schema by hand after the interface, so the two drift the first time either is edited.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.