Community程式設計與開發github.com

FSWP 維護者

針對全端 WordPress 開發流程中的既有程式碼進行變更,包括更新、修復、重構與升級現有外掛與主題,並能安全地為非自己擁有的產品開發附加元件。

FSWP 維護者 是什麼?

FSWP Maintainer 是專為 Full-Stack WP Developer 流程設計的 AI 代理技能,專注於安全地修改既有 WordPress 程式碼。其核心原則是「既有程式碼即規格」,開發者必須先完整閱讀受影響的檔案,並以最小、最符合專案既有慣例的方式進行變更。該技能支援兩種主要模式:A) 更新現有外掛或主題,需遵守優先讀取、再現問題、最小變更、保護公開介面(含棄用流程)、升級路徑、相容性檢查、安全審查、版本與更新日誌管理;B) 為非自有產品開發附加元件,要求透過主產品的公開 API 擴充、宣告依賴關係、適當時機載入、優雅地失敗、明確支援版本範圍、宣告相容性(如 WooCommerce 的 HPOS)、資料自主管理與遵循授權命名規則。最後,變更成果需交付給 QA 工程師進行驗證。 此技能支援 Claude Code、Codex 等代理,並參考 `fswp-developer` 的簡潔編碼、編碼標準文件,以及 `fswp-security-engineer` 進行安全審查。開發者可直接諮詢此技能有關安全變更或附加元件的問題。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/syncwin/fswp-developer/tree/main/skills/fswp-maintainer

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

FSWP 維護者 是做什麼的?

基礎(始終適用): fswp-developer/references/lean-coding.md(少寫、重複使用)、fswp-developer/references/coding-standards.md(編碼標準、文件、國際化、無障礙),以及 fswp-security-engineer(輸入、輸出、授權)。

既有程式碼即規格。執行來自 fswp-architect 的已核准變更簡報(其已執行 detect_wp_project.py)。遵循專案自身的慣例,除非它們不安全;預設範本是給新專案用的,不是用來改寫他人風格的。

模式 A:更新現有外掛或主題

  1. 先讀取。 讀取變更所觸及的檔案、其呼叫者及其測試。注意前綴、命名、錯誤處理風格,以及設定與資料的儲存方式。
  2. 重現。 針對錯誤,寫下步驟與觀察到的結果;在變更任何東西前確認失敗。針對功能,陳述驗收檢查。
  3. 最小且有效的變更。 在共享程式碼中修復原因,而非在單一呼叫點。不要重新格式化未觸及的程式碼;雜亂的差異會隱藏真正的變更並破壞責任歸屬。
  4. 保護公開介面。 掛鉤名稱、函式與類別名稱、選項鍵、元資料鍵、REST 路由與形狀、簡碼屬性以及模板覆蓋都是合約。若要變更其中之一,請先棄用:保持舊的運作,呼叫 _deprecated_function() / _deprecated_hook()(或 _deprecated_argument()),記錄替代方案,並且最早在下一個主要版本中移除。
  5. 升級路徑。 如果資料或架構變更:提高已儲存的版本選項,在載入時執行遷移(不僅在啟用時),使其具有冪等性,並測試從前一個版本的資料升級而不重新啟用。
  6. 相容性。 尊重宣告的 Requires at least 和 Requires PHP;使用 function_exists()/版本檢查來保護較新的函式,或者有目的地提高最低要求並說明。
  7. 安全審查(fswp-security-engineer):錯誤修復不得在沒有授權、nonce、消毒與跳脫的情況下新增新的進入點。
  8. 版本與更新日誌。 修正 = 補丁,功能 = 次要,破壞性變更 = 主要。同時更新外掛/主題版本、常數、readme.txt 的 Stable tag 以及更新日誌。
  9. 交付 作為使用者工作儲存庫中的補丁或差異檔,或者當他們部署檔案時作為 zip。包含一致性檢查清單的結果。

主題:建議使用子主題或 theme.json/樣式變化,而不是編輯會接收更新的父主題。直接編輯父主題或第三方外掛檔案,在下次更新時將會遺失。

模式 B:為非自有產品開發附加元件

附加元件是一個獨立的外掛(或一個小主題層),用於擴充主產品。使用 fswp-plugin-developer(步驟 1-3 和 8)來結構化它,然後應用以下規則:

  1. 透過主產品的公開 API 擴充。 使用文件化的動作、過濾器、註冊表和 REST 路由。絕不編輯主產品檔案,並避免呼叫標記為私有或未記錄的內部函式;如果必須,請在一個適配器類別中隔離該呼叫並保護它。
  2. 宣告依賴關係。 當主產品在 WordPress.org 上時,在標頭中加入 Requires Plugins: host-slug(WordPress 6.5 及以上版本會強制執行)。同時在執行時期檢測:檢查類別、函式或常數,或版本常數,而不是外掛檔案路徑。
  3. 在正確的時間載入。 在確認主產品存在後,於 plugins_loaded(或主產品自身的就緒掛鉤)上初始化;在主產品的註冊掛鉤上註冊,而不是更早。
  4. 優雅且清楚地失敗。 主產品缺失或太舊:不做任何其他事情,顯示一個管理通知說明需要什麼,並且絕不致命錯誤。
  5. 版本範圍。 在 readme 和計畫中說明支援的主產品版本。測試最低和新版支援的版本。
  6. 相容性宣告。 有些主產品要求您宣告功能支援。例如:WooCommerce 期望擴充元件宣告對高效能訂單儲存以及基於區塊的購物車和結帳的相容性。閱讀主產品的開發者文件以了解目前的宣告呼叫。
  7. 資料所有權。 在您自己的前綴下儲存您的資料;不要寫入主產品的資料表或選項。解除安裝只會移除您的資料。
  8. 授權與命名。 遵循主產品的品牌與商標規則來命名;使用描述性的「用於 X」風格,而不是暗示它是官方的。

驗證

將變更交付給 fswp-qa-engineer,並以變更簡報的一致性檢查清單和相容性表格作為情境來源。references/safe-change-checklist.md 是快速交付前檢查清單。

Individual skills in this repo

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

fswp-api-developer

Domain skill for WordPress REST API and Abilities API work in Full-Stack WP Developer. Covers registering routes with schemas, argument validation and sanitization, permission callbacks, controller classes, exposing post types and meta, authentication (cookie nonce, application passwords), pagination and errors, and registering abilities with input and output schemas and safety annotations. Use for any custom endpoint or machine-readable capability in a plugin or theme.

fswp-architect

Planning stage of Full-Stack WP Developer. Classifies the work (new plugin, new theme, update to an existing plugin or theme, add-on for another product, or WordPress Core patch), triages existing code with a bundled detection script, asks one round of essential questions, does competitive research, and produces one reviewable PRD or change brief with a single approval gate. Also covers Migration mode and multi-session handoff docs. Invoked by fswp-developer before any code is written; consult directly for PRD, change-brief, or handoff-doc questions.

fswp-block-developer

Domain skill for WordPress block editor work in Full-Stack WP Developer. Covers building custom Gutenberg blocks (block.json, static and dynamic rendering, attributes, supports, InnerBlocks, variations, deprecations, block bindings), block patterns, and the Interactivity API (data-wp directives, stores, server-side state), with the @wordpress/scripts build workflow. Use for any custom block, pattern, or front-end interactivity in a plugin or theme.

fswp-core-contributor

WordPress Core contribution stage of Full-Stack WP Developer. Guides a contributor through finding or filing a Trac ticket, setting up the wordpress-develop checkout and test environment, writing a patch or GitHub pull request that follows Core coding standards, inline documentation, backward compatibility and tests, and preparing the ticket comment; also routes block-editor changes to the Gutenberg repository and security reports to the private process. Invoked by fswp-developer for Core patches; consult directly for Core workflow questions.

fswp-devops-engineer

Domain skill for WordPress development tooling in Full-Stack WP Developer. Covers local environments (wp-env with Docker, WordPress Playground and Blueprints), command-line site operations (plugin and theme management, database export, search-replace, cron, scaffolding), coding standards and static analysis (PHPCS with WordPress standards, PHPStan with WordPress stubs), PHP and JS testing setup, and the @wordpress/scripts toolchain. Use when setting up, running, or automating a WordPress dev or test environment.

fswp-qa-engineer

Verification stage of Full-Stack WP Developer. Runs the mechanical gate for plugins and themes (house-rule scripts, PHP lint, PHPCS with WordPress standards, PHP compatibility, PHPStan with WordPress stubs), the manual checklist, PRD or change-brief scenario tests, and the pre-release check. Reports PASS, FAIL, or NOT RUN and never implies a skipped check passed. Invoked by fswp-developer after a build and again before delivery; consult directly to audit any plugin or theme folder.

fswp-reviewer

Independent review stage of Full-Stack WP Developer. Reviews a finished WordPress plugin, theme, add-on, or Core patch through a security lens (WordPress-specific vulnerabilities, REST and AJAX authorization with an API risk map, AI-generated-code risks), a quality lens (error handling, data and upgrade safety, performance, i18n, accessibility, comment accuracy, test gaps, class and type design, scope), and an optional lean lens for trimming over-engineering, reporting only high-confidence findings in a fixed format. Invoked by fswp-developer after the verify gate, normally through the fswp-code-reviewer agent; consult directly to review or optimize any WordPress code.

fswp-theme-developer

Theme build stage of Full-Stack WP Developer. Builds custom WordPress themes - block themes (theme.json, templates, template parts, patterns, style variations), classic themes (template hierarchy, functions.php, theme supports), hybrids, and child themes - with accessibility, escaping, and directory readiness built in, plus a scaffold script. Invoked by fswp-developer after an approved PRD for a new theme; consult directly for a specific theme pattern. For changes to an existing theme use fswp-maintainer.

syncwin/fswp-plugin-developer

Plugin build stage of Full-Stack WP Developer. House standards and code templates for real WordPress plugins (not shortcode snippets) - folder anatomy, activation/uninstall lifecycle, custom post types and tables, admin UI tiers, front-end output on the Atomic Framework, REST and cron, i18n, distribution, and the Tier 3 React admin stack - plus a scaffold script. Also the base structure for add-ons. Invoked by fswp-developer after an approved PRD; consult directly for a specific plugin build pattern.

相關技能