agentleFS
beworkallbeworkall/agent-skills-security/skills/offline-first-workflow/SKILL.md

offline-first-workflow

Skill0 starsChanged 26 days agoMITView on GitHub

Use when designing or reviewing a feature/app that should work without a network connection, or when the user asks for offline support, local-first storage, or sync-later behavior.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never require a network round-trip for an action the user expects to be instant (saving a note, marking something done).

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Offline-First Workflow

When to Use

  • The user asks for an app/feature to "work offline" or be "local-first"
  • Designing data storage for a mobile/desktop app that may lose connectivity
  • Reviewing an architecture that currently assumes constant network access

Instructions

  1. Identify the source of truth: for offline-first, the local store is authoritative for the user's immediate experience — the network is a sync target, not a dependency for reads/writes to work.
  2. Design storage choice by data shape: structured relational data → embedded SQL (SQLite/Room/Core Data); simple key-value → local key-value store; large blobs/files → local filesystem with a manifest.
  3. For anything that will eventually sync to a server, record a local pending-change log (operation + timestamp + entity id) rather than only the current state — this is what makes later sync and conflict resolution possible.
  4. Conflict resolution: pick and state one explicit strategy up front — last-write-wins (simplest, acceptable for single-user data), or field-level merge (needed for multi-device/multi-user). Don't leave it undecided.
  5. Network calls must be wrapped so failure is a normal, handled path, not an exception that breaks the feature — queue the action locally and retry when connectivity returns, rather than blocking the user.
  6. Never require a network round-trip for an action the user expects to be instant (saving a note, marking something done). Write locally first, sync in the background.
  7. State explicitly which features (if any) genuinely cannot work offline (e.g., real-time collaboration, payment processing) rather than implying everything can.

Examples

User: "I want my notes app to work without internet and sync when it's back online." Agent should: Recommend SQLite as local source of truth, a pending-change log for edits made offline, last-write-wins for single-user sync, and background retry on reconnect — not a design that treats the server as required for basic save/load.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.