TypeBox + Fastify

Build type-safe Fastify APIs with TypeBox schemas and OpenAPI generation.

88|11|Updated Apr 28, 2020
One-click install
npx skills add https://github.com/blockmatic/basilic --skill typebox-fastify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TypeBox + Fastify
Source: https://github.com/blockmatic/basilic/tree/main/.cursor/skills/fastify-v5
Command: npx skills add https://github.com/blockmatic/basilic --skill typebox-fastify

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Builds robust, type-safe Fastify APIs by using TypeBox schemas for route validation and automatic OpenAPI generation.

Core Features & Use Cases

  • TypeBox-based schemas for route validation (params, query, body, response) with automatic type inference via TypeBoxTypeProvider.
  • OpenAPI generation and documentation synchronization using Fastify Swagger with schema-driven contracts.
  • Clear patterns for composing routes and plugins to deliver end-to-end, production-grade APIs.

Quick Start

Install the skill and start defining Fastify routes with TypeBox schemas to enable automatic OpenAPI generation.

Frequently Asked Questions about TypeBox + Fastify

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

FAQPage Schema
How do I build type-safe Fastify APIs with TypeBox schemas?

You build type-safe Fastify APIs by defining TypeBox schemas for params, query, body, and responses, then applying the TypeBoxTypeProvider to enforce schema-driven contracts and automatic type inference across your routes.

Can I generate OpenAPI documentation automatically from Fastify TypeBox routes?

You generate OpenAPI documentation automatically by integrating Fastify Swagger with TypeBox schemas, synchronizing schema-driven request and response contracts directly into the OpenAPI specification.

Does Fastify v5 support TypeBox for route validation and type inference?

Fastify v5 supports TypeBox for route validation and type inference when configured with the TypeBoxTypeProvider, ensuring strict mode TypeScript compatibility and automatic type generation for REST APIs.

What is the best way to structure Fastify REST API schemas for production?

The best way to structure production-grade Fastify REST APIs is to define response schemas for all statuses using TypeBox, compose routes and plugins clearly, and enforce schema-driven request and response typing.

Why do I need to define response schemas for all statuses in Fastify?

Defining response schemas for all statuses in Fastify is required to enforce end-to-end type safety, ensure accurate OpenAPI generation, and maintain strict schema-driven contracts for every API outcome.