mobile-developer by 404kidwiz/claude-supercode-skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill mobile-developer提供原生移动开发专业知识,专注于 Swift(iOS)和 Kotlin(Android)。构建平台原生应用程序,最大化利用设备能力、性能以及操作系统功能,如灵动岛、小组件和折叠屏支持。
架构选择?
│
├─ **纯原生 (Swift/Kotlin)**
│ ├─ 需要深度系统集成? → **是**(最佳访问权限)
│ ├─ 零妥协用户体验? → **是**(标准平台行为)
│ └─ 团队规模? → **大**(需要独立的 iOS/Android 团队)
│
├─ **Kotlin 多平台 (KMP)**
│ ├─ 仅共享业务逻辑? → **是**(共享领域/数据层)
│ ├─ 需要原生 UI? → **是**(iOS 用 SwiftUI,Android 用 Compose)
│ └─ 已有原生应用? → **是**(适合迁移)
│
└─ **跨平台 (RN/Flutter)**
├─ UI 一致性优先? → **是**(两端 UI 相同)
└─ 单一代码库优先? → **是**
| 平台 | 框架 | 技术现状 (2026) | 推荐建议 |
|---|---|---|---|
| iOS |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| SwiftUI |
| 成熟,默认选择 |
| 95% 的新应用使用它。 仅在复杂自定义手势/遗留代码时回退到 UIKit。 |
| iOS | UIKit | 遗留,稳定 | 仅用于维护,或包装旧库。 |
| Android | Jetpack Compose | 标准,默认 | 100% 的新应用使用它。 XML 已是遗留技术。 |
| Android | XML / View | 遗留 | 仅用于维护。 |
平台 | 模型 | 最佳实践
---|---|---|---
iOS | Swift 并发 | 使用 async/await、Actors 保证线程安全。避免 GCD/闭包。
Android | Kotlin 协程 | 使用 suspend 函数,Flow 处理流。使用 Dispatchers.IO 处理工作。
危险信号 → 上报给 mobile-app-developer(跨平台):
目标: 使用 Swift 6 并发和 SwiftUI 构建一个可扩展的 iOS 应用。
步骤:
Complete。import SwiftUI
import Observation
@Observable
class ProductListViewModel {
var products: [Product] = []
var isLoading = false
var error: Error?
private let service: ProductService
init(service: ProductService = .live) {
self.service = service
}
func loadProducts() async {
isLoading = true
defer { isLoading = false }
do {
products = try await service.fetchProducts()
} catch {
self.error = error
}
}
}
struct ProductListView: View {
@State private var viewModel = ProductListViewModel()
var body: some View {
NavigationStack {
List(viewModel.products) { product in
ProductRow(product: product)
}
.overlay {
if viewModel.isLoading { ProgressView() }
}
.task {
await viewModel.loadProducts()
}
.navigationTitle("Products")
}
}
}
目标: 在 iOS 和 Android 之间共享网络和数据库逻辑。
步骤:
shared/
src/commonMain/kotlin/ # 共享逻辑
src/androidMain/kotlin/ # Android 特定
src/iosMain/kotlin/ # iOS 特定
// commonMain
class ApiClient {
private val client = HttpClient {
install(ContentNegotiation) {
json(Json { ignoreUnknownKeys = true })
}
}
suspend fun getData(): Data = client.get("...").body()
}
ApiClient().getData()。ApiClient().getData()(如果 Kotlin 版本较旧,可能需要包装器来桥接 async/await)。表现:
ViewController.swift 文件。失败原因:
正确方法:
表现:
onAppear 中启动网络请求,但在 onDisappear 中不取消它。失败原因:
正确方法:
.task 会自动取消)。SavedStateHandle 在进程死亡时持久化状态。表现:
失败原因:
正确方法:
Dispatchers.Default / Task.detached)。场景: 为 iOS 和 Android 构建一个具有生物识别认证的安全、合规的银行应用。
开发方法:
实现亮点:
// iOS 生物识别认证
func authenticateWithBiometrics() async throws {
let context = LAContext()
var error: NSError?
guard context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) else {
throw AuthenticationError.biometricsNotAvailable
}
do {
let success = try await context.evaluatePolicy(
.deviceOwnerAuthenticationWithBiometrics,
reason: "验证身份以访问您的账户"
)
guard success else { throw AuthenticationError.authenticationFailed }
} catch {
throw AuthenticationError.authenticationFailed
}
}
成果:
场景: 开发一个具有严格 HIPAA 合规性要求的患者管理应用。
合规性实现:
Android 实现:
// 加密的 SharedPreferences
val masterKey = MasterKey.Builder(context)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
val encryptedPrefs = EncryptedSharedPreferences.create(
context,
"patient_data",
masterKey,
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)
// 用法
encryptedPrefs.edit().putString("patient_id", "12345").apply()
成果:
场景: 构建一个智能家居控制应用,通过蓝牙低功耗与物联网设备集成。
BLE 实现:
架构:
成果:
平台标准:
性能:
架构:
安全:
每周安装
59
仓库
GitHub 星标
45
首次出现
2026年1月24日
安全审计
安装于
opencode47
claude-code47
codex45
gemini-cli44
cursor43
github-copilot38
Provides native mobile development expertise specializing in Swift (iOS) and Kotlin (Android). Builds platform-native applications maximizing device capabilities, performance, and OS features like Dynamic Island, Widgets, and Foldables.
Architecture Choice?
│
├─ **Pure Native (Swift/Kotlin)**
│ ├─ Needs deep system integration? → **Yes** (Best access)
│ ├─ Zero compromise UX? → **Yes** (Standard platform behavior)
│ └─ Team size? → **Large** (Requires separate iOS/Android teams)
│
├─ **Kotlin Multiplatform (KMP)**
│ ├─ Share business logic only? → **Yes** (Shared Domain/Data layer)
│ ├─ Native UI required? → **Yes** (SwiftUI on iOS, Compose on Android)
│ └─ Existing native app? → **Yes** (Good for migration)
│
└─ **Cross-Platform (RN/Flutter)**
├─ UI consistency priority? → **Yes** (Same UI on both)
└─ Single codebase priority? → **Yes**
| Platform | Framework | State of Tech (2026) | Recommendation |
|---|---|---|---|
| iOS | SwiftUI | Mature, Default choice | Use for 95% of new apps. Fallback to UIKit only for complex custom gestures/legacy. |
| iOS | UIKit | Legacy, Stable | Maintenance only, or wrapping old libs. |
| Android | Jetpack Compose | Standard, Default | Use for 100% of new apps. XML is legacy. |
| Android | XML / View | Legacy | Maintenance only. |
| Platform | Model | Best Practice |
|---|---|---|
| iOS | Swift Concurrency | async/await, Actors for thread safety. Avoid GCD/closures. |
| Android | Kotlin Coroutines | suspend functions, Flow for streams. Dispatchers.IO for work. |
Red Flags → Escalate tomobile-app-developer (Cross-platform):
Goal: Build a scalable iOS app using Swift 6 concurrency and SwiftUI.
Steps:
Project Setup
Complete.ViewModel Definition (Observable)
import SwiftUI
import Observation
@Observable
class ProductListViewModel {
var products: [Product] = []
var isLoading = false
var error: Error?
private let service: ProductService
init(service: ProductService = .live) {
self.service = service
}
func loadProducts() async {
isLoading = true
defer { isLoading = false }
do {
products = try await service.fetchProducts()
} catch {
self.error = error
}
}
}
View Implementation
struct ProductListView: View {
@State private var viewModel = ProductListViewModel()
var body: some View {
NavigationStack {
List(viewModel.products) { product in
ProductRow(product: product)
}
.overlay {
if viewModel.isLoading { ProgressView() }
}
.task {
await viewModel.loadProducts()
}
.navigationTitle("Products")
}
}
}
Goal: Share networking and database logic between iOS and Android.
Steps:
Shared Module Structure
shared/
src/commonMain/kotlin/ # Shared logic
src/androidMain/kotlin/ # Android specific
src/iosMain/kotlin/ # iOS specific
Networking (Ktor)
// commonMain
class ApiClient {
private val client = HttpClient {
install(ContentNegotiation) {
json(Json { ignoreUnknownKeys = true })
}
}
suspend fun getData(): Data = client.get("...").body()
}
Consumption
ApiClient().getData() directly in ViewModel.ApiClient().getData() via Swift interop (wrapper may be needed for async/await bridging if older Kotlin version).What it looks like:
ViewController.swift files containing networking, logic, and UI code.Why it fails:
Correct approach:
What it looks like:
onAppear but not cancelling it on onDisappear.Why it fails:
Correct approach:
.task in SwiftUI cancels auto).SavedStateHandle in Android ViewModels to persist state across process death.What it looks like:
Why it fails:
Correct approach:
Dispatchers.Default / Task.detached).Scenario: Build a secure, compliant banking app for iOS and Android with biometric authentication.
Development Approach:
Implementation Highlights:
// iOS Biometric Authentication
func authenticateWithBiometrics() async throws {
let context = LAContext()
var error: NSError?
guard context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) else {
throw AuthenticationError.biometricsNotAvailable
}
do {
let success = try await context.evaluatePolicy(
.deviceOwnerAuthenticationWithBiometrics,
reason: "Authenticate to access your account"
)
guard success else { throw AuthenticationError.authenticationFailed }
} catch {
throw AuthenticationError.authenticationFailed
}
}
Results:
Scenario: Develop a patient management app with strict HIPAA compliance requirements.
Compliance Implementation:
Android Implementation:
// Encrypted SharedPreferences
val masterKey = MasterKey.Builder(context)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
val encryptedPrefs = EncryptedSharedPreferences.create(
context,
"patient_data",
masterKey,
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)
// Usage
encryptedPrefs.edit().putString("patient_id", "12345").apply()
Results:
Scenario: Build a smart home control app integrating with IoT devices via Bluetooth Low Energy.
BLE Implementation:
Architecture:
Results:
Platform Standards:
Performance:
Architecture:
Security:
Weekly Installs
59
Repository
GitHub Stars
45
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode47
claude-code47
codex45
gemini-cli44
cursor43
github-copilot38
Apple Reminders CLI (remindctl) - 终端管理苹果提醒事项,同步iPhone/iPad
1,000 周安装