flutter-firebase-core-engineering
Skill8 starsChanged 48 days agoMITView on GitHub
Design, implement, review, debug, secure, test, migrate, and optimize Firebase Core foundations in Flutter applications. Use when a task involves firebase_core, Firebase.initializeApp, FirebaseApp/FirebaseOptions, Firebase.app or Firebase.apps, the default or secondary Firebase app, flutterfire configure/reconfigure, generated firebase_options.dart, google-services.json, GoogleService-Info.plist, Web Firebase options, dev/staging/production projects, flavors/build configurations, wrong-project or core/no-app/core/not-initialized/core/duplicate-app failures, Firebase startup ownership/performance, background entry-point initialization, emulator bootstrap, or migration of old FlutterFire setup. Do not use for product-specific Auth, Firestore, Messaging, Analytics, Crashlytics, Storage, Functions, Remote Config, or Performance behavior beyond their dependency on Core.
In this repository70 other files it gives its agents.
- camerawesome-flutterSkill
- dart-args-production-cliSkill
- dart-flutter-equatable-engineeringSkill
- dart-flutter-ffi-systems-engineeringSkill
- dart-metaSkill
- document-camera-frameSkill
- document-scan-flutterSkill
- figma-to-flutter-expertSkill
- flutter-animations-production-engineeringSkill
- flutter-app-hardening-reverse-engineeringSkill
- flutter-app-icon-engineeringSkill
- flutter-application-security-engineeringSkill
- flutter-app-links-deep-link-engineeringSkill
- flutter-cachingSkill
- flutter-concurrency-memory-performanceSkill
- flutter-confetti-engineeringSkill
- flutter-dart-package-engineeringSkill
- flutter-design-system-from-design-mdSkill
- flutter-dio-cache-interceptor-engineeringSkill
- flutter-dio-engineeringSkill
- flutter-doc-scannerSkill
- flutter-drift-persistence-engineeringSkill
- flutter-expert-tipsSkill
- flutter-firebase-analyticsSkill
- flutter-firebase-messagingSkill
- flutter-get-it-injectable-dependency-injectionSkill
- flutter-go-router-engineeringSkill
- flutter-hive-persistence-engineeringSkill
- flutter-image-performanceSkill
- flutter-image-picker-production-engineeringSkill
- flutter-lints-static-analysis-engineeringSkill
- flutter-local-notifications-production-engineeringSkill
- flutter-memory-leak-engineeringSkill
- flutter-mobile-developmentSkill
- flutter-motion-engineeringSkill
- flutter-multi-environmentSkill
- flutter-native-splash-engineeringSkill
- flutter-package-plugin-selectionSkill
- flutter-path-provider-production-storageSkill
- flutter-performance-jank-optimizationSkill
- flutter-permission-handler-engineeringSkill
- flutter-pinputSkill
- flutter-production-build-releaseSkill
- flutter-production-engineeringSkill
- flutter-production-loggingSkill
- flutter-pro-image-editor-engineeringSkill
- flutter-secure-storage-security-engineeringSkill
- flutter-sentry-engineeringSkill
- flutter-share-plus-engineeringSkill
- flutter-skeletonizer-engineeringSkill
- flutter-squadron-concurrency-engineeringSkill
- flutter-supabase-engineeringSkill
- flutter-svg-engineeringSkill
- flutter-ui-performance-engineeringSkill
- flutter-url-launcher-engineeringSkill
- flutter-video-player-production-engineeringSkill
- flutter-webview-production-engineeringSkill
- freezed-production-engineeringSkill
- html-to-flutterSkill
- hydrated-blocSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 22 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Treat Firebase Core as app-instance and configuration infrastructure.
- Distinctive: line 13
Before changing code or configuration:
- Distinctive: line 26
Verify the platform matrix of every downstream plugin.
- Very specific: line 36
Use one [DEFAULT] app for the normal application case.
- Very specific: line 39
Call WidgetsFlutterBinding.ensureInitialized() when plugin access precedes runApp, and keep binding initialization and runApp in the same …
- Distinctive: line 44
Do not eagerly initialize every Firebase product merely because Core exists.
- Very specific: line 45
Prefer flutterfire configure and generated platform-aware firebase_options.dart.
- Distinctive: line 47
Treat Firebase client options and API keys as client configuration, not Admin authorization.
- Distinctive: line 50
Never ship service-account JSON, Admin SDK credentials, private keys, signing secrets, database credentials, or privileged server tokens in …
- Distinctive: line 54
Prefer separate Firebase projects for isolated environments.
- Very specific: line 55
Do not use kDebugMode as the complete environment-selection model.
- Distinctive: line 56
Do not dynamically delete/recreate or switch the default app for ordinary user tenancy or logout.
- Distinctive: line 58
Create secondary apps only for genuine simultaneous multi-project needs, then verify every downstream plugin supports the named app.
- Very specific: line 60
Do not use Firebase.apps.isEmpty as a scattered lifecycle guard.
- Very specific: line 61
Treat core/duplicate-app and configuration mismatch as deterministic defects, not transient failures to retry blindly.
- Distinctive: line 65
Do not use production Firebase projects for automated tests.
- Distinctive: line 66
Do not assume Core configures each product's emulator automatically.
- Distinctive: line 67
Do not claim Linux support when no platform implementation is registered.
- Distinctive: line 68
Treat Windows Firebase support as development-oriented unless current official guidance explicitly establishes production support.
- Distinctive: line 75
Use this decision order:
- Very specific: line 79
If root state requires Firebase, await Core before runApp and fail with a bounded, actionable startup state.
- Distinctive: line 81
If the first screen is Firebase-independent, render it first and initialize optional Firebase-dependent features behind an explicit …
- Distinctive: line 85
Add a named secondary app only when two projects must be active simultaneously and all consumers support it.
- Distinctive: line 88
Do not introduce a bootstrap abstraction unless it centralizes real environment, readiness, error, testing, or multi-app policy.
- Very specific: line 93
Read only the relevant sections of references/production-guide.md.
- Distinctive: line 100
Use these search headings:
- Distinctive: line 126
Keep product-specific emulator, permissions, listeners, and remote fetching in the owning product layer.
- Distinctive: line 130
Keep Firebase Core readiness explicit where startup can proceed without it.
- Distinctive: line 134
Run the narrowest relevant Dart/Flutter and configuration checks, then test release-like builds.
- Distinctive: line 148
Never claim Firebase production readiness from Core initialization alone.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Firebase Core Engineering
Treat Firebase Core as app-instance and configuration infrastructure. Keep its lifecycle distinct from every downstream FlutterFire product.
Start with evidence
Before changing code or configuration:
- Inspect
pubspec.yaml,pubspec.lock, Flutter/Dart constraints, target platforms, flavors/build configurations, and downstream FlutterFire plugins. - Identify the locked
firebase_coreand platform implementation versions, plus the installedflutterfireCLI version. - Find every
Firebase.initializeApp,Firebase.app,Firebase.apps, secondary-app creation/deletion, and background entry point. - Inspect
firebase_options.dart, Android service files/Gradle wiring, Apple plist/bundle wiring, Web configuration, and Windows development setup. - Map each build flavor/configuration to its exact Firebase project and app registration; compare project IDs, app IDs, package names, and bundle IDs.
- Audit privileged credentials and all Firebase/product work before
runApp. - Verify the platform matrix of every downstream plugin; Core support alone is not sufficient.
The bundled guide was validated against firebase_core 4.13.0 and FlutterFire
CLI 1.4.0 on 2026-08-11. Use the installed package/CLI documentation and
changelogs as the source of truth when versions differ.
Preserve these invariants
- Initialize Firebase once per intended app instance.
- Use one
[DEFAULT]app for the normal application case. - Centralize bootstrap ownership; do not initialize Firebase from screens, repositories, or unrelated services.
- Call
WidgetsFlutterBinding.ensureInitialized()when plugin access precedesrunApp, and keep binding initialization andrunAppin the same zone. - Still call
Firebase.initializeApp()from Flutter when native Android/Apple files auto-configure the native default app. - Initialize Core before using any FlutterFire product plugin.
- Do not eagerly initialize every Firebase product merely because Core exists.
- Prefer
flutterfire configureand generated platform-awarefirebase_options.dart; do not hand-edit generated options. - Treat Firebase client options and API keys as client configuration, not Admin authorization. Protect access with product security rules and API-key restrictions where applicable.
- Never ship service-account JSON, Admin SDK credentials, private keys, signing secrets, database credentials, or privileged server tokens in Flutter.
- Select dev/staging/production projects deterministically at build time and keep Dart options aligned with native service files for the same build.
- Prefer separate Firebase projects for isolated environments.
- Do not use
kDebugModeas the complete environment-selection model. - Do not dynamically delete/recreate or switch the default app for ordinary user tenancy or logout.
- Create secondary apps only for genuine simultaneous multi-project needs, then verify every downstream plugin supports the named app.
- Do not use
Firebase.apps.isEmptyas a scattered lifecycle guard. - Treat
core/duplicate-appand configuration mismatch as deterministic defects, not transient failures to retry blindly. - Initialize explicitly in background entry points that execute in a separate Dart isolate when their workflow requires Firebase.
- Do not use production Firebase projects for automated tests.
- Do not assume Core configures each product's emulator automatically.
- Do not claim Linux support when no platform implementation is registered.
- Treat Windows Firebase support as development-oriented unless current official guidance explicitly establishes production support.
- Measure startup in profile/release-like builds and separate Core cost from registered plugin and remote-service work.
Choose the smallest bootstrap
Use this decision order:
- For a normal app, initialize one default app with generated current-platform options, then run the application.
- If root state requires Firebase, await Core before
runAppand fail with a bounded, actionable startup state. - If the first screen is Firebase-independent, render it first and initialize optional Firebase-dependent features behind an explicit readiness boundary.
- For dev/staging/production, select the exact project through flavors/build configuration, not runtime user state.
- Add a named secondary app only when two projects must be active simultaneously and all consumers support it.
Do not introduce a bootstrap abstraction unless it centralizes real environment, readiness, error, testing, or multi-app policy.
Route to the production guide
Read only the relevant sections of references/production-guide.md. Locate
sections before reading them with:
rg -n '^#{1,3} (SECTION|RELATED SECTION)$' references/production-guide.mdUse these search headings:
| Task | Search headings | |||||||||||||||
| Understand Core versus native/product initialization, API, or platform support | `Package Architecture | Dart vs Native vs Service Initialization | Current API | FirebaseApp | FirebaseOptions | Platform Capability Matrix` | ||||||||||
| Install/configure CLI or generated options | `FlutterFire CLI | Install | Configure | Noninteractive Configuration | Re-run flutterfire configure | flutterfire reconfigure | firebase_options.dart | Do Not Manually Edit Generated Options` | ||||||||
| Review configuration secrecy and source control | `Are Firebase Options Secrets | Source Control | Security Boundary | NEVER Ship These | API-Key Nuance | Security Rules` | ||||||||||
| Initialize the default app or fix duplicate/lifecycle behavior | `Initialization | Recommended Default | WidgetsFlutterBinding.ensureInitialized | Binding Decision Rule | Keep Binding and runApp in the Same Zone | Default Firebase App | Before Initialization | Native Default Configuration | Duplicate Initialization | Do Not Use Firebase.apps.isEmpty Everywhere | Repeated Initialization Semantics | Hot Reload and Hot Restart` | ||||
| Create, use, or delete secondary apps | `Secondary Firebase Apps | Good Secondary-App Use Cases | Bad Secondary-App Use Cases | Plugin Support for Secondary Apps | Firebase App Deletion | Dynamic Project Switching | Multiple Firebase App Cost` | |||||||||
| Design or optimize startup | `Startup Model | Startup Decision Framework | Default Recommended Bootstrap | Firebase-Independent First Frame | Startup Performance | Native Core Cost | Web Core Cost | Registered Plugin Cost | Avoid Eager Service Initialization | Parallel Startup Work | Startup Audit | Startup Timing | Do Not Skip await Incorrectly` | |||
| Configure Android, Apple, Web, Windows, or check Linux | `Android | Firebase App Registration | google-services.json | Google Services Gradle Plugin | Android Flavors / Build Types | iOS | Bundle ID | GoogleService-Info.plist | Apple Build Configurations | macOS | Web | Web JS SDK | Advanced Web Manual Loading | Web Trusted Types | Windows | Linux` |
| Configure environments/flavors and prevent project mismatch | `Environments and Flavors | Environment Selection | Flavor Options Selection | Avoid kDebugMode as the Entire Environment Model | Configuration Verification | Prevent Production/Stage Mismatch | Manual FirebaseOptions | Native Service Files vs Dart Options` | ||||||||
| Initialize background entry points or isolates | `Background Isolates | Firebase Messaging Background Example | Generic Spawned Isolates` | |||||||||||||
| Test Core or configure emulators/demo projects | `Testing | Pure Unit Tests | Widget Tests | Core Integration Tests | Emulator Suite | Demo Project | Do Not Use Production Firebase for Automated Tests` | |||||||||
| Handle initialization errors or degraded startup | `Error Handling | core/no-app | core/not-initialized | core/duplicate-app | Configuration Failure vs Transient Failure | Initialization Timeout | Fail Fast vs Degraded Mode | Startup Error Screen Pattern` | ||||||||
| Review architecture, ordering, debugging, or production readiness | `Architecture | Firebase Core Is Not a Service Locator | Multiple FlutterFire Plugins | Plugin Ordering | Performance Anti-Optimization Warnings | Logging | Debugging Guide | Anti-Patterns | Implementation Checklist | Startup Audit Checklist | Code Review Checklist | Production Readiness Checklist | Version-Sensitive Areas | Decision Framework` |
For a full Firebase bootstrap or production-readiness audit, read the entire guide after completing the repository inventory.
Implement at the single bootstrap boundary
- Fix repeated initialization in the shared app bootstrap, not with guards in every caller.
- Fix wrong-project behavior by aligning flavor selection, generated Dart options, native service files, and registered package/bundle IDs.
- Keep product-specific emulator, permissions, listeners, and remote fetching in the owning product layer.
- Preserve existing generated-file and CI conventions when sound; regenerate deterministically when configuration changes.
- Keep Firebase Core readiness explicit where startup can proceed without it.
Validate the result
Run the narrowest relevant Dart/Flutter and configuration checks, then test release-like builds. Cover changed paths from this matrix:
- one default app with the expected name/options on every affected platform;
- exact dev/staging/production project and app IDs for each flavor;
- Android package/service file/Gradle alignment;
- Apple bundle ID/plist/build-configuration alignment;
- Web reload and current options/JS integration;
- background entry-point initialization when changed;
- deterministic configuration failures versus supported degraded behavior;
- emulator/demo isolation without production access;
- downstream plugin access after Core readiness;
- profile/release startup timing when performance changed.
Never claim Firebase production readiness from Core initialization alone. Report untested platforms, flavors, downstream plugins, and background entry points.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

