Offline First Development logo

Offline First Development

Community
Omar-Obando
offline-first-development

Use when implementing offline-first applications, managing local storage, implementing data synchronization, handling conflicts, and creating offline UI patterns. Includes IndexedDB, localStorage, service workers, and offline state management. Based on offline-first development best practices.

Overview

PublisherOmar-Obando
Repositoryqwen-orchestrator
Skill nameoffline-first-development
Stars
53
Forks
13
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Omar-Obando on GitHub. Read the source before you install it.

Installation

Install the Offline First Development AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/offline-first-development
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Omar-Obando/qwen-orchestrator.git /tmp/qwen-orchestrator
mkdir -p .claude/skills
cp -r /tmp/qwen-orchestrator/skills/offline-first-development .claude/skills/offline-first-development
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Offline First Development in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Offline First Development on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Offline First Development is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Offline-First Development Skill — Mobile Engineer

Overview

This skill provides comprehensive guidance for implementing offline-first applications. It covers local storage management, data synchronization, conflict resolution, offline UI patterns, and offline state management following offline-first development best practices.

When to Use

Use this skill when:

  • Implementing offline-first applications
  • Managing local storage (IndexedDB, localStorage)
  • Implementing data synchronization
  • Handling synchronization conflicts
  • Creating offline UI patterns
  • Implementing service workers
  • Managing offline state
  • Creating offline data models
  • Implementing offline-first APIs
  • Handling network failures
  • Creating offline indicators
  • Implementing queue for offline actions
  • Managing offline data validation
  • Creating offline sync strategies
  • Implementing conflict resolution
  • Managing offline data consistency
  • Creating offline-first UX patterns
  • Implementing background sync
  • Managing offline data caching
  • Creating offline-first error handling
  • Implementing offline data encryption
  • Managing offline storage limits
  • Creating offline-first testing

Do NOT use this skill when:

  • Writing application business logic (use domain-driven skill)
  • Designing database schemas (use database-design skill)
  • Writing API endpoint specifications (use api-design skill)
  • Performing security audits (use security-auditor skill)
  • Writing SQL queries (use sql-best-practices skill)
  • Designing multi-page website layouts (use design-system skill)
  • Analyzing deployment configurations (use deployment skill)
  • Writing documentation (use documentation-best-practices skill)

Offline-First Principles

Core Principles

┌─────────────────────────────────────────────────────────────┐
│              Offline-First Principles                       │
├─────────────────────────────────────────────────────────────┤
│  1. Always Available:                                       │
│     - Application works offline                             │
│     - Core functionality available                          │
│     - Graceful degradation                                  │
│                                                              │
│  2. Data Persistence:                                       │
│     - Data stored locally                                   │
│     - Data survives app restart                             │
│     - Data survives device restart                          │
│                                                              │
│  3. Automatic Sync:                                         │
│     - Data syncs when online                                │
│     - Sync happens automatically                            │
│     - Sync is transparent to user                           │
│                                                              │
│  4. Conflict Resolution:                                    │
│     - Handle offline changes                                │
│     - Resolve conflicts gracefully                          │
│     - User awareness of conflicts                           │
│                                                              │
│  5. Offline UI:                                             │
│     - Clear offline status                                  │
│     - Offline actions queue                                 │
│     - Offline indicators                                    │
└─────────────────────────────────────────────────────────────┘

Local Storage Options

┌─────────────────────────────────────────────────────────────┐
│              Local Storage Options                          │
├─────────────────────────────────────────────────────────────┤
│  localStorage:                                              │
│  - Key-value storage                                        │
│  - Synchronous API                                          │
│  - Limited to ~5MB                                          │
│  - String values only                                       │
│                                                              │
│  sessionStorage:                                            │
│  - Session-scoped storage                                   │
│  - Synchronous API                                          │
│  - Limited to ~5MB                                          │
│  - Cleared on session end                                   │
│                                                              │
│  IndexedDB:                                                 │
│  - Database-style storage                                   │
│  - Asynchronous API                                         │
│  - Large storage capacity                                   │
│  - Supports complex data structures                         │
│                                                              │
│  Cache API:                                                 │
│  - HTTP response caching                                    │
│  - Service worker integration                               │
│  - Query-based retrieval                                    │
│  - Automatic cache management                               │
│                                                              │
│  Web SQL (deprecated):                                      │
│  - SQL database                                             │
│  - Asynchronous API                                         │
│  - Deprecated in favor of IndexedDB                         │
└─────────────────────────────────────────────────────────────┘

Offline Sync Strategies

Sync Patterns

┌─────────────────────────────────────────────────────────────┐
│              Offline Sync Strategies                        │
├─────────────────────────────────────────────────────────────┤
│  Last Write Wins:                                           │
│  - Simple conflict resolution                               │
│  - Timestamp-based                                          │
│  - May lose data                                            │
│  - Good for: Simple data, low conflict                     │
│                                                              │
│  Operational Transform:                                     │
│  - Collaborative editing                                    │
│  - Transform operations                                    │
│  - Complex implementation                                   │
│  - Good for: Real-time collaboration                       │
│                                                              │
│  CRDT (Conflict-free Replicated Data Types):                │
│  - Automatic conflict resolution                            │
│  - No coordination needed                                   │
│  - Complex data structures                                  │
│  - Good for: Distributed systems                           │
│                                                              │
│  Merge Conflicts:                                           │
│  - User-assisted resolution                                 │
│  - Conflict detection                                       │
│  - User interface for resolution                            │
│  - Good for: User-editable data                            │
│                                                              │
│  Queue-based Sync:                                          │
│  - Queue offline actions                                    │
│  - Process sequentially                                     │
│  - Track sync status                                        │
│  - Good for: Action-based sync                             │
└─────────────────────────────────────────────────────────────┘

Sync Implementation

javascript
// ✅ Good: Offline sync with IndexedDB
class OfflineSync {
  constructor(db, apiClient) {
    this.db = db;
    this.apiClient = apiClient;
  }

  async sync() {
    // Get pending changes
    const pendingChanges = await this.db.getAll('pendingChanges');

    for (const change of pendingChanges) {
      try {
        // Attempt to sync
        const result = await this.apiClient.sync(change);

        // Mark as synced
        await this.db.delete('pendingChanges', change.id);

        // Update local cache
        await this.db.put('cache', result);
      } catch (error) {
        // Handle error
        console.error('Sync failed:', error);

        // Retry later
        if (this.shouldRetry(error)) {
          await this.db.update('pendingChanges', change.id, {
            retryCount: (change.retryCount || 0) + 1,
          });
        }
      }
    }
  }

  async queueChange(record, action) {
    // Queue change for later sync
    await this.db.put('pendingChanges', {
      record,
      action,
      timestamp: Date.now(),
      retryCount: 0,
    });
  }
}

Offline UI Patterns

Offline Indicators

html
<!-- ✅ Good: Offline indicator -->
<div class="offline-indicator" id="offlineIndicator">
  <span class="offline-icon">wifi_off</span>
  <span class="offline-text">You're offline</span>
</div>

<script>
  // Monitor network status
  window.addEventListener('online', () => {
    document.getElementById('offlineIndicator').style.display = 'none';
    // Trigger sync
    offlineSync.sync();
  });

  window.addEventListener('offline', () => {
    document.getElementById('offlineIndicator').style.display = 'block';
  });
</script>

Offline Actions Queue

html
<!-- ✅ Good: Offline action queue -->
<div class="action-queue" id="actionQueue">
  <h3>Pending Actions</h3>
  <ul id="queueList"></ul>
</div>

<script>
  // Display pending actions
  function displayQueue() {
    const queueList = document.getElementById('queueList');
    queueList.innerHTML = '';

    offlineSync.getPendingActions().forEach((action) => {
      const li = document.createElement('li');
      li.textContent = `${action.type}: ${action.description}`;
      queueList.appendChild(li);
    });
  }
</script>

Service Workers

Service Worker Registration

javascript
// ✅ Good: Service worker registration
if ('serviceWorker' in navigator) {
  window.addEventListener('load', () => {
    navigator.serviceWorker
      .register('/sw.js')
      .then((registration) => {
        console.log('SW registered:', registration);
      })
      .catch((error) => {
        console.log('SW registration failed:', error);
      });
  });
}

Service Worker Cache Strategy

javascript
// ✅ Good: Service worker cache strategy
self.addEventListener('install', (event) => {
  event.waitUntil(
    caches.open('app-cache').then((cache) => {
      return cache.addAll([
        '/',
        '/styles/main.css',
        '/scripts/app.js',
        '/images/logo.png',
      ]);
    })
  );
});

self.addEventListener('fetch', (event) => {
  event.respondWith(
    caches.match(event.request).then((cachedResponse) => {
      if (cachedResponse) {
        return cachedResponse;
      }

      return fetch(event.request).then((response) => {
        // Cache the response
        const responseClone = response.clone();
        caches.open('app-cache').then((cache) => {
          cache.put(event.request, responseClone);
        });

        return response;
      });
    })
  );
});

Real-World Impact

Before this skill:

  • Applications fail when offline
  • No data persistence
  • Poor user experience
  • Data loss
  • Manual sync required

After this skill:

  • Applications work offline
  • Automatic data persistence
  • Excellent user experience
  • No data loss
  • Automatic sync

Cross-References

  • mobile-performance - For mobile optimization
  • testing-strategy - For offline testing
  • api-design - For offline-first APIs

References

Frequently asked questions

What does the Offline First Development AI skill do?

Use when implementing offline-first applications, managing local storage, implementing data synchronization, handling conflicts, and creating offline UI patterns. Includes IndexedDB, localStorage, service workers, and offline state management. Based on offline-first development best practices.

Why use Offline First Development on TypingMind?

Because you install it once and use it with any model. Offline First Development is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Offline First Development in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/offline-first-development. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Offline First Development?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Offline First Development?

As many as you like. As long as a model supports skills, you can use Offline First Development with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Offline First Development AI skill free?

Yes. It is published on GitHub by Omar-Obando under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇