Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

migrate-js-to-modern-typescript

БесплатноБез исполняемых скриптовНе проверен

Migrating a JavaScript codebase to TypeScript — converting .js files to .ts, adding types to existing JS, or tightening a loosely-typed TS project toward…

pproencaот pproenca★ 231 звезда на GitHub

Об этом скилле

JavaScript to TypeScript Migration Best Practices

Guide for taking a JavaScript codebase to strict, modern TypeScript without a big-bang rewrite. Contains 42 rules across 7 categories, prioritized by impact to drive an incremental, file-by-file migration that keeps the build compiling at every step.

When to Apply

Reference these guidelines when:

  • Converting a .js codebase to .ts (whole project or one module at a time)
  • Adding types to existing JavaScript via JSDoc or annotations
  • Choosing a tsconfig and allowJs strategy for a mixed JS/TS repo
  • Turning on strict mode or individual strict flags on a large codebase
  • Replacing any, as casts, and ! assertions left over from a quick conversion
  • Validating external data (JSON, env, API responses) so the types you wrote are true at runtime
  • Converting CommonJS to ESM, prototypes to classes, and other JS idioms to TS
  • Updating the build, runner, and CI to type-check and publish TypeScript

How the Migration Flows

tsconfig & strategy → strictness ratchet → type the surfaces → kill any/casts
   → validate runtime boundaries → convert JS idioms → tooling/build/CI

Decisions at the front cascade: a wrong tsconfig or a top-down conversion order forces you to re-type modules twice, and an early any flood poisons everything downstream. Work from the front of this pipeline and from the leaves of the dependency graph inward.

Rule Categories by Priority

Priority Category Impact Prefix
1 Migration Setup & tsconfig CRITICAL setup-
2 Strictness Ratcheting CRITICAL strict-
3 Typing Public Surfaces HIGH surface-
4 Replacing any & Unsafe Casts HIGH unsafe-
5 Runtime Data Validation MEDIUM-HIGH runtime-
6 JS-to-TS Idiom Conversion MEDIUM idiom-
7 Tooling & Build Migration LOW-MEDIUM tooling-

Quick Reference

1. Migration Setup & tsconfig (CRITICAL)

2. Strictness Ratcheting (CRITICAL)

3. Typing Public Surfaces (HIGH)

4. Replacing any & Unsafe Casts (HIGH)

Полный SKILL.md на GitHub

Установить migrate-js-to-modern-typescript в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/idiom-default-export-to-named.mdreferences/idiom-enum-to-union-or-const.mdreferences/idiom-optional-chaining-over-guards.mdreferences/idiom-prototype-to-class.mdreferences/idiom-replace-arguments-object.mdreferences/idiom-require-to-import.mdreferences/idiom-type-only-imports.mdreferences/runtime-derive-types-from-schemas.mdreferences/runtime-type-environment-variables.mdreferences/runtime-type-guards-at-boundaries.mdreferences/runtime-type-json-parse.mdreferences/runtime-validate-external-data.mdreferences/setup-allowjs-checkjs-bridge.mdreferences/setup-jsdoc-before-rename.mdreferences/setup-migrate-leaves-first.mdreferences/setup-modern-module-resolution.mdreferences/setup-noemitonerror-isolatedmodules.mdreferences/setup-prefer-ts-expect-error.mdreferences/setup-skiplibcheck-during-migration.mdreferences/strict-enable-flags-incrementally.mdreferences/strict-exact-optional-property-types.mdreferences/strict-no-implicit-any.mdreferences/strict-no-unchecked-indexed-access.mdreferences/strict-prioritize-null-checks.mdreferences/strict-use-unknown-in-catch.mdreferences/surface-annotate-exported-signatures.mdreferences/surface-interface-for-object-args.mdreferences/surface-replace-jsdoc-with-types.mdreferences/surface-type-callbacks.mdreferences/surface-type-class-fields.mdreferences/surface-type-default-params.mdreferences/tooling-declare-untyped-modules.mdreferences/tooling-emit-declaration-files.mdreferences/tooling-install-types-packages.mdreferences/tooling-typecheck-in-ci.mdreferences/tooling-use-tsx-over-ts-node.md

FAQ

Что делает скилл migrate-js-to-modern-typescript?

Migrating a JavaScript codebase to TypeScript — converting .js files to .ts, adding types to existing JS, or tightening a loosely-typed TS project toward strict mode. Covers tsconfig and allowJs strategy, incremental strict-flag ratcheting (noImplicitAny, strictNullChecks, noUncheckedIndexedAccess), typing public surfaces, replacing `any` and unsafe casts with `unknown` and narrowing, validating runtime boundaries (JSON, env, API responses), converting CommonJS to ESM and prototypes to classes, and the build/CI changes a migration needs. Trigger even when the user only says "add types", "turn on strict mode", or "convert this file to TypeScript", and especially on a mixed JS/TS repo. Distinct from general TypeScript refactoring — this is the migration act itself, performed file by file while keeping the build green.

Как установить скилл migrate-js-to-modern-typescript?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл migrate-js-to-modern-typescript запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить migrate-js-to-modern-typescript с