Reviewing a GEL Component
Reviews components in packages/ui/src/components/ against the conventions defined in packages/ui/.agents/AGENTS.md.
When to Use
Use this skill when a maintainer asks to "review my component", "check my code", "audit this component", or "ensure this follows GEL conventions". This includes checking file structure, types, styles, component implementation, accessibility, and index exports for any component in packages/ui.
Use vercel skills first
Before continuing with this skill, check using vercel-react-best-practices and web-design-guidelines skills to catch common React and web development issues.
Project Review Checklist
The below checklist is based on project specific conventions that may not be covered by general best practices. Use this to review the component for compliance with GEL design system standards.
- File Structure
- All required files exist:
index.ts,*.component.tsx,*.styles.ts,*.types.ts,*.spec.tsx,*.stories.tsx - File names use kebab-case matching the directory name
- Component is exported from
packages/ui/src/components/index.ts
- Types
-
Variantstype alias derived fromVariantProps<typeof styles> - Responsive props wrapped with
ResponsiveVariants<Variants['...']> - Every prop has a JSDoc comment with
@defaulttag where applicable - Extends correct HTML attributes type
- Uses
Omit<>for conflicting HTML attributes -
.jsextensions on relative imports
- Styles
- Uses tailwind styling except when animations/dynamic styles are required
- Uses
tv()fromtailwind-variants, exported asstyles - Uses GEL design tokens — no hardcoded colors
- Uses
typography-body-*for text,focus-outlinefor focus - Uses
slotsfor multi-element components - Uses
compoundSlotsfor variant combinations
- Component
- Has
'use client';if using hooks or client-side rendering - Uses
forwardRefpattern when appropriate - Destructures
classNameand passes to styles - Uses
useBreakpoint()+resolveResponsiveVariant()for responsive props - Uses
useFocusRing()+mergeProps()fromreact-ariawhere appropriate - All props are used (no unused props)
-
.jsextensions on all relative imports - Plain function declarations (not
React.FC)
- Accessibility
- Interactive elements use appropriate ARIA attributes
- Decorative icons use
aria-hidden -
react-ariahooks used for focus and accessibility where appropriate - Semantic HTML elements used
-
react-statelyhooks for state management where applicable
- Index
- Exports component and props type only
- Does NOT re-export styles
-
.jsextensions
- Tests
- At minimum a "renders the component" test
- Uses
userEvent.setup()(notfireEvent) for interactions - Imports from
.component.js(not index)
- Stories
- Imports from
@storybook/react-vite - Has
tags: ['autodocs']and standard decorator - Covers: default state, looks/variants, sizes, responsive, disabled
- Interactive stories defined as function components
Severity Levels
Critical
- Missing
'use client'on components with hooks - Hardcoded colors instead of design tokens
- Missing
forwardRefon components rendering native elements - Custom focus styles instead of
focus-outline - Missing
.jsextensions in imports
Warnings
- Missing JSDoc
@defaulttags - No responsive variant support where beneficial
- Minimal test coverage
- Missing
aria-*attributes on interactive elements
Style
- Using
React.FCinstead of function declarations - Inconsistent prop destructuring order
- Styles not using
slotsfor multi-element components
How to Run
- Read all files in the component directory
- Check each item above
- Report findings grouped by severity
- Suggest specific fixes with code examples