zod

zod is a skill for Claude Code, Codex from neverinfamous/memory-journal-mcp. It costs 53 tokens per session (525 once invoked), scanned A, original, MIT.

A set of standards for using Zod, a TypeScript library that checks whether data matches an expected shape. It covers validation, custom checks, data conversion, and error handling.

In plain words
What is it for?
Use it when defining schemas, checking user input, validating API or tool data, reading environment variables, or converting validated values.
Why use it?
It helps prevent malformed or unsafe data from crossing boundaries such as APIs, tools, databases, and configuration files. It also clarifies when validation should report an error or throw one.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/neverinfamous/memory-journal-mcp/zod
Any agent
npx skills add neverinfamous/memory-journal-mcp --skill zod
Clone the repo
git clone --depth 1 https://github.com/neverinfamous/memory-journal-mcp

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/neverinfamous/memory-journal-mcp/zod.svg)](https://agentmods.dev/skills/neverinfamous/memory-journal-mcp/zod)
Your own site
<a href="https://agentmods.dev/skills/neverinfamous/memory-journal-mcp/zod"><img src="https://agentmods.dev/badge/skills/neverinfamous/memory-journal-mcp/zod.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 525 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00053 $0.00525
Opus 5 $0.00026 $0.00262
Sonnet 5 $0.00011 $0.00105
Haiku 4.5 $0.00005 $0.00052

Measured 5d ago against content hash 5f4091ed78a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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/zod/SKILL.md · 49 lines

What it actually says

Zod Schema Validation

Zod provides strict schema validation and static type inference. It is mandatory for all system boundaries (API endpoints, MCP tools, database inputs, environment variables).

1. Parsing vs Safe Parsing

  • schema.parse(): Throws a ZodError if validation fails. Use this when the framework handles errors globally (e.g., tRPC, Next.js server actions with error boundaries).
  • schema.safeParse(): Returns { success: true, data } or { success: false, error }. Use this when you need to handle validation errors gracefully without throwing exceptions (e.g., in MCP tool execution handlers or client-side form logic).

2. Refinements and SuperRefinements

  • .refine(): Use for custom validation logic (e.g., verifying a string is a valid ID in the database).
  • .superRefine(): Use when you need to attach errors to specific fields within a nested object structure, rather than just the top level.
const passwordSchema = z.string().superRefine((val, ctx) => {
  if (val.length < 8) {
    ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Too short' })
  }
})

3. Transformations

  • .transform(): Use transforms to parse strings into numbers, trim whitespace, or instantiate objects (e.g., converting an ISO string to a Date object).
  • .catch() / .default(): Use to provide fallback values for resilient parsing.

4. Environment Variables

  • Mandatory Env Validation: Use Zod to parse process.env at application startup. This ensures the app crashes immediately with a clear error if required variables are missing, rather than failing silently later.
const envSchema = z.object({
  DATABASE_URL: z.string().url(),
  PORT: z.coerce.number().default(3000),
})
export const env = envSchema.parse(process.env)

5. Inference

  • Always infer TypeScript types directly from the schema using z.infer<typeof schema>. Never manually write interfaces that duplicate Zod schemas.
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. 5d ago First seen · 49 lines · 53 tokens per session scan A 5f4091ed78a4

Subscribe to this mod's changes

zod is a skill published in the GitHub repository neverinfamous/memory-journal-mcp (20 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 525 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other skills, from other repositories

create-gsd-extension

Create, debug, and iterate on GSD extensions (TypeScript modules adding tools, commands, event hooks, custom UI, and providers). Use when asked to build an extension, add a tool the LLM can call, register a slash command, hook into GSD events, create custom TUI components, or modify GSD behavior. Triggers on…

open-gsd/gsd-pi · 101 tokens

capability

Creates or modifies a capability class in domain/capabilities/ and its corresponding Has interface in domain/tools/contracts.ts. Use when adding a new tool runtime behavior (agents, skills, commands, rules, mcp, hooks, settings, plugins), changing the constructor params of an existing capability class, or wiring a new…

ai-driven-dev/framework · 122 tokens

faf-expert

Expert in the .faf format (Persistent Project Context for AI) and the faf-cli toolkit. Use when working with .faf files, scoring AI-readiness, syncing project context to CLAUDE.md, or discussing the Foundational Context Layer (FCL) doctrine. IANA-registered (application/vnd.faf+yaml). Anthropic-listed as "Persistent…

Wolfe-Jam/faf-cli · 82 tokens

javascript-typescript

JavaScript and TypeScript development with ES6+, Node.js, React, and modern web frameworks. Use for frontend, backend, or full-stack JavaScript/TypeScript projects.

myths-labs/muse · 40 tokens

build-error-resolver

Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur.

myths-labs/muse · 26 tokens

structural-code-editing

Trigger: navegar, analizar o editar TypeScript/JavaScript con el compilador. Use tools AST preparadas, revisadas y vinculadas por hash.

yailPeralta/ast-mcp-server · 37 tokens