firebase-database

firebase-database is a skill for Claude Code from evanca/flutter-ai-rules. It costs 38 tokens per session (1,842 once invoked), scanned A, original, MIT.

A guide for using Firebase Realtime Database in Flutter apps. Firebase Realtime Database is a cloud database that synchronizes simple data changes quickly between an app and its users.

In plain words
What is it for?
Use it to add real-time synchronization, presence features such as online status, offline persistence, listeners, queries, data sharding, and database security rules to a Flutter app.
Why use it?
It helps choose this database for simple, frequently changing data and explains how to structure data, read and write it, keep it available offline, and control access. It also identifies when Cloud Firestore may be a better fit for richer queries and larger systems.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter-ai-skills plugin — 36 skills shipped together

Good fit Use it to add real-time synchronization, presence features such as online status, offline persistence, listeners, queries, data sharding, and database security rules to a Flutter app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/evanca/flutter-ai-rules/firebase-database
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 evanca/flutter-ai-rules --skill firebase-database
Clone the repo
git clone --depth 1 https://github.com/evanca/flutter-ai-rules

Made for: Claude Code.

Or install flutter-ai-skills, the plugin that ships this one along with the rest of its 36 skills.

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 firebase-database

README.md
[![agentmods](https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/firebase-database/github.svg)](https://agentmods.dev/skills/evanca/flutter-ai-rules/firebase-database)
Your own site
<a href="https://agentmods.dev/skills/evanca/flutter-ai-rules/firebase-database"><img src="https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/firebase-database/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 firebase-database

Your own site · 80×15
<a href="https://agentmods.dev/skills/evanca/flutter-ai-rules/firebase-database"><img src="https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/firebase-database.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,842 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00038 $0.01842
Opus 5.5 $0.00015 $0.00737
Sonnet 5.5 $0.00008 $0.00368
Haiku 4.5 $0.00004 $0.00184

Measured 1mo ago against content hash 039a244fd557, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

firebase-database 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 1mo 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/firebase-database/SKILL.md · 293 lines

How it starts

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

Firebase Realtime Database Skill

This skill defines how to correctly implement Firebase Realtime Database in Flutter applications, covering data modeling, queries, real-time sync, offline support, and security rules.

When to Use

Use this skill when working with Firebase Realtime Database for simple data models, low-latency sync, or presence functionality. For rich data models requiring complex queries and high scalability, use Cloud Firestore instead.


1. Database Selection

Choose Realtime Database when the app needs:

  • Simple data models with simple lookups.
  • Extremely low-latency synchronization (typical response times under 10ms).
  • Deep queries that return an entire subtree by default.
  • Access to data at any granularity, down to individual leaf-node values.
  • Frequent state-syncing with built-in presence functionality.

Choose Cloud Firestore instead for rich data models requiring queryability, scalability, and high availability.


2. Setup and Configuration

flutter pub add firebase_database
import 'package:firebase_database/firebase_database.dart';

// After Firebase.initializeApp():
final DatabaseReference ref = FirebaseDatabase.instance.ref();
  • Select the database location closest to users.
  • Enable persistence for offline capabilities:
FirebaseDatabase.instance.setPersistenceEnabled(true);
FirebaseDatabase.instance.setPersistenceCacheSizeBytes(10000000); // 10MB

Setup Checklist

  1. Confirm Firebase.initializeApp() completes before accessing FirebaseDatabase.instance.
  2. Set persistence before any read/write operations.
  3. Verify connectivity by writing a test value and reading it back.

3. Data Structure

  • Structure data as a flattened JSON tree — avoid deep nesting.
  • Maximum nesting depth is 32 levels.
  • Design the data structure to support the most common queries.
  • Use push IDs for unique identifiers in list-type data:
final newPostKey = FirebaseDatabase.instance.ref().child('posts').push().key;

Read the full file on GitHub · 293 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. 1mo ago First seen · 293 lines · 38 tokens per session scan A 039a244fd557

Subscribe to this mod's changes

firebase-database is a skill published in the GitHub repository evanca/flutter-ai-rules (652 stars, last pushed 7d ago), licensed MIT. It adds 38 tokens to every session and 1,842 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

dart-expert

Expert-level Dart, Flutter, mobile development, and cross-platform apps. Use when the user mentions Flutter, mobile, cross platform, or widgets, or when the task involves Dart Language or Flutter Framework.

personamanagmentlayer/pcl · 44 tokens

flutter-sdk-changelog

Authoritative guide for Flutter framework APIs, widget lifecycle deprecations, design package unbundling, and version changelogs from Flutter 1.0 through Flutter 3.x+. Use this skill whenever authoring Flutter widgets, inspecting flutter sdk constraints, handling deprecated widgets (WillPopScope, withOpacity…

RandalSchwartz/dart-sdk-skills · 103 tokens

persisting-data-with-drift

Implements type-safe reactive SQL persistence in Flutter using Drift v2.32 (formerly Moor) built on SQLite with automatic code generation. Activates when defining table schemas with Drift DSL, writing type-safe join or subquery operations, handling schema migrations with MigrationStrategy, using reactive watch()…

Poorgramer-Zack/dart-expert-skills · 136 tokens

managing-hive-storage

Hive CE (Community Edition v2.19.x) NoSQL object database for Flutter providing blazing-fast key-value and object storage with TypeAdapters. Use this skill when implementing offline-first architecture, high-performance local data caching, NoSQL document-style object stores, custom TypeAdapter serialization for complex…

Poorgramer-Zack/dart-expert-skills · 146 tokens

Flutter Testing Patterns

Flutter app testing with widget tests, integration tests, golden tests, Mockito, bloc testing, and Flutter Driver for end-to-end scenarios.

PramodDutta/qaskills · 31 tokens

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…

MADTeacher/mad-agents-skills · 111 tokens