Community程式設計與開發github.com

FSWP DevOps 工程師

全端 WordPress 開發環境的工具鏈技能,涵蓋本地環境 (wp-env、WordPress Playground)、命令列站台操作、程式碼標準、靜態分析、測試設定與 CI 流程。

FSWP DevOps 工程師 是什麼?

此技能為 FSWP DevOps 工程師,專注於全端 WordPress 開發的工具鏈與自動化。它支援多種本地環境設定,包括基於 Docker 的 `@wordpress/env` (wp-env) 提供完整的 WordPress 測試環境,以及用於快速原型與分享示範的 WordPress Playground 與 Blueprint 設定。此外,技能涵蓋 WP-CLI 命令列操作,如外掛管理、資料庫匯出與搜尋取代,並遵循安全操作準則。對於程式碼品質,它整合了 PHPCS (WordPress 編碼標準) 與 PHPStan (WordPress stub) 進行靜態分析,以及 PHP 單元/整合測試 (wp-phpunit) 與 JavaScript 測試 (@wordpress/scripts, Playwright)。此技能適用於設定、執行或自動化 WordPress 開發與測試環境,且強調使用最輕量的工具來驗證,無法執行的檢查會回報為 NOT RUN。

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

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

在你喜歡的 AI 中提問

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

說明文件

FSWP DevOps 工程師 是做什麼的?

優先使用最輕量的工具來驗證主張。若在此無法執行的任何檢查,應回報為 NOT RUN,並附上使用者可執行的命令(由 fswp-qa-engineer 處理)。

本地環境

需求工具
完整的 Docker WordPress、PHP 測試、掛載多個外掛/佈景主題@wordpress/env (wp-env)
瀏覽器或 Node 中即時可拋棄的站台、煙霧測試、可分享的示範WordPress Playground,以 Blueprint 設定
使用者已執行的現有本地堆疊使用他們的;不要額外添加

wp-env (需要 Docker 與 Node):在專案根目錄執行 npx @wordpress/env start。使用 .wp-env.json 設定:

{
  "core": null,
  "phpVersion": "8.2",
  "plugins": [ "." ],
  "themes": [],
  "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true }
}

實用命令:npx @wordpress/env run cli wp plugin list、... stop、... clean、... destroy。用於驗證 fswp-qa-engineer 無法靜態檢查的啟用、停用、解除安裝與升級路徑。

Playground: Blueprint 是描述站台的 JSON:

{
  "$schema": "https://playground.wordpress.net/blueprint-schema.json",
  "landingPage": "/wp-admin/",
  "preferredVersions": { "php": "8.3", "wp": "latest" },
  "steps": [ { "step": "login" } ]
}

新增步驟,例如安裝外掛或佈景主題、寫入檔案、設定選項;在撰寫前請閱讀 Playground 文件中目前的步驟名稱。Playground 很快,但不是完整的伺服器:請勿將其作為 cron、郵件或大量檔案系統行為的證據。

步驟列表、資源類型及完整命令表:references/blueprints-and-cli.md。

命令列操作 (WP-CLI)

來自 shell 的站台操作:wp plugin install|activate|deactivate|delete、wp theme ...、wp option get|update、wp post ...、wp user ...、wp cron event list|run、wp db export|import、wp search-replace old new --dry-run、wp eval-file、wp scaffold plugin-tests <plugin>、wp i18n make-pot。規則:在任何破壞性命令前執行 wp db export;務必先以 --dry-run 執行 search-replace;除錯載入錯誤時使用 --skip-plugins --skip-themes;僅在可拋棄環境中以網頁使用者身分或加 --allow-root 執行。(WP-CLI 是 WordPress 基金會專案;此外掛是以描述性方式引用。)

程式碼標準 (PHPCS)

使用 Composer 安裝:wp-coding-standards/wpcs、dealerdirect/phpcodesniffer-composer-installer、phpcompatibility/phpcompatibility-wp。最小的 .phpcs.xml.dist:

<?xml version="1.0"?>
<ruleset name="Project">
  <file>.</file>
  <exclude-pattern>vendor/*</exclude-pattern>
  <exclude-pattern>node_modules/*</exclude-pattern>
  <rule ref="WordPress-Extra"/>
  <rule ref="WordPress.WP.I18n"><properties><property name="text_domain" value="my-text-domain"/></properties></rule>
  <rule ref="WordPress.NamingConventions.PrefixAllGlobals"><properties><property name="prefixes" type="array"><element value="myprefix"/></properties></property></rule>
  <config name="testVersion" value="7.4-"/>
  <rule ref="PHPCompatibilityWP"/>
</ruleset>

phpcs 報告;phpcbf 修正可安全修正的項目(檢視 diff)。fswp-qa-engineer/scripts/setup_toolchain.sh 可在缺少 Composer 的環境中安裝 PHPCS 與 PHPStan。

靜態分析 (PHPStan)

phpstan.neon 以 php-stubs/wordpress-stubs 作為引導(或 szepeviktor/phpstan-wordpress 擴充套件),等級 5 作為門檻,新程式碼使用更高等級。對 WordPress 或此外掛在執行時期定義的常數進行樁。對舊有程式碼可接受基線檔案,新程式碼則不接受。

測試

  • PHP 單元與整合測試: wp-phpunit/wp-phpunit 搭配 yoast/phpunit-polyfills,由 wp scaffold plugin-tests 產生;在 wp-env 中執行。使用 WP_UnitTestCase 進行需要 WordPress 的測試。
  • JavaScript: @wordpress/scripts (wp-scripts build、start、lint-js、lint-style、test-unit-js、test-e2e)。
  • 端到端: 使用 Playwright 搭配 WordPress e2e 輔助工具,針對 wp-env 執行,用於重要的流程(設定儲存、區塊插入、結帳路徑)。

CI 大綱 (保留給 GitHub 工作)

管線應遵循的順序:安裝、PHPCS、PHPStan、PHP 測試(最低與最高 PHP 版本)、JS lint/build/test、打包、上傳成品。在 GitHub 整合啟用之前,請勿建立工作流程檔案 (fswp-developer/references/github-foundation.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-maintainer

Change stage for existing WordPress code in Full-Stack WP Developer. Updates, fixes, refactors, and upgrades existing plugins and themes without breaking them, and builds add-ons for products you do not own (WooCommerce extensions, page-builder elements, extensions of other plugins) using hooks instead of edits to third-party files. Covers reading before changing, parity lists, deprecation, host compatibility, upgrade paths, and patch delivery. Invoked by fswp-developer after an approved change brief; consult directly for safe-change or add-on questions.

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.

相關技能