Use when refactoring existing React Native, Next.js, or TypeScript UI code to apply modern design principles and aesthetic excellence — analyzes the current implementation, applies design presets, and maintains functionality while elevating visual quality.
Systematic approach to transforming existing UI code into modern, aesthetically superior implementations while preserving functionality and improving maintainability.
design-system-foundation instead)Goal: Fully understand what exists before changing anything.
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
Goal: Choose aesthetic direction for refactored component.
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, innovativeExample: For a fitness app → glass-aesthetic (modern, premium feel)
Goal: Transform component while preserving functionality.
// 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
}
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,
}}
// 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={{ disabled, busy: loading }}
accessibilityLabel={title}
>
{loading ? (
<ActivityIndicator color={theme.colors.ui.text.inverse} />
) : (
<>
{leftIcon && <View style={styles.iconLeft}>{leftIcon}</View>}
<Text style={styles.text}>{title}</Text>
</>
)}
</Pressable>
)
}
// WCAG 2.2 AA Compliance
const styles = StyleSheet.create({
base: {
// Minimum touch target: 44x44pt
minHeight: 44,
minWidth: 44,
// Clear focus indicator
borderWidth: 2,
borderColor: 'transparent',
},
focused: {
// Visible focus for keyboard navigation
borderColor: theme.colors.brand.accent,
borderWidth: 2,
},
text: {
// Minimum font size for readability
fontSize: Math.max(theme.typography.scale.base, 16),
// Sufficient contrast ratio (4.5:1 minimum)
color: theme.colors.ui.text.inverse,
}
})
import { useAnimatedStyle, withTiming } from 'react-native-reanimated'
// Thoughtful animations
const animatedStyles = useAnimatedStyle(() => ({
transform: [{
scale: withTiming(pressed ? 0.98 : 1, {
duration: theme.animation.duration.fast,
})
}],
opacity: withTiming(disabled ? 0.5 : 1, {
duration: theme.animation.duration.normal,
})
}))
// Memoize expensive operations
const Button = React.memo(({ title, onPress, ...props }: ButtonProps) => {
// Memoize styles
const styles = useMemo(
() => getStyles(theme, variant, size),
[theme, variant, size]
)
// Memoize callbacks
const handlePress = useCallback(() => {
if (!disabled && !loading) {
onPress()
}
}, [disabled, loading, onPress])
return (
// Component JSX
)
})
Goal: Ensure refactoring meets quality standards.
✓ Visual Parity or Improvement
✓ Functionality Unchanged
✓ Accessibility Enhanced
✓ Performance Maintained or Improved
✓ Code Readability Improved
✓ Design System Compliance
Use in combination:
design-preset-system - For style selectioncomponent-modernization - For React Native/Next.js specific patternsaesthetic-excellence - For visual hierarchy improvementsaccessibility-upgrade - For WCAG complianceanimation-enhancement - For micro-interactions// BEFORE
style={{ color: '#3498db', padding: 15, fontSize: 18 }}
// AFTER
style={{
color: theme.colors.brand.primary,
padding: theme.spacing.lg,
fontSize: theme.typography.scale.lg,
}}
// BEFORE
<View style={{ backgroundColor: '#fff', padding: 20 }}>
// AFTER
const styles = StyleSheet.create({
container: {
backgroundColor: theme.colors.ui.background.primary,
padding: theme.spacing.xl,
}
})
<View style={styles.container}>
// BEFORE: Single style
const Button = ({ onPress }) => <TouchableOpacity style={styles.button}>
// AFTER: Multiple variants
const Button = ({ variant = 'primary', onPress }) => (
<Pressable style={[styles.base, styles[variant]]}>
)
const styles = StyleSheet.create({
base: { /* shared styles */ },
primary: { backgroundColor: theme.colors.brand.primary },
secondary: { backgroundColor: theme.colors.brand.secondary },
tertiary: { backgroundColor: 'transparent' },
})
// BEFORE
<TouchableOpacity onPress={onPress}>
<Text>{label}</Text>
</TouchableOpacity>
// AFTER
<Pressable
onPress={onPress}
accessibilityRole="button"
accessibilityLabel={label}
accessibilityState={{ disabled }}
accessible={true}
>
<Text>{label}</Text>
</Pressable>
Teams using this workflow report:
❌ Changing functionality during refactoring
// BAD: Adding new features while refactoring
const Button = ({ onPress }) => {
// Don't add analytics, new features, etc. during refactor
trackAnalytics('button_pressed') // ❌
}
✅ Refactor only, features later
// GOOD: Pure refactor, no behavioral changes
const Button = ({ onPress }) => {
// Just visual/structural improvements
}
❌ Incomplete token migration
// BAD: Mix of tokens and hardcoded
style={{
padding: theme.spacing.md, // ✅ Token
color: '#3498db', // ❌ Hardcoded
}}
✅ Complete token usage
// GOOD: All values from tokens
style={{
padding: theme.spacing.md,
color: theme.colors.brand.primary,
}}
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer