Write a Type Safety Improvement Plan
Create a plan to improve type safety in [codebase]. Include migration steps, strictness settings, and common pattern fixes. Reduce runtime errors.
Strong typing catches entire classes of bugs at compile time.
If you're struggling with runtime errors and unexpected type-related bugs in your codebase, this ChatGPT prompt helps you build a structured plan to improve type safety across your entire project. This prompt is designed for developers who want to catch bugs earlier in the development process, reduce debugging time, and improve code reliability. Whether you're working with JavaScript, Python, TypeScript, or any other typed language, this prompt guides you through creating a practical roadmap that includes migration steps, strictness settings adjustments, and common pattern fixes that prevent type-related errors before they reach production.
To use this prompt effectively, you need to specify your codebase details in the placeholder. For example, if you're working on a Node.js backend application using TypeScript, you would replace the placeholder with something like "our Node.js Express API with 50,000 lines of TypeScript code currently running with strict mode disabled." The more specific you are about your current setup, the more tailored and actionable ChatGPT's response becomes.
When you run this prompt, expect ChatGPT to provide a comprehensive improvement plan that includes phased migration steps, specific strictness settings recommendations for your language or framework, and detailed fixes for common type safety issues you're likely encountering. The output typically includes implementation timelines, potential breaking changes to watch for, and testing strategies to validate your type safety improvements.
For better results, ask ChatGPT follow-up questions about any specific error patterns you've noticed in your logs. If you mention particular types of bugs that keep appearing in your codebase, ChatGPT can refine the plan to prioritize fixes that address those exact problems first. This targeted approach helps you see immediate improvements in code quality while working toward comprehensive type safety across your entire project.