TypeScript Type Architect skill for Claude and Codex
Derives a complete, accurate set of TypeScript types from a JSON or object sample: nested shapes get their own named types, repeated string values become…
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 you have a JSON payload or object sample and need full TypeScript types for it, with nested shapes named and repeated values turned into unions. Do not use for types described in prose rather than data, or validating data at runtime against a type. Related topics: coding, typescript.
What it will ask you for
- Data sample (longer free text)
- Root type name (free text, e.g. "Order")
- Export style (choose one: named export, default export)
- Include JSDoc comments (choose one: Yes, No)
- Strictness (choose one: strict, relaxed)
- Also generate (choose any: enums, union types, intersection types, literal types)
How it works
- Scan every record in the sample and list each field with the set of value kinds observed, including null and missing.
- Name a type for every nested object and infer array element types from all elements, so no shape is inlined or guessed from one item.
- Convert repeated string values into literal unions or enums as requested, listing the values actually seen.
- Apply the strictness mode: optional fields and unknown in strict, widened strings and index signatures in relaxed.
- Order the output root type first, add JSDoc where the sample shows meaning, and list the inference decisions the sample could not settle.
What you get
A single typescript code block with the root type, auxiliary types, and exports in the chosen style, then a bulleted list of ambiguous inference decisions.
What it watches out for
- Inferring an array's element type from its first item, so a later record with a different shape fails to compile.
- Typing a nullable field as null because the only sample value was null, which hides the real type entirely.
- Turning a free-text field into a literal union because two records happened to share a value.
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.