precise-string-types

Installation
SKILL.md

Prefer More Precise Alternatives to String Types

Overview

The string type is enormous. Use narrower types when possible.

String literal unions, template literal types, and keyof give you better type safety, autocomplete, and documentation than plain string.

When to Use This Skill

  • Defining properties with limited valid values
  • Creating function parameters that accept specific strings
  • Working with object keys or property names
  • Seeing "stringly typed" code
  • Getting no autocomplete on string parameters

The Iron Rule

Related skills
Installs
10
GitHub Stars
2
First Seen
Feb 3, 2026