| name | swe-developing-frontend-ui |
| description | UI development skill covering design token usage, shadcn/ui + Radix composition patterns, accessibility requirements, anti-patterns catalog, and brand context for `crud-fe-ts-nextjs` and `crud-fs-ts-nextjs`. Auto-loads when working on TSX components, CSS, or UI design tasks. |
Frontend UI Development Skill
This skill provides repo-specific guidance for building UI components in the open-sharia-enterprise monorepo. It covers design tokens, component patterns, accessibility, anti-patterns, and per-app brand context.
When This Skill Triggers
- Editing
.tsx component files in apps/*/src/components/
- Editing
globals.css or Tailwind configuration
- Creating or modifying shared UI components in
libs/ts-ui/
- Working on design tokens in
libs/ts-ui-tokens/
Reference Modules
Consult these reference docs for detailed guidance on specific topics:
Quick Reference: Top Rules
Do
- Use semantic tokens โ
bg-primary, text-muted-foreground, border-border (not hardcoded colors)
- Use
React.ComponentProps<"element"> โ not React.forwardRef
- Use
radix-ui unified package โ not @radix-ui/react-slot individual packages; use Slot.Root from unified
- Add
data-slot="component-name" on every component root element
- Use
focus-visible: โ not focus: (keyboard-only focus rings)
- Use
cn() from shared lib โ clsx + tailwind-merge for class composition
- Define variants with CVA โ export from
.variants.ts for reuse
- Every visual token needs a
.dark counterpart โ verify contrast in both modes
- Mobile-first responsive โ start with base styles, add
md:, lg: prefixes
- Minimum hit targets โ 24px desktop, 44px mobile
Do Not
- No hardcoded hex/rgb/hsl in className or style props โ use design tokens
- No
!important โ use @layer specificity or Tailwind modifiers
- No
@apply outside @layer base โ defeats utility-first purpose
- No inline
style={{}} in production โ use Tailwind utilities
- No
focus: without visible โ always focus-visible: for keyboard users
- No color-only status indicators โ include text labels and/or shapes
- No
transition-all โ specify explicit properties: transition-colors, transition-opacity
- No bounce/elastic easing โ use
ease-out or custom cubic-bezier
- No nested Card inside Card โ use spacing/dividers for visual hierarchy
- No font via CSS
font-family โ use next/font for optimization
Governance References