fe-zod-form

Generates Zod schemas and react-hook-form setups for Lety 2.0 frontend forms.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/lety-ai/lety-skill-hub --skill fe-zod-form
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fe-zod-form
Source: https://github.com/lety-ai/lety-skill-hub/tree/main/plugins/zod-form/skills/zod-form
Command: npx skills add https://github.com/lety-ai/lety-skill-hub --skill fe-zod-form

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a clear, project-aligned workflow to generate Zod schemas and react-hook-form components for Lety 2.0 frontend, removing guesswork about file placement, resolver choice, and multi-step validation so forms are consistent, type-safe, and maintainable.

Core Features & Use Cases

  • Schema generation: Create single-step or multi-step Zod schemas placed in the correct features/<feature>/logic/ directory with .schema.ts suffix and exported inferred types.
  • Form scaffolding: Produce react-hook-form components using FormProvider, standardSchemaResolver, mode: 'onChange', and defaultValues for create and edit flows.
  • Validation patterns: Support file uploads, cross-field validation using refine/superRefine, step-by-step partial validation with trigger(fields), and guidance to avoid anti-patterns like zodResolver or inline schemas.

Quick Start

Generate a create form schema and a corresponding form component for a user signup flow with name, email, password, and optional avatar upload.

Frequently Asked Questions about fe-zod-form

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

FAQPage Schema
How do I generate Zod schemas for multi-step react-hook-form wizards?

Generate Zod schemas for multi-step forms by creating individual step schemas and exporting inferred types into features/<feature>/logic/ files with a .schema.ts suffix. This approach uses standardSchemaResolver to validate each step independently via trigger(fields).

What is the best way to set up cross-field validation in Zod for react-hook-form?

Cross-field validation in Zod is best set up using refine or superRefine methods within your schema. This ensures complex conditional rules are evaluated properly when integrated with react-hook-form using standardSchemaResolver and onChange mode.

Does react-hook-form work with standardSchemaResolver for file uploads?

react-hook-form works with standardSchemaResolver to handle file uploads by defining the file validation rules directly in your Zod schema. This integration maintains type safety and validates inputs correctly during create and edit flows.

Why should I avoid zodResolver and inline schemas in form validation?

You should avoid zodResolver and inline schemas because they break project alignment and maintainability. Using standardSchemaResolver with dedicated .schema.ts files ensures consistent validation, proper type inference, and correct file placement for single-step and multi-step forms.

How do I scaffold a react-hook-form component using Zod for create and edit flows?

Scaffold a react-hook-form component using Zod by wrapping inputs in FormProvider, configuring standardSchemaResolver, setting mode to onChange, and defining defaultValues. This structure uniformly supports both create and edit data flows.

Can I use TypeScript standard-schema for partial form validation in wizard steps?

You can use standard-schema for partial form validation in wizard steps by exporting individual step schemas and applying trigger(fields) from react-hook-form. This validates only the active step fields before allowing the user to proceed.