type-tightener
Installation
SKILL.md
Type-Tightener: Strict Typing & Schema Hardening
Tighten types in the code affected by the requested change. Preserve behavior and public contracts. Reuse the project's type and validation tools; this skill does not require new schema libraries or cleanup elsewhere in a touched file.
Type Risks to Check in Scope
anyandas anycasts:- Replace with generic parameters, typed interfaces, or
unknown+ runtime type guard (typeof,instanceof, or Zod parser).
- Replace with generic parameters, typed interfaces, or
@ts-ignore/@ts-nocheck:- Remove ignore directives. Fix underlying type mismatch or declare missing module augmentation.
- Loose object dictionaries (
Record<string, any>/dict):- Replace with explicit TypeScript
interfaceor PythonTypedDict/ Pydantic model.
- Replace with explicit TypeScript
- Bare strings and shapeless variants:
- A
stringthat only ever holds a few values becomes a string literal union ("draft" | "sent"). - An object whose fields depend on its kind becomes a discriminated union tagged by
typeorkind. - A string literal union is already strict; leave it as it is.
- A