Skip to content

Zod v4 and v3 schema validation skill that detects the version per file and applies matching rules.

CCM score
64 of 100
skills.sh installs
1.3K
GitHub stars
24
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers safeParse, object composition, refinements, transforms, codecs, branded types, and v3→v4 migration
  • Includes separate rule sets for Zod 4 and Zod 3 files, selected from the import specifier and lockfile version
  • Enforces parseAsync() for async refinements and z.infer for output types instead of duplicated types
  • Designed for TypeScript projects validating API input, form data, or env vars, with Jest or Vitest schema tests

Install

$ npx -y skills add anivar/zod-skill --skill zod -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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.

Details

Repository
github.com/anivar/zod-skill
Categories
Frontend & UI Code, Backend & APIs, Testing & QA
First seen
Jun 3, 2026

Questions

What is the zod skill for?

The zod skill covers Zod v4 best practices for schema validation, safeParse, object composition, refinements, transforms, branded types and type inference in TypeScript. It also covers migrating from v3 to v4 and testing schemas with Jest or Vitest.

How do I install the zod skill?

Run npx -y skills add anivar/zod-skill --skill zod -y in your project. After that, the agent can write and review Zod schemas using the skill's rules.

Does the zod skill work with Zod 3 projects?

Yes, the skill checks which Zod version a file uses and applies the matching rules. It has separate Zod 3 rule files for projects still on the zod ^3.25.0 line.

Which skills lead the Frontend & UI Code category?

The zod skill sits in the Frontend & UI Code category alongside vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns and lark-apps. It focuses on runtime schema validation rather than UI or design guidance.