firebase-ai

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

Instructions for adding Firebase AI features to Flutter apps, including text and chat generation with Gemini models. Gemini is Google's generative AI system, and the guidance also covers image-and-text prompts and streamed responses.

In plain words
What is it for?
Use it to configure Firebase AI, generate text or chat replies, stream output into an interface, send prompts containing images, and handle AI errors.
Why use it?
It gives developers a defined setup for connecting a Flutter app to Firebase AI services and handling common failures such as offline use or rate limits. It also covers basic privacy and security considerations.

Skill for Claude CodeCodex

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

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.

agentmods
npx agentmods add skills/evanca/flutter-ai-rules/firebase-ai
Any agent
npx skills add evanca/flutter-ai-rules --skill firebase-ai
Clone the repo
git clone --depth 1 https://github.com/evanca/flutter-ai-rules

Made for: Claude Code, Codex.

Or install flutter-ai-skills, the plugin that ships this one along with the rest of its 37 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-ai

README.md
[![agentmods](https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/firebase-ai.svg)](https://agentmods.dev/skills/evanca/flutter-ai-rules/firebase-ai)
Your own site
<a href="https://agentmods.dev/skills/evanca/flutter-ai-rules/firebase-ai"><img src="https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/firebase-ai.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 986 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00030 $0.00986
Opus 5 $0.00015 $0.00493
Sonnet 5 $0.00006 $0.00197
Haiku 4.5 $0.00003 $0.00099

Measured 5d ago against content hash 379b72699830, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

firebase-ai 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 5d 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-ai/SKILL.md · 166 lines

How it starts

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

Firebase AI Skill

This skill defines how to correctly use Firebase AI Logic in Flutter applications.

When to Use

Use this skill when:

  • Setting up and configuring Firebase AI in a Flutter project.
  • Generating text content or chat responses with Gemini models.
  • Implementing streaming AI responses for real-time UI updates.
  • Sending multimodal prompts (text + images) to Gemini.
  • Handling errors, offline scenarios, and rate limits for AI operations.
  • Applying security and privacy considerations for AI features.

1. Setup and Configuration

flutter pub add firebase_ai
import 'package:firebase_ai/firebase_ai.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';

// Initialize FirebaseApp
await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);

// Initialize the Gemini Developer API backend service
final model =
    FirebaseAI.googleAI().generativeModel(model: 'gemini-2.5-flash');
  • Ensure the Firebase project is configured for AI services via the Firebase AI Logic page in the Firebase Console.
  • Initialize Firebase before using any Firebase AI features.
  • Use FirebaseAI.googleAI() for the Gemini Developer API backend (recommended starting point).
  • Implement App Check to prevent abuse of Firebase AI endpoints.

Platform support:

Platform Support
iOS Full
Android Full
Web Full
macOS / other Apple Beta
Windows Not supported

2. Generating Content

Single-turn text generation

final response = await model.generateContent([
  Content.text('Summarize the benefits of Flutter for mobile development'),
]);
final text = response.text; // The generated summary string

Multi-turn chat

final chat = model.startChat();
final response = await chat.sendMessage(
  Content.text('What is the difference between StatelessWidget and StatefulWidget?'),
);
print(response.text);

// Follow-up in the same conversation
final followUp = await chat.sendMessage(
  Content.text('When should I use StatefulWidget?'),
);
print(followUp.text);

Read the full file on GitHub · 166 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. 5d ago First seen · 166 lines · 30 tokens per session scan A 379b72699830

Subscribe to this mod's changes

firebase-ai is a skill published in the GitHub repository evanca/flutter-ai-rules (632 stars, last pushed 5d ago), licensed MIT. It adds 30 tokens to every session and 986 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-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

Expert guide and lookup reference for Flutter framework versions, widget deprecations, API replacements, Material 3 migrations, and the unbundling of standalone materialui and cupertinoui packages from Flutter 1.0 to modern Flutter (3.44+ / 3.47+). Use this skill whenever the user asks "what's new in Flutter X"…

RandalSchwartz/dart-sdk-skills · 186 tokens

standalone-python-scripts

Skill "standalone-python-scripts" from iloveitaly/llm-ide-rules, covering standalone python scripts, /// script, requires-python = ">=3.13", dependencies = [] and ///.

iloveitaly/llm-ide-rules · 9 tokens

audit-langfuse-llm

Run a PDCA quality audit on LLM/AI features: traces, prompts, costs, evals, grounding, hallucination. Use for "audit LLM quality", "check Langfuse", "audit prompts", "check AI quality", "audit AI costs", "check traces". Jailbreak/OWASP LLM → audit-llm-security. Token caps → plan-llm-cost-guardrails.

kensaurus/cursor-kenji · 93 tokens

Prompt Refiner

Improves AI prompts to be clearer, more specific, and produce more consistent outputs.

Notysoty/openagentskills · 21 tokens

generating-freezed-models

Generates immutable Dart data classes, sealed union types, and deep copyWith using Freezed (v3.2.x) with optional jsonserializable integration. Use when creating DTOs, API response models, app state classes, or any model requiring immutability, pattern matching, or JSON serialization. Activates on: @freezed…

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