Zod Documentation
Zod is a TypeScript-first schema validation library with static type inference. It provides a powerful API for defining schemas, validating data at runtime, and automatically inferring TypeScript types from those schemas.
Quick Reference
| File | Title | Description |
|---|---|---|
contents/index.mdx | Intro | Introduction to Zod - TypeScript-first schema validation library with static type inference |
contents/basics.mdx | Basic usage | Basic usage guide covering schema definition, parsing data, error handling, and type inference |
contents/api.mdx | Defining schemas | Complete API reference for all Zod schema types, methods, and validation features |
contents/codecs.mdx | Codecs | Bidirectional transformations with encode and decode (new in v4.1) |
contents/error-customization.mdx | Error customization | Guide to customizing error messages and error handling behavior |
contents/error-formatting.mdx | Formatting errors | Utilities for formatting and displaying Zod validation errors |
contents/json-schema.mdx | JSON Schema | Converting Zod schemas to JSON Schema format |
contents/metadata.mdx | Metadata | Attaching metadata to schemas for documentation and tooling |
contents/library-authors.mdx | Library authors | Guidelines for library authors integrating Zod |
contents/ecosystem.mdx | Ecosystem | Overview of the Zod ecosystem including integrations, tools, and community resources |
contents/blog/clerk-fellowship.mdx | Clerk Fellowship | Blog post about Clerk Fellowship |
contents/packages/zod.mdx | Zod package | Main Zod package documentation |
contents/packages/core.mdx | Zod Core | Zod Core package documentation |
contents/packages/mini.mdx | Zod Mini | Zod Mini package documentation - lightweight alternative |
contents/v4/index.mdx | Zod v4 | Zod v4 overview and introduction |
contents/v4/changelog.mdx | v4 Changelog | Zod v4 changelog and release notes |
contents/v4/versioning.mdx | v4 Versioning | Zod v4 versioning strategy and migration guide |
When to use
Use this skill when the user asks about:
- •Zod schema definition and validation
- •TypeScript type inference from schemas
- •Parsing and validating data at runtime
- •Error handling and error formatting
- •Schema types (primitives, objects, arrays, unions, etc.)
- •Zod transformations and refinements
- •Converting schemas to JSON Schema
- •Zod v4 features and migration
- •Zod Mini or Core packages
- •Integrating Zod with other libraries
How to find information
- •Check Quick Reference above for relevant files
- •Read
TOC.mdfor complete listing - •Read specific files from
contents/{filename}
Getting started: Start with contents/basics.mdx for basic usage
API reference: See contents/api.mdx for complete schema API
Error handling: See contents/error-formatting.mdx and contents/error-customization.mdx