type-alias-compression
Installation
SKILL.md
Type Alias Compression Protocol (Generic Signature Normalization)
Overview
When writing enterprise applications in TypeScript, Python, or Rust, complex nested generic signatures (e.g., Promise<AxiosResponse<PaginatedResponse<UserProfileDTO>>>) are frequently repeated across 10 to 20 method definitions in a single module.
Repeating nested generic signatures causes:
- Severe Token Multiplication: Repeating an 80-character generic signature across 15 functions burns 400+ output tokens on syntax boilerplate.
- Maintenance Drift: Changing the underlying response envelope requires mutating 15 separate function signatures across the file.
- Cognitive Clutter: The actual function argument names are pushed off-screen by long type annotations.
The Type Alias Compression Protocol extracts common nested generic patterns into concise top-level type aliases (type Res<T> = ...), normalizing signatures to 1 to 2 clean tokens.