agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/zod/SKILL.md

zod

Skill13 starsChanged 28 days agoMITView on GitHub

  • Installs packages

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use tailwind-css-patterns, typescript-advanced-types and 6 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.
  • midudevSkill

    tailwind-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

  • xfstudioSkill

    typescript-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

  • VercelSkill

    ai-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

  • nilssonrSkill

    seo

    Full SEO workflow for auditing pages and creating SEO-optimized content. Provides checklists with educational explanations aligned with Google Search Central documentation.

    Also in 3 projects that use this

  • SupabaseSkill

    copywriting

    Write or audit UI copy (buttons, labels, empty states, error messages, tooltips, form text) anywhere in the monorepo. Load it before shipping or reviewing any user-facing text — including when copy is incidental to the task, like a new feature that adds buttons, toasts, dialogs, or validation messages.

    Also in 3 projects that use this

  • BlockSkill

    frontend-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

The file

We found no rules to list in this file: it reads as prose or reference rather than instructions.

Files
SKILL.md

Zod Schema Validation Skill

Overview

Zod is a TypeScript-first schema declaration and validation library used across API route handlers, tRPC procedures, environment variable checks, and AI structured output schemas.

Installation

npm install zod

Core Concepts

  • z.object(): Defines object validation schemas and strips unknown keys by default.
  • .safeParse(input): Returns { success: true, data } or { success: false, error } without throwing exceptions.
  • z.infer<typeof Schema>: Extracts the exact static TypeScript type from a runtime schema.

AI Pitfalls

  • OpenAI Structured Outputs Compatibility: OpenAI's strict JSON schema mode rejects .optional() fields unless they are .nullable(). Use z.string().nullable() when passing Zod schemas to LLM structured output helpers.
  • Query String Coercion: URL search params are always strings. Use z.coerce.number().int().positive() for pagination parameters like ?page=2.

Production Checklist

  • HTTP route handlers use .safeParse() and return 400 Bad Request with result.error.flatten()
  • Environment variables validated at startup via an EnvSchema
  • Types exported via type Payload = z.infer<typeof PayloadSchema>

Last Verified: 2026-10-21

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.