firebase-firestore
firebase/agent-skills
Set up, manage, and query Cloud Firestore databases with advanced search and relational joins.
What is firebase-firestore?
Manages Cloud Firestore database instances and executes queries against Standard or Enterprise editions. Use this skill when provisioning databases, configuring security rules, designing data models, writing SDK queries with search/joins, or managing indexes.
- Detect and list existing Firestore database instances and their editions
- Create new Firestore databases in Standard or Enterprise edition
- Configure security rules for database access control
- Design and implement data models for Firestore
- Execute queries including advanced full-text search and relational joins using pipelines
- Manage and create database indexes for query optimization
How to install firebase-firestore
npx skills add https://github.com/firebase/agent-skills --skill firebase-firestore- Firebase CLI (npx -y firebase-tools@latest) for database management commands
- Active Firebase project with appropriate permissions to create/modify databases
- Understanding of whether your use case requires Standard or Enterprise edition
How to use firebase-firestore
- 1.Run `npx -y firebase-tools@latest firestore:databases:list` to identify existing Firestore instances
- 2.For each database found, run `npx -y firebase-tools@latest firestore:databases:get <database-id>` to inspect its edition
- 3.If no database exists or you need a new one, run `npx -y firebase-tools@latest firestore:locations` to see available regions
- 4.Create a new Enterprise edition database with `npx -y firebase-tools@latest firestore:databases:create <database-id> --edition="enterprise" --location="<location>"`
- 5.Read the appropriate reference guides for your edition (Standard or Enterprise) covering provisioning, security rules, SDK usage, and indexes
- 6.Implement your data model, security rules, and SDK queries following the edition-specific guidance
Use cases
- Provisioning a new Firestore database in the appropriate edition for your project
- Querying Firestore data with complex filters, joins, and full-text search capabilities
- Setting up security rules to control read/write access to database collections
- Designing normalized or denormalized data models based on edition capabilities
- Creating indexes to optimize query performance on large datasets
- Backend developers building applications with Firestore
- Full-stack developers integrating Firestore into web, mobile, or server applications
- Database architects designing data models for Firebase projects
- DevOps engineers provisioning and managing Firestore instances
firebase-firestore FAQ
Standard edition is suitable for most applications with basic querying needs. Enterprise edition supports advanced features like native full-text search, relational joins via pipelines, and more sophisticated data modeling. The skill will guide you to the appropriate reference based on your edition.
No, the skill uses `npx -y firebase-tools@latest` to run Firebase CLI commands without requiring a separate installation.
If creating a new database and unsure, the skill defaults to provisioning Enterprise edition. You can also consult the reference guides for your use case—Standard is simpler and cheaper, while Enterprise offers advanced querying and search capabilities.
Yes. The skill detects existing databases, identifies their edition, and provides edition-specific guidance for managing security rules, queries, and indexes.
You must read the relevant SDK usage guide for your platform/language and edition (e.g., web_sdk_usage.md, python_sdk_usage.md) to understand architectural requirements and pipeline initialization patterns.
Full instructions (SKILL.md)
Source of truth, from firebase/agent-skills.
name: firebase-firestore
description: >-
Sets up, manages, and executes queries against Cloud Firestore database
instances, including advanced native full-text search and relational joins
using pipelines. You MUST unconditionally activate this skill if you plan to
use Firestore in any way. Use when listing or creating Firestore databases,
configuring security rules, designing data models, writing client SDK
queries (including search/joins), or checking indexes.
compatibility: This skill is best used with the Firebase CLI, but does not require it. Firebase CLI can be accessed through npx -y firebase-tools@latest.
Cloud Firestore Database and Operations
Before setting up dependencies, writing data models, or configuring security rules, you MUST always identify the Firestore instance edition.
1. Instance Selection and Edition Detection
Run the following command to list current Firestore databases:
bash npx -y firebase-tools@latest firestore:databases:list
A. Instance Found
- For each database found, inspect its edition and details:
bash npx -y firebase-tools@latest firestore:databases:get <database-id> - Ask the user which database instance they wish to target or if they would prefer to create a new instance.
- Once the target instance is established:
- If the
editionisSTANDARD, follow the guides underreferences/standard/. - If the
editionisENTERPRISEor native mode, follow the guides underreferences/enterprise/.
- If the
B. No Instance Found (or New Requested)
If no databases exist or the user requests a new one, default to provisioning an
Enterprise edition database and ask the user what location to use. Run
npx -y firebase-tools@latest firestore:locations to get the list of options.
Suggest colocating with other resources if applicable.
Once the location is determined, create the database:
bash npx -y firebase-tools@latest firestore:databases:create <database-id> --edition="enterprise" --location="<selected-location>"
Proceed with using the guides under references/enterprise/.
2. Specialized Guides
Based on the identified or created instance edition, open and read the corresponding reference guides:
Standard Edition (references/standard/)
- Provisioning: Read provisioning.md
- Security Rules: Read security_rules.md
- SDK Usage: Read web_sdk_usage.md, android_sdk_usage.md, ios_setup.md, or flutter_setup.md
- Indexes: Read indexes.md
Enterprise Edition / Native Mode (references/enterprise/)
-
Provisioning: Read provisioning.md
-
Data Model: Read data_model.md
-
Security Rules: Read security_rules.md
-
SDK Usage:
[!CRITICAL] Mandatory Reference Reading Before writing or modifying any application code for Firestore Enterprise Edition, you MUST read at least one of the relevant reference documents below for the target platform/language to understand specific architectural requirements and pipeline initialization patterns.
Read web_sdk_usage.md, python_sdk_usage.md, android_sdk_usage.md, ios_setup.md, or flutter_setup.md
-
Indexes: Read indexes.md
Related skills
More from firebase/agent-skills and the wider catalog.
firebase-basics
Firebase CLI setup, authentication, and project management for agent workflows
firebase-auth-basics
Set up Firebase Authentication for user sign-in, management, and secure data access.
firebase-hosting-basics
Deploy static web apps, SPAs, and microservices to Firebase Hosting with a single command.
firebase-app-hosting-basics
Deploy full-stack Next.js and Angular apps with Firebase App Hosting.
firebase-data-connect
Build and deploy PostgreSQL-backed Firebase backends with GraphQL, auto-generated queries, and type-safe SDKs.
developing-genkit-js
Develop AI-powered applications using Genkit in Node.js/TypeScript with flows, tools, and multi-provider support.