zod-4
Installation
SKILL.md
When to Use
Triggers: When validating data, defining schemas, working with forms, or using Zod for type safety.
Load when: validating user input, defining data schemas, working with React Hook Form + Zod, or migrating from Zod 3.
Critical Patterns — Breaking Changes from v3
// ✅ Zod 4 — top-level validators
const emailSchema = z.email();
const urlSchema = z.url();
const uuidSchema = z.uuid();
// ❌ Zod 3 (no longer works the same way)
const emailSchema = z.string().email();
// ✅ Zod 4 — min(1) instead of nonempty()
const nameSchema = z.string().min(1);
Related skills