firebase

Standardize Firebase Auth and Firestore error handling and data conversion.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/DevXoje/gerocare --skill firebase-devxoje
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firebase
Source: https://github.com/DevXoje/gerocare/tree/main/.cursor/skills/firebase
Command: npx skills add https://github.com/DevXoje/gerocare --skill firebase-devxoje

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Patterns and conventions for working with Firebase Auth and Firestore in GeroCare. This skill provides a cohesive approach to building auth and data layers, handling errors, and configuring emulators.

Core Features & Use Cases

  • Auth Repository Pattern: Always map Firebase errors to domain errors; centralize auth repository scaffolding.
  • Firestore Repository Pattern: Convert Firestore timestamps to Date objects; validate documents with Zod; map to domain entities.
  • Error Mapping Pattern: Centralized map of FirebaseError codes to domain errors with Spanish messages.
  • Emulator & Configuration Guidance: Setup for local emulators with connectAuthEmulator and connectFirestoreEmulator; production offline caching guidance.
  • Queries & Data Retrieval Patterns: Safe querying with error handling and results.

Quick Start

Follow the examples in assets to implement the firebase patterns in your features, including Auth and Firestore repositories, error handling, and emulator configuration.

Frequently Asked Questions about firebase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Firebase Auth and Firestore repository patterns for consistent error handling?

Standardize Firebase Auth and Firestore repository patterns by centralizing error mapping, mapping Firebase error codes to domain errors, and converting Firestore timestamps to Date objects. This ensures consistent data conversion and error handling across your web applications.

What is the best way to map Firebase error codes to domain errors with Spanish messages?

Mapping Firebase error codes to domain errors with Spanish messages requires a centralized error mapping pattern. This approach translates FirebaseError codes into localized domain errors, providing consistent Spanish messaging across authentication and Firestore operations.

How do I validate Firestore documents with Zod and map them to domain entities?

Validate Firestore documents with Zod by applying schema validation to retrieved data, then map the validated documents to domain entities. This pattern also handles converting Firestore timestamps to Date objects during the repository data retrieval process.

Can I configure local Firebase emulators for Auth and Firestore alongside production offline caching?

Yes, you can configure Firebase emulators using connectAuthEmulator and connectFirestoreEmulator for local development. The same setup provides production offline caching guidance, ensuring your web apps maintain data availability without network connectivity.

How do I handle Firebase authentication flows using Result types and offline support?

Handle Firebase authentication flows using Result types by implementing an Auth Repository pattern that safely wraps operations. This approach standardizes offline support and error handling, returning structured results instead of throwing exceptions.

Why should I use a centralized repository pattern for Firebase data retrieval and querying?

A centralized Firebase repository pattern ensures safe querying with consistent error handling and structured Result types. It standardizes timestamp conversions and Zod validation, preventing data inconsistencies across your application's data layer.