zod

zod is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (297 once invoked), scanned A, original, MIT.

A TypeScript schema-validation guide explains how to describe and check the shape of data at runtime. TypeScript is a programming language that adds type checking to JavaScript.

In plain words
What is it for?
It helps validate API inputs, environment variables, URL parameters, and AI-generated JSON with Zod.
Why use it?
It helps catch invalid request data, environment settings, and generated structured data before the application uses them.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps validate API inputs, environment variables, URL parameters, and AI-generated JSON with Zod.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/zod
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashish7802/awesome-api-skills --skill zod
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for zod

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/zod/github.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/zod)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/zod"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/zod/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for zod

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/zod"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/zod.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 297 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00297
Opus 5.5 $0.00000 $0.00119
Sonnet 5.5 $0.00000 $0.00059
Haiku 4.5 $0.00000 $0.00030

Measured yesterday against content hash 11a84c915a50, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

zod scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (examples/schema-validation.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/zod/SKILL.md · 27 lines

What it actually says

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

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 27 lines · 0 tokens per session scan A 11a84c915a50

Subscribe to this mod's changes

zod is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 297 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-22.

Related

Other skills, from other repositories

client-setup

Create a vanilla tRPC client with createTRPCClient (), configure link chain with httpBatchLink/httpLink, dynamic headers for auth, transformer on links (not client constructor). Infer types with inferRouterInputs and inferRouterOutputs. AbortController signal support. TRPCClientError typing.

trpc/trpc · 63 tokens

adapter-express

Mount tRPC as Express middleware with createExpressMiddleware() from @trpc/server/adapters/express. Access Express req/res in createContext via CreateExpressContextOptions. Mount at a path prefix like app.use('/trpc', ...). Avoid global express.json() conflicting with tRPC body parsing for FormData.

trpc/trpc · 67 tokens

trpc-router

Entry point for all tRPC skills. Decision tree routing by task: initTRPC.create(), t.router(), t.procedure, createTRPCClient, adapters, subscriptions, React Query, Next.js, links, middleware, validators, error handling, caching, FormData.

trpc/trpc · 59 tokens

azure-identity-ts

Authenticate to Azure services using Azure Identity library for JavaScript (@azure/identity). Use when configuring authentication with DefaultAzureCredential, managed identity, service principals, or interactive browser login.

microsoft/skills · 41 tokens

chat-sdk

Build multi-platform chat bots with Chat SDK (chat npm package). Use when developers want to (1) Build a Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, or WhatsApp bot, (2) Use Chat SDK to handle mentions, direct messages, subscribed threads, reactions, slash commands, cards, modals, files, or AI…

vercel-labs/open-agents · 191 tokens

zod-validation-utilities

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. Use when designing validation layers, parsing z.string(), z.object(), or z.email() schemas, or implementing…

giuseppe-trisciuoglio/developer-kit · 77 tokens