Firestore Data
ClineOfficialPublished by Cline
- Skill
- Tool integration
- Data and AI
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The firestore-data skill provides a set of tools for interacting with Google Cloud Firestore databases. It enables developers to perform standard CRUD operations, query collections with specific filters, and explore the database hierarchy. The skill requires data to be formatted in Firestore's native JSON structure, including explicit type indicators for all fields, ensuring precise and predictable data manipulation.
What it does
- Add new documents to collections with typed field definitions
- Retrieve specific documents by their relative paths
- Delete multiple documents using their paths
- Query collections using various operators and ordering
- Update existing documents with support for selective field updates via masks
- List subcollections within the Firestore hierarchy
When to use it
- When you need to perform programmatic CRUD operations on Firestore data
- When you need to query collections based on specific field criteria
- When you are exploring the structure of a Firestore database
- When you need to update specific fields in a document without overwriting the entire object
Advantages
- Supports granular control over document updates using update masks
- Provides structured querying capabilities for complex data retrieval
- Enforces explicit data typing for reliable Firestore interactions
- Allows for efficient context management by toggling return data
Usage examples
- “Add a new user document to the users collection with a name and age.”
- The agent executes the add_documents script with the collectionPath set to 'users' and the documentData formatted with stringValue and integerValue types.
- “Find all users older than 18 in the users collection.”
- The agent uses query_collection with the path 'users' and a filter object specifying the field 'age', operator '>', and value 18.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/cline/firestore-data/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip firestore-data.zip -d .agents/skills
Documentation by Cline
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 :
Always use typed values in the documentData: Every field must be wrapped with its appropriate type indicator (e.g., {"stringValue": "text"})
Integer values can be strings in the documentData: The tool accepts integer values as strings (e.g., {"integerValue": "1500"})
Use returnData sparingly: Only set to true when you need to verify the exact data that was written
Validate data before sending: Ensure your data matches Firestore's native JSON format
Handle timestamps properly: Use RFC3339 format for timestamp strings
Base64 encode binary data: Binary data must be base64 encoded in the bytesValue field
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|
delete_documents
Delete multiple documents from Firestore
Parameters
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| documentPaths | array | Array of relative document paths to delete from Firestore (e.g., 'users/userId' or 'users/userId/posts/postId'). Note: These are relative paths, NOT absolute paths like 'projects/{project_id}/databases/{database_id}/documents/...' | Yes |
get_documents
Gets multiple documents from Firestore by their paths
Parameters
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| documentPaths | array | Array of relative document paths to retrieve from Firestore (e.g., 'users/userId' or 'users/userId/posts/postId'). Note: These are relative paths, NOT absolute paths like 'projects/{project_id}/databases/{database_id}/documents/...' | Yes |
list_collections
List Firestore collections for a given parent path
Parameters
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| parentPath | string | Relative parent document path to list subcollections from (e.g., 'users/userId'). If not provided, lists root collections. Note: This is a relative path, NOT an absolute path like 'projects/{project_id}/databases/{database_id}/documents/...' | No |
query_collection
Retrieves one or more Firestore documents from a collection in a database in the current project by a collection with a full document path. Use this if you know the exact path of a collection and the filtering clause you would like for the document.
Parameters
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| collectionPath | string | The relative path to the Firestore collection to query (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 | |
| filters | array | Array of filter objects to apply to the query. Each filter is a JSON string with: |
field: The field name to filter on
op: The operator to use ("<", "<=", ">", ">=", "==", "!=", "array-contains", "array-contains-any", "in", "not-in")
value: The value to compare against (can be string, number, boolean, or array) Example: {"field": "age", "op": ">", "value": 18} | Yes | | | orderBy | string | JSON string specifying the field and direction to order by (e.g., {"field": "name", "direction": "ASCENDING"}). Leave empty if not specified | Yes | | | limit | integer | The maximum number of documents to return | No |
100| | analyzeQuery | boolean | If true, returns query explain metrics including execution statistics | No |false|
update_document
Updates an existing document in Firestore. Supports both full document updates and selective field updates using an update mask. Please follow the best practices:
Use update masks for precision: When you only need to update specific fields, use the updateMask parameter to avoid unintended changes
Always use typed values in the documentData: Every field must be wrapped with its appropriate type indicator (e.g., {"stringValue": "text"})
Delete fields using update mask: To delete fields, include them in the updateMask but omit them from documentData
Integer values can be strings: The skill accepts integer values as strings (e.g., {"integerValue": "1500"})
Use returnData sparingly: Only set to true when you need to verify the exact data after the update
Handle timestamps properly: Use RFC3339 format for timestamp strings
Consider security rules: Ensure your Firestore security rules allow document updates
Parameters
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| documentPath | string | The relative path of the document which needs to be updated (e.g., 'users/userId' or 'users/userId/posts/postId'). 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 | | | updateMask | array | The selective fields to update. If not provided, all fields in documentData will be updated. When provided, only the specified fields will be updated. Fields referenced in the mask but not present in documentData will be deleted from the document | No | | | returnData | boolean | If set to true the output will have the data of the updated document. This flag if set to false will help avoid overloading the context of the agent. | No |
false|
Files
- ATTRIBUTION.mdAdded by AutoGineer834 B
- LICENSELicence file added by AutoGineer10.5 KiB
- SKILL.md8.0 KiB
- scripts/add_documents.jsScript3.0 KiB
- scripts/delete_documents.jsScript3.0 KiB
- scripts/get_documents.jsScript3.0 KiB
- scripts/list_collections.jsScript3.0 KiB
- scripts/query_collection.jsScript3.0 KiB
- scripts/update_document.jsScript3.0 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Node.js
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Cline
- Publisher
- Cline (Official)
- Source
- cline/skills · skills/firestore-data · commit 2637846
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Cline.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download firestore-data.zip