zod

Installation
Summary

Schema validation best practices for TypeScript with 43 prioritized rules across type safety, parsing, and error handling.

  • Covers 8 rule categories from schema definition and parsing (CRITICAL) through type inference, error handling, and performance (LOW-MEDIUM)
  • Distinguishes safeParse() for user input, parseAsync() for async refinements, and parse() for trusted data; emphasizes validation at system boundaries
  • Provides guidance on z.infer for type inference, z.unknown() over z.any(), discriminated unions, and schema composition patterns
  • Includes error handling strategies: custom messages, flatten() for forms, path tracking for nested errors, and internationalization support
  • References individual rule files with code examples and a compiled full guide (AGENTS.md) for detailed explanations
SKILL.md

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

| Priority | Category | Impact | Prefix |

Related skills

More from pproenca/dot-skills

Installs
2.4K
GitHub Stars
141
First Seen
Jan 20, 2026