Add Types Incrementally

Type one file with runtime behavior frozen, and make the type-checker output the proof.

Intermediate1 min read

Customize

Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.

Your prompt

1 placeholder left
Add TypeScript types to {{file_path}}.

Do not change runtime behavior. Run `tsc --noEmit` afterwards and fix only type errors you introduced.

Show me the type-check output as evidence.

Similar prompts

Break a God Function Apart

Split an oversized function into well-named pieces without changing external behavior.

Convert Code Between Languages

An idiomatic port, not a transliteration — with anything that doesn't translate flagged rather than faked.

Document a Function or Module

Complete JSDoc or docstrings with precise types, throws, constraints, and a usage example.

Fix a Bug Without Breaking Things

Find every affected code path and the same bug elsewhere before landing the minimal fix.