param087/saas-ui-skills/forms-and-validation
Claude Code and agent skill by param087/saas-ui-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when building forms with react-hook-form + zod and shadcn/ui Form — schema validation, inline errors, accessible fields, async submit with loading and server errors, and avoiding uncontrolled-input bugs.
Install
npx vskill@latest install param087/saas-ui-skills/forms-and-validationSKILL.md
The same SKILL.md was published earlier as param087/saas-ui-skills/forms-and-validation.
Forms & Validation
Overview
The reliable SaaS form stack is react-hook-form (state + performance) + zod (schema validation) + shadcn/ui `Form` (accessible field wiring). Define the schema once, infer the TypeScript type from it, and let the form derive validation, errors, and types from a single source of truth.
When to use
- Any form: auth, settings, create/edit dialogs, checkout.
- Inputs need validation, inline errors, or async submission.
- You're manually wiring
useStateper field (stop — use RHF).
The pattern
shadcn/ui Form auto-wires id, aria-invalid, aria-describedby, and <FormMessage> to each field — accessible errors with no manual plumbing.
Why this stack
- One schema → types + validation.
z.inferkeeps TS and runtime in sync. - Reuse on the server. Run the same zod schema in your API/action; never trust the client.
- Performance. RHF uses uncontrolled inputs + refs, so typing doesn't re-render the whole form.
Submission UX
- Disable submit + show a spinner label while
isSubmitting. - Map server/field errors with
form.setError(name, …); show form-level errors in anAlert. - On success: toast, then redirect or reset (
form.reset()).
Pitfalls
- `useState` per field — re-renders, more code, manual error wiring.
- Always provide `defaultValues` — omitting them makes inputs uncontrolled and React warns/loses data.
- Validating only on the client — re-run the zod schema server-side.
- No submitting state — users double-submit; disable the button.
- Missing `autoComplete`/`type` — hurts autofill and mobile keyboards.
- `type="submit"` missing — Enter won't submit the form.
Hand-off
A validated, accessible form that auth-screens, settings-pages, and onboarding-flows reuse; pair errors with notifications-and-toasts for success feedback.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/forms-and-validation/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/param087/saas-ui-skills/forms-and-validation)