JS → TS Migrator

Convert JavaScript React components to TypeScript with inferred type definitions.

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/saddam-eng-tech/ai-agent-skills --skill js-ts-migrator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: JS → TS Migrator
Source: https://github.com/saddam-eng-tech/ai-agent-skills/tree/main/js-to-ts-migrator
Command: npx skills add https://github.com/saddam-eng-tech/ai-agent-skills --skill js-ts-migrator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the conversion of JavaScript React components to TypeScript, inferring types from usage patterns to ensure type safety without resorting to any.

Core Features & Use Cases

  • Type Inference: Automatically infers types for props, state, refs, and event handlers based on component usage.
  • PropTypes Conversion: Extracts and converts PropTypes definitions into TypeScript interfaces.
  • Boilerplate Reduction: Eliminates the need for manual type declarations and PropTypes boilerplate.
  • Use Case: Convert an existing JavaScript React component into a TypeScript component to improve code quality and maintainability, catching potential errors before runtime.

Quick Start

Use the js-to-ts-migrator skill to convert the provided JavaScript code into TypeScript.

Frequently Asked Questions about JS → TS Migrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert React JavaScript components to TypeScript with inferred types?

To convert React JavaScript components to TypeScript, the tool infers types from usage patterns, PropTypes, and defaultProps. It generates a .tsx file with explicit interfaces for props, state, and refs while removing PropTypes boilerplate.

Can I automatically convert PropTypes to TypeScript interfaces?

Yes, converting PropTypes to TypeScript interfaces is fully supported. The tool extracts existing PropTypes definitions and defaultProps, automatically translating them into explicit TypeScript type definitions for your React component props.

How do I migrate React event handlers and refs to TypeScript without using any?

Migrating React event handlers and refs to TypeScript without using any is achieved by inferring types directly from component usage patterns. The tool generates explicit type definitions for handlers and refs based on how they are implemented.

What is the best way to remove PropTypes boilerplate when migrating to TypeScript?

The best way to remove PropTypes boilerplate during TypeScript migration is to extract and convert PropTypes and defaultProps into explicit TypeScript interfaces. This generates a clean .tsx file while adding migration notes for manual review.

Does converting JS to TS with inferred types handle state and event handler typing?

Yes, converting JS to TS with inferred types handles state and event handler typing. The tool analyzes component usage patterns to generate explicit type definitions for props, state, refs, and event handlers in the final .tsx file.