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,4 Material Design, and Play Store deployment. Use when working with android jetpack.5domain: development6author: oyi777license: Apache-2.08subdomain: software-development9tags:10- android11- coding12- jetpack13- software-engineering14- testing15version: 1.0.016category: development17metadata:18 source: https://skillmd.com/skills/oyi77/android-jetpack19---20212223## Overview2425Jetpack Compose for building native Android apps. Covers declarative UI, state management, Material Design 3, Room database, navigation, and Play Store submission.2627## Capabilities2829- Build declarative UIs with Composable functions30- Implement state management (State, ViewModel, StateFlow)31- Apply Material Design 3 theming and components32- Use Room for local database persistence33- Navigate with Compose Navigation3435## When to Use36**Trigger phrases:**37- "android jetpack"38- "Android Jetpack Compose — declarative UI, state management, Material Design, and"394041- Building native Android apps42- Need Material Design 3 components43- Want declarative UI over XML layouts44- Team has Kotlin experience4546## When NOT to Use4748- Task is about deployment, not development (use deploy skills)49- Task is about code review, not writing (use review skills)50- You need to understand existing code first (use research skills)51- Task is about testing only (use test skills)52- Requirements are unclear (clarify first)53- Task is trivially simple (single line fix)545556## Pseudo Code5758The android-jetpack workflow follows a standard pipeline pattern.5960Core flow:61```62# android-jetpack primary flow63input = prepare(raw_data)64result = process(input, config={android, compose, declarative, deployment, design})65validate(result)66deliver(result)67```6869Error handling:70```71on error:72 log(error_details)73 retry_with_backoff(max=3)74 if still_failing: alert_and_escalate()75```767778### Composable Function79```kotlin80@Composable81fun ItemList(items: List<Item>, onItemClick: (Item) -> Unit) {82 LazyColumn {83 items(items) { item ->84 Card(85 modifier = Modifier86 .fillMaxWidth()87 .clickable { onItemClick(item) }88 .padding(8.dp)89 ) {90 Text(item.name, style = MaterialTheme.typography.titleMedium)91 }92 }93 }94}95```9697### ViewModel98```kotlin99class ItemViewModel : ViewModel() {100 private val _items = MutableStateFlow<List<Item>>(emptyList())101 val items: StateFlow<List<Item>> = _items.asStateFlow()102 103 fun loadItems() {104 viewModelScope.launch {105 _items.value = repository.getItems()106 }107 }108}109```110111## Common Patterns112113- **Single source of truth**: ViewModel holds state, Composables observe114- **Material 3**: Use MaterialTheme for consistent design115- **Navigation Compose**: Type-safe navigation with routes116- **Room + Flow**: Reactive queries with Flow return types117118## How to Use1191201. Understand the requirement and existing codebase patterns1212. Design the solution with error handling and testability in mind1223. Implement incrementally with tests for each change1234. Verify against expected outcomes (manual and automated)1245. Document usage, edge cases, and integration points1256. Review with team before merging to shared branches126127## Red Flags128129- **Skipping tests to ship faster**: Untested code breaks in production when you least expect it130- **No error handling in production code**: Unhandled errors crash services and lose user data131- **Hardcoded configuration values**: Hardcoded values prevent environment switching and leak secrets132- **Ignoring security implications**: Missing input validation, auth bypasses, and injection vulnerabilities133- **Over-engineering simple solutions**: Premature abstraction adds complexity without proportional benefit134135## Verification136137- [ ] Skill output matches expected behavior138139## Process1401411. Analyze the task requirements1422. Apply domain expertise1433. Verify output quality144145## Anti-Rationalization Table146147| Rationalization | Reality |148|---|---|149| "Tests slow me down" | Bugs slow you down 10x more. Tests are speed, not overhead. |150| "I will refactor later" | Technical debt compounds. Refactor as you go. |151| "It works on my machine" | If it is not in CI, it does not work. Ship proof, not claims. |