Skip to main content
skill CX Codex

flutterfire-configure — Claude Code skill: setup and features

Guides Firebase integration in Flutter apps, runs flutterfire configure, and structures multi-flavor project environments.

MIT ★ 674 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules
Open on GitHub

What flutterfire-configure does

This skill directs the coding agent through linking Firebase to a Flutter project. It specifies how to execute flutterfire configure, add firebase_core, and sequence initialization in main.dart so WidgetsFlutterBinding.ensureInitialized() runs ahead of Firebase.initializeApp().

The skill provides patterns for managing distinct environments like dev, stg, and prod. It guides the CLI to write dedicated option files using flags such as --project and --out, assembling them into the codebase via namespace imports and runtime selection with appFlavor.

Setup will fail unless firebase-tools and flutterfire_cli are installed and authenticated on your workstation beforehand. Projects must target at least Android API level 19 and iOS 11.

What it helps with

  • connect Firebase to a Flutter codebase using flutterfire configure
  • initialize Firebase in main.dart with necessary binding checks
  • isolate Firebase configurations across dev, staging, and prod flavors
  • generate platform files like firebase_options.dart without manual editing

Example prompts for the agent

  • Configure Firebase for this Flutter app and add initialization to main.dart.
  • Set up separate Firebase configs for dev, staging, and prod flavors.
  • Update firebase_options.dart after adding Crashlytics plugins.

How to install flutterfire-configure

1Plugin marketplace

/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules

This installs the whole flutter-ai-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -a claude-code

3Manually: put the files in place

~/.claude/skills/flutterfire-configure/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/flutterfire-configure/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about flutterfire-configure

How to install flutterfire-configure in Claude Code?

Add the marketplace source with /plugin marketplace add evanca/flutter-ai-rules and then run /plugin install flutter-ai-skills@flutter-ai-rules.

What does flutterfire-configure do?

It gives your AI assistant clear guidelines for connecting Firebase services to Flutter, maintaining firebase_options.dart, and handling multi-flavor projects.

What prerequisites are needed before using this skill?

You need global installations of firebase-tools and flutterfire_cli, with active login credentials. The Flutter app must target Android API level 19 or iOS 11 at minimum.

Source text

SKILL.md · MIT
---
name: flutterfire-configure
description: "Use when adding Firebase to a Flutter project, running flutterfire configure, initializing Firebase in main.dart, or configuring multiple flavors."
license: MIT
---

# FlutterFire Configure Skill

This skill defines how to correctly set up and configure Firebase for Flutter applications.

## When to Use

Use this skill when:

* Adding Firebase to a Flutter project for the first time.
* Running `flutterfire configure` after adding a new Firebase service or platform.
* Initializing Firebase in `main.dart`.
* Setting up separate Firebase projects for multiple app flavors.

---

## 1. Prerequisites

Install the required tools:

```bash
npm install -g firebase-tools
firebase login
dart pub global activate flutterfire_cli
```

**Minimum platform requirements:**
- Android: API level 19 (KitKat) or higher
- Apple: iOS 11 or higher

---

## 2. Setup and Configuration

```bash
# From your Flutter project directory:
flutterfire configure

# Add the core Firebase package:
flutter pub add firebase_core
```

- Re-run `flutterfire configure` any time you **add support for a new platform** or **start using a new Firebase service**.
- For Android-specific services (Crashlytics, Performance Monitoring), the FlutterFire CLI automatically adds the required Gradle plugins.
- Rebuild with `flutter run` after adding new Firebase plugins.

---

## 3. Firebase Initialization

```dart
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  runApp(const MyApp());
}
```

- Call `WidgetsFlutterBinding.ensureInitialized()` **before** Firebase initialization.
- Place Firebase initialization **before** any other Firebase service calls.
- **Never modify** `firebase_options.dart` manually — it is auto-generated.
- **Commit** `firebase_options.dart` to version control — it contains non-secret configuration identifiers.
- For Firebase Emulator Suite: `await Firebase.initializeApp(demoProjectId: "demo-project-id")`.

---

## 4. Verification and Best Practices

After configuration, verify the setup is working:

1. Run `flutter run` and confirm the app launches without Firebase initialization errors.
2. Check the debug console for `Firebase initialized successfully` or similar confirmation.
3. Verify `firebase_options.dart` was generated with the correct project ID.

- Enable **Firebase Analytics** for optimal experience with Crashlytics, Remote Config, and other products.
- Use a **consistent Firebase project** across all platforms for data consistency.
- For iOS/macOS apps using certain Firebase services, add the **Keychain Sharing** capability in Xcode.
- Test the Firebase configuration with **both debug and release** builds.
- Check **version compatibility** between Flutter plugins and the underlying Firebase SDK.

---

## 5. Multiple App Flavors

Create separate Firebase projects per environment (development, staging, production):

```bash
flutterfire config \
  --project=flutter-app-dev \
  --out=lib/firebase_options_dev.dart \
  --ios-bundle-id=com.example.flutterApp.dev \
  --ios-out=ios/flavors/dev/GoogleService-Info.plist \
  --android-package-name=com.example.flutter_app.dev \
  --android-out=android/app/src/dev/google-services.json
```

**Centralize Firebase initialization by flavor:**

```dart
// firebase.dart
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/firebase_options_prod.dart' as prod;
import 'package:flutter_app/firebase_options_stg.dart' as stg;
import 'package:flutter_app/firebase_options_dev.dart' as dev;

Future<void> initializeFirebaseApp() async {
  final firebaseOptions = switch (appFlavor) {
    'prod' => prod.DefaultFirebaseOptions.currentPlatform,
    'stg' => stg.DefaultFirebaseOptions.currentPlatform,
    'dev' => dev.DefaultFirebaseOptions.currentPlatform,
    _ => throw UnsupportedError('Invalid flavor: $appFlavor'),
  };
  await Firebase.initializeApp(options: firebaseOptions);
}
```

```dart
// main.dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initializeFirebaseApp();
  runApp(const MainApp());
}
```

- Use `appFlavor` or environment variables to select the configuration at runtime.
- Import each flavor's config with **namespace aliases** (e.g., `as dev`).
- Use a helper script to automate multi-flavor configuration.

---

## References

- [Add Firebase to your Flutter app](https://firebase.google.com/docs/flutter/setup)
- [FlutterFire CLI](https://firebase.flutter.dev/docs/cli)

© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules

Similar skills

All skills for Mobile →

From the same set39

The whole set →
firebase-remote-config A Flutter skill that keeps the agent on track with Firebase Remote Config: feature flags, in-app defaults, A/B tests and live config updates. CX Codex +1 ★ 674repo stars firebase-cloud-functions Guides your coding agent on calling Firebase Cloud Functions in Flutter with error handling, region configs, and local emulator support. CX Codex +1 ★ 674repo stars testing The testing skill guides Flutter and Dart test writing and review, helps investigate flaky tests, and clarifies when to use unit or widget tests. CX Codex +1 ★ 674repo stars firebase-ai This skill gives the agent working patterns for wiring up Firebase AI Logic in a Flutter app and writing Gemini text and chat calls. CX Codex +1 ★ 674repo stars flutter-use-column-row-first The flutter-use-column-row-first skill guides Flutter screen layouts with Row, Column, and flexible space. Use it when building a screen that must adapt to different constraints. CX Codex +1 ★ 674repo stars firebase-crashlytics Skill teaches the agent to set up Firebase Crashlytics in Flutter projects: catch fatal and non-fatal errors, log async exceptions, add custom keys, and upload obfuscated build symbols. CX Codex +1 ★ 674repo stars firebase-in-app-messaging Guides Firebase In-App Messaging setup in Flutter: trigger and suppress popups during sensitive flows, configure GDPR opt-in collection, and run tests via test device IDs. CX Codex +1 ★ 674repo stars firebase-analytics firebase-analytics is a Claude Code skill for configuring Firebase Analytics in Flutter apps. It activates for event logging, user properties, funnels, and screen-view tracking. CX Codex +1 ★ 674repo stars

Project sponsors

Companies that keep this analytics open