What problem does it solve?
TypeSpec provides a language to model structured data, APIs, and contracts; this Skill unit introduces the core concepts of syntax, types, decorators, namespaces, templates, and the standard library to help teams design consistent TypeSpec artifacts.
Core Features & Use Cases
- Define TypeSpec models, scalars, enums, unions, interfaces, and operations
- Use decorators like @doc, @summary, @pattern, @minValue, @maxValue, @key, and @secret
- Organize code with namespaces and imports
- Create reusable templates with type parameters
- Declare functions with extern fn for type transforms and value computation (1.10+)
- Apply visibility modifiers (read, update, create, delete)
- Use standard library types (string, int32, int64, float64, boolean, utcDateTime, uuid)
Quick Start
Create a minimal TypeSpec example that defines a User model with a few decorators and a Paginated template.