feat: add Antigravity plugin and Firestore security rules subagent - #172
feat: add Antigravity plugin and Firestore security rules subagent#172christhompsongoogle wants to merge 6 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces the official Firebase plugin for Antigravity, adding configuration files (plugin.json, mcp_config.json), updating the README.md with installation options, and defining a specialized firestore-rules-author subagent. The review feedback highlights a path mismatch in plugin.json for the MCP server configuration, an invalid type check (is number) in the Firestore security rules guidelines, and a potential runtime evaluation error in the isDocOwner helper function when resource is null during document creation.
| ], | ||
| "skills": "./skills/", | ||
| "agents": "./agents/", | ||
| "mcpServers": "./.mcp.json", |
There was a problem hiding this comment.
There is a mismatch between the MCP server configuration file name. The file added in this pull request is named mcp_config.json, but plugin.json references ./.mcp.json. Updating this reference ensures the Antigravity plugin loader can locate the MCP configuration.
| "mcpServers": "./.mcp.json", | |
| "mcpServers": "./mcp_config.json", |
| - Every list/array field must have size bounds: | ||
| - `data.tags is list && data.tags.size() <= 20` | ||
| - Number fields must have realistic boundaries: | ||
| - `data.price is number && data.price >= 0 && data.price <= 1000000` |
|
|
||
| - Validate all fields against explicit CEL types: | ||
| - `data.title is string` | ||
| - `data.count is int` or `data.price is number` |
| } | ||
|
|
||
| function isPositive(field) { | ||
| return request.resource.data[field] is number && request.resource.data[field] > 0; |
There was a problem hiding this comment.
In Cloud Firestore Security Rules, number is not a valid type for the is operator. To check if a value is a number, you must check if it is either an int or a float.
| return request.resource.data[field] is number && request.resource.data[field] > 0; | |
| return (request.resource.data[field] is int || request.resource.data[field] is float) && request.resource.data[field] > 0; |
| } | ||
|
|
||
| function isDocOwner() { | ||
| return isAuthenticated() && request.auth.uid == resource.data.uid; |
There was a problem hiding this comment.
During a create operation, the resource object is null because the document does not exist yet. Accessing resource.data directly will throw an evaluation error and cause the rule to fail. Adding a null check for resource ensures defensive and robust rule evaluation.
| return isAuthenticated() && request.auth.uid == resource.data.uid; | |
| return isAuthenticated() && resource != null && request.auth.uid == resource.data.uid; |
…ing only firestore-rules subagent
…directly in subagent
No description provided.