Files
John Qiu 3706d7f32d feat(skill): REQ-20260406-0004 技能三层分离重构(7主线+16插件)
批次1: req-prd 瘦身 + req-design 重定位 + dev-coding 聚焦
批次2: dev-review 新建 + review-checklist 插件
批次3: dev-integration 新建 + req-compare 拆出
批次4: 插件完善 (req-research/db-migration/dev-scaffold/deploy-rollback)
批次5: 平台拆分 (dev-ios/dev-android/dev-mcp/dev-pda) + dev 分组更新
批次6: marketplace.json 32→44 plugins

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 17:44:08 +09:30

55 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: dev-android
description: Android 开发插件。Kotlin + Jetpack Compose + Hilt 依赖注入。当涉及 Android 开发任务时按需加载。
---
# Android 开发插件 (dev-android)
## 架构MVVM + Hilt
```
android-app/app/src/main/
├── java/com/project/
│ ├── ui/ # Compose 屏幕 + 组件
│ ├── data/ # API + Repository + 本地存储
│ ├── domain/ # 业务逻辑
│ └── di/ # Hilt 依赖注入
└── res/ # 资源文件
```
## 代码规范
```kotlin
@HiltViewModel
class TaskViewModel @Inject constructor(
private val taskRepository: TaskRepository
) : ViewModel() {
private val _tasks = MutableStateFlow<List<Task>>(emptyList())
val tasks: StateFlow<List<Task>> = _tasks.asStateFlow()
fun fetchTasks() {
viewModelScope.launch {
taskRepository.getTasks()
.collect { _tasks.value = it }
}
}
}
@Composable
fun TaskListScreen(viewModel: TaskViewModel = hiltViewModel()) {
val tasks by viewModel.tasks.collectAsState()
LazyColumn {
items(tasks) { task -> TaskItem(task = task) }
}
}
```
## 构建
```bash
./gradlew assembleDebug # Debug 构建
./gradlew assembleRelease # Release 构建
./gradlew test # 测试
```