typespec-core

Define and organize TypeSpec models, scalars, enums, and operations.

1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/hafley66/claude-research --skill typespec-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typespec-core
Source: https://github.com/hafley66/claude-research/tree/main/skills/typespec-core
Command: npx skills add https://github.com/hafley66/claude-research --skill typespec-core

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about typespec-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define TypeSpec models and organize them into namespaces?

To define TypeSpec models and organize them, you declare models, scalars, and enums within namespace blocks. This Skill helps structure TypeSpec projects by applying decorators and visibility rules across real-world API contracts.

Can I create reusable TypeSpec templates with type parameters?

Yes, you can create reusable TypeSpec templates with type parameters. This enables template reuse for common API patterns like pagination, allowing you to define generic structures such as Paginated<T> efficiently.

What decorators are available for API design in TypeSpec?

TypeSpec API design uses decorators like @doc, @summary, @pattern, @minValue, @maxValue, @key, and @secret. These decorators apply validation rules and metadata directly to your models and operations for structured API contracts.

Does TypeSpec 1.10+ support extern functions for type transforms?

Yes, TypeSpec 1.10+ supports declaring functions with extern fn for type transforms and value computation. This allows you to perform complex type manipulations and custom logic within your TypeSpec definitions.

What standard library types are available when modeling TypeSpec APIs?

TypeSpec standard library types include string, int32, int64, float64, boolean, utcDateTime, and uuid. Using these built-in scalars ensures syntax correctness and compatibility when defining your API data models.

How do I apply visibility modifiers to TypeSpec model properties?

You apply visibility modifiers like read, update, create, and delete to TypeSpec model properties. This controls when specific fields appear in API operations, ensuring proper data exposure across different API lifecycle stages.