Mobile app architecture -- native vs cross-platform, offline-first, state management, release management. Use when the user asks to "design mobile architecture", "choose between native and cross-platform", "implement offline-first", "plan mobile CI/CD", "optimize app performance", or mentions Flutter, React Native, KMP, MVVM, SwiftUI, Jetpack Compose, or app store deployment.
From pmnpx claudepluginhub javimontano/mao-pm-apexThis skill is limited to using the following tools:
examples/README.mdexamples/sample-output.htmlexamples/sample-output.mdprompts/prompt.mdreferences/mobile-patterns.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Provides SwiftUI patterns for @Observable state management, view composition, NavigationStack navigation, environment injection, and performance optimization in iOS/macOS apps.
Mobile architecture defines how mobile applications are structured, how they communicate with backends, handle offline scenarios, manage state, and reach users through app stores. This skill produces comprehensive mobile architecture documentation covering platform selection, app architecture patterns, offline-first design, performance optimization, backend integration, and release strategy.
Mobile no es "web en pantalla chica" — es un canal con restricciones únicas. Red inestable, batería finita, ciclos de release controlados por stores, y usuarios que abandonan a los 3 segundos. Diseñar mobile requiere respetar estas restricciones como first-class constraints, no como afterthoughts.
The user provides an app or project name as $ARGUMENTS. Parse $1 as the app/project name used throughout all output artifacts.
Parameters:
{MODO}: piloto-auto (default) | desatendido | supervisado | paso-a-paso
{FORMATO}: markdown (default) | html | dual{VARIANTE}: ejecutiva (~40% — S1 platform strategy + S3 offline-first + S6 release) | técnica (full 6 sections, default)Before generating architecture, detect the mobile project context:
!find . -name "pubspec.yaml" -o -name "package.json" -o -name "*.xcodeproj" -type d -o -name "build.gradle*" -o -name "*.swift" -o -name "*.kt" | head -20
If reference materials exist, load them:
Read ${CLAUDE_SKILL_DIR}/references/mobile-patterns.md
Platform Comparison (2025-2026):
| Factor | Native (Swift/Kotlin) | Flutter (3.24+) | React Native (New Arch) | KMP / CMP |
|---|---|---|---|---|
| Performance | Best | Near-native (Impeller renderer) | Good (Fabric + TurboModules) | Native (shared logic) |
| UI rendering | Platform-native | Impeller: precompiled shaders, 60/120 FPS, no shader jank | Fabric: synchronous, concurrent UI via JSI | Native per platform (or CMP shared UI) |
| Code sharing | 0% | 90-95% | 85-90% | 50-80% logic; 90%+ with CMP UI |
| Team skills | iOS + Android specialists | Dart developers | JavaScript/React developers | Kotlin developers |
| Market share | N/A | ~46% cross-platform | ~35% cross-platform | Growing (Google Docs on iOS uses KMP) |
| Hot reload | Limited | Excellent (sub-second) | Good | N/A (logic layer) |
| App size overhead | Baseline | +5-10MB | +7-15MB | Minimal (logic only) |
| Cold start | Fastest | Fast (Impeller eliminates shader warmup) | Moderate (JSI improves over bridge) | Native speed |
React Native New Architecture (default since 0.76):
Flutter Impeller Renderer (default since 3.16):
Compose Multiplatform (CMP) Status (2025-2026):
Decision Criteria:
Architecture Patterns:
Modularization Strategy (2025 best practices):
| Module Type | Contains | Depends On | Example |
|---|---|---|---|
| Feature module | Screen(s), ViewModel, Repository | Core modules only | :feature-orders, :feature-profile |
| Core module | Shared utilities, networking, design system | Foundation only | :core-network, :core-design |
| Navigation module | Routing, deep links | Feature module interfaces | :navigation |
| Foundation | Extensions, constants, logger | Nothing | :foundation |
Dynamic Feature Delivery:
State Management Layers:
Declarative UI Patterns (2025):
StateFlow. Composable observes via collectAsState(). Side effects: LaunchedEffect, rememberCoroutineScope. Navigation: type-safe Compose Navigation 2.8+.@Observable macro (iOS 17+) replaces ObservableObject. NavigationStack with navigationDestination(for:). Combine phased out for async/await + @Observable.Dependency Injection: Constructor injection for testability. Hilt (Android), Swinject (iOS), get_it (Flutter), inversify (RN).
Local Storage:
Sync Strategies: Pull (client requests on open/refresh), push (WebSocket/SSE), delta (changes since timestamp), full (replace local state).
Conflict Resolution: Last-write-wins (simplest), server-wins (authoritative), field-level merge (most flexible), CRDTs (conflict-free, eventual consistency).
Optimistic UI: Apply locally immediately, queue server sync, confirm on success, revert on failure. Persistent queue survives restart. Exponential backoff retry.
Background Tasks:
Cold Start Benchmarks:
| Rating | Time to First Meaningful Content | Action |
|---|---|---|
| Excellent | <1s | No action needed |
| Good | 1-2s | Monitor, optimize opportunistically |
| Acceptable | 2-3s | Prioritize optimization in next sprint |
| Unacceptable | >3s | Critical fix -- users abandon at 3s+ |
Cold Start Optimization Checklist:
Memory Management:
Animation Targets: 60fps minimum (120fps for ProMotion/high refresh). Animate transform/opacity (GPU), not size/position (CPU). Platform APIs: Compose Animation, SwiftUI withAnimation, Flutter AnimationController.
Battery Optimization: Batch network requests. Significant-change location monitoring. Compress payloads. Prefer WiFi for large transfers.
Accessibility:
Mobile-Optimized API Design:
GraphQL vs. REST Decision:
| Factor | REST | GraphQL |
|---|---|---|
| Over-fetching | Common | Eliminated (client specifies) |
| Under-fetching | Multiple round trips | Single query, nested resolution |
| Caching | HTTP caching (simple) | Client-side (Apollo, Relay, urql) |
| Mobile fit | Good with BFF | Excellent for varied screens |
Push Notifications: APNs (iOS) + FCM (Android). Silent push for background sync. Rich push with images, actions, deep links. Permission strategy: ask after value demonstration, not first launch.
Deep Linking: Universal Links (iOS) / App Links (Android) for domain-based routing. Deferred deep linking for new installs. Full navigation stack restoration.
Mobile CI/CD Pipeline:
Feature Flags: Remote config for enable/disable without app update. Gradual rollout (1% -> 10% -> 50% -> 100%). Kill switch. Tools: Firebase Remote Config, LaunchDarkly, Unleash.
OTA Updates: CodePush (React Native), Shorebird (Flutter). No OTA for native compiled code (store policy). Must not change app purpose.
App Store Compliance:
Versioning: Semantic versioning (major.minor.patch). Always-incrementing build numbers. Minimum version enforcement for critical updates.
| Decision | Enables | Constrains | When to Use |
|---|---|---|---|
| Native | Best performance, full API access | 2x codebase, 2x team | Performance-critical, platform-specific |
| Flutter | Single codebase, Impeller rendering | Custom render engine, plugin gaps | Rapid iteration, consistent UI |
| React Native (New Arch) | JS ecosystem, Fabric/TurboModules perf | Native module migration effort | JS teams, existing React codebase |
| KMP/CMP | Shared logic (+ optional shared UI) | Smaller ecosystem, Kotlin required | Kotlin teams, logic-first sharing |
| Offline-First | Works without network, fast UI | Sync complexity, conflict resolution | Field workers, unreliable connectivity |
| Dynamic Features | Smaller initial download | Delivery complexity, testing overhead | Large features used by <30% of users |
| BFF Pattern | Optimized mobile responses | Additional service to maintain | Shared backend serving web and mobile |
| Caso | Estrategia de Manejo |
|---|---|
| Desarrollador unico construyendo para ambas plataformas (iOS + Android) | Cross-platform obligatorio (Flutter o React Native). Maximizar code sharing. Usar managed services para backend. Evitar native modules custom. Priorizar velocity sobre optimizacion. |
| App enterprise con requisitos MDM (Mobile Device Management) | Integrar MDM desde Sprint 0. Managed app config, VPN tunneling, data loss prevention como constraints de arquitectura. Testear con perfiles MDM reales tempranamente. Certificate pinning obligatorio. |
| Industria regulada (healthcare/finance) con requisitos de compliance estrictos | Biometric auth obligatorio. Certificate pinning. No sensitive data en logs ni screenshots. Jailbreak/root detection. HIPAA/PCI-DSS compliance checklist. Encriptar storage local. Audit trail de acciones criticas. |
| Super app con >10 feature modules y multiples equipos de desarrollo | Micro-frontend architecture. Cada feature team owner de un module. Dynamic feature delivery para reducir APK/IPA inicial. Navigation contract entre modules. CI/CD por modulo con integration testing cruzado. |
| Decision | Alternativa Descartada | Justificacion |
|---|---|---|
| Flutter como default para cross-platform sobre React Native | React Native con New Architecture | Flutter ofrece Impeller renderer (60/120 FPS sin shader jank), 90-95% code sharing, y hot reload sub-segundo. React Native requiere migracion a New Arch para beneficios similares. Flutter mejor para equipos sin experiencia React previa. |
| Offline-first con optimistic UI como patron default | Online-only con loading spinners | Mobile opera en redes inestables. Optimistic UI elimina latencia percibida. Queue persistente sobrevive restart. El costo de sync complexity se justifica por UX superior y retenciones 2-3x mayores. |
| BFF (Backend-for-Frontend) sobre API generica compartida con web | API unica REST para web y mobile | Mobile necesita response shaping especifico (menos datos, diferentes aggregations). BFF elimina over-fetching y reduce round trips. API generica fuerza compromises que degradan performance en ambos canales. |
graph TD
subgraph Core
MOB[mobile-architecture]
end
subgraph Inputs
REQ[Platform Requirements - iOS/Android/Both] --> MOB
TEAM[Team Skills Assessment] --> MOB
UX[UX Design & Wireframes] --> MOB
end
subgraph Outputs
MOB --> PLAT[Platform Decision Matrix]
MOB --> ARCH[App Architecture Diagram]
MOB --> OFF[Offline-First Design]
MOB --> REL[Release Pipeline & Strategy]
end
subgraph Related Skills
MOB -.-> SA[software-architecture]
MOB -.-> API[api-architecture]
MOB -.-> MA[mobile-assessment]
MOB -.-> PE[performance-engineering]
end
Formato MD (default):
# Mobile Architecture: {app_name}
## S1: Platform Strategy
- Comparison matrix (Native vs Flutter vs RN vs KMP)
- Decision rationale with team skill assessment
## S2: App Architecture Patterns
- Architecture diagram (Mermaid)
- Modularization plan
## S3-S6: [remaining sections]
## Anexos: CI/CD pipeline config, app store compliance checklist, accessibility audit
Formato HTML (bajo demanda):
Mobile_Architecture_{app_name}_{WIP}.htmlFormato DOCX (bajo demanda):
{fase}_Mobile_Architecture_{cliente}_{WIP}.docxFormato XLSX (bajo demanda):
{fase}_Mobile_Architecture_{cliente}_{WIP}.xlsxFormato PPTX (bajo demanda):
{fase}_Mobile_Architecture_{cliente}_{WIP}.pptx| Dimension | Peso | Criterio | Umbral Minimo |
|---|---|---|---|
| Trigger Accuracy | 10% | El skill se activa correctamente ante menciones de mobile architecture, Flutter, React Native, KMP, offline-first, app store | 7/10 |
| Completeness | 25% | Las 6 secciones cubren platform, architecture, offline, performance, backend integration, y release | 7/10 |
| Clarity | 20% | Platform decision con justificacion cuantitativa. Architecture patterns con layer separation explicita. Performance targets concretos. | 7/10 |
| Robustness | 20% | Edge cases de single dev, MDM, regulated industry, super app cubiertos. Offline strategy con conflict resolution. Store compliance checklist. | 7/10 |
| Efficiency | 10% | Output proporcional al contexto. Sin documentar plataformas no relevantes. Modularization scoped al tamano del equipo. | 7/10 |
| Value Density | 15% | Cold start optimization checklist accionable. CI/CD pipeline configs concretos. Feature flag strategy con kill switch. | 7/10 |
Umbral minimo global: 7/10. Deliverables por debajo requieren re-work antes de entrega.
Single Developer Building for Both Platforms: Cross-platform (Flutter or React Native) strongly favored. Maximize code sharing. Use managed services for backend.
Enterprise App with MDM Requirements: MDM integration affects architecture: managed app config, VPN tunneling, data loss prevention. Test with MDM profiles early.
App with Large Media (Video, 3D): Streaming over download. Progressive loading for 3D. CDN integration. Selective offline download with storage management UI.
Super App / Multi-Feature App: Micro-frontend architecture: each feature team owns a module. Dynamic feature delivery. Navigation contract between modules.
Regulated Industry (Healthcare, Finance): Biometric auth. Certificate pinning. No sensitive data in logs or screenshots. Jailbreak/root detection. HIPAA/PCI-DSS compliance.
Before finalizing delivery, verify:
| Format | Default | Description |
|---|---|---|
markdown | Yes | Rich Markdown + Mermaid diagrams. Token-efficient. |
html | On demand | Branded HTML (Design System). Visual impact. |
dual | On demand | Both formats. |
Default output is Markdown with embedded Mermaid diagrams. HTML generation requires explicit {FORMATO}=html parameter.
Primary: A-01_Mobile_Architecture.html -- Executive summary, platform decision matrix, architecture diagram, offline-first design, performance optimization plan, backend integration strategy, release pipeline.
Secondary: Module dependency diagram, API contract specification, CI/CD pipeline configuration, app store compliance checklist, accessibility audit template.
Autor: Javier Montaño | Última actualización: 12 de marzo de 2026