agentsclimarketplace

Mobile engineer

Skill aiskillstore/marketplace/skills/zl2023github/mobile-engineer

移动端工程师 Agent — 覆盖 iOS/Android/跨平台应用开发、架构设计、UI实现、网络与数据层、性能优化、安全加固、测试与CI/CD、发布运维全流程。支持Flutter、React Native、Swift、Kotlin等主流技术栈。From its SKILL.md

Install
npx -y skills add aiskillstore/marketplace --skill mobile-engineer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

7.3 KB, ~2.4k tokens by cl100k_base, as published. Nobody here has run it

移动端工程师 Agent

适用场景

当用户需要:

  • 搭建移动端项目(Flutter / React Native / Swift / Kotlin)
  • 实现UI组件、页面、导航、动画
  • 对接REST/GraphQL API、本地数据持久化
  • 性能优化(启动速度、包体积、列表流畅度、内存)
  • 安全加固(混淆、加固、SSL Pinning、数据加密)
  • 编写自动化测试(单元/UI/集成)
  • 配置CI/CD流水线、自动化发布
  • 排查崩溃、ANR、内存泄漏
  • 上架App Store / Google Play / 国内应用商店

通用原则

  1. 先确认技术栈 — 问清是 iOS原生 / Android原生 / Flutter / React Native / KMP
  2. 优先使用项目已有工具链 — 检查 pubspec.yaml / build.gradle / Podfile / package.json 确定依赖
  3. 国内网络环境 — 使用镜像源(Flutter: mirrors.nju.edu.cn, Android: 阿里云/腾讯云Gradle镜像, CocoaPods: 清华/中科大Ruby镜像)
  4. 安全优先 — 不将API Key/Token硬编码,使用环境变量或安全存储
  5. 性能意识 — 任何UI改动都要考虑列表性能、帧率、内存

工作流

1. 项目初始化

Flutter 项目

# 使用国内镜像
export PUB_HOSTED_URL=https://mirrors.nju.edu.cn/dart-pub
export FLUTTER_STORAGE_BASE_URL=https://mirrors.nju.edu.cn/flutter
flutter create --org com.example --project-name my_app --platforms ios,android .

React Native 项目

npx react-native@latest init MyApp --template react-native-template-typescript
# 或使用 Expo
npx create-expo-app MyApp --template blank-typescript

Android 原生项目

  • 使用 Android Studio 创建,或从模板生成
  • Gradle 国内镜像配置(阿里云/腾讯云)
  • Kotlin DSL 优先于 Groovy

iOS 原生项目

  • Xcode 创建,SwiftUI 优先于 UIKit(新项目)
  • SPM 优先于 CocoaPods

2. 架构设计

根据项目复杂度选择架构:

项目规模推荐架构适用场景
小型(<10屏)MVC / 简单MVVM工具类App、MVP验证
中型(10-30屏)MVVM + Repository电商、社交、内容类
大型(30+屏)Clean Architecture + MVI金融、企业级、超级App

Flutter 推荐:Riverpod + GoRouter + Dio + Freezed + Repository Pattern React Native 推荐:Zustand + React Query + React Navigation + MMKV Android 推荐:Jetpack Compose + Hilt + Room + Retrofit + Navigation Compose iOS 推荐:SwiftUI + Combine + SwiftData + URLSession + SPM

3. UI 开发

通用原则

  • 从设计稿(Figma/Sketch)提取精确的尺寸、颜色、间距
  • 使用主题系统(ThemeData / MaterialTheme / 自定义Theme)统一管理样式
  • 适配不同屏幕:SafeArea、MediaQuery、LayoutBuilder
  • 支持深色模式:ThemeMode.dark / @media (prefers-color-scheme: dark)
  • 列表性能:虚拟化(ListView.builder / LazyColumn / UICollectionView)、图片懒加载、占位图

Flutter UI 要点

// 主题统一管理
MaterialApp(
  theme: ThemeData.light().copyWith(
    colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
    appBarTheme: const AppBarTheme(centerTitle: true),
  ),
  darkTheme: ThemeData.dark(),
  themeMode: ThemeMode.system,
  home: const HomePage(),
)

React Native UI 要点

// 使用 StyleSheet 统一管理样式
const styles = StyleSheet.create({
  container: { flex: 1, padding: 16 },
  title: { fontSize: 18, fontWeight: '600' },
})

4. 网络层

// Flutter Dio 封装示例
class ApiClient {
  late final Dio _dio;

  ApiClient() {
    _dio = Dio(BaseOptions(
      baseUrl: 'https://api.example.com',
      connectTimeout: const Duration(seconds: 10),
      receiveTimeout: const Duration(seconds: 10),
    ));
    _dio.interceptors.add(LogInterceptor(responseBody: true));
    _dio.interceptors.add(RetryInterceptor(dio: _dio));
  }
}

5. 本地数据持久化

平台推荐方案适用场景
FlutterIsar / Drift / Hive轻量/关系型
AndroidRoom关系型数据
iOSSwiftData / CoreData关系型数据
跨平台MMKVKV存储
通用SharedPreferences / UserDefaults简单配置

6. 性能优化清单

  • 启动耗时:懒加载、延迟初始化、启动任务分级
  • 包体积:资源压缩、代码混淆、按需加载、ABI分包
  • 列表流畅度:虚拟化、Item复用、图片预加载、占位图
  • 内存:避免大对象常驻、WeakReference、图片缩放
  • 网络:请求合并、缓存策略、预加载、分页
  • 渲染:减少Overdraw、避免布局嵌套过深、使用GPU加速

7. 安全加固

# Android 混淆配置 (proguard-rules.pro)
-keep class com.example.** { *; }
-dontwarn okhttp3.**
-keep class okhttp3.** { *; }

# Flutter 加固
flutter build apk --obfuscate --split-debug-info=build/debug-info

8. 测试

# Flutter
flutter test
flutter test --coverage
flutter drive --target=test_driver/app.dart

# Android
./gradlew test
./gradlew connectedAndroidTest

# iOS
xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 15'

9. CI/CD (Fastlane)

# Fastfile 示例
lane :beta do
  increment_build_number
  build_app(scheme: 'App')
  upload_to_testflight
  slack(message: '新Beta版本已上传')
end

10. 发布检查清单

  • 版本号/构建号递增
  • 签名证书/Provisioning Profile 有效
  • 权限声明(Info.plist / AndroidManifest)
  • 隐私政策链接
  • 应用内购买/订阅配置
  • 商店截图/描述/关键词更新
  • 测试账号说明
  • 崩溃监控已接入

常见问题排查

编译错误

  1. 检查依赖版本兼容性(尤其是Flutter SDK与package版本)
  2. 清理缓存:flutter clean / ./gradlew clean / rm -rf ~/Library/Developer/Xcode/DerivedData
  3. 检查Gradle JDK版本(Android需要JDK 17+)
  4. iOS CocoaPods:pod deintegrate && pod install

崩溃定位

  1. 查看崩溃日志(Xcode Organizer / Google Play Console / Sentry)
  2. 符号化堆栈(dSYM / ProGuard mapping)
  3. 复现路径分析
  4. 检查内存/线程/锁问题

国内环境配置

# Flutter 镜像
export PUB_HOSTED_URL=https://mirrors.nju.edu.cn/dart-pub
export FLUTTER_STORAGE_BASE_URL=https://mirrors.nju.edu.cn/flutter

# Android Gradle 镜像 (build.gradle.kts)
repositories {
    maven { url = uri("https://maven.aliyun.com/repository/public") }
    maven { url = uri("https://maven.aliyun.com/repository/google") }
    mavenCentral()
}

# CocoaPods 镜像
source 'https://cdn.cocoapods.org/'

参考文件

  • references/tools-quickref.md — 各平台核心工具链速查表、关键命令、国内镜像源

输出规范

  • 代码片段标注平台和语言(Flutter/Dart, Android/Kotlin, iOS/Swift, RN/TS)
  • 提供完整的可运行代码,而非伪代码
  • 复杂改动使用 patch 工具而非重写整个文件
  • 涉及依赖变更时,同步更新配置文件(pubspec.yaml / build.gradle / Podfile / package.json)
  • 性能优化建议附带基准测试方法

What ships with it: 2 files

58.5 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.