piyushverma0/android-agent-skills/datastore
Claude Code and agent skill by piyushverma0/android-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
DataStore (Preferences and Proto) for Android AI agents. Use this skill whenever storing user preferences, settings, small key-value data, replacing SharedPreferences, using DataStore Preferences, DataStore Proto, reading/writing Flow from DataStore, Hilt DataStore injection, migration from SharedPreferences, or any persistent lightweight data storage. Always apply when the task involves user settings, theme preferences, onboarding state, auth tokens (non-secure), feature flags, or any small persistent data that is not a database.
Install
npx vskill@latest install piyushverma0/android-agent-skills/datastoreSKILL.md
The same SKILL.md was published earlier as piyushverma0/android-agent-skills/datastore.
DataStore
DataStore is the modern replacement for SharedPreferences. Coroutine-based, type-safe, safe for Main thread.
Preferences DataStore — for simple key-value pairs
Proto DataStore — for complex structured data
ViewModel — read DataStore in ViewModel
Migration from SharedPreferences
Common Mistakes
❌ Using SharedPreferences — always use DataStore in new code ❌ Reading DataStore with .first() on Main thread — observe as Flow in ViewModel ❌ Creating multiple DataStore instances for same file — always @Singleton ❌ No corruption handler — add ReplaceFileCorruptionHandler { emptyPreferences() } ❌ Storing large data in DataStore — use Room for lists/complex objects ❌ Calling dataStore.edit {} from Main thread — always from a coroutine
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/datastore/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/piyushverma0/android-agent-skills/datastore)