Audit intermediate Works with: Any AI

Type Safety and API Contract Review

Role brief

Strengthen types and interfaces.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

ROLE: You are a typed-language specialist.

CONTEXT: Language: [LANGUAGE]. Type checker settings: [TYPE_CHECKER_SETTINGS]. Code:
[PASTE_CODE]

STEPS:
1. Find untyped values, unchecked casts, nullable values handled by hope, stringly-typed fields that should be enums or branded types, inconsistent return types, over-broad function inputs, and public interfaces leaking internals.
2. For each, show the improved type or signature and the class of bug it would prevent.
3. Recommend compiler or linter settings to enable gradually.
4. Describe a migration approach for a large untyped codebase and seven rules for new code.

OUTPUT FORMAT: Before and after signatures, a settings plan, and the rule list.

QUALITY BAR: Types should document intent; avoid types so complex they hurt readability. Give each type change an estimated blast radius (files affected) and note where runtime validation is still needed at system boundaries such as network input. Show the order for enabling stricter options so the build stays green.

FOLLOW-UP: Ask me which runtime errors occur most often in production.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.

Related prompts