android-persistence
Standards for Room Database and DataStore. Use when implementing Room database schemas or DataStore preferences in Android. (triggers: **/*Dao.kt, **/*Database.kt, **/*Entity.kt, @Dao, @Entity, RoomDatabase)
Best use case
android-persistence is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Standards for Room Database and DataStore. Use when implementing Room database schemas or DataStore preferences in Android. (triggers: **/*Dao.kt, **/*Database.kt, **/*Entity.kt, @Dao, @Entity, RoomDatabase)
Teams using android-persistence should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/android-persistence/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How android-persistence Compares
| Feature / Agent | android-persistence | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Standards for Room Database and DataStore. Use when implementing Room database schemas or DataStore preferences in Android. (triggers: **/*Dao.kt, **/*Database.kt, **/*Entity.kt, @Dao, @Entity, RoomDatabase)
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Android Persistence Standards ## **Priority: P0** ## Implementation Guidelines ### Room - **Async**: Return `Flow<List<T>>` for queries, use `suspend` for Write/Insert. - **Entities**: Keep simple `@Entity` data classes. Map to Domain models in Repository. - **Transactions**: Use `@Transaction` for multi-table queries (Relations). ### DataStore - **Usage**: Replace `SharedPreferences` with `ProtoDataStore` (Type-safe) or `PreferencesDataStore`. - **Scope**: Inject singleton instance via Hilt. ## Anti-Patterns - **No IO on Main Thread**: Room handles dispatchers, but verify Flow is collected off-main. - **No @Entity in UI Layer**: Map to Domain or UI models in Repository. ## References - [DAO Templates](references/implementation.md)
Related Skills
mobile-android-design
Master Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.
android-jetpack-compose-expert
Expert guidance for building modern Android UIs with Jetpack Compose, covering state management, navigation, performance, and Material Design 3.
context-persistence
Waypoint plans methodology and session survival patterns for Claude Code. Use when working on long-running features, need to resume after context reset, want to document task progress, or need to survive session interruptions. Covers three-file structure (plan/context/tasks), SESSION PROGRESS tracking, quick resume instructions, update frequency, and context handoff patterns.
swift-actor-persistence
Thread-safe data persistence in Swift using actors — in-memory cache with file-backed storage, eliminating data races by design.
android-clean-architecture
Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns.
Android Reverse Engineering
Decompile Android APK, XAPK, JAR, and AAR files using jadx and Fernflower/Vineflower, trace call flows through application code and libraries, and produce structured documentation of extracted APIs. Two decompiler engines are supported — jadx for broad Android coverage and Fernflower for higher-quality output on complex Java code — and can be used together for comparison.
ios-persistence
Standards for SwiftData, Core Data, and Local Storage. Use when implementing SwiftData, Core Data models, or local persistence in iOS. (triggers: **/*.xcdatamodeld, **/*Model.swift, PersistentContainer, FetchRequest, ManagedObject, Query, ModelContainer, Repository)
android-xml-views
Standards for ViewBinding, RecyclerView, and XML Layouts. Use when implementing XML layouts, ViewBinding, or RecyclerView adapters in Android. (triggers: layout/*.xml, **/*Binding.java, **/*Binding.kt, ViewBinding, ConstraintLayout, RecyclerView)
android-tooling
Standards for Static Analysis (Detekt, Ktlint) and CI/CD Checks. Use when adding or tuning Detekt/Ktlint rules, setting Android Lint as a CI gate, suppressing lint warnings with @Suppress, or configuring code quality checks on pull requests. (triggers: build.gradle.kts, detekt.yml, .detekt/config.yml, detekt, ktlint, lint, @Suppress, abortOnError, jlleitschuh)
android-testing
Standards for Unit Tests, UI Tests (Compose), and Hilt Integration. Use whenever writing Android test files or asking about runTest, composeTestRule, HiltAndroidRule, MockK, MainDispatcherRule, @TestInstallIn, or how to test a ViewModel/Composable/Repository in Android. (triggers: **/*Test.kt, **/*Rule.kt, @Test, runTest, composeTestRule, HiltAndroidTest, MockK, createAndroidComposeRule, MainDispatcherRule, @TestInstallIn)
android-state
Standards for ViewModel, StateFlow, and UI State Patterns. Use whenever someone works with ViewModel files, asks about UiState sealed classes, MutableStateFlow vs LiveData, collectAsStateWithLifecycle, viewModelScope, or exposing state from Android ViewModels — even indirectly. (triggers: **/*ViewModel.kt, **/*UiState.kt, viewmodel, stateflow, livedata, uistate, MutableStateFlow, collectAsState, viewModelScope, UiState)
android-security
Standards for Data Encryption, Network Security, and Permissions. Load whenever API keys, auth tokens, cleartext traffic, android:exported, EncryptedSharedPreferences, certificate pinning, or root detection come up — even if the user just asks 'is this secure'. (triggers: network_security_config.xml, AndroidManifest.xml, EncryptedSharedPreferences, cleartextTrafficPermitted, intent-filter, api key, token storage, certificate pinning, root detection, secure storage)