agentskills.codes
FI

firebase

| Atributo | Valor | |----------|-------| | **ID** | `flutter-firebase` | | **Nivel** | 🟑 Intermedio | | **Versión** | 2.0.0 | | **Keywords** | `firebase`, `firestore`, `auth`, `cloud-messaging`, `analytics`, `storage`, `remote-config`, `crashlytics`, `provider` | | **Referencia

Install

mkdir -p .claude/skills/firebase-altrupets && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16900" && unzip -o skill.zip -d .claude/skills/firebase-altrupets && rm skill.zip

Installs to .claude/skills/firebase-altrupets

Activation

This is the description your AI agent reads to decide when to run this skill β€” the better it matches your request, the more reliably it fires.

| Atributo | Valor | |----------|-------| | **ID** | `flutter-firebase` | | **Nivel** | 🟑 Intermedio | | **Versión** | 2.0.0 | | **Keywords** | `firebase`, `firestore`, `auth`, `cloud-messaging`, `analytics`, `storage`, `remote-config`, `crashlytics`, `provider` | | **Referencia
280 chars Β· catalog descriptionno explicit β€œwhen” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)

About this skill

πŸ”₯ Skill: Firebase Integration

πŸ“‹ Metadata

AtributoValor
IDflutter-firebase
Nivel🟑 Intermedio
VersiΓ³n2.0.0
Keywordsfirebase, firestore, auth, cloud-messaging, analytics, storage, remote-config, crashlytics, provider
ReferenciaFlutterFire

πŸ”‘ Keywords para InvocaciΓ³n

  • firebase
  • firestore
  • firebase-auth
  • cloud-messaging
  • firebase-analytics
  • firebase-storage
  • firebase-remote-config
  • firebase-crashlytics
  • provider
  • @skill:firebase

Ejemplos de Prompts

Integra Firebase con auth y Firestore
Implementa Firebase Authentication y Cloud Messaging
@skill:firebase - Configura Firebase completo

πŸ“– DescripciΓ³n

Firebase Integration proporciona servicios backend completos: Authentication (Email/Password y Google Sign-In), Firestore Database, Cloud Storage, Push Notifications (FCM), Analytics (con tracking de screens, eventos personalizados, user ID y propiedades), Crashlytics y Remote Config. Incluye integraciΓ³n con Provider para state management y configuraciΓ³n multiplataforma con mejores prΓ‘cticas.

⚠️ IMPORTANTE: Todos los comandos de este skill deben ejecutarse desde la raíz del proyecto (donde existe el directorio mobile/). El skill incluye verificaciones para asegurar que se estÑ en el directorio correcto antes de ejecutar cualquier comando.

⚠️ IMPORTANTE: Todos los comandos de este skill deben ejecutarse desde la raíz del proyecto (donde existe el directorio mobile/). El skill incluye verificaciones para asegurar que se estÑ en el directorio correcto antes de ejecutar cualquier comando.

βœ… CuΓ‘ndo Usar Este Skill

  • Backend as a Service rΓ‘pido
  • Authentication con mΓΊltiples providers
  • Base de datos en tiempo real
  • Push notifications
  • Analytics y Crashlytics
  • Remote Config para A/B testing
  • Rapid prototyping

❌ CuÑndo NO Usar Este Skill

  • Requieres control total del backend
  • Costos de Firebase son prohibitivos
  • Backend custom ya existe

πŸ—οΈ Estructura del Proyecto

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ firebase/
β”‚   β”‚   β”œβ”€β”€ firebase_options.dart (generado)
β”‚   β”‚   β”œβ”€β”€ firebase_config.dart
β”‚   β”‚   └── firebase_initialization.dart
β”‚   └── services/
β”‚       β”œβ”€β”€ analytics_service.dart
β”‚       β”œβ”€β”€ crashlytics_service.dart
β”‚       β”œβ”€β”€ remote_config_service.dart
β”‚       └── storage_service.dart
β”‚
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ authentication/
β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”œβ”€β”€ datasources/
β”‚   β”‚   β”‚   β”‚   └── firebase_auth_datasource.dart
β”‚   β”‚   β”‚   └── repositories/
β”‚   β”‚   β”‚       └── auth_repository_impl.dart
β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”‚   β”œβ”€β”€ entities/
β”‚   β”‚   β”‚   β”‚   └── user.dart
β”‚   β”‚   β”‚   └── repositories/
β”‚   β”‚   β”‚       └── auth_repository.dart
β”‚   β”‚   └── presentation/
β”‚   β”‚       β”œβ”€β”€ screens/
β”‚   β”‚       β”‚   └── login_screen.dart
β”‚   β”‚       β”œβ”€β”€ providers/
β”‚   β”‚       β”‚   └── auth_provider.dart
β”‚   β”‚       └── bloc/
β”‚   β”‚           └── auth_bloc.dart
β”‚   β”‚
β”‚   β”œβ”€β”€ products/
β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”œβ”€β”€ datasources/
β”‚   β”‚   β”‚   β”‚   └── firestore_products_datasource.dart
β”‚   β”‚   β”‚   └── models/
β”‚   β”‚   β”‚       └── product_model.dart
β”‚   β”‚   └── domain/
β”‚   β”‚       └── entities/
β”‚   β”‚           └── product.dart
β”‚   β”‚
β”‚   └── notifications/
β”‚       β”œβ”€β”€ data/
β”‚       β”‚   β”œβ”€β”€ datasources/
β”‚       β”‚   β”‚   └── fcm_datasource.dart
β”‚       β”‚   └── services/
β”‚       β”‚       └── notification_service.dart
β”‚       └── presentation/
β”‚           └── screens/
β”‚               └── notifications_screen.dart
β”‚
└── main.dart

πŸ“¦ Dependencias Requeridas

dependencies:
  flutter:
    sdk: flutter

  # Firebase Core
  firebase_core: ^2.24.2

  # Firebase Authentication
  firebase_auth: ^4.15.3
  google_sign_in: ^6.2.1

  # Cloud Firestore
  cloud_firestore: ^4.13.6

  # Cloud Storage
  firebase_storage: ^11.5.6

  # Cloud Messaging
  firebase_messaging: ^14.7.9
  flutter_local_notifications: ^16.3.0

  # Firebase Analytics
  firebase_analytics: ^10.7.4

  # Crashlytics
  firebase_crashlytics: ^3.4.8

  # Remote Config
  firebase_remote_config: ^4.3.8

  # State Management
  provider: ^6.1.1

  # Image Picker (para Storage)
  image_picker: ^1.0.7

  # Utils
  equatable: ^2.0.5
  dartz: ^0.10.1

dev_dependencies:
  flutter_test:
    sdk: flutter

βš™οΈ ConfiguraciΓ³n Inicial

1. Firebase CLI Setup

# Instalar Firebase CLI
npm install -g firebase-tools

# Login a Firebase
firebase login

# Verificar que estamos en la raΓ­z del proyecto
if [ ! -d "mobile" ]; then
    echo "Error: Ejecuta este comando desde la raΓ­z del proyecto"
    exit 1
fi

# Instalar FlutterFire CLI
dart pub global activate flutterfire_cli

# Configurar Firebase para el proyecto
cd mobile
flutterfire configure
cd ..
flutterfire configure

2. Android Configuration

// android/build.gradle
buildscript {
    dependencies {
        classpath 'com.google.gms:google-services:4.4.0'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
    }
}
// android/app/build.gradle
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    defaultConfig {
        minSdkVersion 21  // Firebase requires 21+
    }
}

3. iOS Configuration

# ios/Podfile
platform :ios, '13.0'  # Firebase requires 13.0+

# DespuΓ©s de flutter_install_all_ios_pods
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
    end
  end
end

πŸ’» ImplementaciΓ³n

1. Firebase Initialization

// lib/main.dart
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'firebase_options.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

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

  // Pass all uncaught errors to Crashlytics
  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

  runApp(const MyApp());
}

2. Firebase Authentication

// lib/features/authentication/data/datasources/firebase_auth_datasource.dart
import 'package:firebase_auth/firebase_auth.dart' as firebase_auth;
import 'package:google_sign_in/google_sign_in.dart';
import '../models/user_model.dart';

abstract class FirebaseAuthDataSource {
  Stream<UserModel?> get authStateChanges;
  Future<UserModel> signInWithEmailAndPassword(String email, String password);
  Future<UserModel> signUpWithEmailAndPassword(String email, String password);
  Future<UserModel> signInWithGoogle();
  Future<void> signOut();
  Future<void> sendPasswordResetEmail(String email);
  UserModel? getCurrentUser();
}

class FirebaseAuthDataSourceImpl implements FirebaseAuthDataSource {
  final firebase_auth.FirebaseAuth _firebaseAuth;
  final GoogleSignIn _googleSignIn;

  FirebaseAuthDataSourceImpl({
    firebase_auth.FirebaseAuth? firebaseAuth,
    GoogleSignIn? googleSignIn,
  })  : _firebaseAuth = firebaseAuth ?? firebase_auth.FirebaseAuth.instance,
        _googleSignIn = googleSignIn ?? GoogleSignIn();

  @override
  Stream<UserModel?> get authStateChanges {
    return _firebaseAuth.authStateChanges().map((firebaseUser) {
      return firebaseUser != null ? UserModel.fromFirebaseUser(firebaseUser) : null;
    });
  }

  @override
  Future<UserModel> signInWithEmailAndPassword(
    String email,
    String password,
  ) async {
    try {
      final credential = await _firebaseAuth.signInWithEmailAndPassword(
        email: email,
        password: password,
      );

      if (credential.user == null) {
        throw Exception('Sign in failed');
      }

      return UserModel.fromFirebaseUser(credential.user!);
    } on firebase_auth.FirebaseAuthException catch (e) {
      throw _handleAuthException(e);
    }
  }

  @override
  Future<UserModel> signUpWithEmailAndPassword(
    String email,
    String password,
  ) async {
    try {
      final credential = await _firebaseAuth.createUserWithEmailAndPassword(
        email: email,
        password: password,
      );

      if (credential.user == null) {
        throw Exception('Sign up failed');
      }

      return UserModel.fromFirebaseUser(credential.user!);
    } on firebase_auth.FirebaseAuthException catch (e) {
      throw _handleAuthException(e);
    }
  }

  @override
  Future<UserModel> signInWithGoogle() async {
    try {
      // Trigger the authentication flow
      final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();

      if (googleUser == null) {
        throw Exception('Google sign in was cancelled');
      }

      // Obtain the auth details from the request
      final GoogleSignInAuthentication googleAuth = await googleUser.authentication;

      // Create a new credential
      final credential = firebase_auth.GoogleAuthProvider.credential(
        accessToken: googleAuth.accessToken,
        idToken: googleAuth.idToken,
      );

      // Sign in to Firebase with the Google credential
      final userCredential = await _firebaseAuth.signInWithCredential(credential);

      if (userCredential.user == null) {
        throw Exception('Google sign in failed');
      }

      return UserModel.fromFirebaseUser(userCredential.user!);
    } on firebase_auth.FirebaseAuthException catch (e) {
      throw _handleAuthException(e);
    } catch (e) {
      throw Exception('Google sign in failed: $e');
    }
  }

  @override
  Future<void> signOut() async {
    await Future.wait([
      _firebaseAuth.signOut(),
      _googleSignIn.signOut(),
    ]);
  }

  @override
  Future<void> sendPasswordResetEmail(String email) async {
    try {
      await _firebaseAuth.sendPasswordResetEmail(email: em

---

*Content truncated.*

Search skills

Search the agent skills registry