A comprehensive rulebook for writing Zod schemas the right way, organized into 43 prioritized rules so you know what matters most. Covers the critical stuff first (use safeParse for user input, z.infer for types, z.unknown over z.any) then moves through object composition, refinements, and performance tweaks. The priority system is genuinely useful here because Zod has a lot of surface area and it's easy to either overengineer your schemas or miss the type safety wins. Good for teams that want consistent validation patterns without everyone inventing their own approach. Explicitly excludes React Hook Form and OpenAPI patterns, which have their own skills.

skills.sh installs
7.2K
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add pproenca/dot-skills --skill zod --agent claude-code

Installs into .claude/skills of the current project.

Files

Zod Best Practices

Comprehensive schema validation guide for Zod in TypeScript applications. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new Zod schemas
  • Choosing between parse() and safeParse()
  • Implementing type inference with z.infer
  • Handling validation errors for user feedback
  • Composing complex object schemas
  • Using refinements and transforms
  • Optimizing bundle size and validation performance
  • Reviewing Zod code for best practices

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Schema DefinitionCRITICALschema-
2Parsing & ValidationCRITICALparse-
3Type InferenceHIGHtype-
4Error HandlingHIGHerror-
5Object SchemasMEDIUM-HIGHobject-
6Schema CompositionMEDIUMcompose-
7Refinements & TransformsMEDIUMrefine-
8Performance & BundleLOW-MEDIUMperf-

Quick Reference

1. Schema Definition (CRITICAL)

Sponsors

Details

Repository
github.com/pproenca/dot-skills
Categories
Frontend Development, Debugging

More from pproenca/dot-skills

All 100
1wondelai avatarmicrointeractionswondelai/skillsDesign the small details -- triggers, rules, feedback, loops and modes -- that separate good products from great ones. Use when the user mentions "microinteract7.2Kskills.sh installs
2deckardger avatartanstack-router-best-practicesdeckardger/tanstack-agent-skillsTanStack Router best practices for type-safe routing, data loading, search params, and navigation. Activate when building React applications with complex routin7.2Kskills.sh installs
3vercel avatarvercel-clivercel/vercelDeploy, manage, inspect, and troubleshoot Vercel projects from the command line. Use for Vercel deployments, build failures, projects and teams, environment var7.2Kskills.sh installs
4affaan-m avatarbackend-patternsaffaan-m/eccBackend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.7.2Kskills.sh installs
5lijigang avatarljg-cardlijigang/ljg-skillsContent caster (铸). Transforms content into PNG visuals. Seven molds: -l (default) long reading card, -i infograph, -m multi-card reading cards (1080x1440), -v 7.1Kskills.sh installs
6starchild-ai-agent avatarorderly-onboardingstarchild-ai-agent/official-skillsOrderly Network onboarding: omnichain perps infra, MCP server, SDK and CLI quickstart. Also indexes executed Orderly fills into Starchild trade analytics. Use w7.1Kskills.sh installs