android-compose
Jetpack Compose expert for modern Android UI development. Covers composables, state management, navigation, and Material 3 design.
来源信息
- 仓库
- skeletorflet/opencode-kit
- 最近来源活动
- 2026年3月31日 18:16
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 9
- Forks
- 1
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- android-compose
- description
- Jetpack Compose expert for modern Android UI development. Covers composables, state management, navigation, and Material 3 design.
- license
- MIT
- compatibility
- opencode
- metadata
- {"audience":"developers","category":"mobile"}
# Jetpack Compose Expert
## What I Do
- Build UI with Jetpack Compose declarative patterns
- Manage state with StateFlow, ViewModel, and Compose state
- Implement navigation with Compose Navigation
- Apply Material 3 design system
- Optimize recomposition and performance
## When to Use Me
- Building Android UI with Jetpack Compose
- Migrating from XML to Compose
- Implementing Material 3 design
- Managing UI state in Compose
- Creating custom composables
## Key Principles
1. **Unidirectional Data Flow**: State flows down, events flow up
2. **State Hoisting**: Lift state to the caller for reusability
3. **Remember + MutableState**: Use for local composable state
4. **ViewModel for Screen State**: Use ViewModel for screen-level state
5. **Key for Lists**: Always provide stable keys in LazyColumn/LazyRow
## Common Patterns
### State Hoisting
```kotlin
@Composable
fun GreetingScreen(viewModel: GreetingViewModel = viewModel()) {
val state by viewModel.state.collectAsStateWithLifecycle()
GreetingContent(
state = state,
onNameChange = { viewModel.onNameChange(it) },
onGreet = { viewModel.greet() }
)
}
@Composable
private fun GreetingContent(
state: GreetingState,
onNameChange: (String) -> Unit,
onGreet: () -> Unit
) {
Column(modifier = Modifier.padding(16.dp)) {
OutlinedTextField(
value = state.name,
onValueChange = onNameChange,
label = { Text("Name") }
)
Button(onClick = onGreet, modifier = Modifier.padding(top = 8.dp)) {
Text("Greet")
}
if (state.greeting.isNotEmpty()) {
Text(state.greeting, modifier = Modifier.padding(top = 16.dp))
}
}
}
```
## Validation
```bash
./gradlew assembleDebug
./gradlew test
./gradlew connectedAndroidTest
```
在 GitHub 查看