zod

zod is a skill for Claude Code, Codex from kriscard/Skills. It costs 62 tokens per session (1,109 once invoked), scanned A, original, MIT.

A guide for using Zod 4 to check untrusted data and turn it into a known, structured shape. Zod is a TypeScript library for defining data rules and reporting invalid input.

In plain words
What is it for?
It is for creating and reviewing schemas, parsing data, transforming values, handling errors, composing rules, and producing JSON Schema descriptions.
Why use it?
It helps catch malformed data at system boundaries before the rest of the application relies on it. It also prevents code from assuming that every input matches the expected format.

Skill for Claude CodeCodex

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

Good fit It is for creating and reviewing schemas, parsing data, transforming values, handling errors, composing rules, and producing JSON Schema descriptions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kriscard/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 kriscard/Skills --skill zod
Clone the repo
git clone --depth 1 https://github.com/kriscard/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/kriscard/skills/zod/github.svg)](https://agentmods.dev/skills/kriscard/skills/zod)
Your own site
<a href="https://agentmods.dev/skills/kriscard/skills/zod"><img src="https://agentmods.dev/badge/skills/kriscard/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/kriscard/skills/zod"><img src="https://agentmods.dev/badge/skills/kriscard/skills/zod.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,109 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.00062 $0.01109
Opus 5.5 $0.00025 $0.00444
Sonnet 5.5 $0.00012 $0.00222
Haiku 4.5 $0.00006 $0.00111

Measured 1mo ago against content hash aff18fe27003, 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 1mo ago.

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/dev/zod/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Zod 4

Make untrusted values earn a trusted type once. Start this workflow only when the requested outcome changes, diagnoses, or verifies a Zod contract. Keep unrelated form lifecycle, authorization, UI, and transport failures with their owners even when Zod is nearby.

Workflow

1. Establish the effective contract

Inspect the resolved zod version, actual import path, TypeScript configuration, and affected adapter declarations. This skill targets Zod 4. Use the package root or zod/v4 for Classic and a Mini entrypoint only when the code intentionally uses Mini's functional API. Capability-check APIs introduced during Zod 4 instead of treating the major as a promise that every minor exposes them.

Complete when: the exact Zod 4 version, entrypoint, TypeScript version, and adapter versions are known, and every proposed API exists in those installed declarations.

2. Write the boundary contract

Before code, record:

  • the untrusted producer and raw representation;
  • the parsed output and whether it is still a wire model or a domain value;
  • strip, reject, preserve, or catchall behavior for unknown object keys;
  • synchronous or asynchronous parsing;
  • whether invalid input throws, branches locally, or becomes an adapter error;
  • whether reverse encoding or a published JSON Schema artifact is required.

Use unknown at external boundaries. Parse once, then pass the parsed output inward until another trust boundary is crossed. Keep independent domain rules outside schemas unless they are part of the boundary's validity.

Complete when: input, output, object policy, failure consumer, and artifact direction are explicit.

3. Load the matching reference

Priority Load when Reference
1 — Critical Imports, package capabilities, adapters, Standard Schema, or optional/newer Zod 4 APIs references/imports-and-capabilities.md
1 — Critical Boundary parsing, Query fetchers, input/output types, form conversion, coercion, transforms, defaults, codecs, or async schemas references/types-and-parsing.md
1 — High Object policy, composition, PATCH schemas, refinements, or cross-field rules references/objects-and-refinements.md
1 — High Custom messages, issues, error formatting, localization, logging, or API/form projections references/errors.md
1 — High Tagged unions, ordinary unions, enums, exhaustive records, or sparse enum maps references/unions-records-and-enums.md
2 — Conditional Metadata, registries, JSON Schema, structured outputs, documentation, or code generation references/metadata-and-json-schema.md
2 — Conditional Classic versus Mini, bundle size, compiler/validate APIs, CSP, or parse performance references/mini-and-performance.md

Read the full file on GitHub · 95 lines

Files

What ships with it

7 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. 1mo ago First seen · 95 lines · 62 tokens per session scan A aff18fe27003

Subscribe to this mod's changes

zod is a skill published in the GitHub repository kriscard/Skills (16 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 1,109 once invoked, about $0.0002 per session on Opus 5.5. 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-28.

Related

zod compared with skills from other repositories

zod next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
zodkriscard/SkillsSkill163d agoMITA62Claude Code, Codex
nestjsericrisco/rsc-harnessSkill695todayMITA81Claude Code, Codex
node-modernWrongStack/WrongStackSkill447todayMITA123Claude Code, Codex
bun-runtime-expertroedyrustam/vibes-plugSkill1315d agoMITA51Cursor
js-backend-expertroedyrustam/vibes-plugSkill1315d agoMITA48Cursor
node-typescript-servicemakifbaysal/tasktrooperSkill123yesterdayApache-2.0A51Claude Code, Codex
nodejs-backendiliaal/ai-skillsSkill483d agoMITA69Claude Code