offline-queue

Generate a Swift offline operation queue with disk persistence and automatic retries.

27|5|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/bocan/bocan-music --skill offline-queue-bocan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: offline-queue
Source: https://github.com/bocan/bocan-music/tree/main/.claude/skills/generators/offline-queue
Command: npx skills add https://github.com/bocan/bocan-music --skill offline-queue-bocan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of API requests and mutations failing when a user is offline, ensuring that data changes are not lost and are synchronized automatically when connectivity returns, which is critical for mobile and desktop applications used in areas with unreliable network access.

Core Features & Use Cases

  • Offline Operation Queue: Persists API requests and mutations to disk when the device is offline, using a file-based storage system that survives app restarts.
  • Automatic Retry with Exponential Backoff: Processes queued operations when connectivity returns, with configurable retry strategies including exponential backoff with jitter to prevent thundering herd problems.
  • Conflict Resolution: Handles server conflicts (HTTP 409) with multiple strategies including server-wins, client-wins, and manual merge, plus supports operation dependencies for ordered execution like creating a parent folder before a child document.
  • Use Case: A field service app used in remote areas with no cellular coverage can queue work orders and photos locally, then automatically sync them to the server when the user returns to civilization, with idempotency keys preventing duplicate records if the connection drops during sync.

Quick Start

Use the offline-queue skill to generate a complete offline operation queue system for your Swift app that persists API mutations to disk when offline and automatically retries them with exponential backoff when connectivity returns.

Frequently Asked Questions about offline-queue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I queue API mutations to disk when my Swift app loses network connectivity?

An offline operation queue handles API retries by automatically processing pending mutations when NWPathMonitor detects network connectivity returns. It applies exponential backoff with jitter to prevent thundering herd problems during synchronization.

Can I prevent duplicate API submissions when an offline iOS app reconnects to the network?

You can prevent duplicate API submissions by attaching idempotency keys to queued operations for server-side deduplication. This ensures that if a connection drops during sync, retried requests will not create duplicate records on the server.

Does this offline queue approach work with macOS 13 and iOS 16 Swift applications?

Conflict resolution for HTTP 409 errors in an offline queue supports server-wins, client-wins, and manual merge strategies. It also handles operation dependencies to ensure ordered execution, such as creating a parent folder before a child document.

How do I prune old API requests from an offline-first Swift queue?

You can prune old API requests from an offline-first Swift queue by implementing TTL-based pruning and queue size limits within the file-based JSON persistence system. This automatically removes stale operations to prevent unbounded disk growth.