Creates reusable Zod v4 schemas, validates API payloads, forms, and configuration input, transforms and coerces data safely, and handles validation errors with strong type inference for TypeScript applications.
SkillScore91Maintained
Automatic
◆Coding pack
Last verified 8/21/2026
What it changes
Passed 21 of 23 test cases with the skill, and 11 of 23 without it.
Without skill48%
With skill91%
Checks it passed that the model alone missed
Uses z.coerce.boolean() with default(false).
Uses top-level z.email() for email validation.
Uses top-level z.url() for website validation.
and 13 more in the full report
10 fixed11 passed either way2 still failing0 broke
Pass-rate lift
+43 pp
Tokens
+74%
Agent turns
0%
Response time
-34%
Model gemini-3.6-flashMeasured 8/21/2026v121 of 23 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 10 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 10
Prompt
Write a schema using modern Zod v4 top-level primitive syntax to validate an internal identifier string as a valid UUID with custom error message 'Invalid user id'.
What was checked, without and with the skill
Checked
Without skill
With skill
Uses top-level z.uuid({ error: "Invalid user id" }).
Missed
Passed
case-16 · gemini-3.6-flash · 8/21/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md202 lines2 files
Zod Validation Utilities
Overview
Production-ready Zod v4 patterns for reusable, type-safe validation with minimal boilerplate. Focuses on modern APIs, predictable error handling, and form integration.
When to Use
Defining request/response validation schemas in TypeScript services
Parsing untrusted input from APIs, forms, env vars, or external systems
Standardizing coercion, transforms, and cross-field validation
Building reusable schema utilities across teams
Integrating React Hook Form with Zod using zodResolver
Instructions
Start with strict object schemas and explicit field constraints
Prefer modern Zod v4 APIs and the error option for error messages
Use coercion at boundaries (z.coerce.*) when input types are uncertain
Keep business invariants in refine/superRefine close to schema definitions
Export both schema and inferred types (z.input/z.output) for consistency
Reuse utility schemas (email, id, dates, pagination) to reduce duplication
Validation Workflow
When integrating validation into an API handler or service:
Define the schema at the boundary (handler, queue, config loader)
Parse with safeParse to handle errors gracefully
Checkresult.success to branch on failure/success
Useresult.data with full type inference in success path
Return formatted errors or proceed with validated data
See example 7 (safeParse workflow) for the complete pattern.