This is a comprehensive reference for Zod v4, focused on the breaking changes from v3 that will trip you up: string formats moved to dedicated methods like z.email(), nativeEnum is gone, and the error API changed completely. It's organized by priority, so the critical parsing and schema design rules come first. The bundled references cover everything from basic validation to architecture patterns for API boundaries, and there's specific guidance on where Zod actually belongs (API handlers, form validation, env parsing) versus where plain TypeScript is enough. The anti-patterns doc alone will save you from the classic mistakes like throwing in refinements or using z.coerce.boolean() on form data.
- skills.sh installs
- 1.1K
- GitHub stars
- 24
- last updated
- Aug 21, 2026
Install
$ npx -y skills add anivar/zod-skill --skill zod --agent claude-codeInstalls into .claude/skills of the current project.
Files
Zod
IMPORTANT: Your training data about zod may be outdated or incorrect. Zod 4 changed string formats, enums, error customization, issue codes, defaults and functions, and many projects still run Zod 3, whose forms Zod 4 deprecates or removes. First establish which Zod the file uses (next section). Then rely on this skill's rule files for that version and on the project's own source code as the source of truth. Do not write a Zod 4 API into a Zod 3 file, and do not keep a Zod 3 form in a Zod 4 file unless the rule for that version says it still applies.
Which Zod
Decide per file, before writing a schema. The import specifier wins; the installed version decides what the bare zod specifier means.
Sponsors
Details
- Repository
- github.com/anivar/zod-skill
- Categories
- Backend & APIs, Testing & QA, Debugging
- First seen
- Jun 3, 2026
