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-codeInstalls 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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Schema Definition | CRITICAL | schema- |
| 2 | Parsing & Validation | CRITICAL | parse- |
| 3 | Type Inference | HIGH | type- |
| 4 | Error Handling | HIGH | error- |
| 5 | Object Schemas | MEDIUM-HIGH | object- |
| 6 | Schema Composition | MEDIUM | compose- |
| 7 | Refinements & Transforms | MEDIUM | refine- |
| 8 | Performance & Bundle | LOW-MEDIUM | perf- |
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- Vitest7.2K
- React Hook Form3.1K
- Emilkowal Animations2.8K
- Nuqs2.4K
- Clean Architecture2K
- Typescript1.8K
- Code Simplifier1.6K
- Expo React Native Performance1.5K
- Nextjs1.2K
- Playwright1.2K
- Framer Motion1.2K
- Wxt Browser Extensions1.1K
- Msw897
- Tanstack Query858
- Clean Code857
- Terminal Ui853
- Ui Design827
- Typescript Refactor799
- React Refactor791
- Chrome Extension Ui732
- Shadcn732
- Chrome Extension729
- Shell704
- Tailwind657
