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…
Об этом скилле
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-foundationinstead) - 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, timelessbold-brutalist- High contrast, geometric, boldsoft-neumorphic- Subtle shadows, soft edgesglass-aesthetic- Transparency, blur, depthtimeless-classic- Balanced, professional, accessiblebleeding-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=
Установить 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic