Livedata to Flow
Expert guidance on migrating LiveData to StateFlow / SharedFlow, including lifecycle-aware collection, Transformations replacements, and Java interop. Use this when modernizing a ViewModel or removing the lifecycle-livedata dependency.
Install
npx skills add PanPanFR/oh-my-openkilo --skill livedata-to-flowgit clone --depth 1 https://github.com/PanPanFR/oh-my-openkilo.git /tmp/oh-my-openkilo
mkdir -p ~/.claude/skills
cp -r /tmp/oh-my-openkilo/archive/skills/android/livedata-to-flow ~/.claude/skills/livedata-to-flowPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Migrating LiveData to Kotlin Flow
## Instructions
Kotlin `Flow` / `StateFlow` / `SharedFlow` is the modern replacement for `LiveData`. It is multiplatform-friendly, composable, and the default for Jetpack Compose. Migrate module-by-module.
### 1. Mapping Table
| LiveData | Flow equivalent |
|---|---|
| `val x = MutableLiveData<T>()` | `private val _x = MutableStateFlow<T>(initial); val x = _x.asStateFlow()` |
| `SingleLiveEvent<T>` / `Event<T>` | `private val _events = Channel<T>(BUFFERED); val events = _events.receiveAsFlow()` |
| `Transformations.map` | `.map { ... }` |
| `Transformations.switchMap` | `.flatMapLatest { ... }` |
| `MediatorLiveData` | `combine(flowA, flowB) { a, b -> ... }` |
| `liveData { emit(...) }` | `flow { emit(...) }` or the `stateIn` pattern below |
| `observe(owner) { }` | `lifecycleScope.launch { repeatOnLifecycle(STARTED) { flow.collect { } } }` or `collectAsStateWithLifecycle()` |
### 2. ViewModel: Before and After
**Before**
```kotlin
class ProfileViewModel(private val repo: UserRepository) : ViewModel() {
private val _state = MutableLiveData<ProfileUiState>(ProfileUiState.Loading)
val state: LiveData<ProfileUiState> = _state
fun load(id: String) {
viewModelScope.launch {
_state.value = ProfileUiState.Loading
_state.value = ProfileUiState.Loaded(repo.get(id))
}
}
}
```
**After**Details
- Skill name
livedata-to-flow- Repository
- PanPanFR/oh-my-openkilo
- Path
archive/skills/android/livedata-to-flow/SKILL.md- License
- MIT
- Repo updated
- 2 November 2026
FAQ
What does the Livedata to Flow skill do?
Expert guidance on migrating LiveData to StateFlow / SharedFlow, including lifecycle-aware collection, Transformations replacements, and Java interop. Use this when modernizing a ViewModel or removing the lifecycle-livedata dependency.
How do I install the Livedata to Flow skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add PanPanFR/oh-my-openkilo --skill livedata-to-flow. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Livedata to Flow popular?
It lives in PanPanFR/oh-my-openkilo, which has 9 GitHub stars and 1 forks.
Related skills
Adaptive
9PanPanFR/oh-my-openkilo
Instructions to make or update an app's UI so that it adapts to different Android devices including phones, tablets, foldables, laptops, desktop, TV, Auto, and XR. It includes how to handle different window sizes, pointing devices (such as mouse) and text entry devices (such as keyboard) using the Compose MediaQuery API, and how to preserve UI, navigation, scroll, and media playback state across configuration changes (such as folding/unfolding a foldable, rotating a device, or resizing a window). It also covers multi-pane layouts using Navigation3 Scenes, adaptive UI components (such as button
Agentmemory
9PanPanFR/oh-my-openkilo
Index for agentmemory internals: how it is wired into a host agent, its architecture and ports, configuration flags, capture hooks, MCP tool surface, and REST fallback. Use when installing or debugging agentmemory itself, when a memory tool name or parameter is unclear, or when capture is not recording. For normal recall and save work, use agentmemory-ops instead.
Agentmemory History
9PanPanFR/oh-my-openkilo
Read past work: resume the last session, recap recent sessions, list agent-linked commits, trace a line back to the session that wrote it, or compact the current conversation for handoff. Use when the user says "where were we", "resume", "recap", "session history", "what did we do", "why is this code here", "who wrote this", or "handoff".
Media3 Cast Integration
9PanPanFR/oh-my-openkilo
Implements Google Cast support in Android apps using Jetpack Media3. Handles adding build dependencies, updating manifest, configuring OptionsProvider, and managing CastPlayer or RemoteCastPlayer for playback in both Compose and View-based UIs. Use when adding Cast functionality or migrating from legacy Cast SDK to Media3 Cast.
Leanback to Compose Tv Migration
9PanPanFR/oh-my-openkilo
Provides instructions and architectural patterns for migrating Android TV applications from legacy Leanback UI Toolkit, Android Views, or Support Fragments to Jetpack Compose for TV (androidx.tv). Use this skill for Leanback to Compose migrations, including browse screen, settings screen, authentication screen, login screen, or video playback screen migrations, or when replacing BrowseSupportFragment, LeanbackSettingsFragment, PreferenceFragment, BaseLeanbackPreferenceFragmentCompat, VideoSupportFragment, GuidedStepSupportFragment, SearchSupportFragment, VerticalGridSupportFragment, Presenter,
Migrate Xml Views to Jetpack Compose
9PanPanFR/oh-my-openkilo
Provides a structured workflow for migrating an Android XML View to Jetpack Compose. This skill details the step-by-step process, from planning and dependency setup, to theming and layout migration, validation and XML cleanup. Use this skill when you need to migrate an XML View to Jetpack Compose in an Android project. It solves the problem of converting the UI of a legacy XML View into modern, declarative Compose components while maintaining interoperability. Also covers incremental adoption, AndroidView/ComposeView interop, Fragment hosting, and shared ViewModel strategies.
Browse the most popular Claude skills, all mobile development skills, or write your own with the skills generator.