What problem does it solve?
Refactoring an Android codebase from RxJava to Kotlin Coroutines is error-prone because every type, operator, scheduler, and subscription pattern has a different idiomatic equivalent. This Skill provides a complete mapping guide and a step-by-step execution process so the migration stays consistent and lifecycle-safe.
Core Features & Use Cases
- Type Mapping: Converts Single, Maybe, Completable, Observable, and Flowable to suspend functions or Flow, and maps PublishSubject, BehaviorSubject, and ReplaySubject to SharedFlow or StateFlow.
- Operator & Threading Translation: Replaces operators like flatMap, switchMap, and combineLatest with Flow equivalents, and swaps Schedulers for Dispatchers using withContext or flowOn.
- Lifecycle-Safe Subscription Handling: Replaces Disposable and CompositeDisposable patterns with viewModelScope, Job cancellation, and repeatOnLifecycle collection.
- Use Case: When a user asks to convert a repository returning Single<User> with subscribeOn/observeOn chains, the Skill rewrites it as a suspend function collected in viewModelScope with try/catch error handling.
Quick Start
Ask the agent to convert this RxJava repository class and its ViewModel subscription to Kotlin Coroutines and Flow.