
Frontend Dev Guidelines
Keep React + MUI frontends consistent by following shared patterns for auth hooks, React Hook Form + Zod, DataGrid, and dialogs instead of one-off implementations.
Overview
Frontend-dev-guidelines is an agent skill most often used in Build (also Ship review) that standardizes React, MUI, useAuth, and React Hook Form patterns for recurring UI work.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill frontend-dev-guidelinesWhat is this skill?
- Mandates useAuth hook for identity—no direct auth API calls from components
- React Hook Form with Zod resolver and MUI fields for validated forms
- Patterns for MUI Snackbar feedback via useMuiSnackbar
- Guidance for DataGrid, dialogs, and other recurring admin UI elements
- TypeScript-first examples with explicit user shape (id, email, username, roles)
Adoption & trust: 1k installs on skills.sh; 40.1k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps inventing new auth fetches and unvalidated forms, breaking consistency across MUI screens in a growing SaaS codebase.
Who is it for?
Indie teams on React + MUI stacks with centralized useAuth and snackbar hooks who want agents to mirror existing frontend conventions.
Skip if: Greenfield projects without MUI or those using entirely different state/form libraries unless you plan a wholesale migration first.
When should I use this skill?
Implementing or refactoring React MUI screens that need forms, auth-gated content, DataGrid, or dialogs in a codebase with useAuth and useMuiSnackbar.
What do I get? / Deliverables
New and refactored components follow shared hooks and form validation patterns so UI behavior and error handling match the rest of the app.
- Components aligned with documented auth and form patterns
- Zod schemas and typed form handlers ready for integration tests
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is build/frontend because the skill encodes day-to-day UI implementation conventions agents should apply while coding features. Frontend subphase matches form, auth, and DataGrid recipes that dominate feature work in admin-style SaaS UIs.
Where it fits
Add a settings form using register, Zod resolver, and MUI TextField without custom auth fetches.
PR review pass: flag components calling auth APIs directly and rewrite to useAuth.
Prototype admin screens that already mirror production hook contracts for faster agent codegen.
How it compares
House-style recipe book for an existing React codebase, not a generic component library installer.
Common Questions / FAQ
Who is frontend-dev-guidelines for?
Solo builders and tiny teams maintaining React SaaS frontends that already expose useAuth, MUI, and shared hooks the skill references.
When should I use frontend-dev-guidelines?
While building new forms, grids, or auth-gated views in build/frontend, and during ship/review when fixing components that bypass useAuth or skip Zod validation.
Is frontend-dev-guidelines safe to install?
It is pattern documentation only; review the Security Audits panel on this page and ensure your real auth endpoints match the hooks your repo actually ships.
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>