Skip to content
Development
Skill

/android-persistence

Implement Room schemas and DataStore preferences with proper async patterns in Android. Use when the primary task is storage schema, DAO, migration, or preference isolation; defer auth-token/security storage, any CoroutineWorker/WorkManager task, Hilt graph wiring, and

From plugin
agent-skills-standard
538200 skills1 MCP
Install
$ npx -y skills add hoangnguyen0403/agent-skills-standard --skill android-persistence --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/android-persistence

Context preview

The summary Claude sees to decide when to auto-load this skill.

Implement Room schemas and DataStore preferences with proper async patterns in Android. Use when the primary task is storage schema, DAO, migration, or preference isolation; defer auth-token/security storage, any CoroutineWorker/WorkManager task, Hilt graph wiring, and

SKILL.md

android-persistence.SKILL.md
name: android-persistence
description: Implement Room schemas and DataStore preferences with proper async patterns in Android. Use when the primary task is storage schema, DAO, migration, or preference isolation; defer auth-token/security storage, any CoroutineWorker/WorkManager task, Hilt graph wiring, and cache-policy design.
metadata:
  triggers:
    files:
    - '**/*Dao.kt'
    - '**/*Database.kt'
    - '**/*Entity.kt'
    keywords:
    - "@Dao"
    - "@Entity"
    - RoomDatabase

Android Persistence Standards

**Priority: P0 (CRITICAL)**

1. Configure Room Database

  • Return `Flow<List<T>>` for queries, use `suspend` for Write/Insert.
  • Keep `@Entity` data classes simple. Map to Domain models in Repository.
  • Use `@Transaction` for multi-table queries (Relations).

See [DAO templates](references/implementation.md) for Room DAO patterns.

2. Migrate to DataStore

  • Replace `SharedPreferences` with `ProtoDataStore` (type-safe) or `PreferencesDataStore`.
  • Inject singleton DataStore instance via Hilt.

See [DAO templates](references/implementation.md) for DataStore migration patterns.

Anti-Patterns

  • **No IO on Main Thread**: Room handles dispatchers, but verify Flow collected off-main.
  • **No @Entity in UI Layer**: Map to Domain or UI models in Repository.

References

  • [DAO Templates](references/implementation.md)
Ships withagent-skills-standard

The portable SDLC standards layer for AI coding agents. Sync once, then work in your own runtime.

Get the whole plugin

Other skills on agent-skills-standard.