Designs, implements and tests screens with MVI on Android, iOS and Flutter: intents as sealed types, one immutable state, a pure reducer and side effects fed back as actions, using Kotlin StateFlow stores, Swift @Observable stores (TCA as an option) and Dart Bloc or Cubit. Use for screens with many interacting events, debounced search or racing requests, or when adopting or reviewing Bloc or Redux-style code.
---
name: mobile-mvi
description: "Designs, implements and tests screens with MVI on Android, iOS and Flutter: intents as sealed types, one immutable state, a pure reducer and side effects fed back as actions, using Kotlin StateFlow stores, Swift @Observable stores (TCA as an option) and Dart Bloc or Cubit. Use for screens with many interacting events, debounced search or racing requests, or when adopting or reviewing Bloc or Redux-style code."
license: MIT
metadata:
author: Ahmad Hussain
version: "1.0.1"
pack: mobile-dev-kit
---
# MVI for mobile apps
Build screens where every change goes through one loop: the UI sends an intent, a pure reducer computes
the next state, effects do the IO outside the reducer and report back as new actions. State transitions
become plain functions that are trivial to test, replay and reason about under concurrency.
## When to use
- A screen has many events that interact: typing, retry, refresh, pagination, selection, live updates.
- Requests race each other (debounced search, rapid toggles, BLE or socket updates arriving mid-request).
- State transitions must be auditable or tested exhaustively (payments, onboarding wizards, editors).
- The codebase already uses Bloc, TCA, Orbit, Mavericks or a hand-rolled store, and new code must fit.
- Reviewing an MVI store for impure reducers, lost effects or oversized state.
Not for: simple read-only or CRUD screens; MVVM with a single `UiState` is enough there
(use `mobile-mvvm`). Do not convert a whole app to MVI to fix one complex screen.
## The loop
```
+----------------------- State -----------------------+
v |
UI renders State --- Intent ---> Store --- (State, Action) ---> Reducer (pure)
| ^
| effect for this action | Result action
v |
Effect runner (IO, timers, navigation)
```
| Part | What it is | Kotlin | Swift | Dart |
|---|---|---|---|---|
| Intent | What the user did | `sealed interface SearchIntent` | `enum SearchAction` cases | `sealed class SearchEvent` |
| Result | What an effect produced | `sealed interface SearchResult` | more `SearchAction` cases | internal result classes |
| State | Everything the screen renders | `data class` | `struct: Equatable` | `@immutable` class or `Equatable` |
| Reducer | `(State, Action) -> State`, no IO | top-level or `object` function | `static func` | top-level function |
| Effect | IO, timers, navigation, analytics | coroutine in `viewModelScope` | `Task` owned by the store | code in a Bloc handler |
| Store | Holds state, runs the loop | `ViewModel` + `StateFlow` | `@MainActor @Observable` class | `Bloc` |
## Workflow
1. Confirm the screen needs MVI (see When to use). If not, use `mobile-mvvm`.
2. Load the reference for the platform: [Kotlin and Compose](references/kotlin.md),
[Swift and SwiftUI](references/swift.md), [Dart with Bloc](references/dart.md).
3. Write the `State`: the minimum the UI renders. Derive the rest with computed properties.
4. List intents from the UI as a sealed type, named after what happened (`QueryChanged`, `RetryClicked`).
5. List results the effects can produce (`Loaded`, `Failed`), each carrying what the reducer needs
to reject stale data (for example the query it was for).
6. Write the reducer and its tests first. It is pure, so the tests need no mocks or dispatchers.
7. Write the store: apply the reducer, then start the effect for the action with an explicit
concurrency policy (cancel previous, drop new, or queue).
8. Decide how one-off effects reach the UI: state field first, effect channel only if needed.
9. Build the UI: render `State`, send intents, never mutate state directly.
10. Write effect tests with fakes and virtual time. Run the existing test suite and report failures.
## Rules
### 1. Intents are one sealed type named after what happened
Kotlin:
```kotlin
// BAD: commands named after implementation, open to anything
fun setLoading(value: Boolean)
fun callSearchApi(query: String)
// GOOD
sealed interface SearchIntent {
data class QueryChanged(val query: String) : SearchIntent
data object RetryClicked : SearchIntent
data class ResultClicked(val id: String) : SearchIntent
}
```
Swift:
```swift
enum SearchAction: Equatable, Sendable {
case queryChanged(String) // from the view
case retryTapped
case resultTapped(Repo.ID)
case detailsDismissed
case loaded(query: String, [Repo]) // from effects
case failed(query: String)
}
```
Dart:
```dart
sealed class SearchEvent { const SearchEvent(); }
final class QueryChanged extends SearchEvent { const QueryChanged(this.query); final String query; }
final class RetryPressed extends SearchEvent { const RetryPressed(); }
```
- Exhaustive `when` / `switch` over a sealed type makes the compiler flag every unhandled intent.
- Kotlin can split public intents and internal results into two sealed sub-interfaces of one `SearchAction`,
so the UI cannot send a result. Swift enums cannot; mark effect-only cases with a comment.
### 2. One immutable State; derive instead of duplicating
```kotlin
// BAD: flags that can contradict each other, list duplicated for filtering
data class SearchState(
val isLoading: Boolean, val isError: Boolean, val isEmpty: Boolean,
val items: List<Repo>, val filteredItems: List<Repo>,
)
// GOOD
data class SearchState(
val query: String = "",
val items: List<Repo> = emptyList(),
val isLoading: Boolean = false,
val hasError: Boolean = false,
) {
val showEmpty: Boolean get() = query.isNotBlank() && !isLoading && !hasError && items.isEmpty()
}
```
- When states are mutually exclusive (loading, content, error), model them as a sealed type or enum
instead of booleans; keep shared fields like `query` outside it.
### 3. The reducer is pure
Same state and action in, same state out. No IO, no clock, no random ids, no logging, no launching work.
```kotlin
// BAD: IO and a launched coroutine inside the reducer
fun reduce(state: SearchState, intent: SearchIntent): SearchState = when (intent) {
is SearchIntent.QueryChanged -> {
scope.launch { repository.search(intent.query) }
state.copy(query = intent.query, isLoading = true)
}
...
}
// GOOD: only computes the next state
fun reduce(state: SearchState, action: SearchAction): SearchState = when (action) {
is SearchIntent.QueryChanged ->
state.copy(query = action.query, isLoading = action.query.isNotBlank(), hasError = false)
is SearchResult.Loaded ->
if (action.query != state.query) state else state.copy(items = action.items, isLoading = false)
...
}
```
```swift
// GOOD: a static function on a value type; `inout` is equally pure for structs
enum SearchReducer {
static func reduce(_ state: SearchState, _ action: SearchAction) -> SearchState {
var state = state
switch action {
case .queryChanged(let query):
state.query = query
state.isLoading = !query.isEmpty
case let .loaded(query, items):
guard query == state.query else { return state }
state.items = items
state.isLoading = false
// ...
}
return state
}
}
```
- Kotlin: `MutableStateFlow.update` may run its lambda more than once under contention. A pure reducer
makes that harmless; one with side effects would run them twice.
- Values the reducer needs from the outside world (current time, generated id) arrive inside the action.
### 4. Effects run outside the reducer and report back as actions
```kotlin
fun onIntent(intent: SearchIntent) {
dispatch(intent) // 1. reduce
when (intent) { // 2. start the effect for this intent
is SearchIntent.QueryChanged -> search(intent.query, debounce = true)
SearchIntent.RetryClicked -> search(state.value.query, debounce = false)
is SearchIntent.ResultClicked -> _effects.trySend(SearchEffect.OpenDetails(intent.id))
}
}
private fun dispatch(action: SearchAction) = _state.update { reduce(it, action) }
private fun search(query: String, debounce: Boolean) {
searchJob?.cancel()
if (query.isBlank()) return
searchJob = viewModelScope.launch {
if (debounce) delay(300)
val result = try {
SearchResult.Loaded(query, repository.search(query))
} catch (e: IOException) {
SearchResult.Failed(query)
}
dispatch(result) // 3. result goes back through the reducer
}
}
```
- The effect never writes state directly. Every change is visible as an action in logs and tests.
- Swift: the store keeps a `Task` per effect and calls `send(.loaded(...))` when it finishes.
- Dart (Bloc): the handler awaits the repository, then `emit(reduce(state, result))`.
### 5. Effect concurrency is a decision, not an accident
| Policy | Use for | Kotlin | Swift | Dart (Bloc) |
|---|---|---|---|---|
| Cancel previous | Search, filters, latest-wins loads | `job?.cancel()` before `launch` | `task?.cancel()` before `Task {}` | `restartable()` |
| Drop new while busy | Submit, pay, pull to refresh | `if (job?.isActive == true) return` | `guard task == nil` | `droppable()` |
| Queue | Ordered writes, BLE command sequences | `Channel` + one consumer, or `Mutex` | `AsyncStream` + one consumer | `sequential()` |
- Results carry their input (query, page, request id); the reducer drops results that no longer match.
Cancellation alone is not enough: a result can arrive between completion and cancel.
- Dart: after an `await` in a `restartable()` handler, check `emit.isDone` before doing more IO;
cancellation stops `emit`, not your `Future`.
### 6. One-off effects: state first, channel when it is truly fire-and-forget
```kotlin
// GOOD (preferred): navigation as state, cleared by an intent after the UI acts
data class SearchState(val openDetailsId: String? = null, ...)
// ACCEPTABLE: effect channel, buffered, collected with the lifecycle on Main.immediate
private val _effects = Channel<SearchEffect>(Channel.BUFFERED)
val effects: Flow<SearchEffect> = _effects.receiveAsFlow()
// BAD: SharedFlow without replay loses effects while the UI is stopped or rotating
val effects = MutableSharedFlow<SearchEffect>()
```
```swift
// GOOD: SwiftUI navigation driven by state
.navigationDestination(item: Binding(
get: { store.state.selectedRepo },
set: { if $0 == nil { store.send(.detailsDismissed) } }
)) { id in
RepoDetailView(id: id)
}
```
```dart
// GOOD: Bloc state field plus BlocListener with listenWhen
BlocListener<SearchBloc, SearchState>(
listenWhen: (previous, current) => previous.selectedRepoId != current.selectedRepoId,
listener: (context, state) { /* navigate, then add(const DetailsOpened()) */ },
child: ...,
)
```
- A `Channel` keeps effects while nobody collects, but an effect can still be lost if the collector is
cancelled between receive and handling. Collect on `Dispatchers.Main.immediate` inside
`repeatOnLifecycle(STARTED)`; if losing one is unacceptable, use state.
### 7. The store is the only writer; the UI only renders and sends
```kotlin
// BAD: UI writes state and calls store internals, bypassing the reducer
viewModel.mutableState.value = state.copy(isLoading = true)
viewModel.searchNow("x")
// GOOD: one entry point
@Composable fun SearchScreen(state: SearchState, onIntent: (SearchIntent) -> Unit, modifier: Modifier = Modifier)
```
- Swift: `private(set) var state` on the store; the view calls `store.send(_:)`.
- Dart: widgets call `context.read<SearchBloc>().add(...)`; they never call `emit`.
- Text fields: reduce the text change synchronously on the main thread, otherwise the cursor jumps.
### 8. Keep state lean and render slices
Every action produces a new state and every observer compares it.
- `StateFlow` and Bloc skip equal states using `equals` / `==`; on large lists that comparison is O(n)
per action. Keep big collections out of state that changes on every keystroke, or page them.
- Compose: pass each child only the fields it reads, not the whole `State`; with strong skipping,
unchanged arguments let children skip.
- SwiftUI: `@Observable` tracks `store.state` as one property, so any change re-evaluates every reader.
Pass child views plain values, or split rarely changing parts into separate store properties.
- Flutter: `BlocSelector` or `context.select` for slices; `buildWhen` on `BlocBuilder`.
- High-frequency streams (BLE notifications, sensor data) are sampled or throttled before they become
actions; one action per packet will flood the reducer and the UI.
### 9. Test the reducer as a pure function, the store with fakes
```kotlin
@Test fun `stale result for an older query is ignored`() {
val state = SearchState(query = "kotlin", isLoading = true)
assertEquals(state, reduce(state, SearchResult.Loaded("kot", listOf(repo))))
}
```
```swift
@Test func queryChangeStartsLoading() {
let next = SearchReducer.reduce(SearchState(hasError: true), .queryChanged("swift"))
#expect(next == SearchState(query: "swift", isLoading: true))
}
```
```dart
test('failure for an old query is ignored', () {
const state = SearchState(query: 'flutter', status: SearchStatus.loading);
expect(reduce(state, const SearchFailed('flut')), state);
});
```
- Reducer tests: one test per transition, including the stale-result and no-op cases. No mocks.
- Store tests: fake repository, virtual time (`runTest`), Turbine for state and effect sequences,
`bloc_test` for Blocs, `await store.send(...)?.value` for Swift stores.
- Assert whole states, not single fields, so unexpected changes fail the test.
### 10. Use the platform's established MVI tools when the team has them
- Swift: The Composable Architecture (TCA) gives reducers, effects, dependency injection and an exhaustive
test store. Worth it for large apps that want enforced structure; it is a significant dependency with its
own learning curve and API changes between versions. Follow its current documentation and do not mix
it with hand-rolled stores inside one feature.
- Dart: `Bloc` for event-driven screens (named events, transformers, event traceability in `onTransition`);
`Cubit` for simple screens, with methods instead of events and `emit` directly.
```dart
// Cubit: fine for a counter-sized screen
class FilterCubit extends Cubit<bool> {
FilterCubit() : super(false);
void toggle() => emit(!state);
}
```
## Anti-patterns
- Giant state: one `State` for a whole tab or app. Each screen owns its state; share data through
repositories.
- Reducers doing IO, logging, reading the clock or generating ids.
- Effects writing state directly instead of returning a result action.
- Losing effects: `SharedFlow(replay = 0)`, collecting outside the lifecycle, or `trySend` on a full
`RENDEZVOUS` channel without checking the result.
- State explosion: a sealed state per combination (`LoadingWithError`, `RefreshingEmpty`). Use a few
orthogonal fields plus one sealed sub-state for truly exclusive cases.
- Over-engineering: intents, reducer, effects and a store for a settings toggle or a static detail page.
- Booleans that can contradict each other (`isLoading` and `hasError` both true with no meaning defined).
- One action per BLE packet or scroll pixel, flooding reducer and UI.
- A generic "base MVI" framework written in-house before two screens need it.
- Tests that mock the reducer or assert on private functions instead of states.
## Checklist
- [ ] The screen really needs MVI (interacting events, races or auditable transitions)
- [ ] Intents are one sealed type, named after user actions; results carry their input
- [ ] One immutable `State`, minimal, derived values computed
- [ ] Reducer is pure: no IO, clock, random, logging or launching
- [ ] Effects run outside the reducer and report back through actions
- [ ] Concurrency policy chosen per effect (cancel previous, drop, queue); stale results ignored
- [ ] One-off effects modelled as state, or a buffered channel collected with the lifecycle
- [ ] UI renders state and sends intents only; children receive slices
- [ ] High-frequency inputs throttled before they become actions
- [ ] Reducer tests per transition; store tests with fakes and virtual time; existing tests pass
## Related skills
- `mobile-mvvm` -- the simpler default for screens that do not need a reducer
- `mobile-mvc` -- legacy UIKit and Activity-centric screens
- `mobile-design-patterns` -- state, command and observer patterns behind MVI
- `mobile-kotlin`, `mobile-swift`, `mobile-flutter` -- language rules for each platform
- `mobile-code-review` -- reviewing stores, reducers and effects
- `mobile-testing` -- where reducer and store tests sit in the overall test strategy
- `mobile-kmp` -- sharing a store between Android and iOS
don't have the plugin yet? install it then click "run inline in claude" again.
extracted implicit inputs (platform versions, external connections), split original workflow into 10 explicit procedure steps with inputs/outputs, added 11 decision points covering edge cases (stale results, concurrency policies, state size, TCA/Bloc integration, auth failures), formalized output contract with file locations and test requirements, defined outcome signals as measurable properties reviewers can verify, and embedded anti-patterns plus checklist into decision logic.
Build screens where every change goes through one loop: the UI sends an intent, a pure reducer computes the next state, effects do the IO outside the reducer and report back as new actions. state transitions become plain functions that are trivial to test, replay and reason about under concurrency.
use this skill to design and implement screens in Kotlin/Compose, Swift/SwiftUI, or Dart/Flutter where multiple events interact with each other, requests can race (debounced search, rapid toggles, BLE updates mid-request), or state transitions need to be auditable and exhaustively tested. the MVI loop enforces a single path: intent -> reducer -> state -> UI, with side effects running outside the reducer and reporting results back as actions. apply MVI when MVVM with a single UiState is insufficient; do not convert an entire app to MVI to fix one complex screen.
androidx.lifecycle:lifecycle-viewmodel-ktx with StateFlow, or kotlinx.coroutines for viewModelScope@Observable macro (from iOS 17, macOS 14) or SwiftUI with property wrappers; optionally The Composable Architecture (TCA) 1.9+package:bloc 8.1+ (Bloc, Cubit) or package:flutter_bloc for lifecycle integrationnone required. MVI is a local architecture pattern; it does not mandate external APIs. however, effects often call repositories that connect to:
http or Dio)sqflite)none of these are built into MVI; the effect handler is responsible for injecting them.
bloc_test), and flow/stream inspection (Turbine, stream_test)confirm the screen needs MVI by checking: does it have many events that interact, request races (debounced search, toggles, socket updates), or auditable state transitions? if no, use mobile-mvvm instead. if yes, proceed.
load the platform reference guide: Kotlin and Compose, Swift and SwiftUI, Dart with Bloc. these contain boilerplate, imports and version-specific APIs.
write the State struct/data class: include every piece of data the UI renders. nothing else. use computed properties or derived fields for read-only combinations (e.g. showEmpty: Boolean derived from query, isLoading, hasError, items). mark state as @Immutable (Dart), Equatable (Swift), or data class (Kotlin); ensure it implements equals and hashCode or Equatable.props correctly.
list all intents (user actions) as a sealed type, named after what happened, not what it does: QueryChanged, RetryClicked, ResultClicked, DetailsOpened, not SetLoading or CallApi. add parameters each intent needs (e.g. data class QueryChanged(val query: String)). separately list all results effects can produce (e.g. SearchResult.Loaded(query, items), SearchResult.Failed(query)), each carrying the input it was for so the reducer can drop stale responses.
write the reducer as a pure function: signature is (State, Action) -> State in Kotlin and Dart, or (State, Action) -> State via static func or top-level in Swift. handle every sealed branch exhaustively. for each action, compute only the next state; do not launch coroutines, read the clock, generate IDs, log, or call external functions. the reducer receives the current time or generated IDs inside the action if needed. write unit tests for the reducer first: one test per branch, including stale-result cases (e.g. result for query "kot" arriving while state.query is "kotlin"), no-op cases, and error transitions. use pure equality assertions, not mocking.
write the store (ViewModel for Kotlin, @Observable class for Swift, Bloc/Cubit for Dart). the store owns the reducer, the state, and launches effects. for each intent or result, (1) call dispatch(action) to reduce synchronously (or update { reduce(...) } in Kotlin), (2) decide the effect concurrency policy (cancel previous, drop new, queue) and start the effect if needed. provide one public entry point: onIntent(intent) in Kotlin, send(action) in Swift, add(event) in Dart. never expose the reducer or state mutator to the UI.
write effect handlers for each intent that triggers IO. decide concurrency per effect: (a) cancel-previous for search/filters (user wants the latest result), (b) drop-new for submit/pay (do not interrupt in-flight work), (c) queue for ordered writes (e.g. BLE commands). in Kotlin, store a Job? reference and call job?.cancel() before launch; in Swift, hold a Task? and call task?.cancel(); in Dart, use Bloc.on() with restartable(), droppable() or sequential(). wrap the IO in try-catch or .catch(). emit a result action with the input it was for (query, page, request ID). check in the reducer whether the result still applies (e.g. result.query == state.query) and drop it if not.
decide how one-off effects (navigation, toast, deep link) reach the UI: (a) preferred: add a nullable field to State (e.g. openDetailsId: String?), emit it in the reducer, then add a clearing intent (e.g. DetailsOpened) the UI sends after acting; (b) acceptable: use a buffered Channel or Flow for fire-and-forget effects, collect it in repeatOnLifecycle(STARTED) on Main.immediate in Kotlin or with SwiftUI's .onReceive in Swift; never use SharedFlow(replay = 0) or trySend on RENDEZVOUS without checking the result.
build the UI: render the state's fields directly. send intents via a callback (Kotlin Compose passes (Intent) -> Unit, Swift views call store.send(_:), Dart calls context.read<Bloc>().add(_)). never mutate state, call store internals, or write state directly. for high-frequency inputs (scroll, BLE packets, sensor ticks), throttle or sample them before they become actions; one action per packet floods the reducer and forces UI recomposition. pass each child view only the state fields it reads; in Compose with strong skipping, unchanged props let children skip recomposition.
write effect tests: use a fake repository or mock, Turbine or stream_test to inspect state and effect sequences, and virtual time (Kotlin runTest, Swift structured concurrency, Dart testWidgets with fake timers). test successful and failing paths, stale results, concurrent requests, and cancellation. run the existing test suite; report or fix failures before merging.
screen complexity: if the screen is a static detail page, settings form with one or two toggles, or a simple read-only list, use mobile-mvvm (MVVM with one UiState and no reducer). if intents interact (search + filter + pagination), requests race (debounced search, rapid toggles, live updates arriving during a fetch), or transitions must be auditable (payments, editors, wizards), proceed to MVI.
when no intent is sent: if the user does nothing (screen just loads and displays), the effect for the initial load runs in onInit, onAppear, or in the Bloc's add() during construction. the result action is dispatched through the reducer as normal.
when an effect fails: the effect catches the exception (network timeout, permission denied, 500 error) and emits a result action carrying the error (e.g. SearchResult.Failed(query)). the reducer updates state to hasError = true or transitions to an error sub-state. optionally a RetryClicked intent re-runs the same effect.
when results arrive out of order: a stale result (e.g. for query "kot" arriving after user changed to "kotlin") is dropped in the reducer by checking result.query != state.query. cancellation alone is not enough; a result can arrive between completion and cancel.
when concurrency needs to change: if search should drop new requests instead of cancelling (heavy computation, do not interrupt mid-way), call if (job?.isActive == true) return before launch in Kotlin or guard task == nil before Task {} in Swift. if writes must be ordered (BLE command sequences), use a Channel or AsyncStream with one consumer, or Mutex around the effect.
when the store needs dependency injection: in Kotlin, pass repositories to the ViewModel constructor via factory; in Swift, pass them to the store's init; in Dart, inject into the Bloc constructor or use RepositoryProvider. do not create global singletons inside the reducer or effect.
when navigation is one-way (no return value): emit a state field (e.g. openDetailsId: String?), render it with .navigationDestination or NavigationLink, and add a clearing intent after navigation. if the detail screen sends data back (e.g. edited item), add a result action parameter (e.g. DetailsDismissed(editedItem?)) and handle it in the reducer.
when multiple effects run in parallel: each effect is independent (e.g. load user AND load posts concurrently). launch each in viewModelScope or store's init independently; results come back as separate actions. if two effects must wait on each other, model the second as a "gate" effect triggered by the first's result action.
when state becomes very large: split state into smaller stores (one per sub-feature), or move big collections to repositories and pass only IDs or indices in state. if Compose or SwiftUI re-renders all children on every action, use strong skipping (Compose remember with field arguments, SwiftUI @Observable on child state) or BlocSelector / context.select in Dart to subscribe to slices only.
when joining an existing TCA codebase (Swift): use TCA's Reducer, ReducerProtocol, Effect, and test store. do not mix hand-rolled @Observable stores with TCA in the same feature; commit to one pattern.
when joining an existing Bloc codebase (Dart): use Bloc for event-driven screens (named events, transformers, onTransition logging) or Cubit for simple screens (direct methods, emit). follow the team's existing event naming and transformer patterns; do not mix Bloc and Cubit in one state management tree without clear boundaries.
reducer unit tests:
SearchReducerTest.kt (Kotlin), SearchReducerTests.swift (Swift), search_reducer_test.dart (Dart)assertEquals(expected, reduce(state, action))store unit tests:
SearchViewModelTest.kt, SearchStoreTests.swift, search_bloc_test.dartrunTest in Kotlin, structured concurrency in Swift, testWidgets in Dart)stream_test or bloc_test in Dart)effect tests (optional but recommended):
SearchEffectsTest.ktUI code:
State fieldsstore.send or context.read<Bloc>().add()all existing tests pass: reducer, store, effect and UI tests all run green before merge; no skipped or expected failures introduced
onIntent, effect handler, or on<Event> transformer, never inside reduce. the effect result becomes an action and goes through the reducer.launch with cancel, guard check, or Channel). stale results are dropped in the reducer by checking input fields.onIntent, store.send, or bloc.add; it never mutates state, calls dispatch, or accesses the reducer.State fields and updates when StateFlow, @Observable or Bloc state changes. computed properties are used to avoid state duplication.runTest, bloc_test or testWidgets with fake timers; debounce and delay tests run in milliseconds, not seconds.mobile-mvvmmobile-mvvm -- the simpler default for screens that do not need a reducermobile-mvc -- legacy UIKit and Activity-centric screensmobile-design-patterns -- state, command and observer patterns behind MVImobile-kotlin, mobile-swift, mobile-flutter -- language rules for each platformmobile-code-review -- reviewing stores, reducers and effectsmobile-testing -- where reducer and store tests sit in the overall test strategymobile-kmp -- sharing a store between Android and iOScredits: original skill by Ahmad Hussain. enriched per Implexa standards with explicit inputs, decision points, output contract, outcome signals, and integration guidance for Kotlin StateFlow, Swift @Observable and Dart Bloc/Cubit.