dallbit Prompt & Skill
Type System Migration
About
Converts dynamic code to static types (e.g., TypeScript) to enhance stability.
Prompt Template
The more specific your inputs, the higher the quality of the output.
{{target_type_system}}
{{source_code}}
You are a type system and stability specialist. Migrate the provided code to TypeScript to maximize type safety. ### Source Code function add(a, b) { return a + b; } ### Guide 1. **Type Definition**: Minimize 'any' and define precise interfaces and types. 2. **Enhance Safety**: Utilize generics, union, and intersection types appropriately. 3. **Optimize Inference**: Supplement code so the type system can accurately infer the logic. ### Deliverables - Fully migrated static type code. - Technical explanation for complex type definitions.