typespec

Develop TypeSpec API definitions and generate OpenAPI specs, TypeScript types, validators, routes, and handler stubs.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/monobaselabs/monobase-js --skill typespec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typespec
Source: https://github.com/monobaselabs/monobase-js/tree/main/.claude/skills/typespec
Command: npx skills add https://github.com/monobaselabs/monobase-js --skill typespec

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeSpec-based API design and code generation streamline creating and maintaining robust API contracts by turning TypeSpec definitions into OpenAPI specs, TypeScript types, validators, routes, and handler stubs.

Core Features & Use Cases

  • OpenAPI & TypeScript generation from TypeSpec contracts
  • Validator scaffolding for input/output
  • End-to-end scaffolding for new endpoints and modules

Quick Start

Run bun run build in specs/api and bun run generate in services/api-ts to generate the OpenAPI spec, TypeScript types, validators, routes, and handler stubs.

Frequently Asked Questions about typespec

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

FAQPage Schema
How do I generate OpenAPI specs and TypeScript types from TypeSpec definitions?

You can generate OpenAPI specs and TypeScript types from TypeSpec by running the build command in your specs directory, then executing the generate command in your services directory to produce the full client and server code pipeline.

What is the best way to scaffold validators and handler stubs for a new API endpoint?

Scaffolding validators and handler stubs is handled by defining your API contract in TypeSpec and running the code generation pipeline, which automatically outputs the required input and output validators alongside route handlers.

Can I use TypeSpec to generate routes and handler stubs for an existing TypeScript API?

Yes, TypeSpec supports modifying existing contracts by running the generation pipeline, which outputs updated TypeScript types, validators, routes, and handler stubs to ensure consistency across your existing API modules.

What problems does TypeSpec solve for API contract design and code generation?

TypeSpec streamlines creating and maintaining robust API contracts by turning definitions into OpenAPI specs, TypeScript types, validators, routes, and handler stubs, ensuring consistency between contract design and generated code.

How do I validate generated artifacts after running the TypeSpec code generation pipeline?

The TypeSpec workflow verifies generated artifacts to ensure consistency by building specs, generating client and server code, and checking the outputs against the defined API contracts during the generation process.

Do I need a specific workflow to build TypeSpec specs and generate server code?

Yes, the workflow requires running a build step in the specs directory and a generate step in the services directory, following the process from reviewing patterns to building, generating, and validating the outputs.