# zod-validation-expert

Guides Claude Code on writing TypeScript schemas with Zod, handling static type inference, and connecting validation to React Hook Form.

- skill · `type=skill` · Claude Code · 238 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/web-development/zod-validation-expert
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/zod-validation-expert

## What it does

This skill configures the coding agent to build schema definitions for application inputs. It emphasizes parsing over simple validation, prompting the model to use type coercion on query strings or form payloads.

The instructions cover deriving static definitions via `z.infer`, processing responses with `safeParse`, and configuring transformations. It also supplies patterns for binding schemas to React Hook Form adapters and Next.js server actions.

Your project requires TypeScript and the `zod` package in `node_modules`. Without them, the generated schemas will fail compilation.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill web-development/zod-validation-expert
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill zod-validation-expert -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/zod-validation-expert/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/zod-validation-expert/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/zod-validation-expert/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/zod-validation-expert/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates zod-validation-expert
```

2. **Manually: put the files in place**
- File: `.github/skills/zod-validation-expert/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/web-development/zod-validation-expert
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/zod-validation-expert/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/web-development/zod-validation-expert

## When to use it
- generate TypeScript types directly from runtime schemas
- coerce and validate incoming form data in Next.js actions
- wire Zod resolvers into React Hook Form components
- implement cross-field validation rules using refine

## Example prompts
- Write a Zod schema for a user profile form with custom password matching logic.
- Generate a typed validation schema for Next.js Server Actions handling FormData with boolean flags.
- Create a discriminated union schema in Zod and extract the resulting TypeScript type.

## Similar
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs
- [hyperframes](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes.md) — skill · 1200000 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
