zod
Skill4 starsChanged 21 days agoMITView on GitHub
Zod schema validation. Use when writing or reviewing Zod schemas, parsing untrusted data, handling coercion, refinements, transforms or validation errors, integrating forms or APIs, exporting JSON Schema, or migrating Zod versions.
23 other projects use a version of this.
Adopted by
Most recently taken up by
- compozy/compozytheir own version, first seen Nov 7, 2026
- anivar/zod-skilltheir own version, first seen Nov 3, 2026
- thongdn-it/react-agent-skillstheir own version, first seen Nov 1, 2026
- kriscard/Skillstheir own version, first seen Nov 1, 2026
- Alteriom/ai-dev-skillstheir own version, first seen Oct 11, 2026
- ragna-ai/ragna-studiotheir own version, first seen Oct 11, 2026
Used with
Projects with it also use tailwind-css-patterns, typescript-advanced-types and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
midudevSkilltailwind-css-patterns
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
Also in 3 projects that use this
xfstudioSkilltypescript-advanced-types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
Also in 5 projects that use this
VercelSkillturborepo
Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries.
Also in 4 projects that use this
VercelSkillai-sdk
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
Also in 3 projects that use this
BlockSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Also in 4 projects that use this
Other versions23 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 23
- legions-developer/evilcharts★ 3.2ksame name
- compozy/compozy★ 2.9ksame name
- legions-developer/invoicely★ 923same name
- pedronauck/skills★ 649same name
- jasonjgardner/blockbench-mcp-plugin★ 595same name
- tazo90/next-openapi-gen★ 196same name
- anivar/zod-skill★ 24same name
- PyModel/react-frontend-skills★ 23same name
- kriscard/Skills★ 15same name
- kevyder/banrepco_mcp★ 9same name
13 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- authoringSkill
- chrome-devtoolsSkill
- gamificationSkill
- imagegenSkill
- improve-architectureSkill
- instructionsSkill
- monorepoSkill
- reverse-engineerSkill
- runbookSkill
- security-reviewSkill
- setup-harnessSkill
- skillsSkill
- unslopSkill
- video-reportSkill
- youtube-transcriptSkill
- code-reviewSkill
- debugSkill
- interviewSkill
- prototypeSkill
- researchSkill
- workSkill
- adsenseSkill
- astryxSkill
- cloudflare-cliSkill
- dokploy-best-practicesSkill
- extract-themeSkill
- nextjsSkill
- payload-cmsSkill
- shadersSkill
- swrSkill
- tanstack-querySkill
- tanstack-routerSkill
- tanstack-startSkill
- tanstack-storeSkill
- tauriSkill
- vite-plusSkill
- web-assets-optimizationSkill
- web-extensionSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Read the consuming package's resolved Zod version, imports, TypeScript settings, existing schemas, adapters, and nearest tests.
- Distinctive: line 16
Use strict TypeScript checking.
- Very specific: line 64
Treat external data as unknown until the boundary succeeds.
- Distinctive: line 98
Keep authorization, database uniqueness, and transaction guarantees in their existing enforcement layers.
- Distinctive: line 107
Run the project's existing typecheck and focused tests.
“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zod
1. Establish the version and boundary
Read the consuming package's resolved Zod version, imports, TypeScript settings, existing schemas, adapters, and nearest tests. Account for multiple installed versions. Match the project's import style and preserve its validation layer. Use strict TypeScript checking; investigate incompatible adapters before changing their schema types. This skill targets Zod 4 Classic, with 4.6.5 as its documentation baseline; not every 4.x API is interchangeable.
| Task branch | Read before implementing |
| Zod 3 maintenance, major upgrade, or changing 4.x behavior | migration.md |
| Forms, query strings, environment variables, defaults, custom checks, errors | boundaries.md |
| Codecs, JSON Schema, metadata, Mini, library adapters, performance | interop.md |
| Unclear API availability or disputed behavior | Installed types and the official documentation for the resolved version |
Identify the raw representation, accepted values, parsed output, failure consumer, and synchronous or asynchronous execution. Finish with those five decisions explicit for each changed boundary.
2. Encode the contract
Reuse existing domain schemas where their accepted values and unknown-key policy match. Infer application-owned types from schemas; for externally owned contracts, check compatibility without erasing the concrete schema's inferred type.
| Contract decision | Zod 4 choice |
| Input versus parsed data | z.input<typeof Schema> versus z.output<typeof Schema>; z.infer is output |
| Absent, null, or either | .optional(), .nullable(), .nullish() respectively |
| Extra object keys | z.object strips; z.strictObject rejects; z.looseObject retains; .catchall(schema) validates extras |
| Tagged alternatives | z.discriminatedUnion with a shared discriminant |
| Untagged alternatives | z.union; test overlapping branches and their resulting output |
| All enum keys required | z.record(KeyEnum, ValueSchema) |
| Some enum keys allowed | z.partialRecord(KeyEnum, ValueSchema) |
Derive create, update, and public-response schemas deliberately. .partial() is
shallow; a PATCH contract must define absent versus explicit null and which fields
are writable. A database row schema is not automatically a safe write or response
schema. Select allowed fields before persistence or serialization.
Compose plain object shapes with .extend() or explicit shape spread. Check
overwritten keys and choose the resulting unknown-key policy. For refined objects
on 4.1+, use .safeExtend(): spreading .shape preserves fields, not object-level
checks. Its assignability check does not prove preservation of every runtime
restriction. Prefer object composition over an intersection when downstream code
needs object methods.
Finish when requiredness, variants, extra keys, and input/output differences are intentional rather than side effects of schema composition.
3. Parse and consume the result
Treat external data as unknown until the boundary succeeds. Choose safeParse
for an expected validation-failure branch, or parse where throwing a ZodError
matches the existing caller. Consume parsed data, including normalization,
transforms, defaults, and stripped keys; a successful check does not rewrite input.
import * as z from "zod";
const RenameProject = z.strictObject({
name: z.string().trim().min(1).max(120),
});
type RenameProjectInput = z.input<typeof RenameProject>;
type RenameProjectData = z.output<typeof RenameProject>;
export function validateRename(input: unknown) {
const result = RenameProject.safeParse(input);
if (!result.success) {
return { ok: false as const, issues: result.error.issues };
}
return { ok: true as const, data: result.data };
}Any asynchronous refinement or transform requires awaited parseAsync or
safeParseAsync throughout its callers. Safe parsing handles validation failures,
not arbitrary exceptions from user callbacks or unavailable services. Keep those
failures distinct from invalid input.
For Zod 4.6+, .validate() answers only whether input is acceptable. Use it only
when neither parsed output nor issues are needed; it narrows the input type, not
the output type. See interop.md for measured hot paths.
Validate at the server trust boundary even when the client uses the same schema. Keep authorization, database uniqueness, and transaction guarantees in their existing enforcement layers. Format validation is not authentication, sanitization, or permission to fetch a URL. Bound request size and nesting before costly parsing.
Finish when downstream effects receive the parsed contract and each failure has an explicit owner.
4. Verify the changed boundary
Run the project's existing typecheck and focused tests. Select relevant cases:
- Valid input yields the exact expected output, not merely
success: true. - Wrong types, absent keys, explicit
undefined,null, empty and whitespace-only strings take the intended paths. - Extra keys and privileged fields cannot cross the write or response boundary.
- Union overlap, nested paths, numeric limits, and enum-record omissions behave as specified.
- Coercion, defaults, transform order, and async rejection preserve the contract.
- Composition retains cross-field checks; adapters receive the right input/output types and error shape.
- Version changes preserve recorded fixtures or document intentional differences.
Report the resolved version, changed contracts, executed checks, and any untested integration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

