form-creator
Create forms, validation schemas, and CRUD API endpoints. Use when building new data entry features or managing existing forms.
When & Why to Use This Skill
This Claude skill accelerates full-stack development by automating the creation of robust web forms, Zod validation schemas, and secure CRUD API endpoints. It streamlines the development lifecycle for data entry features by generating type-safe, production-ready code that follows modern best practices like Shadcn UI and Next.js App Router patterns.
Use Cases
- Rapidly scaffolding new data entry features with integrated client-side validation using Zod and Shadcn UI components.
- Generating standardized RESTful API routes for database entities, including built-in authentication checks and pagination handling.
- Modernizing existing legacy forms by migrating them to type-safe validation schemas and consistent UI patterns to reduce technical debt.
| name | form-creator |
|---|---|
| description | Create forms, validation schemas, and CRUD API endpoints. Use when building new data entry features or managing existing forms. |
Form Creator
Instructions
1. Validation Schema
- File:
src/lib/validations/{feature}.schema.ts - Action: Define Zod schema and export inferred type.
export const featureSchema = z.object({ ... }); export type FeatureFormValues = z.infer<typeof featureSchema>;
2. Form Component
- File:
src/components/forms/{feature}-form.tsx - Directives:
"use client";required. - Setup: Use
useFormwithzodResolver. - Props: Accept
initialDataandonSubmit. - UI: Use Shadcn components (
Form,FormField,Input).
3. API Routes
- File:
src/app/api/{feature}/route.ts - Security: Wrap with
withAuthRequiredorwithSuperAdminAuthRequired. - Logic:
GET: Handle pagination/search.POST: Validate body against schema -> Insert to DB.PATCH: Validate partial body -> Update DB.
Reference
For code patterns, best practices, and examples, see reference.md.