WordPress仓库分类路由
wordpress-router
当用户询问 WordPress 代码库(插件、主题、区块主题、Gutenberg 区块、WP 核心检出),且需要快速分类仓库并路由到正确的工作流/技能(区块、theme.json、REST API、WP-CLI、性能、安全、测试、发布打包)时使用。
- License 许可
- GPL-2.0
- 所属仓库
- gambitph/Cimo
- 最近更新
- 2026-10-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- wordpress-router
- description
- Use when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo and route to the correct workflow/skill (blocks, theme.json, REST API, WP-CLI, performance, security, testing, release packaging).
- compatibility
- Targets WordPress 7.0+ (PHP 7.4.0+). Filesystem-based agent with bash + node. Some workflows require WP-CLI.
02 资源文件 1
- 参考文档references/decision-tree.md3.1 KB
03 SKILL.md 正文
WordPress Router
When to use
Use this skill at the start of most WordPress tasks to:
- identify what kind of WordPress codebase this is (plugin vs theme vs block theme vs WP core checkout vs full site),
- pick the right workflow and guardrails,
- delegate to the most relevant domain skill(s).
Inputs required
- Repo root (current working directory).
- The user’s intent (what they want changed) and any constraints (WP version targets, WP.com specifics, release requirements).
Procedure
- Run the project triage script:
node skills/wp-project-triage/scripts/detect_wp_project.mjs
- Read the triage output and classify:
- primary project kind(s),
- tooling available (PHP/Composer, Node, @wordpress/scripts),
- tests present (PHPUnit, Playwright, wp-env),
- any version hints.
- Route to domain workflows based on user intent + repo kind:
- For the decision tree, read:
skills/wordpress-router/references/decision-tree.md.
- For the decision tree, read:
- Apply guardrails before making changes:
- Confirm any version constraints if unclear.
- Prefer the repo’s existing tooling and conventions for builds/tests.
Verification
- Re-run the triage script if you create or restructure significant files.
- Run the repo’s lint/test/build commands that the triage output recommends (if available).
Failure modes / debugging
- If triage reports
kind: unknown, inspect:- root
composer.json,package.json,style.css,block.json,theme.json,wp-content/.
- root
- If the repo is huge, consider narrowing scanning scope or adding ignore rules to the triage script.
Escalation
- If routing is ambiguous, ask one question:
- “Is this intended to be a WordPress plugin, a theme (classic/block), or a full site repo?”
04 同仓库更多 Skills
智能体技能文档编写
writing-for-agents
为智能体编写文档。在创建或编辑技能(skills),或修改 AGENTS.md 或 CLAUDE.md 时使用。
WordPress REST API 开发
wp-rest-api
用于构建、扩展或调试 WordPress REST API 端点/路由:register_rest_route、WP_REST_Controller/控制器类、schema/参数校验、permission_callback/身份验证、响应构造、register_rest_field/register_meta,或通过 show_in_rest 暴露 CPT/分类法。
WordPress 项目诊断
wp-project-triage
当你需要对 WordPress 仓库(插件/主题/区块主题/WP 核心/Gutenberg/完整站点)进行确定性检查,包括工具链/测试/版本提示,并生成结构化 JSON 报告以指导工作流和防护栏时使用。
WordPress插件目录合规审查
wp-plugin-directory-guidelines
审查 WordPress 插件的 GPL 合规性、检查许可证头或兼容性、评估追加销售/免费增值/试用版(upsell/freemium/trialware)模式、验证插件命名或商标规则、检查插件 slug、理解某个插件为何被 WordPress.org 拒绝,或回答有关 18 条 WordPress.org 插件目录指南的任何问题——即使用户没有明确提到『指南』。
WordPress插件开发
wp-plugin-development
开发 WordPress 插件时使用:架构与钩子、激活/停用/卸载、管理界面与 Settings API、数据存储、定时任务、安全(nonce/权限/清理/转义)以及发布打包。
WordPress 性能剖析与优化
wp-performance
在排查或改进 WordPress 性能时使用(仅限后端代理):性能剖析与测量(WP-CLI profile/doctor、Server-Timing、通过 REST 请求头使用 Query Monitor)、数据库/查询优化、自动加载选项(autoloaded options)、对象缓存、定时任务(cron)、HTTP API 调用,以及安全验证。