Community编程与开发github.com

umairmsm/wp-ship

WordPress站点构建的第七阶段——在Cloudflare Access后搭建预发布环境、加固服务器、通过提交安全部署、数据库内容变更、发布审计、不影响线上业务的DNS切换以及上线后的第一周监控。

wp-ship 是什么?

这个AI技能(Agent Skill)是 `wp-site-kit` WordPress 构建流程的第七阶段(Ship),专门用于完成预发布环境搭建、服务器加固、安全部署、内容变更、发布审计、DNS 切换和上线后监控。它适用于“部署”、“搭建预发布”、“正式上线”、“切换 DNS”、“加固服务器”等场景。该技能支持在任何终端中与 AI 开发助手(如 Claude Code、Cursor、Codex 等)配合使用,通过阅读和解释 Markdown 文档、运行脚本、检查状态文件来指导用户逐步操作。技能的核心原则是:**所有部署操作必须由用户手动完成**——AI 只能准备、检查、解释,不能 SSH 到服务器、运行 `deploy-safe.sh`、更改 DNS 或触碰 Cloudflare,除非用户明确要求。技能由详细的步骤、检查清单和历史事故总结组成,确保每次发布都可重复、可回滚、可审计。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/umairmsm/wp-site-kit/tree/HEAD/skills/wp-ship

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

第七阶段:发布(Ship)

目标:预发布环境与线上完全一致,每次部署都平淡无奇,上线当天具备回滚能力,且上线后的第一周受到监控。

所有者运行部署。 代理负责准备、检查和解释。除非所有者明确要求执行该操作,否则代理不得 SSH 到服务器、运行 deploy-safe.sh、更改 DNS 或触碰 Cloudflare。deploy-safe.sh 需要一个终端和一个手动输入的提交 ID,因此代理无法独立完成一次部署。

步骤

  1. 预发布环境(references/deploy-and-launch.md,“Staging”):在线上主机上拥有自己的文件夹和数据库,WP_ENVIRONMENT_TYPE=staging,位于 Cloudflare Access 之后,并提供用于咨询的测试收件箱。
  2. 加固每个服务器:使用项目的 docs/reference/DEPLOY_HARDENING.md。将结果记录到 docs/reference/SECURITY_PRELAUNCH.md 中。
  3. 边缘配置:使用 references/cloudflare-edge.md 中的 Cloudflare 设置。在旧主机前启用代理之前,先测试一下:某些主机根据 IP 进行限速,可能会屏蔽 Cloudflare。
  4. 部署代码,仅限所有者操作:
    • 根据示例填写 deploy/targets.conf;
    • 运行 scripts/deploy-safe.sh <commit> --target staging --dry-run,阅读变更列表,然后不带 --dry-run 再次运行;
    • 在已有代码的服务器上首次运行时,需要加上 --assume-live <commit>。
  5. 单独部署内容。
    • 代码绝不携带价格、页面或法律文本。
    • 每次变更记录为 docs/data/content-changes/<date>-<topic>.json(包含每个字段变更前后的值)。
    • 通过 scripts/apply-content-change.sh <file> --target staging(试运行)应用,然后使用 --apply。
    • 在任何数据库导入或移动之后,运行 scripts/check-emoji.sh --target <env>。
  6. 发布审计:针对预发布环境运行 launch-auditor 代理,修复失败项,然后再次运行直到通过。
  7. 割接计划。 根据 references/deploy-and-launch.md 中的“Cutover”编写割接计划。所有者批准日期和时间;如果网站已接受预订,业务合作伙伴也需要批准。
  8. 正式上线:部署到线上环境,针对线上环境运行 launch-auditor,将站点地图提交给 Search Console,向真实收件箱发送一条真实的测试咨询。
  9. 监控 7 天:错误、404 错误(添加重定向)、表单收件箱、分析数据、Search Console 覆盖率。

检查点(在 SITE_STATUS.md 中勾选)

  • 预发布环境位于 Access 之后,设置 noindex,邮件已保护
  • 安全加固已应用并记录
  • 安全部署到预发布环境;冒烟测试通过
  • launch-auditor 在预发布环境和线上环境均通过
  • 割接计划已批准(日期、回滚方案、邮件/MX 已检查)
  • 7天监控已完成

影响这些规则的事故

  • 一个代理修改了线上价格、发布了 AI 编写的条款并部署了未审查的功能,其报告遗漏了这次部署。此后:部署只能来自合并后的提交,通过脚本执行,由人工输入,生产环境 SSH 密钥每次使用都需要确认。
  • 预发布环境上的联系表单使用测试密钥发送到了第三方表单服务,因此咨询进入了测试收件箱。上线前,在线上发送一条真实的咨询,并确认其已到达。
  • 分析工具处于“精简”模式,连续数周未统计欧盟访客,导致核心市场被隐藏。在第一天检查设置。
  • 一次长时间部署(39 个提交)因 pipefail 下 git log | head 产生的 SIGPIPE 而停止。脚本现在先捕获输出。
  • 一次服务器数据库导入将表情符号变成了 ????。每次导入后运行 check-emoji.sh。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

umairmsm/wp-build

Stage 3 of a wp-site-kit WordPress build - local DDEV site, the core must-use plugin (modules), the presentation-only child theme with skins, the content model (custom post types, meta, WP_Query, render functions), and the enquiry pipeline that saves leads before forwarding. Use when building or changing features, templates, content types, forms or plugin modules on a wp-site-kit site.

umairmsm/wp-content

Stage 4 of a wp-site-kit WordPress build - real copy and photos. Content truth (facts only from the owner), AI drafts and owner approval, claims audits, banned words and fake proof, legal pages, the photo pipeline (dedupe, real-only, EXIF strip, WebP sizes, alt text, AI image register), and recorded content changes. Use for "write the copy", "add photos", "the owner sent new photos", "check for duplicates", "update prices or text on the live site", "legal pages".

umairmsm/wp-design

Stage 2 of a wp-site-kit WordPress build - design direction, a static HTML/CSS prototype with design tokens, owner sign-off with screenshots, self-hosted fonts, and porting the approved look into a swappable WordPress skin. Use for "design the site", "new look", "redesign", "change colours or fonts", "make a new skin", "port the prototype to WordPress".

umairmsm/wp-kickoff

Stage 1 of a wp-site-kit WordPress build. Use when starting a new WordPress website or taking over or rebuilding an existing one - discovery brief, stack decision, creating the project with bin/wp-site-new, locked decisions, private repo and credentials inventory. Triggers - "new WordPress site", "start a client website", "rebuild this site", "take over this WordPress site".

umairmsm/wp-operate

Stage 8 of a wp-site-kit WordPress build and everything after launch - backups with an off-machine copy, restore drills, the disaster-recovery runbook, credentials inventory, update policy, alerts, and working from more than one machine (bridge file, workstation doctor, encrypted state bundle, rescuing unpushed work). Use for "backup", "restore", "move to a new machine/server", "update plugins", "what if the server dies", "work from the cloud box", "set up a second machine".

umairmsm/wp-seo

Stage 5 of a wp-site-kit WordPress build - titles and descriptions, canonical URLs, one schema owner and JSON-LD, sitemaps, robots.txt and llms.txt, AI crawler access, redirects (301 vs 302), legacy URL maps, Search Console, and adding languages one pilot at a time with Polylang (hreflang, .po/.mo strings, native review). Use for "SEO", "schema", "redirect", "old URLs", "translate the site", "add French/Spanish", "hreflang", "canonical".

umairmsm/wp-site

Start here for any WordPress website built with wp-site-kit, from an empty folder to a live site. Use when someone says "build a WordPress site", "new website for a client", "where are we on the site", "what is next before launch", or asks to continue a site project. Finds the current stage from SITE_STATUS.md, applies the hard rules, and hands over to the right stage skill.

相关技能