Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/guillemroca/agent-skills-android/android-data-persistencenpx skills add GuillemRoca/agent-skills-android --skill android-data-persistencegit clone --depth 1 https://github.com/GuillemRoca/agent-skills-androidWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/guillemroca/agent-skills-android/android-data-persistence)<a href="https://agentmods.dev/skills/guillemroca/agent-skills-android/android-data-persistence"><img src="https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/android-data-persistence.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00041 | $0.02464 |
| Opus 5 | $0.00020 | $0.01232 |
| Sonnet 5 | $0.00008 | $0.00493 |
| Haiku 4.5 | $0.00004 | $0.00246 |
Grade A, and why
android-data-persistence scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 366 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Android Data Persistence
Overview
Reliable data persistence is critical for Android apps. This skill covers Room (SQLite abstraction), DataStore (key-value and proto), offline-first architecture, Paging3 for large datasets, and the repository pattern that abstracts data sources from the rest of the app.
When to Use
- Setting up or modifying a Room database
- Writing database migrations
- Implementing offline-first data access
- Adding pagination for large datasets
- Choosing between Room, DataStore, and SharedPreferences
- Implementing the repository pattern
Skip when: Data is purely in-memory or comes only from a remote API with no caching.
Data Storage Decision Guide
| Requirement | Solution |
|---|---|
| Structured data with relations | Room |
| User preferences (key-value) | DataStore (Preferences) |
| Typed settings with schema | DataStore (Proto) |
| Large datasets with pagination | Room + Paging3 |
| Simple flags or tokens | DataStore (Preferences) |
| Never use | SharedPreferences (for new code) |
Core Process
Step 1: Room Setup
- Define entities:
@Entity(
tableName = "tasks",
indices = [Index(value = ["created_at"])],
)
data class TaskEntity(
@PrimaryKey
val id: String,
@ColumnInfo(name = "title")
val title: String,
@ColumnInfo(name = "description")
val description: String?,
@ColumnInfo(name = "completed")
val completed: Boolean = false,
@ColumnInfo(name = "created_at")
val createdAt: Long = System.currentTimeMillis(),
@ColumnInfo(name = "updated_at")
val updatedAt: Long = System.currentTimeMillis(),
)
- Define DAOs:
@Dao
interface TaskDao {
@Query("SELECT * FROM tasks ORDER BY created_at DESC")
fun observeAll(): Flow<List<TaskEntity>>
@Query("SELECT * FROM tasks WHERE id = :taskId")
suspend fun getById(taskId: String): TaskEntity?
@Query("SELECT * FROM tasks WHERE completed = :completed ORDER BY created_at DESC")
fun observeByStatus(completed: Boolean): Flow<List<TaskEntity>>
@Upsert
suspend fun upsert(task: TaskEntity)
@Upsert
suspend fun upsertAll(tasks: List<TaskEntity>)
@Query("DELETE FROM tasks WHERE id = :taskId")
suspend fun deleteById(taskId: String)
@Query("DELETE FROM tasks WHERE completed = 1")
suspend fun deleteCompleted()
@Transaction
suspend fun replaceAll(tasks: List<TaskEntity>) {
deleteAll()
upsertAll(tasks)
}
@Query("DELETE FROM tasks")
suspend fun deleteAll()
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 366 lines · 41 tokens per session scan A 4914ec3091a1
android-data-persistence is a skill published in the GitHub repository GuillemRoca/agent-skills-android (2 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 2,464 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
engineering-backend-architect
Design backend system architecture for new products, large features, platform refactors, API and database design, microservices decomposition, event-driven systems, scaling, reliability, observability, and cloud deployment.
monorepo-sync-types
Regenerate backend types and re-export them via packages/shared/types/ in a turborepo monorepo so both apps/web/ and apps/mobile/ consume a single typed surface. Supports Supabase (via supabase gen types typescript), neon-drizzle (via drizzle-kit introspect/pull + InferSelectModel/InferInsertModel re-exports — the…
offline-first-expert
Expert guidance for offline-first KMP and Android architectures using Store5, Room, SQLDelight, Ktor. Always trigger this skill when designing repositories, databases, caching, offline sync, Fetchers, SourceOfTruth, Updaters, Bookkeepers.
flutter-drift
Implement, fix, review, migrate, test, or debug Drift persistence in Flutter apps using SQLite, driftflutter, type-safe Dart queries, generated tables, StreamBuilder or Riverpod StreamProvider UI, write operations, transactions, schema migrations, web assets, isolate sharing, and local database testing. Use when a…
rubber-duck
Invoke a Rubber Duck Reviewer subagent to independently critique plans and implementations before proceeding. Use when the agent is about to implement a non-trivial plan (multi-file changes, architectural decisions, security-sensitive logic, database schema changes), after completing a self-contained unit of work…
claude-android-ninja
Use when building Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), and multi-module architecture. Triggers on requests to create Android projects, modules, screens, ViewModels, repositories, or Android architecture questions. Not for iOS, Flutter, React Native…