- Home
- Skills
- Code Quality & Review
- JavaScript to TypeScript Migration Tool
Works with the AI Agents you already use
JavaScript to TypeScript Migration Tool
Plan and execute incremental JavaScript to TypeScript migrations using import graph analysis and batch conversion.
$2.99
JavaScript to TypeScript Migration Tool
Example session with this skill installed
Run a migration plan on the src directory of this project and generate a migration-friendly tsconfig.
- Read your context and instructions
- Compiled the javascript to typescript
- Generated the UI component
I have analyzed the src directory and generated a migration plan. The project contains 42 JS/JSX files. I have identified 12 leaf files that are safe to migrate first and detected 3 missing type definitions.
Migration Plan & Configuration
File Inventory & Risk Assessment
| File Path | Size (KB) | Risk Level | Signals Detected |
|---|---|---|---|
src/utils/format.js | 1.2 | Low | Leaf node, simple exports |
src/components/Button.jsx | 2.5 | Low | JSDoc types found, React props |
src/lib/legacy-auth.js | 15.4 | High | prototype manipulation, eval |
src/api/client.js | 4.1 | Med | CommonJS require, dynamic keys |
Missing Type Definitions
Run the following to install necessary types:
npm install --save-dev @types/lodash @types/express @types/react-dom
Migration Config
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"checkJs": false,
"skipLibCheck": true,
"strict": false,
"noImplicitAny": false,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"]
}
Next steps
- Review the
tsconfig.jsonand adjust thejsxsetting if you use a different framework. - Run
python3 scripts/js2ts.py convert src/ --batch 5to begin migrating the first 5 leaf files. - Fix the
// TODO(ts)markers in the newly created.tsfiles and runnpx tsc --noEmit.
Button.jsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Migrating a large JavaScript codebase to TypeScript often results in a broken build or thousands of type errors that halt development. This skill provides a structured, incremental path to move from JS to TS without stopping your team's feature work.
What it does
- Inventory and Risk Analysis: Scans JS/JSX files to identify size and migration risks like prototype manipulation or dynamic property access.
- Dependency Audit: Lists missing
@typespackages for dependencies that do not bundle their own type definitions. - Dependency Graph Ordering: Maps the import tree to prioritize "leaf" files, ensuring you migrate code that doesn't depend on other untyped JS.
- Automated Configuration: Generates a migration-specific
tsconfig.jsonthat balances strictness with the need to coexist with legacy JS. - Batch Conversion: Handles renaming files via
git mvand performs initial syntax transforms from CommonJS to ES modules.
How it works
- Plan: Run the plan command on your source directory to generate an inventory and effort estimate.
- Configure: Generate a migration-friendly
tsconfig.jsonto allow both file types to coexist. - Migrate: Convert files in small batches, starting with leaf nodes in the import graph.
- Iterate: Run the compiler, resolve generated
// TODO(ts)markers, and repeat the process for the next batch.
Frameworks & tools
This tool works with any JavaScript or React project using npm or yarn. It integrates with git for file renaming and targets the standard tsc compiler.
Why this beats prompting it yourself
Manual migration often misses hidden complexity like arguments usage or eval. This skill programmatically analyzes the entire import graph to ensure an incremental rollout that keeps the project buildable at every step.
Use cases
- Legacy Refactoring: Moving a mature Node.js or React codebase to TypeScript.
- Effort Estimation: Auditing a JS project to determine how many hours a migration will take.
- Incremental Adoption: Converting a large mono-repo 5-10 files at a time during normal sprints.
Known limitations
Does not perform deep logic refactoring or complex generic injection. Requires a local Git repository for the automated git mv functionality.
Requires Git for automated renaming. Does not automatically fix complex type errors or logic bugs. Focuses on structural migration and syntax conversion.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Requires