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 skills add piyushverma0/android-agent-skills --skill offline-firstgit clone --depth 1 https://github.com/piyushverma0/android-agent-skillsWrote 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/piyushverma0/android-agent-skills/offline-first)<a href="https://agentmods.dev/skills/piyushverma0/android-agent-skills/offline-first"><img src="https://agentmods.dev/badge/skills/piyushverma0/android-agent-skills/offline-first/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/piyushverma0/android-agent-skills/offline-first"><img src="https://agentmods.dev/badge/skills/piyushverma0/android-agent-skills/offline-first.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00113 | $0.02019 |
| Opus 5.5 | $0.00045 | $0.00808 |
| Sonnet 5.5 | $0.00023 | $0.00404 |
| Haiku 4.5 | $0.00011 | $0.00202 |
Grade A, and why
offline-first 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 3mo 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 — 278 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Offline-First Architecture
Apps that require internet to work lose 30%+ of users. These patterns make your app work everywhere — with or without connectivity.
Core principle: Local DB is source of truth
User Action → ViewModel → Repository
↓
Local DB (Room) ← single source of truth
↓
UI observes Flow from Room
↓ (background)
Network sync → update Local DB → UI auto-updates
Rule 1: Single-direction data flow — never mix local + remote in UI
// ✅ Repository: local DB is source of truth, network updates DB silently
class ItemRepositoryImpl @Inject constructor(
private val itemDao: ItemDao,
private val api: ItemApiService,
@IoDispatcher private val dispatcher: CoroutineDispatcher
) : ItemRepository {
// UI always observes local DB
override fun getItemsStream(): Flow<List<Item>> =
itemDao.getAll().map { it.map { entity -> entity.toDomain() } }
// Sync pulls from network and updates local DB
override suspend fun sync(): Result<Unit> = withContext(dispatcher) {
runCatching {
val remoteItems = api.getItems()
itemDao.upsertAll(remoteItems.map { it.toEntity() })
}
}
}
// ✅ ViewModel triggers sync but observes local DB
@HiltViewModel
class HomeViewModel @Inject constructor(
private val repository: ItemRepository
) : ViewModel() {
val items: StateFlow<List<Item>> = repository.getItemsStream()
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), emptyList())
init { sync() }
fun sync() {
viewModelScope.launch {
repository.sync() // updates DB → Flow auto-updates UI
}
}
}
Rule 2: Optimistic UI updates
// ✅ Apply change locally immediately, sync to server in background
override suspend fun toggleFavorite(itemId: String): Result<Unit> = withContext(dispatcher) {
// 1. Update local DB immediately (UI updates instantly)
val item = itemDao.getByIdOnce(itemId) ?: return@withContext Result.failure(NotFoundException())
val newValue = !item.isFavorite
itemDao.updateFavorite(itemId, newValue)
// 2. Sync to server in background
runCatching {
api.patchItem(itemId, mapOf("is_favorite" to newValue))
}.onFailure {
// 3. Rollback local change if server fails
itemDao.updateFavorite(itemId, !newValue)
}
}
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.
- 3mo ago First seen · 278 lines · 113 tokens per session scan A 859d3bf65877
offline-first is a skill published in the GitHub repository piyushverma0/android-agent-skills (15 stars, last pushed 7mo ago), licensed MIT. It adds 113 tokens to every session and 2,019 once invoked, about $0.0005 per session on Opus 5.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-30.
offline-first compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| offline-firstpiyushverma0/android-agent-skills | Skill | 15 | 7mo ago | MIT | A | 113 | Claude Code, Codex |
| android-ui-journey-testingsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 27 | Claude Code |
| Debroid CLI DebuggerPatilShreyas/debroid | Skill | 280 | 21d ago | Apache-2.0 | A | 61 | Claude Code, Codex |
| kotlin-coroutines-expertrabee-elkholy/android-harness-kit | Skill | 3 | 3mo ago | MIT | A | 30 | Claude Code, Codex |
| compose-inspectorrabee-elkholy/android-harness-kit | Skill | 3 | 3mo ago | MIT | A | 39 | Claude Code, Codex |
| gradle-build-optimizerrabee-elkholy/android-harness-kit | Skill | 3 | 3mo ago | MIT | A | 32 | Claude Code, Codex |
| android-harnessrabee-elkholy/android-harness-kit | Skill | 3 | 3mo ago | MIT | A | 27 | Claude Code, Codex |