# Mobile Design

> ---

- Skill: `anhvu1107/mobile-design` (Agent Skill, multi-file: 20 files)
- Install (CLI): `npx skillmds@latest add anhvu1107/mobile-design`
- Raw SKILL.md: https://api.skillmd.com/api/skills/anhvu1107/mobile-design/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: anhvu1107 (https://skillmd.com/u/anhvu1107)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/anhvu1107/mobile-design

---

﻿---
name: mobile-design
description: ALWAYS use this when the request is about mobile app screens, flows, native-feeling layouts, touch ergonomics, or platform-aware product UI for phones and tablets.
---

# Mobile Design System

## Selective Reading Rule

Start with:

- `references/usage-routing.md`
- `references/quality-checklist.md`

Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.

## Selective Reading Rule

Start with:

- `references/senior-master-standard.md`
- `references/platform-routing.md`
- `references/quality-checklist.md`

Then read only the platform files and root guides that match the request.

> **Philosophy:** Touch-first. Battery-conscious. Platform-respectful. Offline-capable.
> **Core Principle:** Mobile is NOT a small desktop. THINK mobile constraints, ASK platform choice.

---

## đŸ”§ Runtime Scripts

**Execute these for validation (don't read, just run):**

| Script | Purpose | Usage |
|--------|---------|-------|
| `scripts/mobile_audit.py` | Mobile UX & Touch Audit | `python scripts/mobile_audit.py <project_path>` |

---

## đŸ”´ MANDATORY: Read Reference Files Before Working!

**â›” DO NOT start development until you read the relevant files:**

### Universal (Always Read)

| File | Content | Status |
|------|---------|--------|
| **[mobile-design-thinking.md](references/legacy-mobile-design-thinking.md)** | **â ï¸ ANTI-MEMORIZATION: Forces thinking, prevents AI defaults** | **â¬œ CRITICAL FIRST** |
| **[touch-psychology.md](references/legacy-touch-psychology.md)** | **Fitts' Law, gestures, haptics, thumb zone** | **â¬œ CRITICAL** |
| **[mobile-performance.md](references/legacy-mobile-performance.md)** | **RN/Flutter performance, 60fps, memory** | **â¬œ CRITICAL** |
| **[mobile-backend.md](references/legacy-mobile-backend.md)** | **Push notifications, offline sync, mobile API** | **â¬œ CRITICAL** |
| **[mobile-testing.md](references/legacy-mobile-testing.md)** | **Testing pyramid, E2E, platform-specific** | **â¬œ CRITICAL** |
| **[mobile-debugging.md](references/legacy-mobile-debugging.md)** | **Native vs JS debugging, Flipper, Logcat** | **â¬œ CRITICAL** |
| [mobile-navigation.md](references/legacy-mobile-navigation.md) | Tab/Stack/Drawer, deep linking | â¬œ Read |
| [mobile-typography.md](references/legacy-mobile-typography.md) | System fonts, Dynamic Type, a11y | â¬œ Read |
| [mobile-color-system.md](references/legacy-mobile-color-system.md) | OLED, dark mode, battery-aware | â¬œ Read |
| [decision-trees.md](references/legacy-decision-trees.md) | Framework/state/storage selection | â¬œ Read |

> đŸ§  **mobile-design-thinking.md is PRIORITY!** This file ensures AI thinks instead of using memorized patterns.

### Platform-Specific (Read Based on Target)

| Platform | File | Content | When to Read |
|----------|------|---------|--------------|
| **iOS** | [platform-ios.md](references/legacy-platform-ios.md) | Human Interface Guidelines, SF Pro, SwiftUI patterns | Building for iPhone/iPad |
| **Android** | [platform-android.md](references/legacy-platform-android.md) | Material Design 3, Roboto, Compose patterns | Building for Android |
| **Cross-Platform** | Both above | Platform divergence points | React Native / Flutter |

> đŸ”´ **If building for iOS â†’ Read platform-ios.md FIRST!**
> đŸ”´ **If building for Android â†’ Read platform-android.md FIRST!**
> đŸ”´ **If cross-platform â†’ Read BOTH and apply conditional platform logic!**

---

## â ï¸ CRITICAL: ASK BEFORE ASSUMING (MANDATORY)

> **STOP! If the user's request is open-ended, DO NOT default to your favorites.**

### You MUST Ask If Not Specified:

| Aspect | Ask | Why |
|--------|-----|-----|
| **Platform** | "iOS, Android, or both?" | Affects EVERY design decision |
| **Framework** | "React Native, Flutter, or native?" | Determines patterns and tools |
| **Navigation** | "Tab bar, drawer, or stack-based?" | Core UX decision |
| **State** | "What state management? (Zustand/Redux/Riverpod/BLoC?)" | Architecture foundation |
| **Offline** | "Does this need to work offline?" | Affects data strategy |
| **Target devices** | "Phone only, or tablet support?" | Layout complexity |

### â›” AI MOBILE ANTI-PATTERNS (YASAK LÄ°STESÄ°)

> đŸ« **These are AI default tendencies that MUST be avoided!**

#### Performance Sins

| âŒ NEVER DO | Why It's Wrong | âœ… ALWAYS DO |
|-------------|----------------|--------------|
| **ScrollView for long lists** | Renders ALL items, memory explodes | Use `FlatList` / `FlashList` / `ListView.builder` |
| **Inline renderItem function** | New function every render, all items re-render | `useCallback` + `React.memo` |
| **Missing keyExtractor** | Index-based keys cause bugs on reorder | Unique, stable ID from data |
| **Skip getItemLayout** | Async layout = janky scroll | Provide when items have fixed height |
| **setState() everywhere** | Unnecessary widget rebuilds | Targeted state, `const` constructors |
| **Native driver: false** | Animations blocked by JS thread | `useNativeDriver: true` always |
| **console.log in production** | Blocks JS thread severely | Remove before release build |
| **Skip React.memo/const** | Every item re-renders on any change | Memoize list items ALWAYS |

#### Touch/UX Sins

| âŒ NEVER DO | Why It's Wrong | âœ… ALWAYS DO |
|-------------|----------------|--------------|
| **Touch target < 44px** | Impossible to tap accurately, frustrating | Minimum 44pt (iOS) / 48dp (Android) |
| **Spacing < 8px between targets** | Accidental taps on neighbors | Minimum 8-12px gap |
| **Gesture-only interactions** | Motor impaired users excluded | Always provide button alternative |
| **No loading state** | User thinks app crashed | ALWAYS show loading feedback |
| **No error state** | User stuck, no recovery path | Show error with retry option |
| **No offline handling** | Crash/block when network lost | Graceful degradation, cached data |
| **Ignore platform conventions** | Users confused, muscle memory broken | iOS feels iOS, Android feels Android |

#### Security Sins

| âŒ NEVER DO | Why It's Wrong | âœ… ALWAYS DO |
|-------------|----------------|--------------|
| **Token in AsyncStorage** | Easily accessible, stolen on rooted device | `SecureStore` / `Keychain` / `EncryptedSharedPreferences` |
| **Hardcode API keys** | Reverse engineered from APK/IPA | Environment variables, secure storage |
| **Skip SSL pinning** | MITM attacks possible | Pin certificates in production |
| **Log sensitive data** | Logs can be extracted | Never log tokens, passwords, PII |

#### Architecture Sins

| âŒ NEVER DO | Why It's Wrong | âœ… ALWAYS DO |
|-------------|----------------|--------------|
| **Business logic in UI** | Untestable, unmaintainable | Service layer separation |
| **Global state for everything** | Unnecessary re-renders, complexity | Local state default, lift when needed |
| **Deep linking as afterthought** | Notifications, shares broken | Plan deep links from day one |
| **Skip dispose/cleanup** | Memory leaks, zombie listeners | Clean up subscriptions, timers |

---

## đŸ“± Platform Decision Matrix

### When to Unify vs Diverge

```
                    UNIFY (same on both)          DIVERGE (platform-specific)
                    â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€           â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
Business Logic      âœ… Always                     -
Data Layer          âœ… Always                     -
Core Features       âœ… Always                     -
                    
Navigation          -                             âœ… iOS: edge swipe, Android: back button
Gestures            -                             âœ… Platform-native feel
Icons               -                             âœ… SF Symbols vs Material Icons
Date Pickers        -                             âœ… Native pickers feel right
Modals/Sheets       -                             âœ… iOS: bottom sheet vs Android: dialog
Typography          -                             âœ… SF Pro vs Roboto (or custom)
Error Dialogs       -                             âœ… Platform conventions for alerts
```

### Quick Reference: Platform Defaults

| Element | iOS | Android |
|---------|-----|---------|
| **Primary Font** | SF Pro / SF Compact | Roboto |
| **Min Touch Target** | 44pt Ă— 44pt | 48dp Ă— 48dp |
| **Back Navigation** | Edge swipe left | System back button/gesture |
| **Bottom Tab Icons** | SF Symbols | Material Symbols |
| **Action Sheet** | UIActionSheet from bottom | Bottom Sheet / Dialog |
| **Progress** | Spinner | Linear progress (Material) |
| **Pull to Refresh** | Native UIRefreshControl | SwipeRefreshLayout |

---

## đŸ§  Mobile UX Psychology (Quick Reference)

### Fitts' Law for Touch

```
Desktop: Cursor is precise (1px)
Mobile:  Finger is imprecise (~7mm contact area)

â†’ Touch targets MUST be 44-48px minimum
â†’ Important actions in THUMB ZONE (bottom of screen)
â†’ Destructive actions AWAY from easy reach
```

### Thumb Zone (One-Handed Usage)

```
â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
â”‚      HARD TO REACH          â”‚ â† Navigation, menu, back
â”‚        (stretch)            â”‚
â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤
â”‚      OK TO REACH            â”‚ â† Secondary actions
â”‚       (natural)             â”‚
â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤
â”‚      EASY TO REACH          â”‚ â† PRIMARY CTAs, tab bar
â”‚    (thumb's natural arc)    â”‚ â† Main content interaction
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        [  HOME  ]
```

### Mobile-Specific Cognitive Load

| Desktop | Mobile Difference |
|---------|-------------------|
| Multiple windows | ONE task at a time |
| Keyboard shortcuts | Touch gestures |
| Hover states | NO hover (tap or nothing) |
| Large viewport | Limited space, scroll vertical |
| Stable attention | Interrupted constantly |

For deep dive: [touch-psychology.md](references/legacy-touch-psychology.md)

---

## â¡ Performance Principles (Quick Reference)

### React Native Critical Rules

```typescript
// âœ… CORRECT: Memoized renderItem + React.memo wrapper
const ListItem = React.memo(({ item }: { item: Item }) => (
  <View style={styles.item}>
    <Text>{item.title}</Text>
  </View>
));

const renderItem = useCallback(
  ({ item }: { item: Item }) => <ListItem item={item} />,
  []
);

// âœ… CORRECT: FlatList with all optimizations
<FlatList
  data={items}
  renderItem={renderItem}
  keyExtractor={(item) => item.id}  // Stable ID, NOT index
  getItemLayout={(data, index) => ({
    length: ITEM_HEIGHT,
    offset: ITEM_HEIGHT * index,
    index,
  })}
  removeClippedSubviews={true}
  maxToRenderPerBatch={10}
  windowSize={5}
/>
```

### Flutter Critical Rules

```dart
// âœ… CORRECT: const constructors prevent rebuilds
class MyWidget extends StatelessWidget {
  const MyWidget({super.key}); // CONST!

  @override
  Widget build(BuildContext context) {
    return const Column( // CONST!
      children: [
        Text('Static content'),
        MyConstantWidget(),
      ],
    );
  }
}

// âœ… CORRECT: Targeted state with ValueListenableBuilder
ValueListenableBuilder<int>(
  valueListenable: counter,
  builder: (context, value, child) => Text('$value'),
  child: const ExpensiveWidget(), // Won't rebuild!
)
```

### Animation Performance

```
GPU-accelerated (FAST):     CPU-bound (SLOW):
â”œâ”€â”€ transform               â”œâ”€â”€ width, height
â”œâ”€â”€ opacity                 â”œâ”€â”€ top, left, right, bottom
â””â”€â”€ (use these ONLY)        â”œâ”€â”€ margin, padding
                            â””â”€â”€ (AVOID animating these)
```

For complete guide: [mobile-performance.md](references/legacy-mobile-performance.md)

---

## đŸ“ CHECKPOINT (MANDATORY Before Any Mobile Work)

> **Before writing ANY mobile code, you MUST complete this checkpoint:**

```
đŸ§  CHECKPOINT:

Platform:   [ iOS / Android / Both ]
Framework:  [ React Native / Flutter / SwiftUI / Kotlin ]
Files Read: [ List the skill files you've read ]

3 Principles I Will Apply:
1. _______________
2. _______________
3. _______________

Anti-Patterns I Will Avoid:
1. _______________
2. _______________
```

**Example:**
```
đŸ§  CHECKPOINT:

Platform:   iOS + Android (Cross-platform)
Framework:  React Native + Expo
Files Read: touch-psychology.md, mobile-performance.md, platform-ios.md, platform-android.md

3 Principles I Will Apply:
1. FlatList with React.memo + useCallback for all lists
2. 48px touch targets, thumb zone for primary CTAs
3. Platform-specific navigation (edge swipe iOS, back button Android)

Anti-Patterns I Will Avoid:
1. ScrollView for lists â†’ FlatList
2. Inline renderItem â†’ Memoized
3. AsyncStorage for tokens â†’ SecureStore
```

> đŸ”´ **Can't fill the checkpoint? â†’ GO BACK AND READ THE SKILL FILES.**

---

## đŸ”§ Framework Decision Tree

```
WHAT ARE YOU BUILDING?
        â”‚
        â”œâ”€â”€ Need OTA updates + rapid iteration + web team
        â”‚   â””â”€â”€ âœ… React Native + Expo
        â”‚
        â”œâ”€â”€ Need pixel-perfect custom UI + performance critical
        â”‚   â””â”€â”€ âœ… Flutter
        â”‚
        â”œâ”€â”€ Deep native features + single platform focus
        â”‚   â”œâ”€â”€ iOS only â†’ SwiftUI
        â”‚   â””â”€â”€ Android only â†’ Kotlin + Jetpack Compose
        â”‚
        â”œâ”€â”€ Existing RN codebase + new features
        â”‚   â””â”€â”€ âœ… React Native (bare workflow)
        â”‚
        â””â”€â”€ Enterprise + existing Flutter codebase
            â””â”€â”€ âœ… Flutter
```

For complete decision trees: [decision-trees.md](references/legacy-decision-trees.md)

---

## đŸ“‹ Pre-Development Checklist

### Before Starting ANY Mobile Project

- [ ] **Platform confirmed?** (iOS / Android / Both)
- [ ] **Framework chosen?** (RN / Flutter / Native)
- [ ] **Navigation pattern decided?** (Tabs / Stack / Drawer)
- [ ] **State management selected?** (Zustand / Redux / Riverpod / BLoC)
- [ ] **Offline requirements known?**
- [ ] **Deep linking planned from day one?**
- [ ] **Target devices defined?** (Phone / Tablet / Both)

### Before Every Screen

- [ ] **Touch targets â‰¥ 44-48px?**
- [ ] **Primary CTA in thumb zone?**
- [ ] **Loading state exists?**
- [ ] **Error state with retry exists?**
- [ ] **Offline handling considered?**
- [ ] **Platform conventions followed?**

### Before Release

- [ ] **console.log removed?**
- [ ] **SecureStore for sensitive data?**
- [ ] **SSL pinning enabled?**
- [ ] **Lists optimized (memo, keyExtractor)?**
- [ ] **Memory cleanup on unmount?**
- [ ] **Tested on low-end devices?**
- [ ] **Accessibility labels on all interactive elements?**

---

## đŸ“ Reference Files

For deeper guidance on specific areas:

| File | When to Use |
|------|-------------|
| [mobile-design-thinking.md](references/legacy-mobile-design-thinking.md) | **FIRST! Anti-memorization, forces context-based thinking** |
| [touch-psychology.md](references/legacy-touch-psychology.md) | Understanding touch interaction, Fitts' Law, gesture design |
| [mobile-performance.md](references/legacy-mobile-performance.md) | Optimizing RN/Flutter, 60fps, memory/battery |
| [platform-ios.md](references/legacy-platform-ios.md) | iOS-specific design, HIG compliance |
| [platform-android.md](references/legacy-platform-android.md) | Android-specific design, Material Design 3 |
| [mobile-navigation.md](references/legacy-mobile-navigation.md) | Navigation patterns, deep linking |
| [mobile-typography.md](references/legacy-mobile-typography.md) | Type scale, system fonts, accessibility |
| [mobile-color-system.md](references/legacy-mobile-color-system.md) | OLED optimization, dark mode, battery |
| [decision-trees.md](references/legacy-decision-trees.md) | Framework, state, storage decisions |

---

> **Remember:** Mobile users are impatient, interrupted, and using imprecise fingers on small screens. Design for the WORST conditions: bad network, one hand, bright sun, low battery. If it works there, it works everywhere.

