.cursor/skills/nazim-forms/SKILL.md
Form validation and React Hook Form patterns for Nazim. Use when adding or editing forms. Requires Zod schemas in /src/lib/validations/, zodResolver, Controller for Select/file, alignment with Laravel Form Request rules.
npx skillsauth add AHMADJAN-New/nazim-web nazim-formsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
All forms use React Hook Form with Zod validation. Schemas live in /src/lib/validations/ and must align with backend Laravel Form Request rules.
frontend/src/lib/validations/yourResource.tsz.infer<typeof schema>import { z } from 'zod';
import { optionalUuidSchema, requiredStringLength, optionalStringLength } from './common';
export const yourResourceSchema = z.object({
name: requiredStringLength(255, 'Name'),
description: optionalStringLength(1000, 'Description'),
organization_id: optionalUuidSchema,
});
export type YourResourceFormData = z.infer<typeof yourResourceSchema>;
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { yourResourceSchema, type YourResourceFormData } from '@/lib/validations';
const { register, handleSubmit, control, formState: { errors } } = useForm<YourResourceFormData>({
resolver: zodResolver(yourResourceSchema),
defaultValues: { ... },
});
<form onSubmit={handleSubmit(onSubmit)}>
<Input {...register('name')} />
{errors.name && <p className="text-sm text-destructive mt-1">{errors.name.message}</p>}
</form>
Controller with value / onValueChange; bind to control and nameController; pass file via onChange; use fileSchema / validateFile from @/lib/validations/fileUpload when validating uploads.refine() on the schema (e.g. end_date >= start_date)From /src/lib/validations/common.ts:
uuidSchema, optionalUuidSchemaemailSchema, optionalEmailSchemaphoneSchemarequiredStringLength(max, fieldName), optionalStringLength(max, fieldName).optional().nullable() where fields are optional/src/lib/validations/; type exportedtools
Toast notifications for Nazim. Use when showing success/error/info messages. ALWAYS use showToast from @/lib/toast with translation keys; never toast from sonner directly. RTL positioning is automatic.
tools
Enforces status badge patterns for Nazim UI. Use when displaying status in tables, cards, or dialogs. Covers Badge variants, semantic colors, statusBadgeVariant, statusOptions with color.
development
Enforces mobile-first responsive patterns for Nazim UI. Use when building pages, tables, forms, charts, or buttons. Covers page container, FilterPanel, tabs, grids, tables, charts, cards, buttons.
development
PDF and Excel report generation for Nazim. Use when adding or changing reports. Backend uses ReportService and ReportConfig; frontend uses useServerReport. Covers branding, DateConversionService, RTL, acceptance criteria.