Overview
Jetpack Compose for building native Android apps. Covers declarative UI, state management, Material Design 3, Room database, navigation, and Play Store submission.
Capabilities
- Build declarative UIs with Composable functions
- Implement state management (State, ViewModel, StateFlow)
- Apply Material Design 3 theming and components
- Use Room for local database persistence
- Navigate with Compose Navigation
When to Use
Trigger phrases:
"android jetpack"
"Android Jetpack Compose — declarative UI, state management, Material Design, and"
Building native Android apps
Need Material Design 3 components
Want declarative UI over XML layouts
Team has Kotlin experience
When NOT to Use
- Task is about deployment, not development (use deploy skills)
- Task is about code review, not writing (use review skills)
- You need to understand existing code first (use research skills)
- Task is about testing only (use test skills)
- Requirements are unclear (clarify first)
- Task is trivially simple (single line fix)
Pseudo Code
The android-jetpack workflow follows a standard pipeline pattern.
Core flow:
# android-jetpack primary flow
input = prepare(raw_data)
result = process(input, config={android, compose, declarative, deployment, design})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Composable Function
@Composable
fun ItemList(items: List<Item>, onItemClick: (Item) -> Unit) {
LazyColumn {
items(items) { item ->
Card(
modifier = Modifier
.fillMaxWidth()
.clickable { onItemClick(item) }
.padding(8.dp)
) {
Text(item.name, style = MaterialTheme.typography.titleMedium)
}
}
}
}
ViewModel
class ItemViewModel : ViewModel() {
private val _items = MutableStateFlow<List<Item>>(emptyList())
val items: StateFlow<List<Item>> = _items.asStateFlow()
fun loadItems() {
viewModelScope.launch {
_items.value = repository.getItems()
}
}
}
Common Patterns
- Single source of truth: ViewModel holds state, Composables observe
- Material 3: Use MaterialTheme for consistent design
- Navigation Compose: Type-safe navigation with routes
- Room + Flow: Reactive queries with Flow return types
How to Use
- Understand the requirement and existing codebase patterns
- Design the solution with error handling and testability in mind
- Implement incrementally with tests for each change
- Verify against expected outcomes (manual and automated)
- Document usage, edge cases, and integration points
- Review with team before merging to shared branches
Red Flags
- Skipping tests to ship faster: Untested code breaks in production when you least expect it
- No error handling in production code: Unhandled errors crash services and lose user data
- Hardcoded configuration values: Hardcoded values prevent environment switching and leak secrets
- Ignoring security implications: Missing input validation, auth bypasses, and injection vulnerabilities
- Over-engineering simple solutions: Premature abstraction adds complexity without proportional benefit
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "Tests slow me down" |
Bugs slow you down 10x more. Tests are speed, not overhead. |
| "I will refactor later" |
Technical debt compounds. Refactor as you go. |
| "It works on my machine" |
If it is not in CI, it does not work. Ship proof, not claims. |
1---2name: android-jetpack3description: Use when android Jetpack Compose — declarative UI, state management, Material Design, and Play Store deployment. Use when working with android jetpack.4license: Apache-2.05---6789## Overview1011Jetpack Compose for building native Android apps. Covers declarative UI, state management, Material Design 3, Room database, navigation, and Play Store submission.1213## Capabilities1415- Build declarative UIs with Composable functions16- Implement state management (State, ViewModel, StateFlow)17- Apply Material Design 3 theming and components18- Use Room for local database persistence19- Navigate with Compose Navigation2021## When to Use22**Trigger phrases:**23- "android jetpack"24- "Android Jetpack Compose — declarative UI, state management, Material Design, and"252627- Building native Android apps28- Need Material Design 3 components29- Want declarative UI over XML layouts30- Team has Kotlin experience3132## When NOT to Use3334- Task is about deployment, not development (use deploy skills)35- Task is about code review, not writing (use review skills)36- You need to understand existing code first (use research skills)37- Task is about testing only (use test skills)38- Requirements are unclear (clarify first)39- Task is trivially simple (single line fix)404142## Pseudo Code4344The android-jetpack workflow follows a standard pipeline pattern.4546Core flow:47```48# android-jetpack primary flow49input = prepare(raw_data)50result = process(input, config={android, compose, declarative, deployment, design})51validate(result)52deliver(result)53```5455Error handling:56```57on error:58 log(error_details)59 retry_with_backoff(max=3)60 if still_failing: alert_and_escalate()61```626364### Composable Function65```kotlin66@Composable67fun ItemList(items: List<Item>, onItemClick: (Item) -> Unit) {68 LazyColumn {69 items(items) { item ->70 Card(71 modifier = Modifier72 .fillMaxWidth()73 .clickable { onItemClick(item) }74 .padding(8.dp)75 ) {76 Text(item.name, style = MaterialTheme.typography.titleMedium)77 }78 }79 }80}81```8283### ViewModel84```kotlin85class ItemViewModel : ViewModel() {86 private val _items = MutableStateFlow<List<Item>>(emptyList())87 val items: StateFlow<List<Item>> = _items.asStateFlow()88 89 fun loadItems() {90 viewModelScope.launch {91 _items.value = repository.getItems()92 }93 }94}95```9697## Common Patterns9899- **Single source of truth**: ViewModel holds state, Composables observe100- **Material 3**: Use MaterialTheme for consistent design101- **Navigation Compose**: Type-safe navigation with routes102- **Room + Flow**: Reactive queries with Flow return types103104## How to Use1051061. Understand the requirement and existing codebase patterns1072. Design the solution with error handling and testability in mind1083. Implement incrementally with tests for each change1094. Verify against expected outcomes (manual and automated)1105. Document usage, edge cases, and integration points1116. Review with team before merging to shared branches112113## Red Flags114115- **Skipping tests to ship faster**: Untested code breaks in production when you least expect it116- **No error handling in production code**: Unhandled errors crash services and lose user data117- **Hardcoded configuration values**: Hardcoded values prevent environment switching and leak secrets118- **Ignoring security implications**: Missing input validation, auth bypasses, and injection vulnerabilities119- **Over-engineering simple solutions**: Premature abstraction adds complexity without proportional benefit120121## Verification122123- [ ] Skill output matches expected behavior124125## Process1261271. Analyze the task requirements1282. Apply domain expertise1293. Verify output quality130131## Anti-Rationalization Table132133| Rationalization | Reality |134|---|---|135| "Tests slow me down" | Bugs slow you down 10x more. Tests are speed, not overhead. |136| "I will refactor later" | Technical debt compounds. Refactor as you go. |137| "It works on my machine" | If it is not in CI, it does not work. Ship proof, not claims. |