Agent skill

Migrate JS To Modern Typescript

by pproenca in pproenca/dot-skills

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.

MITAuto-check passedDevelopment

Install Migrate JS To Modern Typescript

skills CLI
$ npx skills add pproenca/dot-skills --skill migrate-js-to-modern-typescript -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pproenca/dot-skills migrate-js-to-modern-typescript --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pproenca/dot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.experimental/migrate-js-to-modern-typescript .claude/skills/migrate-js-to-modern-typescript && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
migrate-js-to-modern-typescript
GitHub stars
215
Token cost
~2.4k tokens
SKILL.md length
682 words
Files
47 (incl. references, assets)
Skills in repo
41
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 7 steps: Migration Setup & tsconfig (CRITICAL) → Strictness Ratcheting (CRITICAL) → Typing Public Surfaces (HIGH) → …
  • Even when the user only says add types
  • SKILL.md covers When to Apply, How the Migration Flows, Rule Categories by Priority and Quick Reference, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Migrate JS To Modern Typescript is an agent skill from pproenca/dot-skills. 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…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 49 other files, including reference files and assets (for example `AGENTS.md`, `assets/templates/_template.md` and `metadata.json`).

It sits in Development, covering Refactoring. It works with TypeScript and JavaScript. The repository describes itself as: A collection of AI agent skills following the Agent Skills open format. The licence is MIT.

When your agent uses it

  • Even when the user only says add types
  • Turn on strict mode
  • Convert this file to TypeScript
  • Especially on a mixed JS/TS repo

Example prompts

  • “add types”
  • “turn on strict mode”
  • “convert this file to TypeScript”
  • “/migrate-js-to-modern-typescript”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Migration Setup & tsconfig (CRITICAL)
  2. Strictness Ratcheting (CRITICAL)
  3. Typing Public Surfaces (HIGH)
  4. Replacing any & Unsafe Casts (HIGH)
  5. Runtime Data Validation (MEDIUM-HIGH)
  6. JS-to-TS Idiom Conversion (MEDIUM)
  7. Tooling & Build Migration (LOW-MEDIUM)

What it can do on your machine

Read from SKILL.md and the folder at commit cf93c57. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Migrate JS To Modern Typescript loads about 2.4k tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 215 tokens; SKILL.md has 682 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~215
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~17k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pproenca/dot-skills at commit cf93c57, republished under its MIT licence (© pproenca). 682 words, ~2,386 tokens.

Download SKILL.mdSave it as .claude/skills/migrate-js-to-modern-typescript/SKILL.md (or your agent's skills folder). This skill also uses 46 other files; get the full folder from GitHub.
name
migrate-js-to-modern-typescript
description
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.

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

PriorityCategoryImpactPrefix
1Migration Setup & tsconfigCRITICALsetup-
2Strictness RatchetingCRITICALstrict-
3Typing Public SurfacesHIGHsurface-
4Replacing any & Unsafe CastsHIGHunsafe-
5Runtime Data ValidationMEDIUM-HIGHruntime-
6JS-to-TS Idiom ConversionMEDIUMidiom-
7Tooling & Build MigrationLOW-MEDIUMtooling-

Quick Reference

1. Migration Setup & tsconfig (CRITICAL)
2. Strictness Ratcheting (CRITICAL)
3. Typing Public Surfaces (HIGH)
Show full SKILL.md (271 more words)Show less
4. Replacing any & Unsafe Casts (HIGH)
5. Runtime Data Validation (MEDIUM-HIGH)
6. JS-to-TS Idiom Conversion (MEDIUM)
7. Tooling & Build Migration (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

  • typescript-refactor — Refactoring and modernizing code that is already TypeScript
  • typescript-advanced-patterns — Advanced type-level patterns once the migration is done

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

© pproenca, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 46 other files (references, assets) in skills/.experimental/migrate-js-to-modern-typescript of pproenca/dot-skills.

  • SKILL.md
  • AGENTS.md
  • assets/templates/_template.md
  • metadata.json
  • references/_sections.md
  • references/idiom-default-export-to-named.md
  • references/idiom-enum-to-union-or-const.md
  • references/idiom-optional-chaining-over-guards.md
  • references/idiom-prototype-to-class.md
  • references/idiom-replace-arguments-object.md
  • references/idiom-require-to-import.md
  • references/idiom-type-only-imports.md
  • references/runtime-derive-types-from-schemas.md
  • references/runtime-type-environment-variables.md
  • references/runtime-type-guards-at-boundaries.md
  • references/runtime-type-json-parse.md
  • references/runtime-validate-external-data.md
  • references/setup-allowjs-checkjs-bridge.md
  • … and 29 more

Open the folder on GitHubat commit cf93c57

Compare with similar skills

Migrate JS To Modern Typescript next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Migrate JS To Modern Typescript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Migrate JS To Modern Typescript this skillpproenca/dot-skills215—~2.4kAutomated safety check: PassMIT
Dinero Best Practicesdinerojs/dinero.js6.8k—~756Automated safety check: PassMIT
ast-grep Codemod Referencewarp-drive-data/warp-drive3.2k—~2.6kAutomated safety check: PassMIT
DRY Refactoring With jscpdkucherenko/jscpd6.4k—~2.1kAutomated safety check: PassMIT
Coding Agentmastra-ai/mastra29k—~2.3kAutomated safety check: PassCustom licence
jscpd Duplicate Code Detectorkucherenko/jscpd6.4k—~4.5kAutomated safety check: PassMIT

Similar skills

  • Dinero Best Practices

    dinerojs/dinero.js

    Core best practices for the Dinero.js money library. An agent skill from dinerojs/dinero.js.

    6.8k GitHub stars~756 tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • ast-grep Codemod Reference

    warp-drive-data/warp-drive

    Reference for writing and debugging TypeScript and JavaScript codemods with @ast-grep/napi: parsing, node queries, meta-variables, rule objects and editing.

    3.2k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Removes copy-paste duplication found by jscpd, starting with exact clones and hotspots, then renamed and near-miss copies, using proven refactoring strategies.

    6.4k GitHub stars~2.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Finds duplicated code in 220+ languages with jscpd, reports exact, renamed and near-miss clones in a compact agent-friendly format and measures duplication.

    6.4k GitHub stars~4.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Crowdin API Client

    crowdin/crowdin-cli

    A skill your agent uses when implementing, refactoring, or reviewing @crowdin/crowdin-api-client usage in any JavaScript or TypeScript project, especially for endpoint selection, request/response…

    320 GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from pproenca/dot-skills

All 41 skills in this repo
  • Audio Voice Recovery

    pproenca/dot-skills

    Audio forensics and voice recovery guidelines for CSI-level audio analysis.

    215 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Codemod React Pipeline

    pproenca/dot-skills

    Guided, scripted pipeline for running JSX/TSX/React codemods safely across large legacy codebases.

    215 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    215 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Dx Harness

    pproenca/dot-skills

    Developer-experience friction auditing and fixing — slow onboarding, repeated manual setup steps, missing bootstrap/reset/seed scripts, undiscoverable conventions.

    215 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Language Spec Author

    pproenca/dot-skills

    Turn a rough idea for a language into a complete, implementable specification — a DSL, query, config/data, template, or protocol language — by interviewing the author dimension by dimension until…

    215 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Python Pep Author

    pproenca/dot-skills

    Drafting Python Enhancement Proposals (PEPs) — proposing a Python language feature, a standard library change, an interoperability standard, or an informational/process document for the Python…

    215 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Migrate JS To Modern Typescript

What does Migrate JS To Modern Typescript do?

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. Migrate JS To Modern Typescript is an agent skill from pproenca/dot-skills.ts, adding types to existing JS, or tightening a loosely-typed TS project toward strict mode.

When should I use Migrate JS To Modern Typescript?

Migrate JS To Modern Typescript fits situations like: even when the user only says add types; turn on strict mode; convert this file to TypeScript; especially on a mixed JS/TS repo.

How do I install Migrate JS To Modern Typescript in Claude Code?

Run `npx skills add pproenca/dot-skills --skill migrate-js-to-modern-typescript -a claude-code`. Or copy the skill folder (skills/.experimental/migrate-js-to-modern-typescript in pproenca/dot-skills) into .claude/skills/migrate-js-to-modern-typescript in your project. Claude Code loads it when a task matches its description.

How do I install Migrate JS To Modern Typescript in Codex?

Run `npx skills add pproenca/dot-skills --skill migrate-js-to-modern-typescript -a codex`. Or copy the skill folder (skills/.experimental/migrate-js-to-modern-typescript in pproenca/dot-skills) into .agents/skills/migrate-js-to-modern-typescript in your project. Codex loads it when a task matches its description.

Can I use Migrate JS To Modern Typescript in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pproenca/dot-skills --skill migrate-js-to-modern-typescript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migrate-js-to-modern-typescript, .gemini/skills/migrate-js-to-modern-typescript, .github/skills/migrate-js-to-modern-typescript and .opencode/skills/migrate-js-to-modern-typescript in your project.

What does Migrate JS To Modern Typescript need to run?

SKILL.md names no scripts, command-line tools or credentials: Migrate JS To Modern Typescript is instructions for the agent only.

Does Migrate JS To Modern Typescript access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Migrate JS To Modern Typescript safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Migrate JS To Modern Typescript use?

Migrate JS To Modern Typescript is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Migrate JS To Modern Typescript use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 14k tokens, read only when the agent opens those files.

What are the alternatives to Migrate JS To Modern Typescript?

Skills that share tags, products or a category with Migrate JS To Modern Typescript: Dinero Best Practices (dinerojs/dinero.js, 6.8k stars), ast-grep Codemod Reference (warp-drive-data/warp-drive, 3.2k stars), DRY Refactoring With jscpd (kucherenko/jscpd, 6.4k stars) and Coding Agent (mastra-ai/mastra, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Migrate JS To Modern Typescript?

pproenca (a GitHub user) maintains it in pproenca/dot-skills, which has 215 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on August 15, 2026.

Source: pproenca/dot-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.