Skip to content
Agentmart
Submit a tool

zod-to-valibot

Skill by karlarao

IndexedMIT★ 2
Write a review

Chalk Labs

Need help deploying zod-to-valibot?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/karlarao-zod-to-valibot

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The publisher has not written a description yet.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
zod-to-valibot
Description
None
License
MIT
Instructions
51 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • missing YAML frontmatter
  • name: missing
  • description: missing

Files (3)

  • EXAMPLES.md
  • REFERENCE.md
  • SKILL.md

SKILL.md (first lines)

# Zod to Valibot Migration

## Key differences

Zod uses **method chaining** (`z.string().email().min(5)`). Valibot uses **functional pipes** (`v.pipe(v.string(), v.email(), v.minLength(5))`). Every chain becomes a `v.pipe()` call.

Zod calls parse on the schema (`schema.safeParse()`). Valibot calls parse as a standalone function (`v.safeParse(schema, input)`).

## Workflow

1. **Install Valibot**:
   - [ ] `npm install valibot` (or pnpm/bun equivalent)

2. **Try the automated codemod first** (handles ~80% of cases):
   - [ ] `npx @valibot/zod-to-valibot --dry "src/**/*"` to preview
   - [ ] `npx @valibot/zod-to-valibot "src/**/*"` to apply
   - [ ] Review output for errors — codemod is beta and misses edge cases

3. **Fix what the codemod missed** — use [REFERENCE.md](REFERENCE.md) for the full API mapping

4. **Migrate validation wrappers** — any utility that accepts `z.ZodType` or calls `schema.safeParse()` needs updating. See [EXAMPLES.md](EXAMPLES.md) for a complete wrapper migration.

5. **Update imports**:
   - [ ] Replace `import { z } from "zod"` with `import * as v from "valibot"`
   - [ ] Replace `z.infer<typeof schema>` with `v.InferOutput<typeof schema>`
   - [ ] Replace `z.input<typeof schema>` with `v.InferInput<typeof schema>`

6. **Verify**:
   - [ ] Run type checker (`tsc --noEmit`)
   - [ ] Run tests
   - [ ] Remove `zod` from dependencies

## Critical gotchas

- `z.enum(['a','b'])` becomes `v.picklist(['a','b'])` — NOT `v.enum()`. Valibot's `v.enum()` is for native TS enums (Zod's `z.nativeEnum()`).
- `z.discriminatedUnion()` becomes `v.variant()`.
- `.default('x')` becomes the 2nd arg: `v.optional(v.string(), 'x')`.
- `safeParse` success returns `.output` not `.data`. Failure returns `.issues` not `.error`.
- `.pick({ a: true })` becomes `v.pick(schema, ['a'])` — keys as array, not object.
- `z.coerce.number()` becomes `v.pipe(v.unknown(), v.transform(Number))`.
- `.extend()` / `.merge()` become spread: `v.object({ ...base.entries, newField: v.string() })`.
- `v.partial()`, `v.pick()`, `v.omit()` CANNOT wrap a schema already in `v.pipe()` — apply them first, then pipe.
- Validation names change: `.min()` splits into `v.minLength()` (strings/arrays) vs `v.minValue()` (numbers).
- `.flatten().fieldErrors` becomes `v.flatten(result.issues).nested`.
- `z.ZodType` generic constraint becomes `v.GenericSchema`.

## Reference

- [REFERENCE.md](REFERENCE.md) — Complete API mapping table (every Zod method to Valibot equivalent)
- [EXAMPLES.md](EXAMPLES.md) — Before/after migration examples for common patterns

From karlarao/afk, MIT.

Signals

Stars
2
Forks
2
Open issues
0
Last commit (this folder)
May 8, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from karlarao

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get zod-to-valibot running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying zod-to-valibot?

CallGet help
Cite this page

zod-to-valibot skill. Agent Mart. https://agentmart.dev/skills/karlarao-zod-to-valibot (last updated 2026-10-24)