prefer-type-annotations

Installation
SKILL.md

Prefer Type Annotations to Type Assertions

Overview

Type annotations (: Type) verify that values conform to types. Type assertions (as Type) tell TypeScript to trust you.

Annotations check your work. Assertions bypass checks. When you have a choice, prefer annotations.

When to Use This Skill

  • Assigning values to variables
  • Defining function return types
  • Working with object literals
  • Tempted to use as Type to fix errors
  • Getting "not assignable" errors

The Iron Rule

Installs
15
GitHub Stars
2
First Seen
Feb 3, 2026
prefer-type-annotations — marius-townhouse/effective-typescript-skills