firebase-expert
Builds, secures and reviews Firebase apps with the modular JS SDK (firebase 13), firebase-admin 14 and Cloud Functions 2nd gen: Firestore data modeling, queries, indexes, transactions and offline cache, Firestore and Storage Security Rules with emulator tests, Firebase Authentication and Identity Pl
- 01Installs
- New
- 02Files scanned
- 8
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 40ef8cbf67549740… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Firebase Expert
Senior Firebase engineer for the modular JS SDK 13, firebase-admin 14 (Node 22+), firebase-functions 7 on Cloud Functions 2nd gen and firebase-tools 15: data shaped for the queries the app runs, Security Rules that enforce every invariant the client could fake, and every change proven against the Emulator Suite before deploy.
When to Use This Skill
- Designing Firestore collections, queries, composite indexes, transactions and listeners for a web or Node app
- Writing or auditing
firestore.rulesandstorage.rules, and testing them with@firebase/rules-unit-testing - Adding sign-in, custom claims, SSR session cookies or blocking functions with Firebase Auth / Identity Platform
- Writing 2nd gen Cloud Functions (callable, HTTP, Firestore, Storage, scheduled, task queue) with params and secrets
- Deploying to Firebase Hosting or App Hosting, wiring App Check, or cutting a Firestore bill
Core Workflow
- Inventory: Read
package.jsonpins,firebase.json,.firebaserc, the rules and index files; note the Firestore edition, the plan (Blaze is required for Functions, App Hosting and Cloud Storage) and whether the code is modular or compat - Model: Shape documents around the screens' queries, list every query with its index, estimate reads per screen
- Secure: Write rules for every collection and bucket path first: auth, ownership from
request.auth.uid, validated fields, server-only fields; privileged work goes to functions using the Admin SDK - Build: Modular client code, 2nd gen functions with
defineSecret/defineString, idempotent triggers, App Check on clients and enforced on callables - Verify & deploy: Run rules and function tests under
firebase emulators:exec, fix failures and re-run until green, thenfirebase deploy --onlythe changed targets and check the console for index builds and errors
Reference Guide
| Topic | Reference | Load When |
|---|---|---|
| Firestore | references/firestore.md | Data modeling, converters, queries, indexes, pagination, aggregation, transactions, batches, listeners, offline cache, read costs, RTDB and SQL Connect choice |
| Security Rules | references/security-rules.md | firestore.rules, storage.rules, validation helpers, role claims, rules-vs-queries, rules unit tests |
| Authentication | references/authentication.md | Client sign-in, Admin token verification, custom claims, session cookies for SSR, blocking functions, Identity Platform |
| Cloud Functions | references/cloud-functions.md | 2nd gen triggers, callable functions, params and secrets, idempotency, retries, concurrency, regions |
| Storage, App Check & AI Logic | references/storage-app-check.md | Uploads, Storage paths and metadata, App Check providers and enforcement, Firebase AI Logic client calls |
| Emulators & testing | references/emulators-testing.md | firebase.json emulators, connecting SDKs, seeding, function integration tests, CI with emulators:exec |
| Hosting & deployment | references/hosting-deployment.md | Hosting vs App Hosting, apphosting.yaml, environments and project aliases, CI auth without keys, index and rules deploys |
Minimal Working Example
Client init that talks to the emulators in development and caches offline:
// src/lib/firebase.ts
import { initializeApp } from 'firebase/app';
import { connectAuthEmulator, getAuth } from 'firebase/auth';
import {
connectFirestoreEmulator,
initializeFirestore,
persistentLocalCache,
persistentMultipleTabManager,
} from 'firebase/firestore';
export const app = initializeApp({
apiKey: import.meta.env.VITE_FIREBASE_API_KEY, // public identifier, not a secret
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
appId: import.meta.env.VITE_FIREBASE_APP_ID,
});
export const auth = getAuth(app);
export const db = initializeFirestore(app, {
localCache: persistentLocalCache({ tabManager: persistentMultipleTabManager() }),
});
if (import.meta.env.DEV) {
connectAuthEmulator(auth, 'http://127.0.0.1:9099', { disableWarnings: true });
connectFirestoreEmulator(db, '127.0.0.1', 8080);
}
Constraints
MUST DO
- Use the modular API (
firebase/firestore,firebase-admin/firestore); leave existing compat code alone unless asked to migrate - Deny by default in rules; derive identity from
request.auth.uidand custom claims, set timestamps withrequest.time/serverTimestamp(), restrict updates withdiff().affectedKeys().hasOnly() - Give every query a bounded
limit()and its composite index infirestore.indexes.json - Make event-triggered functions idempotent (key on
event.id) and guard against re-triggering on their own writes - Read secrets with
defineSecretand bind them per function; enforce App Check on callables the client uses - Test rules and functions against the emulators, and commit rules and indexes to the repo
MUST NOT DO
- Ship test-mode or
allow read, write: if truerules, or trustrole,ownerIdorcreatedAtsent by the client - Commit service-account JSON keys or call
initializeAppwith a key file on Google infrastructure (use ADC, Workload Identity Federation in CI) - Use
functions.config()(removed in firebase-functions 7) or start new 1st gen functions - Attach
onSnapshotto unbounded collections, or read one document per list row (N+1) - Use the Admin SDK in client bundles, or treat the web
apiKeyas the security boundary
Output Templates
When implementing a Firebase feature, provide:
- Data model (collection paths, document shapes, the queries and their indexes) and the
firestore.indexes.jsonentries - Rules for every new path, with emulator tests that show allowed and denied cases
- Client and function code, plus the
firebase deploy --only ...targets, secrets to set and plan requirements - A note on expected reads per screen and any cost or quota risk
Knowledge Reference
Firebase JS SDK 13 (modular), firebase-admin 14, firebase-functions 7, firebase-tools 15, Cloud Firestore Standard and Enterprise editions, Security Rules v2, @firebase/rules-unit-testing 6, Firebase Authentication, Identity Platform, custom claims, session cookies, blocking functions, Cloud Functions 2nd gen (Cloud Run, Eventarc), params and Secret Manager, Cloud Storage for Firebase, App Check (reCAPTCHA Enterprise, Play Integrity, App Attest), Firebase Hosting, App Hosting, Emulator Suite, Realtime Database, SQL Connect, Firebase AI Logic
Related Skills
cloud-architect: wider Google Cloud topology, multi-region and disaster recovery beyond Firebasesecure-code-guardian: generic auth hardening, input validation and OWASP controlsnextjs-developer,react-expert: UI and SSR around the Firebase data layerflutter-expert,react-native-expert: mobile clients (FlutterFire, React Native Firebase); rules, indexes and functions here still apply
Maintained by @jeffallan, Principal Consultant at Synergetic Solutions
Files
8- SKILL.md
eb76fa72f38.7 KB - references/authentication.md
6ced8b14c310.7 KB - references/cloud-functions.md
628630466a11.4 KB - references/emulators-testing.md
ac6141afb98.9 KB - references/firestore.md
6d7e1bf57011.2 KB - references/hosting-deployment.md
d44181ae237.2 KB - references/security-rules.md
352a9f1cdb11.3 KB - references/storage-app-check.md
90126827947.4 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from Jeffallan/claude-skills8
Use when writing E2E tests with Playwright, setting up test infrastructure, or debugging flaky browser tests. Invoke to write test scripts, create page objects, configure test fixtures, set up reporters, add CI integration, implement API mocking, or perform visual regression testing. Trigger terms:
Generates Angular 17+ standalone components, configures advanced routing with lazy loading and guards, implements NgRx state management, applies RxJS patterns, and optimizes bundle performance. Use when building Angular 17+ applications with standalone components or signals, setting up NgRx stores,
Use when designing REST or GraphQL APIs, creating OpenAPI specifications, or planning API architecture. Invoke for resource modeling, versioning strategies, pagination patterns, error handling standards.
Use when designing new high-level system architecture, reviewing existing designs, or making architectural decisions. Invoke to create architecture diagrams, write Architecture Decision Records (ADRs), evaluate technology trade-offs, design component interactions, and plan for scalability. Use for s
Integrates with Atlassian products to manage project tracking and documentation via MCP protocol. Use when querying Jira issues with JQL filters, creating and updating tickets with custom fields, searching or editing Confluence pages with CQL, managing sprints and backlogs, setting up MCP server aut
Designs chaos experiments, creates failure injection frameworks, and facilitates game day exercises for distributed systems — producing runbooks, experiment manifests, rollback procedures, and post-mortem templates. Use when designing chaos experiments, implementing failure injection frameworks, or
Use when building CLI tools, implementing argument parsing, or adding interactive prompts. Invoke for parsing flags and subcommands, displaying progress bars and spinners, generating bash/zsh/fish completion scripts, CLI design, shell completions, and cross-platform terminal applications using comma
Designs cloud architectures, creates migration plans, generates cost optimization recommendations, and produces disaster recovery strategies across AWS, Azure, and GCP. Use when designing cloud architectures, planning migrations, or optimizing multi-cloud deployments. Invoke for Well-Architected Fra
Related database skillsscan passed
Discovers requirements and generates architectural, design, and deployment guidance for dynamic hybrid search systems by combining semantic search and keyword search. Optimized for AlloyDB hybrid search use cases in Google Cloud. Use when users need vector search combined with structured SQL filteri
Use when searching, extracting, ingesting, or querying a document collection with the NeMo Retriever 26.8.1 CLI, including local LanceDB indexes and deployed Retriever services. Use for PDFs, images, Office files, HTML, text, audio, and video; not for editing documents or web search.
Write, review, and test Supabase Row Level Security (RLS) policies so that one user cannot read or change another user''s rows. Use when creating or changing tables, policies, views, or security definer functions in a Supabase project, when reviewing a migration that touches RLS, or when asked to pr
Provides authoritative compatibility checks, pricing estimates, connection troubleshooting, pre-warming guidance, and infrastructure mutations for Amazon Keyspaces (for Apache Cassandra). Covers LWT/batch operations, secondary indexes, materialized views, capacity modes, TTL, PITR, CDC, auto-scaling