software-mobile
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill software-mobile
Agent 安装分布
Skill 文档
Mobile Development Skill â Quick Reference
This skill equips mobile developers with execution-ready patterns for building native and cross-platform mobile applications. Apply these patterns when you need iOS/Android app architecture, UI components, navigation flows, API integration, offline storage, authentication, or mobile-specific features.
When to Use This Skill
Use this skill when you need:
- iOS app development (Swift, SwiftUI, UIKit)
- Android app development (Kotlin, Jetpack Compose)
- Cross-platform development (React Native, WebView)
- Mobile app architecture and patterns
- Navigation and routing
- State management (Redux, MobX, MVVM)
- Network requests and API integration
- Local data storage (Core Data, Room, SQLite)
- Authentication and session management
- Push notifications (APNs, FCM)
- Camera and media access
- Location services
- App Store / Play Store deployment
- Mobile performance optimization
- Offline-first architecture
- Deep linking and universal links
Quick Reference Table
| Task | iOS | Android | Cross-Platform | When to Use |
|---|---|---|---|---|
| Native UI | SwiftUI + UIKit | Jetpack Compose + Views | React Native | Native: Best performance; Cross-platform: Code sharing |
| Navigation | NavigationStack | Navigation Component | React Navigation | Platform-specific for native feel |
| State Management | @State/@Observable | ViewModel + StateFlow | Redux/MobX | iOS: @Observable; Android: ViewModel; RN: Redux |
| Networking | URLSession + async/await | Retrofit + Coroutines | Axios/Fetch | Native: Type-safe; RN: JavaScript ecosystem |
| Local Storage | Core Data + SwiftData | Room Database | AsyncStorage/SQLite | Native: Full control; RN: Simpler |
| Push Notifications | APNs | FCM | React Native Firebase | Native: Platform-specific; RN: Unified API |
| Background Tasks | BGTaskScheduler | WorkManager | Headless JS | For scheduled/background work |
| Deep Linking | Universal Links | App Links | React Navigation linking | For URL-based app entry |
| Authentication | AuthenticationServices | Credential Manager | Expo AuthSession | For social/biometric auth |
| Analytics | Firebase/Amplitude | Firebase/Amplitude | Expo Analytics | Track user behavior |
Decision Tree: Platform Selection
Need to build mobile app for: [Target Audience]
â
ââ iOS only?
â ââ New app? â SwiftUI (modern, declarative)
â ââ Existing UIKit codebase? â UIKit + incremental SwiftUI adoption
â ââ Complex animations? â UIKit for fine-grained control
â
ââ Android only?
â ââ New app? â Jetpack Compose (modern, declarative)
â ââ Existing Views codebase? â Views + incremental Compose adoption
â ââ Complex custom views? â Custom View for fine-grained control
â
ââ Both iOS and Android?
â ââ Need maximum performance / platform fidelity?
â â ââ Build separate native apps (Swift + Kotlin)
â â
â ââ Need faster development + code sharing?
â â ââ JavaScript/TypeScript team? â React Native (Expo-managed or bare)
â â ââ Dart team? â Flutter
â â ââ Kotlin team? â Kotlin Multiplatform (KMP)
â â
â ââ Kotlin Multiplatform (KMP)?
â â ââ Share business logic only? â KMP shared module + native UI
â â ââ Share some UI? â Compose Multiplatform (validate iOS maturity for your needs)
â â ââ Shared modules need platform UI? â Keep native UI, share domain/data/networking
â â
â ââ Wrapping existing web app?
â ââ Simple wrapper? â WebView (iOS WKWebView / Android WebView)
â ââ Native features needed? â Capacitor or React Native WebView
â
ââ Prototype/MVP only?
ââ React Native or Flutter for fastest iteration
Decision Tree: Architecture Pattern
Choosing architecture pattern?
â
ââ iOS (Swift)?
â ââ SwiftUI app? â MVVM with @Observable/ObservableObject (based on OS baseline)
â ââ Complex SwiftUI? â TCA (Composable Architecture) for testability
â ââ UIKit app? â MVVM-C (Coordinator pattern)
â ââ Large team? â Clean Architecture + MVVM
â ââ Simple app? â MVC (Apple default)
â
ââ Android (Kotlin)?
â ââ Compose app? â MVVM with ViewModel + StateFlow
â ââ Views app? â MVVM with LiveData
â ââ Large team? â Clean Architecture + MVVM
â ââ Simple app? â Activity/Fragment-based
â
ââ React Native?
ââ Small app? â Context API + useState
ââ Medium app? â Redux Toolkit or Zustand
ââ Large app? â Redux + RTK Query + feature-based structure
Decision Tree: Data Persistence
Need to store data locally?
â
ââ Simple key-value pairs?
â ââ iOS â UserDefaults
â ââ Android â SharedPreferences / DataStore
â ââ RN â AsyncStorage
â
ââ Structured data with relationships?
â ââ iOS â Core Data or SwiftData
â ââ Android â Room Database
â ââ RN â WatermelonDB or Realm
â
ââ Secure credentials?
â ââ iOS â Keychain
â ââ Android â EncryptedSharedPreferences / Keystore
â ââ RN â react-native-keychain
â
ââ Large files/media?
ââ iOS â FileManager (Documents/Cache)
ââ Android â Internal/External Storage
ââ RN â react-native-fs
Decision Tree: Networking
Need to make API calls?
â
ââ iOS?
â ââ Simple REST? â URLSession + async/await
â ââ Complex API? â URLSession + Codable
â ââ GraphQL? â Apollo iOS
â
ââ Android?
â ââ Simple REST? â Retrofit + Coroutines
â ââ Complex API? â Retrofit + OkHttp interceptors
â ââ GraphQL? â Apollo Android
â
ââ React Native?
ââ Simple REST? â fetch() or Axios
ââ Complex API? â RTK Query or React Query
ââ GraphQL? â Apollo Client
Core Capabilities
iOS Development
- UI Frameworks: SwiftUI (declarative), UIKit (imperative)
- Architecture: MVVM, Clean Architecture, Coordinator, TCA (Composable Architecture)
- Concurrency: Swift Concurrency (async/await, actors, TaskGroup); keep UI state on
@MainActor; enable strict concurrency checks as appropriate - Storage: Core Data, SwiftData, Keychain
- Networking: URLSession, async/await patterns
- Platform compliance: Privacy manifests + required-reason APIs, background execution limits, and accessibility settings (Dynamic Type, VoiceOver)
- Defensive Decoding: Handle missing fields, array/dict formats, snake_case/camelCase
Android Development
- UI Frameworks: Jetpack Compose (declarative), Views (XML)
- Architecture: MVVM, Clean Architecture, MVI
- Concurrency: Coroutines, Flow, LiveData
- Storage: Room, DataStore, Keystore
- Networking: Retrofit, OkHttp, Ktor
Cross-Platform Development
- Kotlin Multiplatform (KMP): Share domain/data/networking; keep native UI; consider Compose Multiplatform when shared UI is worth the constraints
- React Native: JavaScript/TypeScript; evaluate New Architecture readiness and native-module surface area; Expo-managed path is often fastest for greenfield apps
- Flutter: Dart; high code sharing; validate platform-specific gaps and plugin maturity for your requirements
- WebView: WKWebView (iOS), WebView (Android), JavaScript bridge
Platform Baselines (Verify Current Requirements)
iOS/iPadOS (Core)
- Privacy manifest files (app + embedded SDKs) are maintained and reviewed https://developer.apple.com/documentation/bundlereferences/privacy_manifest_files
- Required-reason APIs are declared with valid reasons https://developer.apple.com/documentation/bundlereferences/privacy_manifest_files
- Background work uses supported primitives (avoid fragile timers) https://developer.apple.com/documentation/backgroundtasks
- App Transport Security is configured; exceptions are justified and documented https://developer.apple.com/documentation/bundlereferences/information_property_list/nsapptransportsecurity
- Concurrency is implemented with Swift Concurrency (async/await, actors, TaskGroup) and checked with current Swift language mode settings https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html
- Swift 6 migration / strict concurrency guidance is followed when upgrading toolchains https://developer.apple.com/documentation/swift/adoptingswift6
- UI/UX follows current Human Interface Guidelines (including accessibility) https://developer.apple.com/design/human-interface-guidelines/ios
Android (Core)
- Background work uses WorkManager for deferrable, guaranteed work https://developer.android.com/topic/libraries/architecture/workmanager
- Network calls and auth state survive process death (no hidden singleton assumptions) [Inference]
- Target SDK meets current Google Play requirements (verify policy + deadlines) https://support.google.com/googleplay/android-developer/answer/11926878
- Prefer Play Integrity API over deprecated SafetyNet Attestation https://developer.android.com/google/play/integrity
- Prefer Credential Manager for passkeys and modern sign-in flows https://developer.android.com/identity/sign-in/credential-manager
Cross-Platform (Core)
- Feature parity is explicit (document what is native-only vs shared) [Inference]
- Bridges are treated as public APIs (versioned, tested, and observable) [Inference]
- React Native upgrades follow the official upgrade guide; validate New Architecture readiness against your native-module surface area https://reactnative.dev/docs/upgrading
- Expo SDK upgrades follow Expo release notes and upgrade guides https://expo.dev/changelog
Optional: AI/Automation Extensions
Note: Skip unless the app ships AI/automation features.
- iOS: Core ML / on-device inference primitives https://developer.apple.com/documentation/coreml
- Android: Google ML Kit https://developers.google.com/ml-kit
- Verify: model size/battery impact, offline/online behavior, user controls (cancel/undo), and privacy boundaries [Inference]
Common Patterns
App Startup Checklist
-
Initialize dependencies
- Configure DI container (Hilt/Koin/Swinject)
- Set up logging and crash reporting
- Initialize analytics
-
Check authentication state
- Validate stored tokens
- Refresh if needed
- Route to login or main screen
-
Configure app state
- Load user preferences
- Set up push notification handlers
- Initialize deep link handling
Offline-First Architecture
1. Local-first data access
- Always read from local database
- Display cached data immediately
- Show loading indicator for sync
2. Background sync
- Queue write operations
- Sync when connectivity available
- Handle conflict resolution
3. Optimistic updates
- Update UI immediately
- Sync in background
- Rollback on failure
Push Notification Setup
iOS (APNs):
1. Enable Push Notifications capability
2. Request user permission
3. Register for remote notifications
4. Handle device token
5. Implement notification delegate
Android (FCM):
1. Add Firebase to project
2. Implement FirebaseMessagingService
3. Handle notification/data messages
4. Manage notification channels (Android 8+)
5. Handle background/foreground states
Performance Optimization
| Area | iOS | Android | Metric |
|---|---|---|---|
| Launch time | Pre-warm, lazy loading | Cold start optimization | < 2s cold start |
| List scrolling | LazyVStack, prefetch | LazyColumn, paging | 60 FPS |
| Image loading | AsyncImage, cache | Coil/Glide, disk cache | < 100ms visible |
| Memory | Instruments profiling | LeakCanary, Profiler | No memory leaks |
| Battery | Background App Refresh limits | Doze mode compliance | Minimal drain |
App Store Deployment Checklist
iOS App Store
- App icons (all required sizes)
- Launch screen configured
- Privacy manifest per target and embedded frameworks (iOS 18+)
- Required-reason APIs declared with justifications
- Third-party SDK privacy manifests attached; SDK signature attestation (iOS 19+)
- Info.plist permissions explanations
- App Store screenshots (all device sizes)
- App Store description and keywords
- Privacy policy URL
- TestFlight beta testing
Google Play Store
- App icons and feature graphic
- Store listing screenshots
- Privacy policy URL
- Content rating questionnaire
- Target API level compliance
- Data safety form
- Internal/closed/open testing tracks
Navigation
Resources
- references/ios-best-practices.md â iOS architecture, concurrency, testing, performance, defensive decoding, and accessibility
- references/android-best-practices.md â Android/Kotlin architecture, coroutines, Compose, testing, performance
- references/operational-playbook.md â Mobile architecture patterns, platform-specific guides, security notes, and decision tables
- README.md â Folder overview and usage notes
- data/sources.json â Curated external references by platform
Shared Checklists
- ../software-clean-code-standard/assets/checklists/mobile-release-checklist.md â Product-agnostic mobile release readiness checklist (core + optional AI)
Shared Utilities (Centralized patterns â extract, don’t duplicate)
- ../software-clean-code-standard/utilities/auth-utilities.md â Argon2id, jose JWT, OAuth 2.1/PKCE (backend auth for mobile clients)
- ../software-clean-code-standard/utilities/error-handling.md â Error patterns, Result types
- ../software-clean-code-standard/utilities/resilience-utilities.md â Retry, circuit breaker for network calls
- ../software-clean-code-standard/utilities/logging-utilities.md â Structured logging patterns
- ../software-clean-code-standard/utilities/testing-utilities.md â Test factories, fixtures, mocks
- ../software-clean-code-standard/references/clean-code-standard.md â Canonical clean code rules (
CC-*) for citation
Templates
- Swift: assets/swift/template-swift.md, assets/swift/template-swift-concurrency.md, assets/swift/template-swift-combine.md, assets/swift/template-swift-performance.md, assets/swift/template-swift-testing.md
- SwiftUI: assets/swiftui/template-swiftui-advanced.md
- Kotlin/Android: assets/kotlin/template-kotlin.md, assets/kotlin/template-kotlin-coroutines.md, assets/kotlin/template-kotlin-compose-advanced.md, assets/kotlin/template-kotlin-testing.md
- Cross-platform: assets/cross-platform/template-platform-patterns.md, assets/cross-platform/template-webview.md
Anti-Patterns to Avoid
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Blocking main thread | UI freezes, ANRs | Use async/coroutines for all I/O |
| Massive view controllers | Hard to test/maintain | Extract to MVVM/services |
| Hardcoded strings | No localization | Use NSLocalizedString/strings.xml |
| Ignoring lifecycle | Memory leaks, crashes | Respect activity/view lifecycle |
| No offline handling | Poor UX without network | Cache data, queue operations |
| Storing secrets in code | Security vulnerability | Use Keychain/Keystore |
Using decode() without fallback |
Crashes on missing/malformed API data | Use decodeIfPresent() with defaults |
| Missing @Bindable for @Observable | NavigationStack bindings don’t work | Add @Bindable var vm = vm in body |
Trend Awareness Protocol
IMPORTANT: When users ask recommendation questions about mobile development, you MUST use a web search capability (if available) to check current trends before answering. If web search is unavailable, say so and answer using data/sources.json, clearly flagging that the recommendation may be stale.
Trigger Conditions
- “What’s the best mobile framework for [use case]?”
- “What should I use for [cross-platform/native/hybrid]?”
- “What’s the latest in iOS/Android development?”
- “Current best practices for [Swift/Kotlin/React Native]?”
- “Is [React Native/Flutter/Expo] still relevant in 2026?”
- “[React Native] vs [Flutter] vs [native]?”
- “Best approach for [offline/push/deep linking]?”
Required Searches
- Search:
"mobile development best practices 2026" - Search:
"[iOS/Android/React Native/Flutter] updates 2026" - Search:
"mobile framework comparison 2026" - Search:
"[Expo/Swift/Kotlin] new features 2026"
What to Report
After searching, provide:
- Current landscape: What frameworks/approaches are popular NOW
- Emerging trends: New patterns or tools gaining traction
- Deprecated/declining: Approaches that are losing relevance
- Recommendation: Based on fresh data and recent releases
Example Topics (verify with fresh search)
- Current iOS + Swift Concurrency migration guidance
- Current Play target SDK policy and identity/auth guidance
- React Native New Architecture maturity and upgrade pain points
- Expo-managed vs bare React Native tradeoffs
- Flutter vs React Native vs KMP ecosystem in 2026
- Compose Multiplatform readiness for iOS in 2026
Related Skills
- ../software-frontend/SKILL.md â Web-facing UI patterns and Next.js integration
- ../software-backend/SKILL.md â API design, auth, and backend contracts for mobile clients
- ../qa-testing-strategy/SKILL.md â Mobile CI, test strategy, and reliability gates
- ../qa-resilience/SKILL.md â Resilience patterns for networked mobile apps
- ../qa-testing-ios/SKILL.md â iOS-focused test planning, XCTest/Swift Testing patterns, device matrix, and app health checks
- ../software-ui-ux-design/SKILL.md â Mobile UI/UX design patterns and accessibility