askill
tech-firebase

tech-firebaseSafety 80Repository

Firebase integration patterns and best practices for AI-assisted development.

0 stars
1.2k downloads
Updated 2/21/2026

Package Files

Loading files...
SKILL.md

Firebase Integration Patterns

Tech-stack skill for Firebase services in mobile and web applications. Covers Firestore, Cloud Functions, security rules, authentication, storage, and multi-environment management.

Supporting Files

FilePurpose
firestore-patterns.mdQuery optimization, pagination, batch writes, listeners, offline persistence
security-rules.mdLeast privilege, document validation, RBAC with custom claims, testing
cloud-functions.mdCold starts, memory sizing, connection pooling, triggers, timeouts
environment-management.mdMulti-environment setup, region consistency, Terraform IaC, index management

Services Overview

ServiceKey Considerations
FirestorePagination, batch writes (500 max), compound indexes, listener cleanup
AuthenticationToken refresh via auth state stream, App Check enforcement, multi-provider
Cloud FunctionsCold starts, memory sizing, region consistency, conditional triggers
StorageImage compression before upload, CDN caching, thumbnails via resize function
AnalyticsEvent tracking, user properties, conversion funnels
CrashlyticsError reporting, custom keys, non-fatal exceptions
PerformanceCustom traces, screen load tracking, network monitoring
MessagingFCM tokens, topic subscriptions, background handlers
App CheckPlay Integrity (Android), App Attest (iOS), debug tokens for dev

Key Principles

  1. Region consistency -- all services in the same region for lowest latency
  2. Offline-first -- leverage Firestore offline persistence and cache-first reads
  3. Pagination everywhere -- never load unbounded collections
  4. Listener hygiene -- always cancel StreamSubscriptions in dispose()
  5. Least privilege -- security rules deny by default, grant specific access
  6. Index management -- create composite indexes in all environments
  7. Cost awareness -- every listener, query, and function invocation has a cost

Cost Model (Key Metrics)

ServiceFree TierCost After Free
Firestore Reads50K/day$0.06/100K
Firestore Writes20K/day$0.18/100K
Storage5 GB$0.026/GB/month
Cloud Functions2M invocations/month$0.40/M
Phone Auth10K/month$0.06/verification

Authentication Patterns

  • Single auth state listener -- not per-screen, centralized in a service
  • Token refresh handled reactively via authStateChanges() stream
  • Anonymous upgrade -- allow anonymous users to link permanent credentials
  • Sign-out cleanup -- clear all local state, cancel listeners, reset providers
  • No auth tokens in logs -- sanitize error messages

Storage Patterns

  • Compress images before upload (quality reduction, resize)
  • Generate thumbnails via Cloud Function on upload
  • CDN caching -- Firebase Storage uses Google CDN by default
  • Progressive loading -- show thumbnail first, load full resolution on demand
  • User-scoped paths -- store files under users/{uid}/ for security rules

Performance Monitoring

  • Custom traces for business-critical operations
  • Screen load tracking via mixin on screen widgets
  • Route observer for navigation performance
  • Network monitoring for API call latency

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

68/100Analyzed 2/24/2026

Technical reference skill covering Firebase integration patterns across multiple services (Firestore, Auth, Cloud Functions, Storage, Analytics). Well-structured with tables, cost models, and key principles. Scores well on clarity, reusability, and safety. Main weakness is actionability - provides comprehensive reference material but lacks step-by-step implementation guidance and code examples. References supporting files that aren't included in the content, reducing practical utility. Appropriate for a reference-style tech-stack skill but would benefit from more actionable examples.

80
80
75
65
40

Metadata

Licenseunknown
Version-
Updated2/21/2026
Publisherrobertdewilde-dev

Tags

apiobservabilitysecurity