/typescript:typescript-updatefrom typescript
Upgrades TypeScript across major versions (4→5→6→7) with config migration, dependency updates, and baseline comparison. Use during dependency updates or TypeScript version bumps.
Ships in typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Your role is to upgrade the project to the latest TypeScript version (7.x, or a later minor such as 7.1 if it is current), leaving the project's own build, typecheck, test and lint commands at least as healthy as they were before you started. You must always finish with the summary described in Summarize, even if you are blocked.
package.json that declares typescript, the package manager (lockfile, packageManager field), the engines.node range, and node --version.build, typecheck/check-types, test and lint scripts.node_modules if present. Otherwise do one non-interactive install (see Long-Running and Interactive Commands). Do not change the package-manager setup (Corepack, packageManager, lockfile format, install modes) just to get a baseline.typescript aliased to @typescript/typescript6, @typescript/native aliased to typescript@7) from the start. Otherwise install plain typescript@7.tsconfig*.json and related config straight to the target layout, applying every checklist item for every major version between the starting version and 7.0 (e.g. types, module/moduleResolution, baseUrl/paths, rootDir, esModuleInterop, removed options). Update @types/* and TypeScript-dependent tools (see @types Dependencies).tsc and fix the errors.
npx tsc6 --noEmit from @typescript/typescript6) to read its more descriptive deprecation messages.Installs and builds in large repositories can take several minutes. Agent terminals may move a command to the background after a timeout; the command is still running.
CI=true yarn build > /tmp/ts-upgrade-build.log 2>&1; echo "exit=$?". Then read the tail of the log.pnpm patch without --edit-dir, npx without -y, npm init, project generators, git rebase -i). If a prompt appears anyway, answer it immediately and finish the workflow it started in the same turn.pnpm patch <pkg>@<exact-version> --edit-dir /tmp/patch-<pkg>, edit the files there, pnpm patch-commit /tmp/patch-<pkg> (writes patches/ and patchedDependencies and updates the lockfile), then verify with pnpm install --frozen-lockfile.yarn patch <pkg>@npm:<exact-version> prints a folder; edit it, run yarn patch-commit -s <folder>, then yarn install.node_modules/<pkg>, run npx -y patch-package <pkg>, and add a "postinstall": "patch-package" script.Do not paper over upgrade errors with suppression escape hatches. Specifically:
ignoreDeprecations. The target version will not support this option.// @ts-ignore, // @ts-expect-error, or // @ts-nocheck to silence new errors.any just to make an error go away.tsconfig.json strictness flags (strict, noImplicitAny, strictNullChecks, skipLibCheck, etc.)Additional files document version-specific changes and migration steps. Read the ones that apply before editing (see step 2 above):
baseUrl, the Node.js version required by the 7.0 tsc launcher, and framework-generated tsconfigs.All versions of TypeScript may include updates to the DOM. These are not specifically documented anywhere. Use your best judgment to determine how to fix these, keeping in mind that you should not be making runtime-affecting changes unless absolutely justified.
Newer versions TypeScript may sometimes find unambiguous problems in the user's code that were not caught by previous versions.
Sometimes you will be able to easily determine the correct fix (i.e. what was intended).
If you can't determine the correct fix, add a temporary ts-ignore comment to suppress the error so you can continue with the upgrade process:
// @ts-ignore BUG: This is always a runtime error! Fix as appropriate depending on intended meaning
const p = "foo" in 42;
When you're done, remove the @ts-ignore part of the comment, but leave behind the explanation of why the code is wrong.
Report all bugs you found in the summary.
@types DependenciesYou may need to update @types dependencies alongside the main TypeScript version.
Check the package.json for any @types/ entries and update them to the latest version compatible with the corresponding core dependency.
The upgrade is not done until this gate has been run after your last edit:
npm ci, pnpm install --frozen-lockfile, yarn install --immutable). This proves package.json, the lockfile and any patchedDependencies agree.npx tsc --version.tsc reports errors for the project, including errors from framework-generated tsconfigs.Your final message must always be this summary, even if you were blocked or stopped early:
tsc --version or the lockfile), and the package layout used (plain typescript@7 or side-by-side with @typescript/typescript6)// @ts-ignore comments you addedWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/typescript-skills --plugin typescript6 skills in this plugin
/typescript-build-referencesGuidance for configuring TypeScript project references and incremental builds (`tsc -b`/`--build`, `composite`, solution-style tsconfigs) and declaration emission (`.d.ts` files) with `isolatedDeclarations` in an existing repo or monorepo. Use this whenever asked to add project references, build mode, incremental builds, declaration files, or isolated declarations, even when the repo already has a working build or bundler./typescript-project-setupHow to set up a new TypeScript project/typescript-publish-typesHow to publish TypeScript declarations from an npm package so consumers actually resolve them. Use this when asked to add types/typings to a package, ship .d.ts files, fix "Could not find a declaration file for module", or make a package's published types resolve correctly.Other plugins' skills for the same job