Skip to content

Guidance for an offline-first Android data layer built on the Repository pattern, Room, and Retrofit.

CCM score
57 of 100
skills.sh installs
559
GitHub stars
1K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the repository as single source of truth, with Room as local cache and Retrofit as remote fetcher
  • Includes sync guidance for stale-while-revalidate reads and an outbox pattern for writes via WorkManager
  • Requires remote errors such as no connectivity and 404 to be wrapped in try-catch or a Result type
  • Designed for Android developers wiring Hilt dependency injection into offline-first app architecture

Install

$ npx -y skills add new-silvermoon/awesome-android-agent-skills --skill android-data-layer -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Android Data Layer & Offline-First

Instructions

The Data Layer coordinates data from multiple sources.

1. Repository Pattern

  • Role: Single Source of Truth (SSOT).
  • Logic: The repository decides whether to return cached data or fetch fresh data.
  • Implementation:
    class NewsRepository @Inject constructor(
        private val newsDao: NewsDao,
        private val newsApi: NewsApi
    ) {
        // Expose data from Local DB as the source of truth
        val newsStream: Flow<List<News>> = newsDao.getAllNews()
    
        // Sync operation
        suspend fun refreshNews() {
            val remoteNews = newsApi.fetchLatest()
            newsDao.insertAll(remoteNews)
        }
    }
    

2. Local Persistence (Room)

  • Usage: Primary cache and offline storage.
  • Entities: Define @Entity data classes.
  • DAOs: Return Flow<T> for observable data.

Details

Repository
github.com/new-silvermoon/awesome-android-agent-skills
Category
Mobile Apps
First seen
Jun 3, 2026

Questions

What does the android-data-layer skill do?

android-data-layer guides an agent through implementing the Android Data Layer with the Repository pattern, Room for local storage and Retrofit for remote data. It covers offline-first synchronization, where the repository acts as the single source of truth.

How do I install the android-data-layer skill?

Run npx -y skills add new-silvermoon/awesome-android-agent-skills --skill android-data-layer -y in your project. Once installed, android-data-layer lets the agent follow its Room, Retrofit and Hilt binding patterns when you work on data code.

Which skills are in the Mobile Apps category with android-data-layer?

The Mobile Apps category on Claude Marketplaces lists vercel-react-native-skills, animate-expo, write-swift, firebase-crashlytics and xcode-project-setup. android-data-layer focuses on Android data persistence and synchronization rather than cross-platform UI or Apple tooling.

Does android-data-layer explain how to handle offline writes?

Yes, android-data-layer describes an Outbox Pattern for writes, where changes are saved locally, marked as unsynced and pushed to the server with WorkManager. It also explains stale-while-revalidate reads that show local data first and refresh it in the background.

More from new-silvermoon/awesome-android-agent-skills

All 17

Similar to Android Data Layer

More Mobile Apps