Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
secondsky avatar

Mobile Offline Support

  • 312 installs
  • 202 repo stars
  • Updated August 4, 2026
  • secondsky/claude-skills

mobile-offline-support is a secondsky/claude-skills module that helps developers design offline-first mobile experiences with local caching, sync queues, and connectivity-aware UI behavior.

About

mobile-offline-support is a skill in secondsky/claude-skills for mobile clients that must work on unreliable networks, though its published description is generic and the readme is empty. From the name and catalog context, it guides agents through offline-first patterns such as local persistence, action queues that sync on reconnect, conflict handling, and user-facing connectivity states. Mobile engineers reach for mobile-offline-support when field apps, travel products, or low-connectivity regions break naive online-only assumptions. Treat outputs as architectural recommendations to validate against your platform stack—React Native, Flutter, or native—because the skill manifest lacks platform-specific detail.

  • mobile-offline-support

Mobile Offline Support by the numbers

  • 312 all-time installs (skills.sh)
  • +14 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #1,311 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/secondsky/claude-skills --skill mobile-offline-support

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs312
repo stars202
Last updatedAugust 4, 2026
Repositorysecondsky/claude-skills

How do you build offline-first mobile app sync?

Use mobile-offline-support for development tasks

Who is it for?

Mobile developers shipping apps that must remain usable during intermittent connectivity or fully offline sessions.

Skip if: Server-only APIs, desktop web SPAs without mobile offline requirements, or pure UI mockups with no sync design.

When should I use this skill?

The user asks for offline mobile support, sync queues, local caching on devices, or connectivity-aware mobile UX patterns.

What you get

Offline cache strategy, sync queue design, connectivity UI states, and conflict-handling notes for mobile clients.

  • Offline sync design
  • Cache and queue patterns

Files

SKILL.mdMarkdownGitHub ↗

Mobile Offline Support

Build offline-first mobile applications with local storage and synchronization.

React Native Implementation

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

class OfflineManager {
  constructor() {
    this.syncQueue = [];
    this.isOnline = true;
    // Maximum items in sync queue before discarding oldest
    this.MAX_SYNC_QUEUE_LENGTH = 1000;

    NetInfo.addEventListener(state => {
      this.isOnline = state.isConnected;
      if (this.isOnline) this.processQueue();
    });
  }

  /**
   * Fetch data from server.
   * TODO: Replace with actual API endpoint implementation.
   */
  async fetchFromServer(key) {
    try {
      // Example implementation - replace with your API
      const response = await fetch(`${API_BASE_URL}/data/${key}`);
      if (!response.ok) {
        throw new Error(`Server returned ${response.status}`);
      }
      return await response.json();
    } catch (error) {
      console.error('fetchFromServer failed:', error);
      throw new Error(`Failed to fetch ${key}: ${error.message}`);
    }
  }

  /**
   * Sync data to server.
   * TODO: Replace with actual API endpoint implementation.
   */
  async syncToServer(key, data) {
    try {
      // Example implementation - replace with your API
      const response = await fetch(`${API_BASE_URL}/data/${key}`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(data)
      });
      if (!response.ok) {
        throw new Error(`Server returned ${response.status}`);
      }
      return await response.json();
    } catch (error) {
      console.error('syncToServer failed:', error);
      throw new Error(`Failed to sync ${key}: ${error.message}`);
    }
  }

  async getData(key) {
    const cached = await AsyncStorage.getItem(key);
    if (cached) return JSON.parse(cached);

    if (this.isOnline) {
      const data = await this.fetchFromServer(key);
      await AsyncStorage.setItem(key, JSON.stringify(data));
      return data;
    }

    return null;
  }

  async saveData(key, data) {
    await AsyncStorage.setItem(key, JSON.stringify(data));

    if (this.isOnline) {
      await this.syncToServer(key, data);
    } else {
      // Add to queue
      this.syncQueue.push({ key, data, timestamp: Date.now() });

      // Enforce queue bounds - discard oldest if exceeded
      while (this.syncQueue.length > this.MAX_SYNC_QUEUE_LENGTH) {
        const discarded = this.syncQueue.shift();
        console.warn(`Sync queue full - discarded oldest item: ${discarded.key}`);
      }

      // Persist trimmed queue
      await AsyncStorage.setItem('syncQueue', JSON.stringify(this.syncQueue));
    }
  }

  async processQueue() {
    const failedItems = [];
    for (const item of this.syncQueue) {
      try {
        await this.syncToServer(item.key, item.data);
      } catch (err) {
        console.error('Sync failed:', err);
        failedItems.push(item);
      }
    }
    this.syncQueue = failedItems;
    if (failedItems.length === 0) {
      await AsyncStorage.removeItem('syncQueue');
    } else {
      await AsyncStorage.setItem('syncQueue', JSON.stringify(failedItems));
    }
  }
}

Conflict Resolution

function resolveConflict(local, server) {
  // Last-write-wins
  if (local.updatedAt > server.updatedAt) return local;
  return server;

  // Or merge changes
  // return { ...server, ...local };
}

UI Indicators

function OfflineIndicator() {
  const [isOnline, setIsOnline] = useState(true);

  useEffect(() => {
    return NetInfo.addEventListener(state => {
      setIsOnline(state.isConnected);
    });
  }, []);

  if (isOnline) return null;

  return (
    <View style={styles.banner}>
      <Text>You're offline. Changes will sync when connected.</Text>
    </View>
  );
}

Best Practices

  • Cache frequently accessed data locally
  • Queue actions for later sync
  • Show clear offline indicators
  • Handle sync conflicts gracefully
  • Compress stored data
  • Test offline scenarios thoroughly

Native Implementations

See references/native-implementations.md for:

  • iOS Core Data with sync manager
  • Android Room database with WorkManager sync

Avoid

  • Assuming connectivity
  • Losing data on sync failures
  • Unbounded queue growth
  • Syncing sensitive data insecurely

Related skills

FAQ

What does mobile-offline-support cover?

mobile-offline-support guides offline-first mobile design—local caching, sync queues, reconnect behavior, and connectivity UI—for apps that must work without constant network access.

Is mobile-offline-support platform-specific?

mobile-offline-support describes cross-cutting offline patterns; developers still map recommendations to React Native, Flutter, Swift, or Kotlin implementations in their codebase.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.