TypeScript Type Refactoring Tool skill for Claude and Codex
Applies a mechanical refactor across TypeScript type definitions: renames by pattern, strips deprecated members, injects generic parameters, and lists every…
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 existing TypeScript types need a bulk rename, deprecated members removed, or a generic parameter threaded through, with every change itemised. Do not use for redesigning types for stronger safety, inferring types from data, or writing documentation. Related topics: coding, typescript.
What it will ask you for
- Source (longer free text)
- Declaration kinds to touch (choose any: Interface, Type alias, Enum, Class)
- Rename pattern (free text, e.g. "prefix every name with Api")
- Remove deprecated members (choose one: Yes, No)
- Generic parameters to add (free text, e.g. "TPayload with a default of unknown")
- Keep comments (choose one: Yes, No)
- Export style (choose one: named, default, none)
- Output location (free text, e.g. "src/types/refactored")
How it works
- Apply renames to the chosen declaration kinds and update every reference in the supplied source so nothing dangles.
- Remove members marked @deprecated and list borderline cases for a decision instead of removing them.
- Add the generic parameters with defaults where given and thread them to the members that should use them; untouched usages still compile.
- Apply the export style and output location, preserving comments and formatting as requested.
- Check for dangling references, name collisions, and removed members still extended, and list them as blockers in the summary.
What you get
A markdown document with Refactored Types (one TypeScript code block per file) and Change Summary (one bullet per change with old and new form, blockers last).
What it watches out for
- Renaming a declaration without updating the references inside other declarations, so the output fails to compile.
- Removing a member that is not tagged @deprecated because its name looks old, which deletes live API surface.
- Adding a generic parameter without a default, which breaks every existing usage that passes no type argument.
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.