SuperAPI AI Directory

forge_zod-infer-type-best-practice

General & other

View repository

Updated 10-16 09:31

About this skill

Zod Derived Types Best Practices

Prerequisites

You must first confirm that Zod is installed in the project, and if it is not installed, run first:

pnpm add zod

Usage Instructions

  1. Read the Specification Description to understand the core principles and prohibited behaviors
  2. Refer to the Checklist to verify the code item by item
  3. Refer to the Best Practice Examples to understand the correct way to write it

Core Rule: For runtime data that can be expressed by a Zod Schema, the Schema is the single source of truth; TypeScript types use z.infer derivation, and duplicate fields must not be handwritten