/typescript:typescriptfrom typescript
Handles TypeScript type-level and compiler work, covering tsconfig strictness, narrowing, generics, discriminated unions, declarations and module resolution, public type APIs, runtime validation of unknown data, and type tests. Use when editing *.ts/*.tsx types or tsconfig.json, or fixing tsc errors.
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.
This skill owns the compile-time contract, meaning compiler configuration, type representations, inference, declarations, module typing, and type tests. Preserve runtime behavior unless the request changes it. JS runtime behavior (modules, async, the event loop) is out of scope, and React components belong to react, if installed.
tsconfig*.json and its extends chain, references (project graph), package scripts, and the installed TypeScript version (npx tsc -v).search_graph, trace_path) when the repo is indexed, otherwise Grep.resolve-library-id, then query-docs) for TypeScript and third-party APIs, since options like moduleResolution: "bundler", verbatimModuleSyntax, and isolatedDeclarations are version-sensitive.latest (check npm view typescript dist-tags): a native compiler (npm install typescript installs its tsc), but it ships no JS compiler API (a new one is planned for 7.1). Tools that require('typescript') (typescript-eslint and similar) need the 6.0 package, aliased as @typescript/typescript6. Options deprecated in 6.0 are errors in 7: target: es5, moduleResolution: node10/classic, module: amd|umd|systemjs|none, baseUrl (put its prefix into paths), outFile, downlevelIteration, esModuleInterop: false. 6.0 changed defaults: strict true, types empty (add "node" explicitly), rootDir the tsconfig directory. "ignoreDeprecations": "6.0" only silences 6.x warnings..ts directly by type stripping (on by default since 22.18 and 23.6): erasable syntax only (no enums, runtime namespaces or parameter properties), import type for types, file extensions in imports, tsconfig.json ignored, nothing under node_modules. Check with erasableSyntaxOnly.require() of an ES module works unflagged since Node 20.19 and 22.12, but throws ERR_REQUIRE_ASYNC_MODULE if the module graph has top-level await; use import() there. The result is the namespace object, so a default export is on .default.unknown until a parser proves its shape. Annotations don't validate JSON, env vars, network data, or storage.strict: true for new code unless a stated compatibility constraint prevents it.noUncheckedIndexedAccess and exactOptionalPropertyTypes when their semantics match the domain. When they surface large existing debt, migrate in a scoped, staged way.readonly where mutation isn't part of the contract.prop?: T and prop: T | undefined differ under exactOptionalPropertyTypes. Follow the boundary's existing convention for absence.Pick, Omit, indexed access, or typeof instead of duplicating shapes.type or interface by local convention and capability. Use type for unions and intersections, and interface when declaration merging or extension is needed.satisfies to check a value against a shape while keeping its literal types. Use as const for literal tuples and objects.any. When unsafe interop is unavoidable, confine it to one documented boundary and convert to a checked type immediately.typeof, instanceof, in, and equality checks.x is T) or assertion function (asserts x is T) must verify everything it claims. It is part of the safety boundary.switch statements over maintained unions exhaustive with a never check (const _exhaustive: never = x).as, !, or a false predicate unless a narrow, documented invariant exists that the types can't express.module and moduleResolution. Use import type/export type when verbatimModuleSyntax, isolatedModules, or convention requires it.declare module "x" to one verified untyped dependency or asset pattern, declaring only what exists at runtime.exports, resolution config, or upstream @types over declare module "*", global augmentation, or duplicate third-party typings.skipLibCheck, paths aliases, ambient globals, or module shims as a local fix without weighing their project-wide effect.To enforce which files a package may import (entry points only, no deep imports, no cycles), suggest the user run /ts-module-boundaries:ts-module-boundaries (from the ts-module-boundaries plugin, if installed). It sets up dependency-cruiser and proves the rules fail on a violation.
typecheck script when one exists. Otherwise pick the tsconfig that owns the changed files, not the repo-root one by default: a root config is often a solution file with files: [] that checks nothing. Run npx tsc --noEmit -p <tsconfig>.tsc -b emits outputs and .tsbuildinfo. Prefer the repo's own non-emitting check script over running build mode blindly, and know where its outputs land before you run it.unit-testing skill for runtime tests.// @ts-expect-error, expectTypeOf, or tsd, whichever the repo uses). Keep type tests apart from runtime tests when their runners differ.tsc --extendedDiagnostics, --generateTrace) before simplifying types for performance.Reduce the error to the smallest failing call, export, config, or declaration. tsc --traceResolution explains module resolution, and --explainFiles shows why a file is included. Then test one cause at a time, from this list:
Fix the source boundary instead of casting, loosening, or disabling an option.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin typescript