firestore-data

A guide and set of scripts for working with Firestore, Google's NoSQL document database. It covers adding documents and exploring collections and document hierarchies using Node.js.

In plain words
What is it for?
Use it to add, retrieve, query, and inspect Firestore documents and collections with typed JSON input.
Why use it?
It reduces errors when formatting Firestore values, handling timestamps, and passing data to database operations.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gemini-cli-extensions/firestore-native/firestore-data
Any agent
npx skills add gemini-cli-extensions/firestore-native --skill firestore-data
Clone the repo
git clone --depth 1 https://github.com/gemini-cli-extensions/firestore-native

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,031 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.02031
Opus 5 $0.00015 $0.01015
Sonnet 5 $0.00006 $0.00406
Haiku 4.5 $0.00003 $0.00203

Measured 2d ago against content hash 9444fdb737f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

firestore-data scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/add_documents.js, scripts/delete_documents.js, scripts/get_documents.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/firestore-data/SKILL.md · 153 lines

How it starts

The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Usage

All scripts can be executed using Node.js. Replace <param_name> and <param_value> with actual values.

Bash: node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'

PowerShell: node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'

Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.

Scripts

add_documents

Adds a new document to a Firestore collection. Please follow the best practices :

  1. Always use typed values in the documentData: Every field must be wrapped with its appropriate type indicator (e.g., {"stringValue": "text"})
  2. Integer values can be strings in the documentData: The tool accepts integer values as strings (e.g., {"integerValue": "1500"})
  3. Use returnData sparingly: Only set to true when you need to verify the exact data that was written
  4. Validate data before sending: Ensure your data matches Firestore's native JSON format
  5. Handle timestamps properly: Use RFC3339 format for timestamp strings
  6. Base64 encode binary data: Binary data must be base64 encoded in the bytesValue field
  7. Consider security rules: Ensure your Firestore security rules allow document creation in the target collection
Parameters
Name Type Description Required Default
collectionPath string The relative path of the collection where the document will be added to (e.g., 'users' or 'users/userId/posts'). Note: This is a relative path, NOT an absolute path like 'projects/{project_id}/databases/{database_id}/documents/...' Yes
documentData object The document data in Firestore's native JSON format. Each field must be wrapped with a type indicator:
  • Strings: {"stringValue": "text"}
  • Integers: {"integerValue": "123"} or {"integerValue": 123}
  • Doubles: {"doubleValue": 123.45}
  • Booleans: {"booleanValue": true}
  • Timestamps: {"timestampValue": "2025-01-07T10:00:00Z"}
  • GeoPoints: {"geoPointValue": {"latitude": 34.05, "longitude": -118.24}}
  • Arrays: {"arrayValue": {"values": [{"stringValue": "item1"}, {"integerValue": "2"}]}}
  • Maps: {"mapValue": {"fields": {"key1": {"stringValue": "value1"}, "key2": {"booleanValue": true}}}}
  • Null: {"nullValue": null}
  • Bytes: {"bytesValue": "base64EncodedString"}
  • References: {"referenceValue": "collection/document"} | Yes | | | returnData | boolean | If set to true the output will have the data of the created document. This flag if set to false will help avoid overloading the context of the agent. | No | false |

Read the full file on GitHub · 153 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 153 lines · 30 tokens per session scan A 9444fdb737f0

Subscribe to this mod's changes

firestore-data is a skill published in the GitHub repository gemini-cli-extensions/firestore-native (30 stars, last pushed 5d ago), licensed Apache-2.0. It adds 30 tokens to every session and 2,031 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.