What problem does it solve?
This Skill prevents client/server form validation drift by ensuring the same Zod schema drives both the UI resolver and the server-side input validation. It also standardizes UX patterns like pending states, field-level error rendering, and post-mutation invalidations so list pages refresh reliably after submissions.
Core Features & Use Cases
- Shared schema on both sides: Define a single Zod schema once and reuse it in both the client form resolver and the server function validator.
- Convention-aware form scaffolding: Detect whether the project uses react-hook-form (typical shadcn setup) or TanStack Form, then generate the form using the matching primitives and patterns already present.
- End-to-end wiring: Create a server function in src/fn/ that calls the appropriate use-case/data-access function, then connect it with a mutation that handles pending state, success toasts, error toasts, and query invalidations.
- Security guardrails: Never trust ownership/author IDs from form input; assign/derive them server-side from the authenticated session helper used by the project.
- Layer discipline: Do not write db.insert/Drizzle calls directly inside server functions; route persistence through the data-access layer.
Quick Start
Ask the Skill to scaffold a form for creating or editing your entity by specifying the route/page location, the exact fields (types and required/optional), and what should happen on success.