Communitygithub.com

umairmsm/wp-operate

WordPress 網站營運階段:備份、災難復原、憑證管理與多機工作流程。適用於「備份」、「還原」、「搬遷至新機器/伺服器」、「更新外掛」、「伺服器故障應變」、「從雲端主機工作」、「設定第二台機器」。

wp-operate 是什麼?

這個技能對應 wp-site-kit WordPress 建置流程的第八階段「營運 (Operate)」,專注於網站上線後的維運工作,確保網站能承受筆電遺失、伺服器故障、錯誤更新或更換機器等狀況,且不需有人記住繁複的步驟。它支援所有使用 SKILL.md 文件的 AI 編程工具(如 Claude Code、Cursor、Codex 等)。技能涵蓋自動化備份腳本 (`scripts/backup.sh`),支援加密與離線備份;詳細的災難復原手冊模板,包含憑證清單 (`CREDENTIALS_INVENTORY.md`) 與營運程序 (`OPERATIONS.md`);以及多機工作流程,利用橋接文件、工作站檢查腳本與加密狀態套件來確保環境一致。此外,它還整合了還原演練的規範與定時檢查,並從過往教訓中學習,例如備份路徑設定、雲端主機的 Git bundle 救援,以及跨平台視覺基準的處理方式。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

第八階段:營運 (Operate)

目標:網站能夠承受筆電遺失、伺服器故障、錯誤更新或更換機器等情況,且不需要任何人記住如何處理。

步驟

  1. 備份。
    • 每週執行 scripts/backup.sh,並在進行有風險的操作前執行。它會打包資料庫、上傳檔案、所有 Git 分支與暫存區,以及 Claude 記憶。
    • 在壓縮檔離開本機前使用 --encrypt,並在機器外保留一份副本。
    • 線上備份:主機的每日備份,加上部署與內容腳本產生的匯出檔。
  2. 記錄所有資源的位置,寫在專案內的 docs/reference/DISASTER_RECOVERY.md 的章節 0 中。包括原始照片資料夾:它不在 Git 中。
  3. 還原演練。 每季度在備用機器或全新的 DDEV 專案上執行一次還原,計時並記錄在 §5 中。從未還原過的備份只是個希望,不是備份。
  4. 憑證: 每個機密在 CREDENTIALS_INVENTORY.md 中都有一行記錄(名稱、存放位置、誰擁有、上次輪換時間)。輪換任何曾被 AI 代理看過的機密。
  5. 例行工作: 週、月、年度的檢查項目、更新政策與警報設定在 docs/reference/OPERATIONS.md 中。外掛更新先上到暫存環境。
  6. 使用超過一台機器? 遵循 references/multi-machine.md:
    • docs/team/BRIDGE.md 存放角色、規則與交接記錄;
    • scripts/workstation-doctor.sh 檢查環境一致性;
    • scripts/make-state-bundle.sh 打包被 Git 忽略的設定檔(加密)。

閘門 (在 SITE_STATUS.md 中打勾)

  • 已排程備份,並有離機副本
  • 已執行還原演練(日期、耗時分鐘數)
  • 更新與警報例行程序已寫入 OPERATIONS.md

教訓

  • 備份腳本曾指向錯誤的 Claude 記憶資料夾。工作階段是從上層資料夾執行的,因此記憶檔案存在不同的路徑下。腳本會推導出路徑,但為此情況接受 CLAUDE_MEM= 參數。
  • 某個雲端構建主機上有一個分支和暫存區只在該主機上存在,且該主機無法推送。請在該主機關閉或刪除之前,使用 SSH git bundle 將它們提取出來。
  • 在一種作業系統上建立的視覺基準,在另一種上會失敗。請將它們保留在固定的 Docker 映像檔中。
  • 有結束日期的免費方案或點數,就是一個退出演練的期限:在到期前一週,證明你可以從 Git、狀態套件和備份檔,在下一台機器上重建網站。

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-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-ship

Stage 7 of a wp-site-kit WordPress build - staging behind Cloudflare Access, server hardening, safe deploys from a commit (scripts/deploy-safe.sh), database content changes, the launch audit, DNS cutover without breaking a running business, and the first week after launch. Use for "deploy", "set up staging", "go live", "launch", "cutover", "move DNS", "harden the server".

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.

相關技能