Command Palette

Search for a command to run...

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

ui-refactoring-workflow

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

Use when refactoring existing React Native, Next.js, or TypeScript UI code to apply modern design principles and aesthetic excellence - analyzes current…

apexscaleaiот apexscaleai★ 29 звёзд на GitHub21 установка в других каталогах

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

UI Refactoring Workflow

Overview

Systematic approach to transforming existing UI code into modern, aesthetically superior implementations while preserving functionality and improving maintainability.

When to Use

  • Refactoring brownfield React Native/Next.js apps
  • Modernizing outdated UI components
  • Applying consistent design system to existing code
  • Switching design styles/presets across application
  • Elevating visual quality without rebuilding from scratch
  • Improving accessibility of existing components

When NOT to Use

  • Starting new project from scratch (use design-system-foundation instead)
  • Just fixing bugs (regular debugging workflow)
  • Performance optimization only (use performance tools)
  • Backend refactoring (this is UI-focused)

Refactoring Process

Phase 1: Analysis (Understand Current State)

Goal: Fully understand what exists before changing anything.

1.1 Identify Component Structure

  • What props does it accept?
  • What is the component API?
  • What are the TypeScript types?
  • How is it composed (children, render props, etc.)?

1.2 Extract Current Styling

  • Inline styles vs stylesheet usage
  • Color values (hardcoded vs tokens)
  • Spacing patterns
  • Typography implementation
  • Animation/transition usage

1.3 Document Functionality

  • What does this component do?
  • What are the interaction patterns?
  • What states exist? (loading, error, success, disabled, focused, etc.)
  • What accessibility features are present?
  • What are the edge cases?

1.4 Identify Pain Points

  • Hardcoded values
  • Inconsistent spacing
  • Poor color contrast
  • Accessibility issues
  • Performance problems
  • Maintainability issues

Example Analysis:

// BEFORE (Current State)
const Button = ({ title, onPress, disabled }) => {
  return (
    <TouchableOpacity
      onPress={onPress}
      disabled={disabled}
      style={{
        backgroundColor: disabled ? '#ccc' : '#3498db', // Hardcoded colors
        padding: 12, // Hardcoded spacing
        borderRadius: 5,
        marginTop: 10,
      }}
    >
      <Text style={{ color: '#fff', fontSize: 16 }}> // Hardcoded typography
        {title}
      </Text>
    </TouchableOpacity>
  )
}

// ANALYSIS NOTES:
// ❌ Hardcoded colors (no design tokens)
// ❌ Inconsistent spacing (12, 10)
// ❌ No TypeScript types
// ❌ Missing accessibility props
// ❌ No loading state
// ❌ No variants (primary, secondary, etc.)
// ❌ No size options
// ❌ Poor disabled state (just gray)
// ✅ Basic functionality works
// ✅ Has disabled prop

Phase 2: Design Preset Selection

Goal: Choose aesthetic direction for refactored component.

Available Presets:

  • minimalist-modern - Clean, spacious, timeless
  • bold-brutalist - High contrast, geometric, bold
  • soft-neumorphic - Subtle shadows, soft edges
  • glass-aesthetic - Transparency, blur, depth
  • timeless-classic - Balanced, professional, accessible
  • bleeding-edge-experimental - Latest trends, innovative

Selection Criteria:

  • What's the app's target audience?
  • What's the brand personality?
  • What design system already exists (if any)?
  • What accessibility requirements exist?
  • What's the desired visual impact?

Example: For a fitness app → glass-aesthetic (modern, premium feel)


Phase 3: Refactoring Execution

Goal: Transform component while preserving functionality.

3.1 Preserve Functionality First

// Step 1: Extract interface (no visual changes yet)
interface ButtonProps {
  title: string
  onPress: () => void
  disabled?: boolean
  // ADD: New props for enhanced functionality
  loading?: boolean
  variant?: 'primary' | 'secondary' | 'tertiary'
  size?: 'sm' | 'md' | 'lg'
  leftIcon?: React.ReactNode
}

3.2 Apply Design Tokens

import { glassAesthetic } from '@/theme/presets'

// Step 2: Replace hardcoded values with tokens
style={{
  // BEFORE: backgroundColor: disabled ? '#ccc' : '#3498db'
  // AFTER: Use tokens
  backgroundColor: disabled
    ? glassAesthetic.colors.ui.background.tertiary
    : glassAesthetic.colors.brand.primary,

  // BEFORE: padding: 12
  // AFTER: Use spacing tokens
  padding: glassAesthetic.spacing.md,

  // BEFORE: borderRadius: 5
  // AFTER: Use radius tokens
  borderRadius: glassAesthetic.radius.lg,
}}

3.3 Modernize Component Structure

// Step 3: Improve composition and patterns
const Button: React.FC<ButtonProps> = ({
  title,
  onPress,
  disabled = false,
  loading = false,
  variant = 'primary',
  size = 'md',
  leftIcon,
}) => {
  const theme = useTheme() // Use theme hook
  const styles = getStyles(theme, variant, size) // Dynamic styles

  return (
    <Pressable
      onPress={onPress}
      disabled={disabled || loading}
      style={({ pressed }) => [
        styles.base,
        pressed && styles.pressed,
        disabled && styles.disabled,
      ]}
      // Add accessibility
      accessibilityRole="button"
      accessibilityState=
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

FAQ

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

Use when refactoring existing React Native, Next.js, or TypeScript UI code to apply modern design principles and aesthetic excellence - analyzes current implementation, applies design presets, maintains functionality while elevating visual quality

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

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

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

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

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

Сравнить ui-refactoring-workflow с