Community编程与开发github.com

FSWP 维护者

在 Full-Stack WP Developer 框架下对现有 WordPress 代码进行更改:修复、重构、升级已有插件和主题,并利用钩子为第三方产品构建附加组件。强调先读后改、保持兼容性、安全交付。

FSWP 维护者 是什么?

FSWP Maintainer 是 Full-Stack WP Developer 框架中的专职技能,专注于对现有 WordPress 插件和主题进行安全、非破坏性的更改。它涵盖两种核心模式: - **模式 A(更新已有插件/主题)**:强调“先读后动”,要求阅读被修改文件及其调用者、测试,确认错误后再动手,并遵循最小改动原则。它强制保护公共接口(钩子名、函数名、选项键等),任何破坏性更改都必须先弃用(使用 `_deprecated_function()` 等)并在下一个大版本才移除。数据迁移必须幂等,兼容性需与声明的 `Requires at least` 和 `Requires PHP` 保持一致,并完成安全审计(输入/输出/授权/nonce/转义)。最后以补丁、diff 或 zip 搭配变更清单(parity checklist)交付。 - **模式 B(为第三产品构建附加组件)**:指导开发者创建独立插件或主题层,通过宿主公共 API(动作、过滤器、注册机、REST 路由)扩展功能,绝不直接改动宿主文件。需声明依赖关系(`Requires Plugins` 头或运行时检测),在正确时机(如 `plugins_loaded`)初始化,宿主缺失时仅显示管理通知而不崩溃。数据必须使用自有前缀,卸载时只清理自身数据,并遵守宿主的品牌和许可证规则。 该技能在收到 `fswp-architect`(已运行 `detect_wp_project.py`)批准的变更简报后执行,输出最终交付物给 `fswp-qa-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)的变更简报。应遵循项目自身的约定,除非该约定不安全;内部模板(house templates)仅用于新项目,不用于重写他人的风格。

模式 A:更新现有插件或主题

  1. 先阅读。 阅读被修改文件及其调用者、测试文件。注意前缀、命名、错误处理风格以及设置和数据的存储方式。
  2. 重现。 对于缺陷,写下重现步骤和观察到的结果;在更改任何内容之前确认失败。对于功能,明确验收条件。
  3. 最小的可工作更改。 在共享代码中修复原因,而非单个调用点。不要重新格式化未触及的代码;杂乱的 diff 会掩盖真实更改并破坏 blame 信息。
  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. 交付 为用户工作的仓库提供补丁或 diff,或在他们部署文件时提供 zip。包含校验列表(parity checklist)的结果。

主题:优先使用子主题或 theme.json/样式变体更改,而非编辑会接收更新的父主题。直接编辑父主题以及第三方插件文件会在下一次更新时丢失。

模式 B:为未拥有的产品构建附加组件

附加组件是一个独立的插件(或小型主题层),用于扩展宿主。使用 fswp-plugin-developer(步骤 1-3 和 8)构建结构,然后应用以下规则:

  1. 通过宿主的公共 API 扩展。 使用文档化的动作、过滤器、注册机和 REST 路由。永远不要编辑宿主文件,避免调用标记为 private 或未记录的内部方法;如果必须调用,将其隔离在一个适配器类中并进行保护。
  2. 声明依赖关系。 当宿主位于 WordPress.org 时,在插件头部添加 Requires Plugins: host-slug(WordPress 6.5 及更高版本强制执行)。还应在运行时检测:检查类、函数或常量,或版本常量,而不是插件文件路径。
  3. 在正确时机加载。 在确认宿主存在后,于 plugins_loaded(或宿主的就绪钩子)上初始化;在宿主的注册钩子上注册,而不是更早。
  4. 安静且清晰地失败。 宿主缺失或过旧:不执行其他操作,仅显示一条管理通知解释需要什么,绝不要致命错误。
  5. 版本范围。 在 readme 和计划中说明支持的宿主版本。测试最低和支持的最新版本。
  6. 兼容性声明。 某些宿主要求您声明功能支持。例如:WooCommerce 期望扩展声明与高性能订单存储以及基于区块的购物车和结账的兼容性。阅读宿主的开发者文档以获取最新的声明调用。
  7. 数据所有权。 在您自己的前缀下存储数据;不要写入宿主的表或选项。卸载时仅删除您自己的数据。
  8. 许可和命名。 遵循宿主的品牌和商标规则进行命名;使用描述性的“for X”风格,而非暗示它是官方的。

验证

将带有变更简报的校验列表(parity list)和兼容性表(作为场景源)交给 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.

相关技能