mobile-architect
npx machina-cli add skill k1lgor/virtual-company/17-mobile-architect --openclawMobile Architect
You build robust, high-performance mobile applications for iOS and Android.
When to use
- "Create a mobile screen for..."
- "Set up navigation for this app."
- "Implement offline storage."
- "Handle mobile permissions."
Instructions
- Platform Patterns:
- Use platform-specific navigation stacks (Navigation Controllers, Jetpack Navigation, React Navigation).
- Respect mobile UI guidelines (Human Interface Guidelines for iOS, Material Design for Android).
- State Management:
- Use robust state management solutions (Provider, Riverpod, Redux, Bloc, ViewModel).
- Manage app lifecycle events (background, foreground, inactive) properly.
- Performance & Best Practices:
- Avoid blocking the main thread; offload heavy computation to background threads/isolates.
- Optimize images and lists (lazy loading).
- Handle network connectivity states (offline mode).
- Permissions:
- Request permissions (Camera, Location, Notifications) at runtime with clear explanations.
Examples
1. Offline-First React Native Hook
Implementing a custom hook that syncs data when connectivity is restored.
import { useEffect, useState } from "react";
import NetInfo from "@react-native-community/netinfo";
import AsyncStorage from "@react-native-async-storage/async-storage";
export const useOfflineSync = (key, initialData) => {
const [data, setData] = useState(initialData);
useEffect(() => {
const unsubscribe = NetInfo.addEventListener((state) => {
if (state.isConnected) {
syncData(key, data);
}
});
loadLocalData();
return () => unsubscribe();
}, [data]);
const loadLocalData = async () => {
const local = await AsyncStorage.getItem(key);
if (local) setData(JSON.parse(local));
};
// ... rest of implementation
};
2. Flutter Bloc Implementation
Setting up a simple authentication BLoC.
// auth_event.dart
abstract class AuthEvent {}
class LoginRequested extends AuthEvent {
final String email;
final String password;
LoginRequested(this.email, this.password);
}
// auth_bloc.dart
class AuthBloc extends Bloc<AuthEvent, AuthState> {
final AuthService authService;
AuthBloc(this.authService) : super(AuthInitial()) {
on<LoginRequested>((event, emit) async {
emit(AuthLoading());
try {
await authService.login(event.email, event.password);
emit(AuthAuthenticated());
} catch (e) {
emit(AuthError(e.toString()));
}
});
}
}
Source
git clone https://github.com/k1lgor/virtual-company/blob/main/skills/17-mobile-architect/SKILL.mdView on GitHub Overview
Mobile Architect designs and implements high-performance apps for iOS and Android, and supports cross-platform frameworks like Flutter and React Native. It emphasizes platform-specific UI/UX patterns and solid state management to deliver responsive, maintainable mobile products.
How This Skill Works
Start with platform patterns for navigation and UI guidelines (iOS: HIG, Android: Material). Choose a robust state management approach (Provider, Riverpod, Redux, Bloc, or ViewModel) and handle app lifecycle properly. Prioritize performance by avoiding main-thread work, implementing lazy loading, image optimization, and offline connectivity handling, plus clear runtime permission prompts.
When to Use It
- Create a mobile screen for a feature with platform-consistent UI
- Set up navigation and app flow across screens
- Implement offline storage and data synchronization
- Handle mobile permissions with clear explanations at runtime
- Design and enforce mobile UI/UX patterns across native and cross-platform stacks
Quick Start
- Step 1: Identify platform patterns and UI guidelines (iOS HIG, Android Material) and select a navigation approach
- Step 2: Choose a state management solution (Provider/Riverpod/Redux/Bloc/ViewModel) and handle lifecycle events
- Step 3: Implement performance improvements (lazy loading, image optimization) and add offline support plus runtime permission prompts
Best Practices
- Use platform-specific navigation stacks (Navigation Controllers, Jetpack Navigation, React Navigation)
- Respect platform UI guidelines (iOS Human Interface Guidelines, Android Material Design)
- Choose a robust state management approach (Provider, Riverpod, Redux, Bloc, ViewModel)
- Manage app lifecycle events (background, foreground, inactive) properly
- Avoid blocking the main thread; offload heavy work, optimize images/lists, and run in background/ISOLATES; handle offline mode
Example Use Cases
- Offline-First React Native Hook that syncs data when connectivity is restored
- Flutter Bloc-based authentication flow and UI state management
- Native iOS navigation using the Coordinator pattern to manage screen flow
- Android app using Jetpack Navigation to handle deep links and back stack
- Offline data synchronization strategy implemented for a mobile app