All skills
firebase avatar

/firebase-firestore

@cad5019 official
by firebasefirebase/agent-skills461 stars
102

Sets up, manages, queries, and configures Cloud Firestore databases (Standard/Enterprise edition), including data modeling, security rules, indexes, and SDK integrations (Web, Python, iOS, Android, Flutter). Use when 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 Firebase Hosting, Data Connect, Auth, Storage/GCS, Crashlytics, Functions, or BigQuery.

Use this Skill: https://skilld.dev/gh/firebase/agent-skills/firebase-firestore

This session only. Nothing lands on disk.

referencesstandardprovisioning.md

≈725 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Provisioning Cloud Firestore

Manual Initialization

Initialize the following firebase configuration files manually. Do not use npx -y firebase-tools@latest init, as it expects interactive inputs.

  1. Create firebase.json: This file configures the Firebase CLI.
  2. Create firestore.rules: This file contains your security rules.
  3. Create firestore.indexes.json: This file contains your index definitions.

1. Create firebase.json

Create a file named firebase.json in your project root with the following content. If this file already exists, instead append to the existing JSON:

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  }
}

This will use the default database with the Standard edition. To use a different database, specify the database ID and location:

  1. Run npx -y firebase-tools@latest firestore:locations to get the list of locations.
  2. Ask the user which location to use, suggesting colocation if other parts of the app already have a region selected.

You can check the list of available databases using npx -y firebase-tools@latest firestore:databases:list.

If the database does not exist, it will be created when you deploy with the specified configuration:

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json",
    "database": "my-database-id",
    "location": "<selected-location>"
  }
}

2. Create firestore.rules

Create a file named firestore.rules. A good starting point (locking down the database) is:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false;
    }
  }
}

See the firestore-rules-creation skill for how to write actual rules.

3. Create firestore.indexes.json

Create a file named firestore.indexes.json with an empty configuration to start:

{
  "indexes": [],
  "fieldOverrides": []
}

See indexes.md for how to configure indexes.

Deploy database, rules and indexes

CRITICAL: You MUST deploy the firestore configuration for the database to be provisioned in the cloud and for your rules/indexes to take effect. If you don't run this, your database will not exist.

# To deploy all rules and indexes
npx -y firebase-tools@latest deploy --only firestore

# To deploy just rules
npx -y firebase-tools@latest deploy --only firestore:rules

# To deploy just indexes
npx -y firebase-tools@latest deploy --only firestore:indexes

Local Emulation

To run Firestore locally for development and testing:

npx -y firebase-tools@latest emulators:start --only firestore

This starts the Firestore emulator, typically on port 8080. You can interact with it using the Emulator UI (usually at http://localhost:4000/firestore).

Source: SKILL.md on GitHub

1 warning3d3 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    The skill is generally safe, utilizing official Firebase tools and Google-hosted resources. It contains a minor vulnerability surface for indirect prompt injection by instructing the agent to read documentation from local library files. Additionally, it uses assertive language to mandate specific technical patterns.

  • Socket3d

    No alerts

  • Snyk3d

    Risk: MEDIUM · 1 issue

Signed by skilld at cad5019. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last week
metadata
{
  "category": "Databases"
}
Other metadata
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`.

README badge

README badge for firebase/agent-skills/firebase-firestore