skills/k1lgor/virtual-company/mobile-architect

mobile-architect

SKILL.md

Mobile 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

  1. 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).
  2. State Management:
    • Use robust state management solutions (Provider, Riverpod, Redux, Bloc, ViewModel).
    • Manage app lifecycle events (background, foreground, inactive) properly.
  3. 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).
  4. 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()));
      }
    });
  }
}
Weekly Installs
2
First Seen
Feb 22, 2026
Installed on
mcpjam2
claude-code2
replit2
junie2
windsurf2
zencoder2