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.

referencesenterpriseprovisioning.md

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

Provisioning Firestore Enterprise Native Mode

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 a Firestore Enterprise Database: Create a Firestore Enterprise database using the Firebase CLI.
  2. Create firebase.json: This file contains database configuration for the Firebase CLI.
  3. Create firestore.rules: This file contains your security rules.
  4. Create firestore.indexes.json: This file contains your index definitions.

1. Create a Firestore Enterprise Database

If the user needs to create a new database, 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.

Use the following command to create a Firestore Enterprise database:

firebase firestore:databases:create my-database-id \
  --location="<selected-location>" \
  --edition="enterprise" \
  --firestore-data-access="ENABLED" \
  --mongodb-compatible-data-access="DISABLED"

This will create an enterprise database in the selected location with native mode enabled. A database id is required to create an enterprise database and the database id must not be (default). To enable realtime-updates feature, use --realtime-updates flag.

firebase firestore:databases:create my-database-id \
  --location="<selected-location>" \
  --edition="enterprise" \
  --firestore-data-access="ENABLED" \
  --mongodb-compatible-data-access="DISABLED" \
  --realtime-updates="ENABLED"

2. Create firebase.json

Create a file named firebase.json in your project root with the following content (edit database and location to match the ones you created above). If this file already exists, instead append to the existing JSON:

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json",
    "edition": "enterprise",
    "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 rules and indexes

# To deploy all rules and indexes
firebase deploy --only firestore

# To deploy just rules
firebase deploy --only firestore:rules

# To deploy just indexes
firebase deploy --only firestore:indexes

Local Emulation

To run Firestore locally for development and testing:

firebase 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