mobile
移动开发。iOS、Android、SwiftUI、Jetpack Compose、React Native、Flutter、跨平台。当用户提到移动开发、iOS、Android、跨平台时路由到此。
Best use case
mobile is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
移动开发。iOS、Android、SwiftUI、Jetpack Compose、React Native、Flutter、跨平台。当用户提到移动开发、iOS、Android、跨平台时路由到此。
Teams using mobile should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mobile/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How mobile Compares
| Feature / Agent | mobile | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
移动开发。iOS、Android、SwiftUI、Jetpack Compose、React Native、Flutter、跨平台。当用户提到移动开发、iOS、Android、跨平台时路由到此。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 移动开发域 · Mobile
```
原生:iOS(SwiftUI/UIKit) | Android(Compose/Kotlin)
跨平台:React Native(TS) | Flutter(Dart)
```
---
## iOS
### SwiftUI
View:`struct V: View { var body: some View {} }`
State:`@State`本地 | `@Binding`双向 | `@StateObject`拥有 | `@ObservedObject`引用 | `@EnvironmentObject`全局
生命周期:`.task { await }` / `.onAppear` / `.onDisappear`
ViewModifier:`struct M: ViewModifier` + `extension View { func style() }`
### Combine
`dataTaskPublisher` → `map` → `decode` → `eraseToAnyPublisher`
订阅:`.sink(receiveCompletion:receiveValue:)` + `.store(in: &cancellables)`
常用:`debounce` / `removeDuplicates` / `combineLatest` / `flatMap`
### iOS 架构
MVVM:Model(`Codable`) → Repository(`protocol`+`async throws`) → ViewModel(`@MainActor ObservableObject`+`@Published`) → View(`@StateObject`)
网络:泛型 `func get<T: Decodable>(_ path:) async throws -> T` + Bearer Token
持久化:UserDefaults(轻量) | Keychain(敏感) | SwiftData(iOS 17+, `@Model`宏) | Core Data
### iOS 检查项
SwiftUI 优先 | `@MainActor` 线程安全 | async/await | 依赖注入 | LazyVStack | Keychain 存敏感 | ViewModel 单测+Mock
---
## Android
### Jetpack Compose
`@Composable fun Screen() {}` | State:`remember { mutableStateOf() }` | `rememberSaveable`
LazyColumn:`items(list, key={it.id})` | Side Effects:`LaunchedEffect` | `DisposableEffect`
Navigation:`NavHost` + `composable(route)` + `navController.navigate()`
### ViewModel + StateFlow
`MutableStateFlow(UiState())` → `.asStateFlow()` → `.update { it.copy() }`
Compose:`val uiState by viewModel.uiState.collectAsState()`
### Coroutines
`viewModelScope.launch { withContext(Dispatchers.IO) {} }` | `coroutineScope { async{} + async{} }`
Flow:`.flowOn(IO)` + `.stateIn(scope, WhileSubscribed(5000), initial)` | 防抖:`.debounce(300).flatMapLatest{}`
### Hilt + Room
Hilt:`@HiltAndroidApp` + `@AndroidEntryPoint` + `@HiltViewModel class VM @Inject constructor(repo)`
Room:`@Entity` → `@Dao`(`@Query`/`@Insert(REPLACE)` 返回 `Flow<List<T>>`) → `@Database`
### Android 检查项
Compose 优先 | StateFlow 替代 LiveData | Hilt 注入 | Room 持久化 | key 优化 LazyColumn | remember 防重组 | ViewModel 单测(runTest)
---
## 跨平台
| 维度 | React Native | Flutter |
|------|--------------|---------|
| 渲染 | 原生组件(桥接) | 自绘(Skia) |
| 热重载 | Fast Refresh | Hot Reload |
| UI 一致性 | 跟随系统 | 完全一致 |
RN:函数组件+Hooks | FlatList+keyExtractor | @react-navigation | Redux Toolkit/Zustand | Hermes/JSI
Flutter:StatelessWidget/StatefulWidget | Riverpod(`ref.watch`) | go_router | MethodChannel 桥接 | `const`构造+`ListView.builder`
### 选型
Web 背景→RN | 极致动画/UI 定制→Flutter | 大量原生交互→RN | 极致原生体验→原生
### 跨平台检查项
列表优化(FlatList/ListView.builder+key) | 状态管理(RTK/Riverpod) | 原生桥接验证 | 冷启动<1.5s | 渲染>55fps
## 触发词
iOS、SwiftUI、Android、Jetpack Compose、React Native、Flutter、跨平台、移动开发Related Skills
name: parse-error
this is not frontmatter
multi-script
too many scripts
missing-description
No description provided.
invalid-tools
invalid tool name
clash-skill
second duplicate
review
Review skill. Read ~/.claude/skills/gstack/review/checklist.md before acting.
office-hours
Office hours skill. Uses ~/.claude/skills/gstack/bin/gstack-config.
codex
Should be skipped for codex host.
gstack
Root gstack skill. Uses ~/.claude/skills/gstack/bin helpers.
verify-security
安全校验关卡。自动扫描代码安全漏洞,检测危险模式,确保安全决策有文档记录。当魔尊提到安全扫描、漏洞检测、安全审计、代码安全、OWASP、注入检测、敏感信息泄露时使用。在新建模块、安全相关变更、攻防任务、重构完成时自动触发。
verify-quality
代码质量校验关卡。检测复杂度、重复代码、命名规范、函数长度等质量指标。当魔尊提到代码质量、复杂度检查、代码异味、重构建议、lint检查、代码规范时使用。在复杂模块、重构完成时自动触发。
verify-module
模块完整性校验关卡。扫描目录结构、检测缺失文档、验证代码与文档同步。当魔尊提到模块校验、文档检查、结构完整性、README检查、DESIGN检查时使用。在新建模块完成时自动触发。