用途
该技能用于在智能体工作流中处理 Cloud Firestore 数据库的搭建、管理与操作,包括数据建模、安全规则编写、索引配置以及各平台 SDK 的使用。
主要能力
- 列出并检查现有 Firestore 数据库实例及其版本(Standard 或 Enterprise)。
- 创建新的 Firestore 数据库实例(默认建议 Enterprise 版本)。
- 根据实例版本提供对应的配置指南:Standard 版涵盖 provisioning、安全规则、SDK 使用(Web、Android、iOS、Flutter)与索引;Enterprise/Native 模式涵盖 provisioning、数据模型、安全规则、SDK 使用(Web、Python、Android、iOS、Flutter)与索引。
- 安全规则编写:若支持子智能体委派且已安装 firestore-rules-author 子智能体,则委派其编写 firestore.rules;否则遵循 firestore-rules-creation 技能直接编写。
使用方式
- 识别实例版本:运行
npx -y firebase-tools@latest firestore:databases:list列出数据库。 - 若找到实例,对每个数据库运行
npx -y firebase-tools@latest firestore:databases:get <database-id>检查版本与详情,并询问用户目标实例或是否新建。 - 若未找到实例或用户要求新建,默认创建 Enterprise 版本数据库,先运行
npx -y firebase-tools@latest firestore:locations获取可用位置,再运行npx -y firebase-tools@latest firestore:databases:create <database-id> --edition="enterprise" --location="<selected-location>"。 - 根据版本打开对应参考指南:Standard 版读取 references/standard/ 下的 provisioning.md、web_sdk_usage.md、android_sdk_usage.md、ios_setup.md、flutter_setup.md、indexes.md;Enterprise/Native 模式读取 references/enterprise/ 下的 provisioning.md、data_model.md、web_sdk_usage.md、python_sdk_usage.md、android_sdk_usage.md、ios_setup.md、flutter_setup.md、indexes.md。
- 编写或修改 Enterprise 版应用代码前,必须至少阅读目标平台/语言对应的参考文档,以理解架构要求与管道初始化模式。
适用场景
适用于需要由智能体协助完成 Firestore 数据库初始化、版本识别、数据建模、安全规则编写、索引配置及多平台 SDK 接入的开发任务。
限制
安全规则编写依赖 firestore-rules-author 子智能体或 firestore-rules-creation 技能;具体收费、价格、平台支持范围等未在资料中提供。