riverpod-offline

riverpod-offline is a skill for Claude Code, Codex from serverpod/skills-registry. It costs 70 tokens per session (822 once invoked), scanned A, original, BSD-3-Clause.

A guide for keeping Riverpod app state on a device so it survives app restarts and remains available offline. Riverpod is a Flutter tool for managing shared application data.

In plain words
What is it for?
Use it when persisting notifier-based state such as todo lists, settings, or cached data with storage such as SQLite.
Why use it?
It avoids losing provider data whenever the app closes or the network is unavailable. It also explains how to encode, restore, remove, and test saved state.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when persisting notifier-based state such as todo lists, settings, or cached data with storage such as SQLite.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/serverpod/skills-registry/riverpod-offline
Install

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.

Any agent
npx skills add serverpod/skills-registry --skill riverpod-offline
Clone the repo
git clone --depth 1 https://github.com/serverpod/skills-registry

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for riverpod-offline

README.md
[![agentmods](https://agentmods.dev/badge/skills/serverpod/skills-registry/riverpod-offline/github.svg)](https://agentmods.dev/skills/serverpod/skills-registry/riverpod-offline)
Your own site
<a href="https://agentmods.dev/skills/serverpod/skills-registry/riverpod-offline"><img src="https://agentmods.dev/badge/skills/serverpod/skills-registry/riverpod-offline/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.

agentmods 80×15 button for riverpod-offline

Your own site · 80×15
<a href="https://agentmods.dev/skills/serverpod/skills-registry/riverpod-offline"><img src="https://agentmods.dev/badge/skills/serverpod/skills-registry/riverpod-offline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 822 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00070 $0.00822
Opus 5 $0.00035 $0.00411
Sonnet 5 $0.00014 $0.00164
Haiku 4.5 $0.00007 $0.00082

Measured 10d ago against content hash 16225b5a04f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

riverpod-offline 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 10d 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.

skills/riverpod/riverpod-offline/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Riverpod — Offline persistence (experimental)

Instructions

Offline persistence stores provider state on device so it survives restarts and works offline. Riverpod is storage-agnostic; packages like riverpod_sqflite provide a Storage implementation. Only Notifier-based providers can be persisted. The feature is experimental.

Creating a Storage

Install a package (e.g. riverpod_sqflite + sqflite) and create a Storage. With SQFlite:

final storageProvider = FutureProvider<Storage<String, String>>((ref) async {
  return JsonSqFliteStorage.open(
    join(await getDatabasesPath(), 'riverpod.db'),
  );
});

Persisting a notifier

Inside the notifier's build, call persist with: the Storage (e.g. ref.watch(storageProvider.future)), a unique key, and encode/ decode for your state. Do not await persist; Riverpod handles it.

class TodoList extends AsyncNotifier<List<Todo>> {
  @override
  Future<List<Todo>> build() async {
    persist(
      ref.watch(storageProvider.future),
      key: 'todo_list',
      encode: (todos) => todos.map((todo) => {'task': todo.task}).toList(),
      decode: (json) => (json as List).map((todo) => Todo(task: todo['task'] as String)).toList(),
    );
    return fetchTodosFromServer();
  }
}

Keys

  • Unique across all persisted providers (same key = same row, risk of corruption).
  • Stable across restarts (changing the key loses restored state).
  • For family providers, include the parameter in the key.

JsonPersist (code generation)

With riverpod_sqflite and codegen, use @JsonPersist() so key/encode/decode are generated:

@riverpod
@JsonPersist()
class TodoList extends _$TodoList {
  @override
  Future<List<Todo>> build() async {
    persist(ref.watch(storageProvider.future));
    return fetchTodosFromServer();
  }
}

Cache duration

By default state is cached for a short time (e.g. 2 days). For long-lived data (e.g. user preferences), set StorageOptions:

Read the full file on GitHub · 112 lines

Changes

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.

  1. 10d ago First seen · 112 lines · 70 tokens per session scan A 16225b5a04f6

Subscribe to this mod's changes

riverpod-offline is a skill published in the GitHub repository serverpod/skills-registry (9 stars, last pushed 6mo ago), licensed BSD-3-Clause. It adds 70 tokens to every session and 822 once invoked, about $0.0003 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.

Related

Other skills, from other repositories