This walks you through setting up an offline-first data layer with the Repository pattern as your single source of truth, Room for local persistence, and Retrofit for network calls. It covers the stale-while-revalidate pattern for reads (show cached data immediately, refresh in background) and touches on the outbox pattern for syncing writes. You'll use this when building any Android app that needs to work offline or reduce loading states by caching aggressively. The code examples are straightforward, showing a repository that exposes Room's Flow for reactive updates and a separate sync method for fetching fresh data. It assumes you're already using Hilt for dependency injection and doesn't dive deep into conflict resolution or advanced sync scenarios.
npx skills add https://github.com/new-silvermoon/awesome-android-agent-skills --skill android-data-layer