firebase-ai
Use when setting up firebase_ai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.
Install / Use
npx skills add evanca/flutter-ai-rules --skill firebase-aiInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of firebase-ai
firebase-ai scores 87/100 on our quality scale, 1743rd of 4,634 Development & Engineering skills we index (top 38%).
Its SKILL.md is 4.5 KB long, well organised into 11 sections with 8 code examples: a solid amount of guidance for an agent.
It has 646 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 19 days ago, so firebase-ai is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
firebase-ai compared with similar skills
All 4 of these similar skills score higher than firebase-ai; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| firebase-ai (this skill)by evanca | 87 | 646 | 19d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.9k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 3d ago | CLAUDE.md |
| LocalAIby mudler | 100 | 49.4k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
Frequently asked questions
- How do I install firebase-ai?
- Run
npx skills add evanca/flutter-ai-rules --skill firebase-ai. The install tabs above show the steps for each supported agent. - Which AI agents does firebase-ai work with?
- It is written for Gemini CLI, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is firebase-ai safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is firebase-ai still maintained?
- The repository was last updated 19 days ago, so firebase-ai is actively maintained.
Skill content
View source on GitHubname: firebase-ai description: "Use when setting up firebase_ai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors." license: MIT
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);
Streaming responses
Use streaming to display partial results as they arrive:
final stream = model.generateContentStream([
Content.text('Write a step-by-step guide to implementing dark mode in Flutter'),
]);
await for (final chunk in stream) {
// Append chunk.text to the UI progressively
setState(() => _output += chunk.text ?? '');
}
Multimodal prompts (text + image)
final imageBytes = await File('photo.jpg').readAsBytes();
final response = await model.generateContent([
Content.multi([
TextPart('Describe what you see in this image'),
InlineDataPart('image/jpeg', imageBytes),
]),
]);
3. Error Handling
Wrap AI calls in structured error handling:
try {
final response = await model.generateContent([Content.text(prompt)]);
return response.text;
} on FirebaseAIException catch (e) {
if (e.message?.contains('quota') ?? false) {
// Handle rate limiting — show retry message or queue the request
return 'Service is busy. Please try again shortly.';
}
return 'AI service error: ${e.message}';
} catch (e) {
return 'Unexpected error: $e';
}
- Provide meaningful error messages to users when AI operations fail.
- Handle offline scenarios with appropriate fallback behavior (e.g., cached responses).
- Implement exponential backoff for rate-limited or transient errors.
4. Security and Privacy
- Follow Firebase Security Rules best practices when using AI services alongside other Firebase products.
- Ensure proper authentication and authorization for AI feature access.
- Sanitize user input before sending it to the model to prevent prompt injection.
- Be mindful of data privacy requirements when processing user content with AI services.
- Implement appropriate content filtering and moderation using safety settings:
final model = FirebaseAI.googleAI().generativeModel(
model: 'gemini-2.5-flash',
safetySettings: [
SafetySetting(HarmCategory.harassment, HarmBlockThreshold.medium),
SafetySetting(HarmCategory.dangerousContent, HarmBlockThreshold.high),
],
);
References
Related Skills
ai-job-search
44.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
LocalAI
49.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
