/apk-skills-jeiler:android-patternsfrom apk-skills-jeiler
Defines Android implementation patterns: Unidirectional Data Flow, ViewModel design, Flow composition, repository pattern, UseCases, and Compose UI patterns. Use when implementing ViewModels, state models, repositories, or reviewing reactive state management.
Ships in apk-skills-jeiler. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill to implement Android features with explicit state, reactive flows, and testable logic.
Use a single direction of data movement.
User action -> ViewModel -> state update -> UI render -> optional event
Rules:
SharedFlow.Prefer this structure:
UiAction -> onAction() -> internal state -> derived state -> UiState -> Composable
Use explicit state types instead of boolean flags when possible.
Use a sealed interface for high-level screen lifecycle state.
@Immutable
internal sealed interface FeatureScreenUiState {
data object Loading : FeatureScreenUiState
data class Loaded(val data: FeatureUiState) : FeatureScreenUiState
data object Error : FeatureScreenUiState
}
Use a data class for the rendered content.
@Immutable
internal data class FeatureUiState(
val title: String,
val subtitle: String,
val items: List<ItemUiState>,
)
Use a sealed interface for user intents.
@Immutable
internal sealed interface FeatureUiAction {
data object Retry : FeatureUiAction
data class QueryChanged(val value: String) : FeatureUiAction
}
Use a sealed interface for one-time side effects.
internal sealed interface FeatureUiEvent {
data class ShowError(val message: String) : FeatureUiEvent
data object NavigateBack : FeatureUiEvent
}
Rules:
ViewModels should coordinate, not calculate everything.
Responsibilities:
StateFlowViewModels should not:
Recommended shape:
@HiltViewModel
internal class FeatureViewModel @Inject constructor(
private val observeItemsUseCase: ObserveItemsUseCase,
private val mapper: FeatureUiStateMapper,
) : ViewModel() {
private val _internalState = MutableStateFlow<FeatureInput?>(null)
private val _uiEvents = MutableSharedFlow<FeatureUiEvent>()
val uiEvents: SharedFlow<FeatureUiEvent> = _uiEvents.asSharedFlow()
val uiState: StateFlow<FeatureScreenUiState> =
someFlow
.map { result -> result.fold(...) }
.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5_000),
initialValue = FeatureScreenUiState.Loading,
)
fun onAction(action: FeatureUiAction) {
when (action) {
FeatureUiAction.Retry -> retry()
is FeatureUiAction.QueryChanged -> updateQuery(action.value)
}
}
}
Rules:
stateIn for StateFlow exposure.SharingStarted.WhileSubscribed(...) for UI-bound streams.onAction(action) as the single entry point for user input.Use Flow operators to compose asynchronous work.
combineUse when output depends on multiple latest values.
combine(firstFlow, secondFlow) { first, second ->
...
}
flatMapLatestUse when a new upstream value should cancel previous work.
queryFlow.flatMapLatest { query ->
repository.search(query)
}
mapUse for pure transformations.
flow.map { value -> transform(value) }
scanUse when the next value depends on the previous one.
flow.scan(initialValue) { previous, current ->
...
}
distinctUntilChangedUse to prevent unnecessary recomputation and re-rendering.
shareIn and stateInUse to share upstream work and keep the latest state available.
Rules:
mapLatest or flatMapLatest when newer input should cancel older work.Use explicit domain errors when possible.
Prefer:
sealed interface FeatureError {
data object Network : FeatureError
data object Unauthorized : FeatureError
data object Unknown : FeatureError
}
Rules:
Result<T> for operations that may fail.Recommended patterns:
Error screen state or explicit error stateRepositories should expose domain models and flows, not transport models.
Prefer:
Flow<Result<List<Model>>>Flow<Result<Model>>ResultAvoid:
Repository responsibilities may include:
Keep mapping explicit and dedicated to mapper classes.
Use cases represent application actions.
Naming:
FetchItemsUseCaseObserveItemsUseCaseSubmitFormUseCaseRules:
fun [verb](...). For example, fetchItemsUseCase.fetch() or observeItemsUseCase.observe()Use a screen composable to connect to the ViewModel, and a stateless content composable for rendering.
@Composable
internal fun FeatureScreen(viewModel: FeatureViewModel) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
FeatureContent(
uiState = uiState,
onAction = viewModel::onAction,
)
}
Rules:
Collect events in LaunchedEffect from the screen layer.
Keep purely visual or temporary state in Compose when it does not belong in the ViewModel.
Examples:
Hoist state to the nearest composable that needs to share it.
Always provide stable keys in lazy lists when item identity exists.
Use a local TextFieldValue only when the UI must preserve cursor position or selection.
Use a visual transformation only for display formatting. Keep the raw input value separate.
Keep mapping and calculations out of composables.
Use dedicated classes for:
Rules:
Do not mix these concerns in one place unless the feature is extremely small.
Check the code against these questions:
Refactor when:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
android-patterns, udf, viewmodel, compose, state-management, reactive-flows
apk-skills-jeiler@plugins-jeiler is listed by jrivadeneiramejia1-source/plugins-jeiler — review the source before installing
npx claudepluginhub jrivadeneiramejia1-source/plugins-jeiler --plugin apk-skills-jeiler37 skills in this plugin
/adaptiveInstructions 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 buttons) with varying target sizes, and adaptive layouts (including navigation areas - nav rails and nav bars) using the Compose Grid and FlexBox APIs. It also covers desktop experiences with keyboard shortcuts, tooltips and custom cursors./android-intent-securityBest practices for Android Intent security. Use this skill when auditing component configurations in AndroidManifest.xml activities, services, receivers) or source code handling incoming Intents (getIntent, getParcelableExtra) to prevent Intent Redirection and unauthorized access./android-permissions-securityAudits, detects gaps, and remediates Android permissions and IPC component security vulnerabilities. Use when reviewing AndroidManifest.xml, defining custom permissions, securing Services, Receivers, and Providers, verifying caller signatures and UID using Binder, or implementing runtime permission flows.2 plugins ship this exact skill · first indexed Oct 17, 2026
Other plugins' skills for the same job