zod-schema-generator
Installation
SKILL.md
Zod Schema Generator
Before generating any output, read config/defaults.md and adapt all patterns, imports, and code examples to the user's configured stack.
Process
- Identify the source: Prisma model, TypeScript interface/type, or raw JSON example.
- Determine schema purpose: input validation (create/update), output validation (API response), or full round-trip.
- Generate Zod schema with correct types, optional fields, and refinements.
- Add
.transform()and.refine()where appropriate. - Output the schema file with proper imports and exports.
Source: Prisma Model
Parse the Prisma model and generate both input and output schemas.
Input Schema (for create/update)
Omit auto-generated fields (id, createdAt, updatedAt) and fields with @default.