OpenParable
Skip to content
← Back to skills

Typebox

Development
typebox

Typebox is an Agent Skill for development published in the EpicenterHQ/epicenter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

TypeBox patterns for runtime schema validation and JSON Schema generation. Use when mentioning TypeBox, Standard Schema, or schema-based validation.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/EpicenterHQ/epicenter/blob/HEAD/.agents/skills/typebox/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/typebox, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

TypeBox

Package Names

Use typebox, not @sinclair/typebox. The @sinclair/typebox package is deprecated.

// Correct
import { Type } from 'typebox';
import { Compile } from 'typebox/compile';
import { Value } from 'typebox/value';

// Wrong - deprecated
import { Type } from '@sinclair/typebox';

When to Use What

NeedUse
Define schemastypebox with Type.*
One-off validationValue.Check() from typebox/value
High-performance validationCompile() from typebox/compile

TypeBox schemas are portable JSON Schema-shaped data. If a TypeBox boundary needs validation, validate the TypeBox schema directly:

import { Type } from 'typebox';
import { Compile } from 'typebox/compile';
import { Value } from 'typebox/value';

const schema = Type.Object({ name: Type.String(), age: Type.Number() });

Value.Check(schema, value); // boolean

const validator = Compile(schema);
validator.Check(value); // boolean
validator.Parse(value); // throws or returns typed value

Standard Schema Boundary

TypeBox does not implement Standard Schema. Do not write TypeBox code that expects schema['~standard']. If a boundary accepts Standard Schema, prefer Arktype or another schema library that implements it natively. If a boundary owns TypeBox schemas, keep the boundary TypeBox-native and use JSON Schema as the portable representation.

Repo Policy

Use TypeBox for portable schema objects: workspace tables, kv, fields, actions, MCP inputs, manifests, and other surfaces that need JSON Schema shape, metadata, Static<>, or schema inspection. Use Arktype for local runtime validation, request parsing, env/config parsing, persisted UI state, transforms, and branded domain values.

References