Skip to content
Back to skills

Api Schema Zod

ASecurity

Generate Zod validation schemas for reusable API contracts shared between backend and frontend. Use when creating type-safe schemas or sharing validation between projects.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmenttypescriptbashapifrontendbackend

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill api-schema-zod --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Schema Zod?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Schema Zod
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-api-schema-zod/badge)](https://www.skillsdirectory.com/skills/david-li0406-api-schema-zod)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-schema-zod
description: Generate Zod validation schemas for reusable API contracts shared between backend and frontend. Use when creating type-safe schemas or sharing validation between projects.
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
---

# 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

```bash
/skill schema-zod --name=User --fields='email:email,password:password,name:string,isActive:boolean'
```

## Related Files

- [API DTO](../../core/api-dto/SKILL.md) - Class-validator DTOs (alternative)
- [API Controller](../../core/api-controller/SKILL.md) - Controllers using schemas

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…