deployment-cleanup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedeployment-cleanup
deployment-cleanup
The site works, but it still thinks it is running on someone's laptop: canonical to , sitemap on , , a test-mode payment key, a route. This skill hunts those leftovers.
localhost:5173staging.NEXT_PUBLIC_API_URL=http://localhost:3001/debug网站功能正常,但它仍然像运行在某人的笔记本电脑上:canonical 指向 ,sitemap 指向 ,,使用 test 模式的支付密钥,以及存在 路由。此 skill 用于排查这些遗留项。
localhost:5173staging.NEXT_PUBLIC_API_URL=http://localhost:3001/debugActivate when
何时启用
- Before any launch, domain cutover, or move from preview to production.
- /
discoverability-allroute here (checks 17, 38).production-all - Not to deploy, change DNS, or edit production secrets.
- 在任何 launch、domain cutover,或从 preview 迁移到 production 之前。
- /
discoverability-all由此路由至这里(checks 17、38)。production-all - 不用于 deploy、修改 DNS 或编辑 production secrets。
Inspect
检查
-
Shipped-output sweep (run against a production build, not dev):bash
node scripts/scan-secrets.mjs --root . # DEV_URL_IN_SHIPPED_OUTPUT, SOURCEMAP_EXPOSED, DEBUG_ROUTE_PRESENT, secrets node scripts/inspect-metadata.mjs --url <site> --render # localhost/staging in canonical, OG, sitemap, robots, JSON-LD node scripts/check-links.mjs --url <site> --render # LINK_DEV_HOST, placeholder targets, form actionsPaths are relative to this skill's folder. -
Search config and source for:,
localhost,127.0.0.1,0.0.0.0,.local,staging,preview/.vercel.app(ok only if intended),.netlify.app,ngrok,example.com/TODO/FIXMEin user-visible strings,XXX/console.logwith sensitive data,debuggerguards that fail open, feature flags defaulting to "on" for admin/debug,if (process.env.NODE_ENV !== "production")/NEXT_PUBLIC_*URLs pointing at dev services.VITE_* -
Environment parity: which env vars the code needs (, config reads) vs. which are set in the deployment (owner confirms; you cannot read production values). Missing values silently falling back to dev defaults (
.env.example) are launch bugs.process.env.API_URL ?? "http://localhost:3001" -
Test vs live modes: payment provider keys (/
pk_testvs live), OAuth redirect URIs, webhook endpoints, email provider sandbox mode, analytics property IDs (dev vs prod), captcha test keys (sk_teststyle always-pass keys), map/API key restrictions (HTTP-referrer or origin restricted?).1x00000000000000000000AA -
Test data and accounts: seed users, default admin passwords, demo content, "test" products/orders, fake reviews, sample emails; sitemap/robots/noindex states appropriate for launch (aleft on production, or removed on a site meant to stay private).
noindex -
Build hygiene: production build succeeds without warnings that indicate misconfiguration; source maps excluded or access-restricted; no/
distcache directories committed; drafts and preview routes not shipped;.nextcorrect for production.robots.txt -
Ops basics (ask, do not assume): error monitoring installed and pointing at the right project; analytics environment separation; uptime check; backup for the database; domain/HTTPS/redirect policy set (); rollback path known.
security-headers -
Domain-move checklist when switching hosts: canonical/sitemap/OG/host absolutes updated; redirects from old hosts; OAuth/webhook URLs updated.
-
发布产物扫描(针对 production build 运行,而不是 dev):bash
node scripts/scan-secrets.mjs --root . # DEV_URL_IN_SHIPPED_OUTPUT, SOURCEMAP_EXPOSED, DEBUG_ROUTE_PRESENT, secrets node scripts/inspect-metadata.mjs --url <site> --render # localhost/staging in canonical, OG, sitemap, robots, JSON-LD node scripts/check-links.mjs --url <site> --render # LINK_DEV_HOST, placeholder targets, form actions路径相对于此 skill 所在目录。 -
在 config 和 source 中搜索:、
localhost、127.0.0.1、0.0.0.0、.local、staging、preview/.vercel.app(仅在意图明确时允许)、.netlify.app、ngrok、用户可见字符串中的example.com/TODO/FIXME、包含敏感数据的XXX/console.log、采用 fail open 的debuggerguard、为 admin/debug 默认设为if (process.env.NODE_ENV !== "production")的 feature flag,以及指向 dev service 的"on"/NEXT_PUBLIC_*URL。VITE_* -
**环境一致性:**代码需要哪些 env var(、config 读取项),以及 deployment 中设置了哪些 env var(由 owner 确认;你无法读取 production 值)。缺失值静默 fallback 到 dev 默认值(
.env.example)属于 launch bug。process.env.API_URL ?? "http://localhost:3001" -
**test 与 live 模式:**支付 provider 的 key(/
pk_test与 live key)、OAuth redirect URI、webhook endpoint、email provider 的 sandbox 模式、analytics property ID(dev 与 prod)、captcha test key(sk_test样式的永久通过 key),以及 map/API key 限制(是否限制 HTTP referrer 或 origin)。1x00000000000000000000AA -
**测试数据和账户:**seed 中的用户、默认 admin 密码、demo 内容、“test”商品或订单、虚假评价、示例邮箱;sitemap/robots/noindex 状态应符合上线目标(面向公网的 production 上不应残留;本应保持私有的站点则不应移除
noindex)。noindex -
**构建卫生:**production build 应成功完成,且不应出现表明 misconfiguration 的 warning;source map 应被排除或限制访问;不应将/
distcache 目录提交到版本库;draft 和 preview route 不应进入发布产物;.next应符合 production 要求。robots.txt -
运维基础项(需要询问,不要臆测):已安装错误监控并指向正确项目;analytics 环境已隔离;已配置 uptime check;数据库有 backup;已设置 domain/HTTPS/redirect 策略();已知 rollback 路径。
security-headers -
**切换 host 时的 domain 迁移检查清单:**更新 canonical/sitemap/OG/host 中的绝对 URL;配置旧 host 的 redirect;更新 OAuth/webhook URL。
Evidence that counts
有效证据
Label each claim OBSERVED, SOURCE-INDICATED, DECLARED, INFERRED, UNKNOWN, or REVIEW REQUIRED. UNKNOWN is never a pass and never a failure.
- A string in the shipped bundle or served HTML: OBSERVED. A string in source or config: SOURCE-INDICATED (it may not reach production).
- Production environment values are the owner's; ask them to confirm which are set. Do not read secrets from files.
.env - A or platform hostname may be the production host; do not call it a leftover without confirming intent.
.vercel.app
将每项结论标记为 OBSERVED、SOURCE-INDICATED、DECLARED、INFERRED、UNKNOWN 或 REVIEW REQUIRED。UNKNOWN 既不表示通过,也不表示失败。
- 发布 bundle 或已提供 HTML 中的字符串:OBSERVED。source 或 config 中的字符串:SOURCE-INDICATED(它可能不会进入 production)。
- production env 值由 owner 掌握;请 owner 确认已设置哪些值。不要从 文件读取 secrets。
.env - 或平台主机名可能就是 production host;未确认意图前,不要将其判定为遗留项。
.vercel.app
May change
可以修改的内容
Replace dev/staging URLs with the confirmed production origin (via env-driven config, not hardcoding); remove dev fallbacks that fail open (fail loudly instead); remove or gate debug routes and console noise; exclude source maps from production; delete test data from seeds shipped to production; fix /robots for the intended state; add entries; update docs listing required production env vars. Do not change deployment settings, DNS, or environment values on the platform.
noindex.env.example使用经确认的 production origin 替换 dev/staging URL(通过 env-driven config,不要硬编码);移除会 fail open 的 dev fallback(应改为明确报错);移除 debug route 和 console noise,或为其增加访问限制;从 production 中排除 source map;从会发布到 production 的 seed 中删除 test data;根据预期状态修正 noindex/robots;补充 条目;更新文档,列出 required production env var。不要修改平台上的 deployment 设置、DNS 或环境值。
.env.exampleMust not claim
不得声称
"Production-ready", "clean", or "no dev artifacts" beyond what the sweep covered. Say which builds and paths were scanned.
不得超出本次扫描的覆盖范围声称“Production-ready”、“clean”或“no dev artifacts”。应说明扫描了哪些 build 和 path。
Verify
验证
Rebuild and re-run the three commands; grep the rebuilt output for /; confirm debug routes 404 in production mode; confirm behavior with only production env values present (missing var now errors clearly).
localhoststaging重新构建并再次运行这三个命令;对重建后的 output grep /;确认 debug route 在 production 模式下返回 404;确认仅提供 production env 值时的行为(缺失 var 现在应明确报错)。
localhoststagingEscalate
升级处理
Test-mode keys in production or live keys exposed (owner action needed); real user data in test fixtures; anything requiring platform access; missing backups or monitoring for a launch with real users.
production 中存在 test-mode key,或 live key 已暴露(需要 owner 采取行动);test fixture 中包含真实用户数据;任何需要 platform access 的事项;面向真实用户上线时缺少 backup 或 monitoring。
No change is valid when
何时不修改也是有效结果
The sweeps are clean and the owner confirms production env parity. Do not remove intentional staging banners on a staging site.
各项扫描均未发现问题,且 owner 确认 production 环境一致时,不做修改是有效的。不要移除 staging site 上有意设置的 staging banner。