live-dev-storage-init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

live-dev-storage-init

live-dev-storage-init

This skill handles backend resource provisioning specifically for Firebase and Firestore database setup.
bash
blocks are POSIX (Git Bash on Windows). Any logic beyond one command/pipe lives in
resources/*.js
(if applicable), never in shell control flow. If your Bash tool is cmd.exe or PowerShell, translate each snippet before running it.
本Skill专门处理Firebase和Firestore数据库设置的后端资源配置。
bash
代码块遵循POSIX标准(Windows系统可使用Git Bash)。任何超出单条命令/管道的逻辑都应放在
resources/*.js
中(如适用),绝不要放在shell控制流中。如果你的Bash工具是cmd.exe或PowerShell,请在运行前转换每个代码片段。

1. Firebase & Firestore Provisioning

1. Firebase & Firestore 配置

Configure or verify Firebase resources in this order:
ResourceSkip ifConstraints
Firebase project
.firebaserc
Project ids are globally unique → generate
<repo-name>-<rand4>
, never ask the user to invent one.
Firestore databaseit already existsid is the literal
'(default)'
— quote it, bash eats the parens. Location
us-central1
unless data-residency is stated.
firebase.json
file exists
firebase init firestore
must run non-interactively; hand-write the file if it prompts. Without it, both deploy and the emulator fail.
firestore.rules
never skipauthor before deploying:
allow read, write: if false;
+ per-collection auth rules from
references/react-firestore-rules.md
. Deploy immediately — never leave test-mode rules live.
  • Blaze-plan features (Cloud Functions, outbound calls from triggers) need a card entered in the Console — the CLI cannot do it. This is the only legitimate console visit. On any billing/plan error: stop → name the single step → link
    https://console.firebase.google.com/project/<id>/usage/details
    → resume on confirmation.
  • Local QA verification using Firestore emulator should follow rules in
    references/react-firestore-rules.md
    .
按以下顺序配置或验证Firebase资源:
资源可跳过条件约束
Firebase项目已存在
.firebaserc
项目ID全局唯一 → 生成格式为
<repo-name>-<rand4>
,切勿让用户自行创建。
Firestore数据库已存在ID为字面量
'(default)'
— 需添加引号,否则bash会解析括号。位置默认
us-central1
,除非有数据驻留要求。
firebase.json
文件已存在
firebase init firestore
必须以非交互模式运行;若出现提示则手动编写该文件。没有此文件,部署和模拟器都会失败。
firestore.rules
不可跳过部署前编写规则:
allow read, write: if false;
+ 来自
references/react-firestore-rules.md
的按集合划分的权限规则。立即部署 — 切勿让测试模式规则处于生效状态。
  • Blaze计划功能(Cloud Functions、触发器的出站调用)需要在控制台中绑定银行卡 — CLI无法完成此操作。这是唯一需要访问控制台的合法场景。遇到任何计费/计划错误时:停止操作 → 明确说明这一步骤 → 链接
    https://console.firebase.google.com/project/<id>/usage/details
    → 确认后再继续。
  • 使用Firestore模拟器进行本地QA验证时,请遵循
    references/react-firestore-rules.md
    中的规则。