live-dev-deploy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselive-dev-deploy
开发-部署全流程
This skill guides local verification, test-driven auto-healing, preview URL delivery, and Git Flow release deployment.
bashresources/*.js本技能可引导完成本地验证、测试驱动的自动修复、预览URL交付以及Git Flow版本发布部署。
bashresources/*.js1. Git Flow & Release Lifecycle
1. Git Flow 与发布生命周期
| Transition | Trigger | Gate |
|---|---|---|
| new request | — |
| QA loop + secret scan PASS locally | |
| user approves the release prompt below | same CI wait → merge → tag → bump |
| immediately after the release PR merges | back-merge, no PR needed. The bump commit exists only on |
Release prompt, verbatim:
"Would you like to release this to the production environment?"- Version Bump: The release PR carries both the tag and the matching
v<major>.<minor>.<patch>(read it, defaultpackage.json:version, bump patch unless told otherwise).0.0.0 - Merge Restrictions: Never merge on red or pending CI. Red after green local → back into the QA healing loop → push → wait.
- Merge Conflicts: Show conflicts to the user. Do not self-resolve handwritten source conflicts.
- Staging vs. Production Deploy: Deploy via Vercel GitHub integration. Production deployments must not have Vercel Deployment Protection (password protection or Vercel Authentication) by default, ensuring public access.
- Public Access Validation: If a production deployment is not publicly accessible (redirects to login/fails ping), ask: "The production deployment is not publicly accessible. Would you like to enable public access?" and guide them to Vercel Project Dashboard (Settings -> Deployment Protection) to disable it.
- Rollback: In case of broken production, the merge commit on
git revert→ push.main
| 阶段过渡 | 触发条件 | 准入条件 |
|---|---|---|
| 新需求发起 | — |
| 本地QA循环+密钥扫描通过 | |
| 用户确认下方的发布提示 | 等待CI验证通过 → 合并 → 打标签 → 版本号升级 |
| 发布PR合并完成后立即执行 | 反向合并,无需创建PR。版本号升级提交仅存在于 |
发布提示原文:
"是否要将此版本发布到生产环境?"- 版本号升级: 发布PR需同时包含标签和对应的
v<major>.<minor>.<patch>(默认值为package.json:version,除非另有说明,否则升级补丁版本号)。0.0.0 - 合并限制: CI状态为红色或待处理时切勿合并。本地验证通过但CI失败 → 回到QA修复循环 → 推送代码 → 等待验证。
- 合并冲突: 将冲突内容展示给用户,不要自行解决手写代码的冲突。
- 预发布与生产环境部署: 通过Vercel GitHub集成进行部署。生产环境部署默认不应启用Vercel部署保护(密码保护或Vercel身份验证),以确保公开访问。
- 公开访问验证: 如果生产环境部署无法公开访问(重定向到登录页或ping测试失败),请询问:“生产环境部署无法公开访问,是否要启用公开访问?”并引导用户前往Vercel项目控制台(设置 -> 部署保护)关闭保护功能。
- 回滚: 若生产环境出现故障,在分支上执行
main撤销合并提交 → 推送代码。git revert
2. Local Verification & Auto-Healing
2. 本地验证与自动修复
Setup, port discovery, and test templates: . One port for dev server + + any test URL.
references/playwright-qa-rules.mdbaseURLGates, all green before any commit or push — never commit or push past a red one: the Playwright suite, , , and (staged diff, not ) before every commit.
lintbuildgitleaks protect --stageddetect- On failure: Parse errors/traces → fix implementation code only → rerun under the healing loop of (limit 3 attempts, then halt and report).
references/playwright-qa-rules.md - Secret Scan Gate: Any secret match blocks the commit → move to vault, reference via .
process.env - Firestore Local Verification: If features touch Firestore, run the QA loop against the Local Emulator Suite (), never the real project.
references/react-firestore-rules.md - Hooks: Install a committed, auto-installing hook manager (Husky/Lefthook) running lint + secret scan pre-commit.
环境配置、端口发现及测试模板:。开发服务器、及所有测试URL使用同一个端口。
references/playwright-qa-rules.mdbaseURL准入条件:提交或推送前必须全部验证通过——绝不允许跳过失败项进行提交或推送:每次提交前需运行Playwright测试套件、、以及(针对暂存区差异,而非命令)。
lintbuildgitleaks protect --stageddetect- 失败处理: 解析错误/追踪信息 → 仅修改实现代码 → 按照中的修复循环重新运行(最多尝试3次,之后停止并上报)。
references/playwright-qa-rules.md - 密钥扫描准入: 任何匹配到的密钥都会阻止提交 → 将密钥移至密钥库,通过引用。
process.env - Firestore本地验证: 若功能涉及Firestore,需针对本地模拟器套件()运行QA循环,切勿使用真实项目。
references/react-firestore-rules.md - 钩子: 安装已提交的自动安装钩子管理器(Husky/Lefthook),在提交前运行lint + 密钥扫描。
3. Preview-First Delivery
3. 优先交付预览链接
Never hand the user a link for verification. Run:
localhostbash
node resources/resolve-preview-url.js # exit 0 -> prints PREVIEW_URL=<url>- Polling uses to query GitHub Deployments API.
resolve-preview-url.js - If it takes too long, escalate:
- 60s: extend attempts, tell user a build is in progress.
- ~5 min: use non-interactive JSON filtered to the pushed commit.
vercel list - After that: report dashboard URL or .
vercel inspect
text
⚡️ Features deployed successfully! Preview URL: https://project-git-develop-user.vercel.app切勿向用户提供链接用于验证。运行以下命令:
localhostbash
node resources/resolve-preview-url.js # exit 0 -> prints PREVIEW_URL=<url>- 轮询通过查询GitHub Deployments API。
resolve-preview-url.js - 如果耗时过长,按以下步骤处理:
- 60秒:延长尝试次数,告知用户构建正在进行中。
- 约5分钟:使用非交互式JSON命令筛选已推送的提交。
vercel list - 超过5分钟:上报控制台URL或使用查询。
vercel inspect
text
⚡️ Features deployed successfully! Preview URL: https://project-git-develop-user.vercel.app4. Guardrails
4. 防护规则
Bad pattern requested (prop drilling over Context, bypassing GitHub automation, reusing preview database for production, …) → halt and emit:
| Requested | Proposed alternative | |
|---|---|---|
| Security risk | ||
| Maintenance cost |
Resume only on the verbatim string
"I understand the risk and insist on this."若请求使用不良模式(如通过Props传递替代Context、绕过GitHub自动化、将预览数据库用于生产环境等)→ 停止操作并输出:
| 请求的操作 | 建议替代方案 | |
|---|---|---|
| 安全风险 | ||
| 维护成本 |
仅当用户输入原文时才继续操作。
"I understand the risk and insist on this."5. Output Format
5. 输出格式
Verification Log
验证日志
- Vercel Deployment Link: [preview or production URL]
- Git Branch: [feature branch / develop / main]
- PLAYWRIGHT Test Status: [PASS / FAIL]
- Vercel部署链接: [预览或生产环境URL]
- Git分支: [功能分支 / develop / main]
- PLAYWRIGHT测试状态: [通过 / 失败]
Checklist
检查清单
| ID | Item | Result | Evidence |
|---|---|---|---|
| F1 | Local QA Test | PASS / FAIL / N/A | [test log snippet] |
| F2 | Preview URL | PASS / FAIL / N/A | [live vercel preview URL] |
| F3 | Secret Scan | PASS / FAIL / N/A | [scan result summary] |
| ID | 检查项 | 结果 | 证据 |
|---|---|---|---|
| F1 | 本地QA测试 | 通过 / 失败 / 不适用 | [测试日志片段] |
| F2 | 预览URL | 通过 / 失败 / 不适用 | [Vercel实时预览URL] |
| F3 | 密钥扫描 | 通过 / 失败 / 不适用 | [扫描结果摘要] |
Code Changes
代码变更
- : [description of change]
[file path]
- : [变更描述]
[文件路径]
Smoke Test Output
冒烟测试输出
text
[Playwright execution output]text
[Playwright execution output]Remaining Risks
剩余风险
- [untested features, credentials isolation, or "None"]
- [未测试功能、凭证隔离情况,或“无”]
Recurrence Protection
重复风险防护
- [Rule / Hook / Test / Skill / "Not Needed" + reason; plus the repo URL, Vercel project, and Firebase project id]
- [规则 / 钩子 / 测试 / 技能 / “无需防护”+原因;同时提供仓库URL、Vercel项目及Firebase项目ID]