mcpbeat

Android Persistence

hoangnguyen0403/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 cache-policy design.

1k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
536
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill android-persistence

What comes with it

4 571 bytes besides the instruction
evals/evals.json
references/implementation.md

The instruction itself

6 sections, as written by the author

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 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 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

How to use it

Copy the folder

Take hoangnguyen0403/android-persistence from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.