android-offline-first

android-offline-first is a skill for Claude Code, Codex from prasad-vennam/Awesome-Android-AI-Agent-Skills. It costs 22 tokens per session (804 once invoked), scanned A, original, MIT.

Guidance for Android apps that keep a local copy of data and continue working when the network is unreliable or unavailable. It covers local storage, syncing with remote services, background work, and resolving conflicting changes.

In plain words
What is it for?
Use it for cached API data, offline editing, background synchronization, large paged lists, and repositories where the local database is the main source for the UI.
Why use it?
It prevents the interface from depending directly on a live network connection and gives the app one consistent place to read its data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for cached API data, offline editing, background synchronization, large paged lists, and repositories where the local database is the main source for the UI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add prasad-vennam/Awesome-Android-AI-Agent-Skills --skill android-offline-first
Clone the repo
git clone --depth 1 https://github.com/prasad-vennam/Awesome-Android-AI-Agent-Skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for android-offline-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first/github.svg)](https://agentmods.dev/skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first)
Your own site
<a href="https://agentmods.dev/skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first"><img src="https://agentmods.dev/badge/skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for android-offline-first

Your own site · 80×15
<a href="https://agentmods.dev/skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first"><img src="https://agentmods.dev/badge/skills/prasad-vennam/awesome-android-ai-agent-skills/android-offline-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 804 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.00804
Opus 5 $0.00011 $0.00402
Sonnet 5 $0.00004 $0.00161
Haiku 4.5 $0.00002 $0.00080

Measured 12d ago against content hash 98b9461e5e4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

android-offline-first scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/android-offline-first/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Android Offline-First Excellence 📶🛡️

Standard patterns for architecting professional-grade Android applications that are resilient to poor network conditions and function seamlessly offline.

⚡ When to Use

  • Local Persistence: Caching API responses in Room.
  • Sync Logic: Synchronizing local changes with remote APIs.
  • Background Work: Using WorkManager for data-heavy tasks.
  • Reliable Data Fetching: Building "SSOT" (Single Source of Truth) repositories.
  • Conflict Resolution: Managing data versioning between local and remote.

🏗️ The Single Source of Truth (SSOT)

  • Rule: The UI ALWAYS reads from the Local Database (Room).
  • Rule: The Network Layer ALWAYS writes to the Local Database (Room).
  • Architecture:
    class MyRepository(
        private val localSource: RoomDao,
        private val remoteSource: APIInterface
    ) {
        fun getItems(): Flow<List<Item>> = localSource.observeAll()
    
        suspend fun refreshItems() {
            val items = remoteSource.fetchItems()
            localSource.insertAll(items) // UI updates automatically via Flow
        }
    }
    
  • Advanced (Paging 3): For large lists, you MUST use RemoteMediator. The RemoteMediator intercepts the pagination request, fetches the remote page, dumps it into Room, and signals the PagingSource to re-read from the DB.

🛠️ Essential Tools

1. Room (SQL Persistence)

  • Use Kotlin Flows for observing database changes.
  • Use Transactions for atomic operations.
  • Always implement Migrations for schema changes.

2. WorkManager (Guaranteed Execution)

  • Use for tasks that MUST complete even if the app closes (e.g., uploading a post).
  • Set constraints: NetworkType.CONNECTED, RequiresCharging(true).

3. DataStore (Key-Value)

  • Use for user preferences, simple settings, or session tokens.
  • Choose Preferences DataStore or Proto DataStore (Type-safe).

🚀 Sync Strategies

  • On Demand: Refresh data when the user opens the screen.
  • Periodic Sync: Use WorkManager to sync data every few hours.
  • Immediate Push: Sync with network changes via a BroadcastReceiver or callback.

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 85 lines · 22 tokens per session scan A 98b9461e5e4d

Subscribe to this mod's changes

android-offline-first is a skill published in the GitHub repository prasad-vennam/Awesome-Android-AI-Agent-Skills (9 stars, last pushed 5mo ago), licensed MIT. It adds 22 tokens to every session and 804 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.