What this prompt does
This prompt produces a phased plan to migrate a [project_size] [framework] project from [current_state] to strict TypeScript. The AI audits your tsconfig and recommends enabling [strict_flags] in order, categorises type errors by severity, fixes [priority_area] first, replaces [any_count]+ any types with generics and interfaces, adds type guards for runtime narrowing, centralises shared types in [types_location], configures eslint-typescript with [lint_rules], sets up path aliases, and adds a pre-commit hook blocking new any. It delivers a rollout the team follows over [timeline].
The structure works because it makes strictness incremental instead of a big-bang freeze. By enabling [strict_flags] in a sane order and killing any at the boundaries — [priority_area] — first, the riskiest runtime surprises get addressed early without halting feature work. The pre-commit guard is what stops the team quietly reintroducing any while the migration is in flight.
When to use it
- You have a loose or JavaScript codebase and want strict TypeScript without freezing development.
- You need a sane order for enabling
[strict_flags]rather than flipping them all at once. - You want to fix the highest-impact
[priority_area]first. - You need to systematically replace
anytypes with real types. - You want a pre-commit guard against new
anyadditions. - You are planning the migration across a fixed
[timeline].
Example output
You get a phased plan: a tsconfig audit recommending [strict_flags] in order, an error inventory grouped by severity, a fix sequence starting with [priority_area], a strategy for replacing [any_count]+ any types, type guards, a [types_location] structure, eslint-typescript config with [lint_rules], path aliases, and a pre-commit hook — staged across [timeline].
Pro tips
- Enable
[strict_flags]one at a time;strictNullChecksalone can surface a large error wave, so isolate it. - Fix
[priority_area]first — boundaries like the API layer are whereanycauses the worst runtime surprises. - Be realistic about
[any_count]; an estimate is fine, but expect the real number to shift as flags reveal more. - Add the pre-commit
anyguard early so progress is not eroded while you work. - Size the
[timeline]to leave room for feature work; an aggressive schedule encouragesanyshortcuts. - Centralise shared types in
[types_location]so the team reuses definitions instead of duplicating them.