Command Palette

Search for a command to run...

Back to skills
skill № 67741

mobile-patterns

Use when the user asks about mobile architecture patterns, MVVM vs MVI, Clean Architecture, Coordinator, repository and use case layers, dependency injection…

FreeNo executable scripts
j4flmaoby j4flmao★ 47 GitHub stars

Install mobile-patterns in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Mobile Architecture Patterns

Purpose

Select and implement cross-platform mobile architecture patterns including MVVM, MVI, Clean Architecture, Coordinator, and Repository patterns.

Agent Protocol

Trigger

User request includes: mobile pattern, mobile architecture, mvvm, mvi, clean architecture mobile, coordinator, navigator pattern, mobile project structure, mobile folder structure, mobile di.

Input Context

  • Platform (iOS, Android, Flutter, React Native)
  • Architecture approach (MVVM, MVI, Clean, TCA)
  • DI framework (Hilt, Swinject, GetIt, manual)

Output Artifact

A markdown document containing:

  • Architecture pattern selection guide
  • Folder structure matching the pattern
  • Data flow diagram (text)
  • Key code snippets for the chosen pattern

Response Format

No preamble. No postamble. No explanations.

Max Response Length

4096 tokens

Decision Trees

Architecture Pattern Selection

App complexity?
├── Simple CRUD, list/detail, <10 screens
│   └── MVVM + Repository (minimal abstraction, well-known)
├── Complex state (real-time, multi-step, concurrent updates)
│   └── MVI (unidirectional, predictable, sealed intents/state)
├── Large codebase, 5+ teams, shared domain logic
│   └── Clean Architecture (strict boundaries, modular)
└── Swift-only, complex state, composable
    └── TCA (The Composable Architecture, SwiftUI-native)

DI Framework Selection

Platform?
├── Android
│   ├── Hilt (standard, Dagger wrapper, @HiltViewModel)
│   └── Koin (lightweight, Kotlin DSL, no annotation processing)
├── iOS
│   ├── Swinject (runtime DI, container, assembly)
│   └── Factory (Swift macros, compile-time safe)
├── Flutter
│   ├── GetIt (service locator, simple, fast)
│   └── Riverpod (declarative, auto-dispose, testable)
└── React Native
    ├── Module-level factories or a small container (decorator DI such as InversifyJS is rare in RN)
    └── Manual context-based DI (React Context + hooks)

Navigation Pattern Selection

Navigation complexity?
├── Simple linear flow (login → home → detail)
│   └── Built-in navigation (NavigationStack, NavHost, Stack)
├── Deep linking, conditional flows, auth state
│   └── Coordinator pattern (navigation extracted from views)
├── Tab-based with nested stacks
│   └── ShellRoute (Flutter), Tab Navigator (RN)
└── Complex onboarding/wizard with branching
    └── Coordinator with child coordinators

Workflow

Step 1: Identify Architecture Requirements

Assess team size, app complexity, testing requirements, and platform constraints.

Step 2: Select Core Pattern

Choose MVVM for standard apps, MVI for complex state, Clean Architecture for large multi-team codebases.

Step 3: Define Layer Boundaries

Establish dependency rules: presentation depends on domain, domain is pure business logic, data implements domain interfaces.

Step 4: Separate Navigation

Extract navigation logic into Coordinator/Navigator — views know nothing about other screens.

Step 5: Set Up Dependency Injection

Configure DI framework with explicit scopes and clear module organization per layer.

Cross-Platform Pattern Mapping

Pattern iOS Android Flutter React Native
MVVM ObservableObject + @Published ViewModel + StateFlow ChangeNotifier + Riverpod useState + Zustand
MVI Combine + enum Intent MVI + StateFlow + sealed class BLoC (Event → Bloc → State) useReducer + dispatch
Clean Arch SPM modules per layer Gradle modules Dart packages Workspace packages
Coordinator Coordinator protocol + child NavHost + sealed route GoRouter ShellRoute React Navigation nesting

Rules

  • Domain layer must have zero framework dependencies — pure business logic only
  • Data layer depends on domain layer — never the reverse
  • MVVM: View observes ViewModel state; ViewModel never holds View reference
  • MVI: sealed class for intents, single sealed state class, reducer function
  • Clean Architecture: outer layers depend on inner layers, never inward
  • Coordinator owns navigation — views call coordinator callbacks
  • Repository is the single source of truth
  • Choose architecture based on app complexity, not trends

MVVM Implementation

Android — Jetpack Compose

// ViewModel
@HiltViewModel
class OrderViewModel @Inject constructor(
  private val getOrdersUseCase: GetOrdersUseCase
) : ViewModel() {
  private val _state = MutableStateFlow(OrderUiState())
  val state: StateFlow<OrderUiState> = _state.asStateFlow()

  init { loadOrders() }

  fun onAction(action: OrderAction) {
    when (action) {
      is OrderAction.Refresh -> loadOrders()
      is OrderAction.SelectOrder -> selectOrder(action.id)
    }
  }

  private fun loadOrders() {
    viewModelScope.launch {
      _state.update { it.copy(isLoading = true) }
      getOrdersUseCase().fold(
        onSuccess = { orders ->
          _state.update { it.copy(orders = orders, isLoading = false) }
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/clean-arch.md
  • references/coordinator.md
  • references/design-patterns.md
  • references/mobile-architecture-patterns.md
  • references/mvvm-mvi.md
  • references/offline-first-architecture.md
  • references/state-management-mobile.md

FAQ

What does the mobile-patterns skill do?

Use when the user asks about mobile architecture patterns, MVVM vs MVI, Clean Architecture, Coordinator, repository and use case layers, dependency injection in mobile apps or choosing a cross-platform framework. Produces layer boundaries and module structure. Not for platform-specific code (use ios, android or flutter-expertise).

How do I install the mobile-patterns skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the mobile-patterns skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare mobile-patterns with