Skill Press

No. 53 · firebase-firestore

Cloud Firestore Database and Operations

A field guide from Firebase

Firebase

When to use it

Sets up, manages, queries, and configures Cloud Firestore databases (Standard/Enterprise edition), including data modeling, security rules, indexes, and SDK integrations (Web, Admin, Python, iOS, Android, Flutter). Use when adding or migrating app databases, creating/listing Firestore databases, defining data models/indexes, writing SDK queries, or integrating Firestore SDKs. For authoring or modifying Firestore Security Rules (firestore.rules), delegate to the firestore-rules-author subagent if subagent delegation is available, or use firestore-rules-creation otherwise. Don't use for Data Connect, BigQuery, or standalone Hosting, Auth, Storage/GCS, Crashlytics, or Functions tasks.

Rank
No. 53 of 971
Installs
151,752
Runs in
Gemini, Codex
Length
434 words · 2 min
Files
16
License
Apache-2.0

Get this skill

Download the skill folder (.zip, 34 KB) ↓ · SKILL.md only ↓

Agent prompt

Paste into a coding agent with terminal access. Check the upstream requirements for the skill you’re installing.

Prompt
Install the "firebase-firestore" Agent Skill by Firebase, from https://github.com/firebase/agent-skills.

1. Fetch the whole folder skills/firebase-firestore — SKILL.md plus every script, reference, and asset beside it, not just SKILL.md. For example:
   skill_checkout=$(mktemp -d)
   git init "$skill_checkout"
   git -C "$skill_checkout" fetch --depth 1 https://github.com/firebase/agent-skills.git 99954a30898bb5ddc8152ee10e124dc3b4106bf7
   git -C "$skill_checkout" checkout --detach FETCH_HEAD
2. Copy it into your skills directory as a folder named "firebase-firestore":
   - Claude Code: ~/.claude/skills/firebase-firestore/ (all projects) or .claude/skills/firebase-firestore/ (this project only)
   - Another agent: the directory you load Agent Skills from (folders containing a SKILL.md)
3. Check that firebase-firestore/SKILL.md exists and its frontmatter says name: firebase-firestore.
4. Read SKILL.md, then tell me in two or three sentences what the skill does and when it will trigger, and list any dependencies it mentions (Python packages, npm packages, CLIs) that aren't installed yet. Don't install them without asking.

skills CLI

One command; the skills.sh installer detects your agents (Claude Code, Cursor, Codex, and more).

Terminal
npx skills add https://github.com/firebase/agent-skills/tree/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-firestore --skill firebase-firestore
This skill on skills.sh ↗

Contents

  1. 1. Instance Selection and Edition Detection
  2. 2. Specialized Guides

The skill, in full

[!IMPORTANT] Security Rules Authoring (firestore.rules) Whenever setting up a Firestore-backed app or creating/modifying firestore.rules, configure "firestore": { "rules": "firestore.rules" } in firebase.json and deploy firestore.rules (npx -y firebase-tools@latest deploy --only firestore:rules), even if server routes use the Admin SDK:

  • If subagent delegation AND the firestore-rules-author subagent are available: delegate authoring firestore.rules to the firestore-rules-author subagent rather than writing firestore.rules directly in the main agent.
  • If subagent delegation is unavailable (e.g., subagents not enabled in the IDE) OR firestore-rules-author is not installed: read and follow the firestore-rules-creation skill to write firestore.rules directly.

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:

npx -y firebase-tools@latest firestore:databases:list

A. Instance Found

  1. For each database found, inspect its edition and details:

    npx -y firebase-tools@latest firestore:databases:get <database-id>
    
  2. Ask the user which database instance they wish to target or if they would prefer to create a new instance.

  3. Once the target instance is established:

    • If the edition is STANDARD, follow the guides under references/standard/.
    • If the edition is ENTERPRISE or native mode, follow the guides under references/enterprise/.

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:

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/)

Enterprise Edition / Native Mode (references/enterprise/)

More in Databases & Storage

All Databases & Storage skills →

More from Firebase

From firebase/agent-skills at 99954a3, Apache-2.0. Install counts from skills.sh.