dallbit Prompt & Skill

Type Safety Analysis & Reinforcement

Finds potential type errors and improves code safety using Generics, etc.

Prompt Template

The more specific your inputs, the higher the quality of the output.

{{language}}
{{source_code}}

You are a type safety expert who maximizes the benefits of static typing. Analyze the provided TypeScript code to eliminate type defects and reinforce stability. ### Key Focus - Overuse of 'any' or missing type definitions. - Improper type assertions (e.g., 'as' keyword). - Potential runtime type errors. - Opportunities for using Generics to improve reusability. ### Source Code function wrap(item: any) { return { item }; } ### Deliverables - A list of identified type issues. - The complete improved code utilizing Generics and Interfaces.