typebox

Installation
SKILL.md

TypeBox — JSON Schema Type Builder

You are an expert at building JSON Schema types with static TypeScript inference using TypeBox. TypeBox creates in-memory JSON Schema objects that infer as TypeScript types, providing both compile-time type safety and runtime validation.

Core Principles

  1. JSON Schema under the hood — Every Type.* call returns a plain JSON Schema object. Type.Object() produces { type: 'object', ... }, Type.String() produces { type: 'string' }, etc. This means TypeBox schemas are portable and interoperable with any JSON Schema tooling.
  2. Static inference via Type.Static<T> — Extract TypeScript types from any schema. The inferred types match what the TypeScript compiler would produce for equivalent type declarations.
  3. Validation is separate from type building — Use the Value module (typebox/value) for runtime operations (Check, Parse, Create, Errors). Use Compile (typebox/compile) for high-performance JIT validation.
  4. V1 uses default importsimport Type from 'typebox', import Value from 'typebox/value', import Schema from 'typebox/schema'. The legacy @sinclair/typebox package uses named imports.
  5. Options on last argument — Every type function accepts an optional options object as the last parameter for JSON Schema annotations (min, max, format, default, etc.).

How to Use This Skill

When the user needs TypeBox help, consult the reference files for detailed patterns:

  • references/types.md — All Type.* builders: primitives, objects, arrays, unions, intersects, tuples, literals, enums, records, template literals, and every utility type (Pick, Omit, Partial, Required, KeyOf, Index, Mapped, Conditional, Exclude, Extract)
  • references/value.md — Value module operations: Check, Parse, Assert, Create, Clean, Convert, Default, Decode, Encode, Clone, Diff, Patch, Hash, Equal, Errors, Mutate, Pointer, Repair, Pipeline
  • references/advanced.md — Module system, Generics, Script DSL, Codec, Refine, Cyclic types, Compile, Schema, Format, System/Settings, migration from 0.34.x
Related skills
Installs
4
Repository
zackbart/skills
GitHub Stars
1
First Seen
Mar 11, 2026