create-schema

Generate Zod schemas and DTOs for new TypeScript backend resources.

1|Updated May 21, 2025
One-click install
npx skills add https://github.com/madooei/backend-template --skill create-schema
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-schema
Source: https://github.com/madooei/backend-template/tree/main/.claude/skills/create-schema
Command: npx skills add https://github.com/madooei/backend-template --skill create-schema

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating consistent, validated backend data contracts for new resources by auto-generating Zod schemas and DTOs, reducing boilerplate and preventing validation errors.

Core Features & Use Cases

  • ID and Base Schemas: Generate primary key, base entity, and relational references with type inference.
  • Create/Update DTOs: Produce create and update schemas with appropriate field omissions and optional fields.
  • Query Params & Reuse: Extend shared query parameter schemas for flexible filtering and pagination when querying resources.
  • Use Case: When adding a new resource like Note or CourseRegistration, quickly scaffold all necessary schemas and types.

Quick Start

Create a new file at src/schemas/{entity-name}.schema.ts and implement ID, base, create/update schemas following the patterns described.

Frequently Asked Questions about create-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Zod schemas and DTOs for a new TypeScript backend entity?

You create Zod schemas and DTOs by defining ID and base entity schemas, then deriving create and update DTOs with appropriate field omissions and optional timestamps to ensure consistent data contracts.

What is the best way to reduce boilerplate when defining validated data models in TypeScript?

The best way to reduce boilerplate for validated data models is auto-generating Zod schemas and exporting both schema and inferred types, preventing validation errors while ensuring type-safe backend data contracts.

How do I structure create and update DTOs with Zod for backend validation?

Structure create and update DTOs by extending a base entity schema, making timestamps optional, and properly omitting generated fields like IDs to maintain strict backend validation.

Can I extend shared query parameter schemas for filtering and pagination in a TypeScript backend?

You can extend shared query parameter schemas to enable flexible filtering and pagination when querying resources, ensuring your backend query DTOs remain strongly typed and validated.

Do I need path aliases when scaffolding backend schemas and DTOs?

Yes, you need path aliases when scaffolding backend schemas and DTOs to properly extend shared schemas across modules, ensuring consistent imports and type-safe data contracts.