ask-form

Implements forms with React Hook Form, Zod validation, and server actions.

1|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/NalinDalal/skillset --skill ask-form-nalindalal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ask-form
Source: https://github.com/NalinDalal/skillset/tree/main/skills/ui/ask-form
Command: npx skills add https://github.com/NalinDalal/skillset --skill ask-form-nalindalal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react-hook-form, zod, @hookform/resolvers, sonner.

What problem does it solve? Building forms with validation, submission states, and server error handling involves repetitive boilerplate and common UX mistakes like double submits, scattered validation, and missing loading feedback. ## Core Features & Use Cases - Schema-first validation: Define a single Zod schema shared between client and server as the source of truth. - React Hook Form patterns: Uncontrolled inputs with blur validation, field arrays for dynamic fields, and dirty tracking. - Server action integration: Loading toasts, optimistic UI, and mapping server errors back to individual fields. - Use Case: When building a project creation form, apply this pattern to get inline validation on blur, a disabled submit button during saving, toast feedback on success or failure, and server field errors displayed inline. ## Quick Start Ask the agent to build a form with validation for your page, and it will load the react-hook-form and Zod pattern with server action handling.

Frequently Asked Questions about ask-form

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

FAQPage Schema
How do I build a form with validation in React?▼

Use React Hook Form with a Zod schema via zodResolver. Define the schema once, register uncontrolled inputs with form.register, and validate on blur rather than on change to avoid showing errors before the user finishes typing.

React Hook Form vs controlled useState inputs for forms?▼

React Hook Form uses uncontrolled inputs, minimizing re-renders and boilerplate compared to managing useState per field. Controlled per-field state is an anti-pattern for forms because it is slow and adds unnecessary code.

How to handle server errors in React Hook Form?▼

Map server field errors back to inputs using form.setError for each field returned by the server. Show errors both inline at the field and summarized at the top so users do not hunt for the problem.

Does Zod validation work on both client and server?▼

Yes, a single Zod schema serves as the source of truth for both sides. Use zodResolver on the client and schema.parse inside server actions to keep validation consistent.

How do I prevent double form submission in React?▼

Disable the submit button while form.formState.isSubmitting is true and show a loading state such as a toast. This gives the user feedback and blocks duplicate submissions.