template-literal-types

Installation
SKILL.md

Use Template Literal Types to Model DSLs and String Relationships

Overview

Template literal types bring the power of JavaScript template literals to TypeScript's type system. They allow you to model structured subsets of strings, parse domain-specific languages (DSLs), and capture relationships between string types. Combined with conditional types and the infer keyword, they enable sophisticated string manipulation at the type level.

This skill is essential for bringing type safety to string-heavy APIs and for building powerful type transformations.

When to Use This Skill

  • Modeling structured string patterns (IDs, paths, URLs)
  • Parsing domain-specific languages (CSS selectors, query languages)
  • Transforming string types (camelCase, snake_case conversion)
  • Validating string formats at compile time
  • Combining with mapped types for key transformations

The Iron Rule

Use template literal types to model structured string subsets and DSLs. Combine with infer for parsing and mapped types for transformations.

Installs
14
GitHub Stars
2
First Seen
Feb 3, 2026
template-literal-types — marius-townhouse/effective-typescript-skills