firebase
Skill15 starsChanged 9 months agoMITView on GitHub
Firebase integration for Android AI agents. Use this skill whenever integrating Firebase Authentication, Firestore, Realtime Database, Firebase Storage, Firebase Analytics, Firebase Crashlytics, Firebase Messaging (FCM), Firebase Remote Config, Firebase App Check, google-services.json, Firebase SDK setup, BoM (Bill of Materials), Hilt Firebase injection, Firebase Auth with email/password/Google/phone, Firestore CRUD, Firestore real-time listeners, Firebase Collections, Documents, Queries, or any Firebase service in Android.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- LDKTC/Agent-P-FullStacktheir own version, first seen Jul 31, 2026
- alinaqi/maggytheir own version, first seen Jun 12, 2026
- Fandry96/k3-agentic-skillstheir own version, first seen May 12, 2026
- tuannv14/claude-team-toolkittheir own version, first seen May 5, 2026
- ai4brands-design/claude-skillstheir own version, first seen Mar 22, 2026
- alanalvestech/hitanktheir own version, first seen Mar 5, 2026
Used with
Projects with it also use supabase.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillsupabase
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector).
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- alinaqi/maggy★ 707same name
- alanalvestech/hitank★ 38same name
- Fandry96/k3-agentic-skills★ 27same name
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- LDKTC/Agent-P-FullStack★ 1same name
- tuannv14/claude-team-toolkit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- adaptive-uiSkill
- android-architectureSkill
- android-setupSkill
- android-testingSkill
- biometricsSkill
- ci-cd-androidSkill
- compose-animationSkill
- compose-navigationSkill
- compose-uiSkill
- datastoreSkill
- design-systemSkill
- design-tokensSkill
- gradleSkill
- hilt-diSkill
- kotlin-patternsSkill
- material3Skill
- notificationsSkill
- offline-firstSkill
- performanceSkill
- permissionsSkill
- play-store-releaseSkill
- retrofitSkill
- room-databaseSkill
- securitySkill
- supabase-androidSkill
The file
Files
Firebase for Android
Setup — always use BoM for version management
[versions]
firebaseBom = "33.5.1"
googleServices = "4.4.2"// build.gradle.kts
plugins { alias(libs.plugins.google.services) }
dependencies {
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.auth.ktx)
implementation(libs.firebase.firestore.ktx)
implementation(libs.firebase.storage.ktx)
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.crashlytics.ktx)
implementation(libs.firebase.messaging.ktx)
}Firebase Auth
// ✅ Auth repository
class AuthRepositoryImpl @Inject constructor(
private val auth: FirebaseAuth
) : AuthRepository {
override val currentUser: Flow<User?> = callbackFlow {
val listener = FirebaseAuth.AuthStateListener { auth ->
trySend(auth.currentUser?.toDomain())
}
auth.addAuthStateListener(listener)
awaitClose { auth.removeAuthStateListener(listener) }
}
override suspend fun signInWithEmail(email: String, password: String): Result<User> =
runCatching {
auth.signInWithEmailAndPassword(email, password).await()
.user?.toDomain() ?: throw IllegalStateException("User is null after sign in")
}
override suspend fun createAccount(email: String, password: String): Result<User> =
runCatching {
auth.createUserWithEmailAndPassword(email, password).await()
.user?.toDomain() ?: throw IllegalStateException("User is null after creation")
}
override suspend fun signInWithGoogle(idToken: String): Result<User> = runCatching {
val credential = GoogleAuthProvider.getCredential(idToken, null)
auth.signInWithCredential(credential).await()
.user?.toDomain() ?: throw IllegalStateException("User is null")
}
override fun signOut() = auth.signOut()
override fun isSignedIn(): Boolean = auth.currentUser != null
}
fun FirebaseUser.toDomain() = User(uid, email ?: "", displayName ?: "", photoUrl?.toString())Firestore — CRUD + real-time
// ✅ Firestore repository
class ItemFirestoreDataSource @Inject constructor(
private val firestore: FirebaseFirestore,
private val auth: FirebaseAuth
) {
private val itemsCollection
get() = firestore.collection("users")
.document(auth.currentUser?.uid ?: throw UnauthorizedException())
.collection("items")
// Real-time stream
fun getItemsStream(): Flow<List<ItemDto>> = callbackFlow {
val listener = itemsCollection
.orderBy("created_at", Query.Direction.DESCENDING)
.addSnapshotListener { snapshot, error ->
if (error != null) { close(error); return@addSnapshotListener }
val items = snapshot?.documents?.mapNotNull { doc ->
doc.toObject(ItemDto::class.java)?.copy(id = doc.id)
} ?: emptyList()
trySend(items)
}
awaitClose { listener.remove() }
}
// One-shot get
suspend fun getItem(id: String): ItemDto? =
itemsCollection.document(id).get().await()
.toObject(ItemDto::class.java)?.copy(id = id)
// Write
suspend fun upsertItem(item: ItemDto): String {
return if (item.id.isEmpty()) {
itemsCollection.add(item).await().id
} else {
itemsCollection.document(item.id).set(item).await()
item.id
}
}
// Update specific fields
suspend fun updateFavorite(id: String, isFavorite: Boolean) {
itemsCollection.document(id).update(
"is_favorite", isFavorite,
"updated_at", FieldValue.serverTimestamp()
).await()
}
// Delete
suspend fun deleteItem(id: String) {
itemsCollection.document(id).delete().await()
}
// Batch write — atomic multi-document update
suspend fun batchUpdate(updates: List<Pair<String, Map<String, Any>>>) {
firestore.runBatch { batch ->
updates.forEach { (id, fields) ->
batch.update(itemsCollection.document(id), fields)
}
}.await()
}
// Transaction
suspend fun transferItem(fromId: String, toUserId: String): Result<Unit> = runCatching {
firestore.runTransaction { transaction ->
val fromRef = itemsCollection.document(fromId)
val item = transaction.get(fromRef).toObject(ItemDto::class.java)
?: throw NotFoundException()
val toRef = firestore.collection("users").document(toUserId)
.collection("items").document(fromId)
transaction.set(toRef, item)
transaction.delete(fromRef)
}.await()
}
}Hilt Firebase module
@Module
@InstallIn(SingletonComponent::class)
object FirebaseModule {
@Provides @Singleton
fun provideFirebaseAuth(): FirebaseAuth = Firebase.auth
@Provides @Singleton
fun provideFirestore(): FirebaseFirestore = Firebase.firestore.also {
it.firestoreSettings = firestoreSettings { isPersistenceEnabled = true }
}
@Provides @Singleton
fun provideStorage(): FirebaseStorage = Firebase.storage
@Provides @Singleton
fun provideAnalytics(@ApplicationContext context: Context): FirebaseAnalytics =
Firebase.analytics
}FCM — Firebase Cloud Messaging
@AndroidEntryPoint
class MyFirebaseMessagingService : FirebaseMessagingService() {
@Inject lateinit var notificationHandler: NotificationHandler
override fun onMessageReceived(message: RemoteMessage) {
message.notification?.let { notification ->
notificationHandler.showNotification(
title = notification.title ?: "",
body = notification.body ?: "",
data = message.data
)
}
}
override fun onNewToken(token: String) {
// Send token to your server
}
}Common Mistakes
❌ Missing google-services.json in app/ directory
❌ Not using BoM — version conflicts between Firebase libraries
❌ Calling Firebase on Main thread without .await() — use suspend + .await()
❌ No offline persistence for Firestore — enable isPersistenceEnabled = true
❌ Missing Firestore security rules — always configure before production
❌ Storing sensitive data in Firestore without encryption
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.

