zod-llm-docs
Fetch Zod schema validation documentation via llms.txt for up-to-date API references
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Zod LLM Documentation
Zod provides comprehensive LLM-optimized documentation at https://zod.dev/llms.txt.
When to Use
Fetch this documentation when:
- Defining TypeScript-first schemas for data validation
- Working with Zod 4's new features (codecs, metadata, registries)
- Converting schemas to/from JSON Schema
- Customizing or formatting validation errors
- Integrating with form libraries or API validation
- Using Zod Mini for bundle size optimization
Key Topics Covered
- Schema Types: Primitives, Objects, Arrays, Unions, Records, Tuples
- String Validation: Email, UUID, URL, ISO datetime, IP addresses, JWT
- Transformations: Refinements, Transforms, Pipes, Codecs
- Error Handling: Custom errors, Formatting, Internationalization
- Advanced: Recursive objects, Discriminated unions, Branded types
- JSON Schema: Conversion, Metadata, Registries
Quick Reference
// Fetch Zod docs via Firecrawl
const docs = await firecrawl.scrape({
url: "https://zod.dev/llms.txt",
formats: ["markdown"]
});
Common Schema Patterns
import { z } from "zod";
// Basic object schema
const userSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
age: z.number().int().positive(),
role: z.enum(["admin", "user"]),
});
// Infer TypeScript type
type User = z.infer<typeof userSchema>;
Zod 4 Features
| Feature | Description |
|---|---|
| Codecs | Bidirectional encode/decode |
| Metadata | Attach metadata to schemas |
| Registries | Organize and reference schemas |
| Zod Mini | Tree-shakable minimal build |
| JSON Schema | Native conversion support |
Related Skills
-
effect-patterns- Effect TypeScript (uses Zod-like Schema) -
better-auth- Uses Zod for validation
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-03-03
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!