mobile-system-design/SKILL.md
Master mobile system design interviews with iOS-specific patterns for offline-first architecture, sync strategies, caching, real-time features, and scalable mobile systems. Use when preparing for mobile system design interviews or architecting complex iOS applications.
npx skillsauth add abanoub-ashraf/manus-skills-import mobile-system-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Mobile system design is fundamentally different from backend system design. While backend focuses on horizontal scaling, mobile design emphasizes constraints: battery, network, storage, and user experience under unreliable conditions.
Functional Requirements
Non-Functional Requirements
Constraints
┌─────────────────────────────────────────────────────────────┐
│ iOS App │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ UI │ │ Business │ │ Data Layer │ │
│ │ Layer │←→│ Logic │←→│ (Repository Pattern)│ │
│ │ (SwiftUI) │ │ (ViewModels│ │ │ │
│ └─────────────┘ └─────────────┘ └──────────┬──────────┘ │
│ │ │
│ ┌───────────────────────────┼───────────┐ │
│ │ │ │ │
│ ┌────▼────┐ ┌─────▼─────┐ │ │
│ │ Local │ │ Remote │ │ │
│ │ Cache │ │ API │ │ │
│ │(SwiftData│ │ (Network) │ │ │
│ └────┬────┘ └─────┬─────┘ │ │
│ │ │ │ │
│ └─────────────┬─────────────┘ │ │
│ │ │ │
│ ┌──────▼──────┐ │ │
│ │ Sync Engine│ │ │
│ └─────────────┘ │ │
└─────────────────────────────────────────────────────────────┘
Strategy 1: Last Write Wins
struct SyncableEntity {
let id: UUID
var data: Data
var updatedAt: Date
var syncStatus: SyncStatus
}
enum SyncStatus {
case synced
case pendingUpload
case conflict
}
Strategy 2: Optimistic Updates
class OptimisticSyncEngine {
func createPost(_ post: Post) async throws -> Post {
// 1. Save locally with pending status
let localPost = post.with(syncStatus: .pendingUpload)
try await localStorage.save(localPost)
// 2. Notify UI immediately (optimistic)
NotificationCenter.default.post(name: .postCreated, object: localPost)
// 3. Sync to server
do {
let serverPost = try await api.createPost(post)
try await localStorage.update(localPost.id, with: serverPost)
return serverPost
} catch {
try await localStorage.markAsFailed(localPost.id)
throw error
}
}
}
Key Components:
Image Loading Pipeline:
Request Image URL
│
▼
┌───────────────────┐
│ Memory Cache │ ─── Hit ──→ Return UIImage
│ (NSCache) │
└────────┬──────────┘
│ Miss
▼
┌───────────────────┐
│ Disk Cache │ ─── Hit ──→ Decode → Memory Cache → Return
│ (FileManager) │
└────────┬──────────┘
│ Miss
▼
┌───────────────────┐
│ Network │ ─── Download → Decode → Both Caches → Return
└───────────────────┘
Key Challenges:
Location Tracking:
class LocationManager {
func startTracking(mode: TrackingMode) {
switch mode {
case .searching:
// High accuracy, frequent updates
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.distanceFilter = 10
case .inRide:
// High accuracy for fare calculation
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation
case .background:
// Significant location changes only (battery saving)
locationManager.startMonitoringSignificantLocationChanges()
}
}
}
Key Challenges:
Message State Machine:
┌─────────┐ Send ┌─────────┐ Server ┌───────────┐
│ Pending │ ─────────→ │ Sent │ ─────────→ │ Delivered │
└─────────┘ └─────────┘ └───────────┘
│ │ │
│ Error │ Timeout │ Read
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Failed │ │ Failed │ │ Read │
└─────────┘ └─────────┘ └─────────┘
Ask me to:
development
Design principles for building polished, native-feeling SwiftUI apps and widgets. Use this skill when creating or modifying SwiftUI views, iOS widgets (WidgetKit), or any native Apple UI. Ensures proper spacing, typography, colors, and widget implementations that look and feel like quality apps rather than AI-generated slop.
data-ai
Design and implement SwiftUI views, components, and app architecture. Use when creating new SwiftUI views, implementing MVVM/TCA patterns, managing state with @Observable, @State, @Binding, or @Environment, designing navigation flows, or structuring iOS app architecture. Triggers on SwiftUI, view model, state management, navigation, coordinator pattern.
development
Implement, review, or improve SwiftUI animations and transitions. Use when adding implicit or explicit animations with withAnimation, configuring spring animations (.smooth, .snappy, .bouncy), building phase or keyframe animations with PhaseAnimator/KeyframeAnimator, creating hero transitions with matchedGeometryEffect or matchedTransitionSource, adding SF Symbol effects (bounce, pulse, variableColor, breathe, rotate, wiggle), implementing custom Transition or CustomAnimation types, or ensuring animations respect accessibilityReduceMotion.
testing
Audit SwiftUI views for accessibility (iOS + macOS) with patch-ready fixes