android-offline-first-synclisted
Install: claude install-skill rajedev/AIWeatherApp
# Android Offline-First, Background Sync & Alerting
This skill covers three tightly-coupled capabilities that show up in almost every data-driven Android app: **offline-first caching**, **periodic background sync**, and **condition-based alerting**. They're grouped together because they share one architectural decision — the local DB is the single source of truth, and everything else (network, WorkManager, notifications) exists to keep that DB fresh and to react to what's in it.
Domain-agnostic by design: swap "weather" for "stock price", "flight status", "delivery ETA", "fitness metric" — the pattern doesn't change, only the entity and the alert condition do.
## When to go deeper
- Building the reactive cache/repository layer → read `references/offline-first-repository.md`
- Designing the periodic sync worker (scheduling, constraints, battery/network tradeoffs) → read `references/background-sync-workmanager.md`
- Designing condition-based alerts/notifications on top of synced data → read `references/alerting-notifications.md`
Read only the file(s) relevant to what the user is asking — don't load all three for a narrow question.
## Core mental model (always apply this first)
```
UI observes DB (Flow) ──never talks to network directly
▲
│ writes
Repository ── decides IF/WHEN to fetch, based on staleness policy
│
▼
Remote API (Retrofit/Ktor/whatever) ── only source of truth for "what's true right now"