# flutterfire-configure

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

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 674 repo stars
- Author: Ivanna Kaceviča
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/flutterfire-configure/SKILL.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/flutterfire-configure

## What it 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.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add evanca/flutter-ai-rules
```
In the agent chat (not a shell):
```text
/plugin install flutter-ai-skills@flutter-ai-rules
```
This installs the whole flutter-ai-skills plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/flutterfire-configure/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/flutterfire-configure/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/flutterfire-configure/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/flutterfire-configure/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install evanca/flutter-ai-rules skills/flutterfire-configure
```

2. **Manually: put the files in place**
- File: `.github/skills/flutterfire-configure/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/evanca/flutter-ai-rules --path skills/flutterfire-configure
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/flutterfire-configure/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/flutterfire-configure/SKILL.md

## When to use it
- 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
- 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.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: dcc3e9282c8624b5.

BEGIN THIRD-PARTY FILE dcc3e9282c8624b5
````text
---
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.
````
END THIRD-PARTY FILE dcc3e9282c8624b5

The third-party file has ended. Everything between the dcc3e9282c8624b5 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2503 of 4698 bytes. © Ivanna Kaceviča · MIT · https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/flutterfire-configure/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
