mcpField
M
mobile-offline-support

mobile-offline-support

github.com/aj-geddesDevelopment373542 installsUpdated 34w ago
Repository

About mobile-offline-support

mobile-offline-support is a skill for designing offline-first mobile apps. It covers local storage, synchronization when connectivity returns, and conflict handling for apps that must remain usable without a network connection.

Key features

  1. 01Implement robust local storage
  2. 02Sync automatically when online
  3. 03Queue actions for later sync
  4. 04Handle data conflicts
  5. 05Cache frequently accessed data

Use cases

  1. 01Build apps that work without internet access
  2. 02Sync device and server data after reconnection
  3. 03Improve app responsiveness with local storage

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill mobile-offline-support

After installing, type/mobile-offline-supportin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
android-room-database.md
ios-core-data-implementation.md
react-native-offline-storage.md
templates/
component-template.tsx

Details

From the project README

Mobile Offline Support

Table of Contents

Overview

Design offline-first mobile applications that provide seamless user experience regardless of connectivity.

When to Use

  • Building apps that work without internet connection
  • Implementing seamless sync when connectivity returns
  • Handling data conflicts between device and server
  • Reducing server load with intelligent caching
  • Improving app responsiveness with local storage

Quick Start

Minimal working example:

import AsyncStorage from '@react-native-async-storage/async-storage';
import NetInfo from '@react-native-community/netinfo';

class StorageManager {
  static async saveItems(items) {
    try {
      await AsyncStorage.setItem(
        'items_cache',
        JSON.stringify({ data: items, timestamp: Date.now() })
      );
    } catch (error) {
      console.error('Failed to save items:', error);
    }
  }

  static async getItems() {
    try {
      const data = await AsyncStorage.getItem('items_cache');
      return data ? JSON.parse(data) : null;
    } catch (error) {
      console.error('Failed to retrieve items:', error);
      return null;
    }
  }

// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
React Native Offline StorageReact Native Offline Storage
iOS Core Data ImplementationiOS Core Data Implementation
Android Room DatabaseAndroid Room Database

Best Practices

✅ DO
  • Implement robust local storage
  • Use automatic sync when online
  • Provide visual feedback for offline status
  • Queue actions for later sync
  • Handle conflicts gracefully
  • Cache frequently accessed data
  • Implement proper error recovery
  • Test offline scenarios thoroughly
  • Use compression for large data
  • Monitor storage usage
❌ DON'T
  • Assume constant connectivity
  • Sync large files frequently
  • Ignore storage limitations
  • Force unnecessary syncing
  • Lose data on offline mode
  • Store sensitive data unencrypted
  • Accumulate infinite queue items
  • Ignore sync failures silently
  • Sync in tight loops
  • Deploy without offline testing

Comments

Markdown supported