api-schema-zod
SKILL.md
Zod Schemas
Purpose
Generate Zod validation schemas that can be used both on the backend for validation and shared with the frontend for type-safe API contracts.
When to Use
- Creating reusable validation schemas
- Sharing schemas between backend and frontend
- Type-safe API contracts
- Runtime validation with TypeScript inference
What It Generates
Directory Structure
packages/shared-schemas/src/schemas/{feature}/
├── {entity}.schema.ts
├── index.ts
Patterns Enforced
Schema Reusability
- Common schemas (email, password, UUID) imported from shared
- Schemas composable via
.pick(),.omit(),.extend() - Transformations for data normalization
Type Inference
z.infer<typeof schema>for TypeScript types- Types can be exported to frontend
Error Messages
- Custom validation messages
- User-friendly error descriptions
Usage Example
/skill schema-zod --name=User --fields='email:email,password:password,name:string,isActive:boolean'
Related Files
- API DTO - Class-validator DTOs (alternative)
- API Controller - Controllers using schemas
Weekly Installs
3
Repository
rimthan-lab/rim…-pluginsGitHub Stars
1
First Seen
Feb 25, 2026
Security Audits
Installed on
opencode3
cursor3
gemini-cli2
antigravity2
claude-code2
github-copilot2