New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Best-practice rules for Zod schema definition, safe parsing, type inference, and error handling in TypeScript.

skills.sh installs
7.3K
GitHub stars
227
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers schema definition, parsing and validation, type inference, error handling, object schemas, composition, refinements, and performance across 43 rules
  • Includes category-level references and per-rule files such as references/{prefix}-{slug}.md, plus a compiled AGENTS.md document
  • Guides choosing safeParse() for user input, z.infer over manual types, and z.unknown() instead of z.any() for type safety
  • Excludes React Hook Form integration and OpenAPI client generation, which are handled by the react-hook-form and orval skills

Install

$ npx -y skills add pproenca/dot-skills --skill zod -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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)

Details

Repository
github.com/pproenca/dot-skills
Categories
Frontend & UI Code, Backend & APIs

More from pproenca/dot-skills

All 100