Skip to content
Skill Authoring
Skill

/mobile-offline-support

Implement offline-first mobile apps with local storage, sync strategies, and conflict resolution. Covers AsyncStorage, Realm, SQLite, and background sync patterns.

From plugin
useful-ai-prompts
309200 skills
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill mobile-offline-support --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/mobile-offline-support

Context preview

The summary Claude sees to decide when to auto-load this skill.

Implement offline-first mobile apps with local storage, sync strategies, and conflict resolution. Covers AsyncStorage, Realm, SQLite, and background sync patterns.

SKILL.md

mobile-offline-support.SKILL.md
name: mobile-offline-support
description: >
  Implement offline-first mobile apps with local storage, sync strategies, and
  conflict resolution. Covers AsyncStorage, Realm, SQLite, and background sync
  patterns.

Mobile Offline Support

Table of Contents

  • [Overview](#overview)
  • [When to Use](#when-to-use)
  • [Quick Start](#quick-start)
  • [Reference Guides](#reference-guides)
  • [Best Practices](#best-practices)

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:

| Guide | Contents | |---|---| | [React Native Offline Storage](references/react-native-offline-storage.md) | React Native Offline Storage | | [iOS Core Data Implementation](references/ios-core-data-implementation.md) | iOS Core Data Implementation | | [Android Room Database](references/android-room-database.md) | Android 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
Read more
Ships withuseful-ai-prompts

488 production-ready AI prompts, all following a standardized template with validated quality gates. Transform ChatGPT, Claude, and other AI assistants into expert consultants.

Get the whole plugin