بنقرة واحدة
zod-to-form
Use when working with zod-to-form (core, react, cli, codegen, vite).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when working with zod-to-form (core, react, cli, codegen, vite).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Configuration for zod-to-form code generation (defineConfig / z2f.config.ts): component library, generation defaults, file selection, and per-schema overrides. Also: zod, zod-v4, forms, form-generation, schema, schema-walker, processor-registry, react-hook-form, schema-driven, form-schema, zod-registry.
Documentation site for zod-to-form (Docusaurus 3 + TypeDoc) Use when: Building a custom codegen pipeline that assembles `FormField[]` and needs the....
Documentation site for zod-to-form (Docusaurus 3 + TypeDoc) Use when: You need programmatic codegen from a Node.js script or build tool (not just....
Documentation site for zod-to-form (Docusaurus 3 + TypeDoc) Use when: You want per-field validation instead of whole-form validation.
Documentation site for zod-to-form (Docusaurus 3 + TypeDoc) Use when: You need form rendering in storybook, playgrounds, or low-traffic admin UIs —....
Documentation site for zod-to-form (Docusaurus 3 + TypeDoc) Use when: You want `import SignupForm from './signup.schema?z2f'` to Just Work in a....
| name | zod-to-form |
| description | Use when working with zod-to-form (core, react, cli, codegen, vite). |
Use this skill for ANY work with zod-to-form. It routes to the correct package.
Use this router when:
zod-to-form-corezod-to-form-reactzod-to-form-clizod-to-form-codegenzod-to-form-vitezod-to-form-coreRequires Zod v4 — uses _zod.def, _zod.bag, and z.registry() APIs.
Does NOT work with Zod v3 (which uses _def internals).
defineConfig is the typed entry point; bare object literals lose generic inference on components.overridesKey APIs: canonicalizeConfig, createOptimizers, createSchemaLiteCollector
zod-to-form-reactChoose your abstraction level: <ZodForm> for zero-config, useZodForm for custom
rendering, manual walkSchema for full control. Each step down trades convenience for
flexibility.
<ZodForm> and the CLI share the same walkSchema output so the migration is mechanicalform instance (e.g. to call form.setValue)Key APIs: ZodForm, useZodForm, useExternalSync
zod-to-form-cliBefore using the CLI, decide: are you scripting (use runGenerate) or interacting
(use npx zod-to-form)? For config authoring, always use defineConfig for type inference.
dryRun output for preview/diffing without touching the filesystemKey APIs: runGenerate, createProgram, defineConfig
zod-to-form-codegenFormField[] and needs the TSX stringKey APIs: generateFormComponent, resolveFieldMapping, getFileHeader
zod-to-form-viteTwo modes: ?z2f query imports (transform per-import, HMR works) vs generate mode
(static JSX rewriting, no HMR integration). Use ?z2f for new forms, generate for
migrating existing <ZodForm> call sites.
import SignupForm from './signup.schema?z2f' to Just Work in a Vite app — the plugin intercepts the import and compiles the form on demand<ZodForm> call sites — opt in via generate: {} in plugin optionsKey APIs: Z2FViteError, z2fVite, formatZ2FViteError
Top pitfall per package:
componentConfig without a matching components map that covers the component names referenced — missing components are silently dropped at render time with no console error; add each name to components or use defaultComponentMap as the base (react)result.code as the on-disk file content when overwrite is false — if the output file already exists, runGenerate returns wroteFile: false and the existing file is unchanged without throwing; FIX: check result.wroteFile before assuming the file was updated, or set defaults.overwrite: true explicitly (cli)generateFormComponent with a stale fields array from a previous schema version — there is no cache invalidation; callers must re-run walkSchema on schema change (codegen)?z2f on schemas with cyclic type references — the schema walker recurses on Zod's internal type graph and hangs with no error or timeout; FIX: break cycles with z.lazy() before using the ?z2f import (vite)| Thought | Reality |
|---|---|
| "I'll just use core for everything" | core is for documentation site for zod-to-form (docusaurus 3 + typedoc). You only need whole-schema validation — omit the optimization option entirely |
| "I'll just use react for everything" | react is for documentation site for zod-to-form (docusaurus 3 + typedoc). Bundle size is critical — use CLI codegen (@zod-to-form/cli) instead; runtime schema walking includes the full Zod type graph traversal, which does not tree-shake |
| "I'll just use cli for everything" | cli is for documentation site for zod-to-form (docusaurus 3 + typedoc). Interactive use — run npx zod-to-form generate (via createProgram()) instead |
| "I'll just use codegen for everything" | codegen is for documentation site for zod-to-form (docusaurus 3 + typedoc). You want file-writing behavior — use runGenerate() from @zod-to-form/cli instead |
| "I'll just use vite for everything" | vite is for documentation site for zod-to-form (docusaurus 3 + typedoc). You are building with webpack, esbuild, Rollup, or any non-Vite bundler — use @zod-to-form/cli instead |
User: "I need to documentation site for zod-to-form (docusaurus 3 + typedoc)"
→ Load zod-to-form-core
User: "I need to documentation site for zod-to-form (docusaurus 3 + typedoc)"
→ Load zod-to-form-react
User: "I need to documentation site for zod-to-form (docusaurus 3 + typedoc)"
→ Load zod-to-form-cli
User: "I need to documentation site for zod-to-form (docusaurus 3 + typedoc)"
→ Load zod-to-form-codegen
User: "I need to documentation site for zod-to-form (docusaurus 3 + typedoc)"
→ Load zod-to-form-vite