Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ui-engineer

БесплатноБез исполняемых скриптовНе проверен

MUI component styling and implementation rules — sx prop patterns, theme usage, dark mode, spacing, accessibility, form best practices, chart config, and…

siriwatknpот siriwatknp★ 2 442 звезды на GitHub

Об этом скилле

Role

Staff Design Engineer with comprehensive MUI expertise and pixel-perfect implementation skills.

Core Principles

  1. Minimal sx props — layout structure only, not decoration
  2. Theme-first — theme variables over hardcoded values
  3. Alias tokens only — never direct static tokens
  4. Dark mode: theme.applyStyles('dark', styles) exclusively
  5. TypeScript: no type errors on changed files
  6. Lean API: no redundant props (e.g., no onClear when onChange(null) suffices)

Spacing

  • 0.5 step increments only (0.5, 1, 1.5, 2...). Never arbitrary decimals like 1.2
  • Text/icon spacing: 0.5–1.5 based on font size
  • Component spacing: 1–2 based on component size
  • Flexbox containers: gap at least 1 unless design explicitly says otherwise

Images & Media

  • Use <Box component="img" /> with empty src and proper alt, style via sx with proper aspectRatio
  • Never use fake divs to simulate images
  • Placeholders when no real image: https://placehold.co/600x400 (no query params). Use correct aspect ratio (e.g., 3:4 → https://placehold.co/600x400, square → https://placehold.co/400)
  • For components filling a layout (cards, buttons, inputs): don't set maxWidth/width — let them flow naturally; control width from the preview page

Colors

  • Semantic text (error, success, info, warning): use <palette>.text token for better contrast

    <Typography sx={{ color: "error.text" }}>Error</Typography>
    
    <Box sx={theme => ({
      color: (theme.vars || theme).palette.success.text,
    })}>
    

Button vs IconButton

  • High contrast background → Button with custom borderRadius (IconButton doesn't support variant)

    <Button variant="contained" sx={{ borderRadius: 99 }}>
      <AddIcon />
    </Button>
    
  • IconButton only for secondary actions or lists of same-size icon-only buttons

  • No textTransform: "none" needed — built-in theme already handles it

  • Don't customize buttons with grey tokens — use primary color

Charts

Always start with zero margin/axis, then adjust:

import { BarChart } from '@mui/x-charts/BarChart';

<BarChart
  margin={{ left: 0, right: 0, top: 0, bottom: 0 }}
  xAxis={[{ height: 0, position: 'none' }]} // min 28 to display label
  yAxis={[{ width: 0, position: 'none' }]} // min 28 to display label
/>;

PieChart

  • Hide legend: slotProps.legend.sx.display = "none"
  • Format values: valueFormatter: (params) => \${params.value}%``
  • Arc colors: colors prop with string array
  • Remove spacing: same margin pattern as above

Component-Specific Rules

Chip

  • Subtle background → <Chip variant="filled" color="success|error|info|warning|secondary">

Icon

  • First: @mui/icons-material. Fallback: lucide-react
  • Last resort: <Box sx={{ display: 'inline-block', width: size, height: size, bgcolor: 'text.icon', borderRadius: '50%' }} />

ListItem

  • Use sx={{ alignItems: 'flex-start' }} — NOT the alignItems prop
    • Add margin-top to ListItemAvatar for alignment (unless ListItemText is not used)
  • Don't use disablePadding when secondaryAction is present (removes padding-right)
  • With secondaryAction: ensure padding-right accommodates the action content

ListItemText

  • Set slotProps.secondary.component to "div" if secondary is a React element (avoids <p> nesting)

Typography

  • No h5/h6 variants — lowest heading is h4

TextField & Forms

  1. Always use built-in label prop — not separate Typography
  2. Use slotProps — not deprecated InputProps/InputLabelProps
    • slotProps.input, slotProps.inputLabel, slotProps.htmlInput
  3. Include required, error, helperText for validation and a11y
  4. Controlled components with proper state handling
  5. Clear errors on user interaction
// ✅ CORRECT
<TextField
  fullWidth
  required
  label="Card Number"
  placeholder="1234 5678 9012 3456"
  variant="outlined"
  value={formData.cardNumber}
  onChange={handleInputChange("cardNumber")}
  error={!!errors.cardNumber}
  helperText={errors.cardNumber || "Enter 16-digit card number"}
/>

// ❌ INCORRECT
<Box>
  <Typography variant="body2">CARD NUMBER</Typography>
  <TextField
    fullWidth
    placeholder="1234..."
    InputProps={{ /* deprecated */ }}
  />
</Box>

sx Prop Rules

  • Minimize usage — layout structure, not decoration
  • No hardcoded colors/spacing — use theme variables
  • No explicit height — let padding/line-height determine it
  • Use alias tokens:
- sx={theme => ({ borderRadius: (theme.vars || theme).shape.borderRadius * 3 })}
+ sx={{ borderRadius: 3 }}

- sx={theme => ({ color: (theme.vars || theme).palette.primary.main })}
+ sx={{ color: "primary.main" }}

Theme access — MANDATORY

Use callback as value or array item. NEVER spread callback in object:

// ✅ Callback as value
sx={theme => ({
  color: (theme.vars || theme).palette.primary.main,
})}

// ✅ Callback as array item
sx={[
Полный SKILL.md на GitHub

Установить ui-engineer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл ui-engineer?

MUI component styling and implementation rules — sx prop patterns, theme usage, dark mode, spacing, accessibility, form best practices, chart config, and component-specific gotchas. Use whenever building or modifying MUI components, reviewing MUI code, or implementing designs with Material UI. Triggers on any task involving MUI component creation, styling, theming, or mockup implementation.

Как установить скилл ui-engineer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ui-engineer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ui-engineer с