Community程式設計與開發github.com

umairmsm/wp-ship

WordPress 網站建置的最後階段:上線前準備、安全部署、DNS 切換與上線後監控。用於「部署」、「設定暫存環境」、「正式上線」、「DNS 轉移」、「強化伺服器」。

wp-ship 是什麼?

此技能對應 wp-site-kit WordPress 建置流程的第七階段「Ship」,專注於將暫存環境與正式環境同步、執行可安全回滾的部署、進行上線稽核,以及管理 DNS 切換流程。它支援在 Cloudflare Access 後方建立暫存環境、強化了伺服器安全性、透過 `scripts/deploy-safe.sh` 要求人類在終端機輸入提交 ID 以確保安全,並將內容變更與程式碼部署嚴格分離,防止價格或法律文字意外被修改。此外,它還提供上線後七天的監控指引,包括錯誤、404、表單收件匣與分析工具的檢查清單。此技能設計給 Claude Code 等 AI 代理使用,代理負責準備、檢查與解釋,但最終的 SSH、部署腳本執行、Cloudflare 修改與 DNS 變更操作均由專案擁有者手動完成。

相容平台~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 的新對話。

說明文件

第七階段:出貨

目標:暫存環境與正式環境一致,每次部署都無聊可預測,上線當天有復原機制,且上線後第一週受到監控。

部署由專案擁有者執行。 代理負責準備、檢查與解釋。代理不得 SSH 到伺服器、執行 deploy-safe.sh、修改 DNS 或觸及 Cloudflare,除非專案擁有者明確要求該動作。deploy-safe.sh 需要終端機與手動輸入的提交 ID,因此代理無法獨自完成部署。

步驟

  1. 暫存環境(references/deploy-and-launch.md,「暫存環境」):在正式主機上擁有自己的資料夾與資料庫,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 的「切換」章節撰寫。專案擁有者批准日期與時間;如果網站已接受預約,則也需要業務合作夥伴的批准。
  8. 正式上線:部署至正式環境,對正式環境執行 launch-auditor,將 Sitemap 提交至 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.

相關技能