
Frontend Dev Guidelines
Apply consistent React, MUI, React Hook Form, Zod, and useAuth patterns so agents do not invent one-off API auth or form code.
Install
npx skills add https://github.com/davila7/claude-code-templates --skill frontend-dev-guidelinesWhat is this skill?
- useAuth hook pattern for user id, email, username, and roles—no direct auth API calls
- React Hook Form with Zod resolver for validated MUI TextField forms
- useMuiSnackbar integration for success and error feedback on submit
- Documented common patterns for forms, authentication, DataGrid, and dialogs
- TypeScript-first examples aligned with @/hooks and @mui imports
Adoption & trust: 623 installs on skills.sh; 27.8k GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Frontend Designanthropics/skills
Vercel React Best Practicesvercel-labs/agent-skills
Remotion Best Practicesremotion-dev/skills
Vercel Composition Patternsvercel-labs/agent-skills
Develop Userscriptsxixu-me/skills
Next Best Practicesvercel-labs/next-skills
Journey fit
Primary fit
Frontend dev guidelines are canonical on Build frontend where UI components, forms, and client auth patterns are implemented. Frontend subphase matches template-style guidance for DataGrid, dialogs, and MUI snackbars—not backend API design.
Common Questions / FAQ
Is Frontend Dev Guidelines safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Frontend Dev Guidelines
# Common Patterns Frequently used patterns for forms, authentication, DataGrid, dialogs, and other common UI elements. --- ## Authentication with useAuth ### Getting Current User ```typescript import { useAuth } from '@/hooks/useAuth'; export const MyComponent: React.FC = () => { const { user } = useAuth(); // Available properties: // - user.id: string // - user.email: string // - user.username: string // - user.roles: string[] return ( <div> <p>Logged in as: {user.email}</p> <p>Username: {user.username}</p> <p>Roles: {user.roles.join(', ')}</p> </div> ); }; ``` **NEVER make direct API calls for auth** - always use `useAuth` hook. --- ## Forms with React Hook Form ### Basic Form ```typescript import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; import { TextField, Button } from '@mui/material'; import { useMuiSnackbar } from '@/hooks/useMuiSnackbar'; // Zod schema for validation const formSchema = z.object({ username: z.string().min(3, 'Username must be at least 3 characters'), email: z.string().email('Invalid email address'), age: z.number().min(18, 'Must be 18 or older'), }); type FormData = z.infer<typeof formSchema>; export const MyForm: React.FC = () => { const { showSuccess, showError } = useMuiSnackbar(); const { register, handleSubmit, formState: { errors } } = useForm<FormData>({ resolver: zodResolver(formSchema), defaultValues: { username: '', email: '', age: 18, }, }); const onSubmit = async (data: FormData) => { try { await api.submitForm(data); showSuccess('Form submitted successfully'); } catch (error) { showError('Failed to submit form'); } }; return ( <form onSubmit={handleSubmit(onSubmit)}> <TextField {...register('username')} label='Username' error={!!errors.username} helperText={errors.username?.message} /> <TextField {...register('email')} label='Email' error={!!errors.email} helperText={errors.email?.message} type='email' /> <TextField {...register('age', { valueAsNumber: true })} label='Age' error={!!errors.age} helperText={errors.age?.message} type='number' /> <Button type='submit' variant='contained'> Submit </Button> </form> ); }; ``` --- ## Dialog Component Pattern ### Standard Dialog Structure From BEST_PRACTICES.md - All dialogs should have: - Icon in title - Close button (X) - Action buttons at bottom ```typescript import { Dialog, DialogTitle, DialogContent, DialogActions, Button, IconButton } from '@mui/material'; import { Close, Info } from '@mui/icons-material'; interface MyDialogProps { open: boolean; onClose: () => void; onConfirm: () => void; } export const MyDialog: React.FC<MyDialogProps> = ({ open, onClose, onConfirm }) => { return ( <Dialog open={open} onClose={onClose} maxWidth='sm' fullWidth> <DialogTitle> <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> <Info color='primary' /> Dialog Title </Box> <IconButton onClick={onClose} size='small'> <Close /> </IconButton> </Box> </DialogTitle> <DialogContent> {/* Content here */} </DialogContent>