timeout_s: 1200
repository:
working_dir: wear_compose_m3_empty_app
prompt: |-
Add a horizontal pager to MainActivity.kt with three pages
showing "Page 1", "Page 2", "Page 3" centered on screen.
commands:
build:
- ./gradlew assembleDebug
acceptance_criteria:
project_builds: true
llm_diff_judge:
- Must use `HorizontalPagerScaffold`
- Each page must use `AnimatedPage` wrapping `ScreenScaffold`
评估不仅仅检查它是否编译,它还验证代理使用了正确的 Wear OS API。这就是为什么官方技能有大约 20 种,而不是 200 种。每一种都代表一种已确认的、可测量的故障模式。如果一个模型可靠地得到了正确的结果,那么就不需要任何技能——也不应该有。
# AGENTS.md
## Documentation
Always consult the Android Knowledge Base (android docs)
before suggesting any Jetpack API.
## Architecture
- MVVM + Hilt — do NOT suggest Koin or manual DI
- ViewModels use StateFlow — never LiveData for new code
- Repository pattern required for all data access
## UI
- All new screens use Jetpack Compose — no new XML layouts
- Reference HomeScreen.kt as the Compose pattern for this project
## Navigation
- Navigation 3 with type-safe routes — not navigation-compose 2.x
- All routes must be @Serializable — reference NavGraph.kt
## Build
- AGP 9 — use libs.versions.toml, no direct build.gradle.kts deps
## Testing
- JUnit 5 + MockK for unit tests — not Mockito or Espresso
- Coroutine tests use runTest from kotlinx-coroutines-test
## Never
- Thread.sleep() → use delay()
- GlobalScope → use viewModelScope
- Broad catch(Exception) → handle specific types
- !! operator → handle nullability explicitly
// ❌ Agent adding to a legacy screen WITHOUT modernisation skill
// Prompt: "Add an order history section to the user screen"
// Agent sees surrounding LiveData code and matches it
viewModel.orderHistory.observe(viewLifecycleOwner) { orders ->
binding.orderCount.text = "Orders: ${orders.size}"
binding.lastOrder.text = orders.firstOrNull()?.date ?: "None"
}
// ✅ Agent WITH a custom legacy migration skill
// Produces Compose alongside legacy code instead
binding.composeContainer.setContent {
val orders by viewModel.orderHistory
.collectAsStateWithLifecycle()
AppTheme {
OrderHistorySection(orders = orders)
}
}
# 1. Install Android CLI from d.android.com/tools/agents
# 2. Test Knowledge Base first — you may not need a skill
android docs search "Navigation 3 type-safe routes"
# 3. Install only confirmed-necessary skills
android skills install navigation3 # Only if using Nav 3
android skills install edge-to-edge # Only if targeting API 35+
android skills install agp9 # Only if on AGP 9
# 4. Quarterly — remove skills your model no longer needs
android skills list --installed