android-local-persistence-datastore
Persist lightweight user and app preferences with DataStore, schema-safe models, and migration-aware defaults.
Works with
--- name: android-local-persistence-datastore description: Persist lightweight user and app preferences with DataStore, schema-safe models, and migration-aware defaults. license: MIT --- # Android Local Persistence DataStore ## When To Use - Use this skill when the request is about: android datastore setup, replace sharedpreferences android, typed local preferences android. - Primary outcome: Persist lightweight user and app preferences with DataStore, schema-safe models, and migration-aware defaults. - Handoff skills when the scope expands: - `android-room-database` - `android-modernization-upgrade` ## Workflow 1. Confirm the data source, persistence boundary, sync model, and device capability involved. 2. Model contracts explicitly before wiring network, storage, media, or background APIs. 3. Apply the recommended AndroidX or platform pattern with migration-safe defaults. 4. Validate offline, retry, and process death behavior against the sample apps and scenarios. 5. Escalate security, performance, or release risk to the linked supporting skills when needed. ## Guardrails - Prefer typed models and explicit serializers over ad-hoc maps or bundles. - Keep background work idempotent and cancellation-aware. - Do not leak storage, media, or networking details into presentation code. - Treat user data durability, privacy, and migration paths as part of the implementation. ## Anti-Patterns - Blocking the main thread with disk or network calls. - Treating retryable sync failures as terminal user-facing errors. - Mixing cache models and wire models without a mapping layer. - Requesting broad storage or notification capabilities when a narrower API exists. ## Examples ### Happy path - Scenario: Store reminder and filter preferences for OrbitTasks safely. - Command: `cd examples/orbittasks-compose && ./gradlew :app:testDebugUnitTest` ### Edge case - Scenario: Migrate old preference keys without breaking the XML fixture. - Command: `cd examples/orbittasks-xml && ./gradlew :app:testDebugUnitTest` ### Failure recovery - Scenario: Avoid mixing lightweight preference storage requests with Room persistence work. - Command: `python3 scripts/eval_triggers.py --skill android-local-persistence-datastore` ## Done Checklist - The implementation path is explicit, minimal, and tied to the right Android surface. - Relevant example commands and benchmark prompts have been exercised or updated. - Handoffs to adjacent skills are documented when the request crosses boundaries. - Official references cover the chosen pattern and the main migration or troubleshooting path. ## Official References - [https://developer.android.com/topic/libraries/architecture/datastore](https://developer.android.com/topic/libraries/architecture/datastore) - [https://developer.android.com/codelabs/android-preferences-datastore](https://developer.android.com/codelabs/android-preferences-datastore) - [https://developer.android.com/training/data-storage/shared-preferences](https://developer.android.com/training/data-storage/shared-preferences) - [https://developer.android.com/topic/libraries/architecture/datastore#proto-datastore](https://developer.android.com/topic/libraries/architecture/datastore#proto-datastore)
More Mobile skills
animation-vocabulary
emilkowalski/skills
Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.
cross-border-ecommerce
nexscope-ai/ecommerce-skills
Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.
developing-genkit-dart
firebase/agent-skills
Generates code and provides documentation for the Genkit Dart SDK. Use when the user asks to build AI agents in Dart, use Genkit flows, or integrate LLMs into Dart/Flutter applications.

