convert_to_typescript
Convert JavaScript code to TypeScript with comprehensive type annotations, modern best practices, and production-ready output including tests and documentation.
Instructions
Convert JavaScript code to TypeScript with comprehensive type annotations and modern best practices
WORKFLOW: Ideal for creating production-ready code, tests, and documentation TIP: Generate unlimited iterations locally, then review with Claude SAVES: Claude context for strategic decisions
Input Schema
Name | Required | Description | Default |
---|---|---|---|
addTypeGuards | No | Add type guard functions for runtime type checking | |
analysisDepth | No | Level of conversion detail | comprehensive |
analysisType | No | Type of conversion to perform | comprehensive |
code | No | JavaScript code to convert (for single-file conversion) | |
filePath | No | Path to single JavaScript file to convert | |
files | No | Array of specific JavaScript file paths to convert | |
maxDepth | No | Maximum directory depth for multi-file discovery (1-5) | |
module | No | Module system | ESNext |
preserveComments | No | Preserve original comments and add TSDoc | |
projectPath | No | Path to project root (for multi-file conversion) | |
strict | No | Use strict TypeScript mode | |
target | No | TypeScript compilation target | ES2020 |
useEnums | No | Use enums for fixed value sets | |
useInterfaces | No | Prefer interfaces over type aliases |
Input Schema (JSON Schema)
{
"properties": {
"addTypeGuards": {
"default": true,
"description": "Add type guard functions for runtime type checking",
"type": "boolean"
},
"analysisDepth": {
"default": "comprehensive",
"description": "Level of conversion detail",
"enum": [
"basic",
"detailed",
"comprehensive"
],
"type": "string"
},
"analysisType": {
"default": "comprehensive",
"description": "Type of conversion to perform",
"enum": [
"type-safety",
"modern-features",
"comprehensive"
],
"type": "string"
},
"code": {
"description": "JavaScript code to convert (for single-file conversion)",
"type": "string"
},
"filePath": {
"description": "Path to single JavaScript file to convert",
"type": "string"
},
"files": {
"description": "Array of specific JavaScript file paths to convert",
"type": "array"
},
"maxDepth": {
"default": 3,
"description": "Maximum directory depth for multi-file discovery (1-5)",
"type": "number"
},
"module": {
"default": "ESNext",
"description": "Module system",
"type": "string"
},
"preserveComments": {
"default": true,
"description": "Preserve original comments and add TSDoc",
"type": "boolean"
},
"projectPath": {
"description": "Path to project root (for multi-file conversion)",
"type": "string"
},
"strict": {
"default": true,
"description": "Use strict TypeScript mode",
"type": "boolean"
},
"target": {
"default": "ES2020",
"description": "TypeScript compilation target",
"type": "string"
},
"useEnums": {
"default": true,
"description": "Use enums for fixed value sets",
"type": "boolean"
},
"useInterfaces": {
"default": true,
"description": "Prefer interfaces over type aliases",
"type": "boolean"
}
},
"required": [],
"type": "object"
}