Back to skills
SKILL.md
Android Persistence
ASecurityStandards for Room Database and DataStore
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added September 27, 2026
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add David-Li0406/meta-skill-evloving --skill android-persistence --agent claude-codeAre you the author of Android Persistence?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/david-li0406-android-persistence)---
name: Android Persistence
description: Standards for Room Database and DataStore
metadata:
labels: [android, persistence, room, database]
triggers:
files: ['**/*Dao.kt', '**/*Database.kt', '**/*Entity.kt']
keywords: ['@Dao', '@Entity', 'RoomDatabase']
---
# 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
- **Main Thread**: `**No IO on Main**: Use Dispatchers.IO (Room helper does this, but verify flow collection).`
- **Domain Leak**: `**No Entities in UI**: Map to Domain/UI Models.`
## References
- [DAO Templates](references/implementation.md)
Files in this skill
- SKILL.md
- references/implementation.md
Attribution
Comments
Loading comments…