Skip to content

Zod 4 schema patterns with v3-to-v4 migration guidance for forms, request payloads, and adapters.

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

Own this skill? Claim it

What it does

  • Covers primitives, objects, arrays, records, unions, transformations, refinements, and optional/nullable handling
  • Lists breaking changes from Zod 3, such as top-level z.email(), z.uuid(), z.url(), the single error parameter, and z.strictObject
  • Shows superRefine cross-field checks using code: "custom" and React Hook Form integration via zodResolver
  • Points to UI schema locations in ui/types/formSchemas.ts, ui/types/authFormSchema.ts, and ui/types/integrations.ts

Install

$ npx -y skills add prowler-cloud/prowler --skill zod-4 -y

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

Files

Breaking Changes from Zod 3

// ❌ Zod 3 (OLD)
z.string().email()
z.string().uuid()
z.string().url()
z.string({ required_error: "Required", invalid_type_error: "Not a string" })
z.string().min(1, { message: "Required" })
schema.merge(other)
z.object({...}).strict()
z.ZodIssueCode.custom

// ✅ Zod 4 (NEW)
z.email()
z.uuid()
z.url()
z.string({ error: "Required" })          // single `error` param (string or function)
z.string().min(1, { error: "Required" }) // `message` still works but is deprecated
schema.extend(other.shape)
z.strictObject({...})
"custom"                                  // issue code literal in ctx.addIssue

z.ZodIssueCode.custom still compiles in Zod 4 (deprecated) and is used in ui/types/formSchemas.ts and ui/types/integrations.ts; use code: "custom" in new code.

Prowler UI schemas live in ui/types/formSchemas.ts, ui/types/authFormSchema.ts, ui/types/integrations.ts and next to the feature that uses them.

Basic Schemas

import { z } from "zod";

// Primitives
const stringSchema = z.string();
const numberSchema = z.number();
const booleanSchema = z.boolean();
const dateSchema = z.date();

Details

Repository
github.com/prowler-cloud/prowler
Categories
Frontend & UI Code, Backend & APIs
First seen
May 16, 2026

More from prowler-cloud/prowler

All 6

Similar to Zod 4

More Frontend & UI Code