wordpress-router

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WordPress Router

WordPress 路由工具

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).
在大多数WordPress任务开始时使用此技能,以:
  • 识别当前WordPress代码库的类型(插件 vs 主题 vs 区块主题 vs WP核心检出 vs 完整站点),
  • 选择合适的工作流和约束规则,
  • 委派给最相关的领域技能。

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).
  • 仓库根目录(当前工作目录)。
  • 用户的意图(想要进行的更改)以及任何约束条件(目标WP版本、WP.com特定要求、发布规范)。

Procedure

操作步骤

  1. Run the project triage script:
    • node skills/wp-project-triage/scripts/detect_wp_project.mjs
  2. 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.
  3. Route to domain workflows based on user intent + repo kind:
    • For the decision tree, read:
      skills/wordpress-router/references/decision-tree.md
      .
  4. Apply guardrails before making changes:
    • Confirm any version constraints if unclear.
    • Prefer the repo’s existing tooling and conventions for builds/tests.
  1. 运行项目分类脚本:
    • node skills/wp-project-triage/scripts/detect_wp_project.mjs
  2. 读取分类输出并进行归类:
    • 主要项目类型,
    • 可用的工具(PHP/Composer、Node、@wordpress/scripts),
    • 已有的测试(PHPUnit、Playwright、wp-env),
    • 任何版本提示。
  3. 根据用户意图 + 仓库类型路由到领域工作流:
    • 决策树请参考:
      skills/wordpress-router/references/decision-tree.md
  4. 在进行更改前应用约束规则:
    • 若有不明确的版本约束,需确认清楚。
    • 优先使用仓库现有的工具和约定来进行构建/测试。

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).
  • 若创建或重构了重要文件,请重新运行分类脚本。
  • 运行分类输出推荐的仓库 lint/测试/构建命令(如果可用)。

Failure modes / debugging

故障排查

  • If triage reports
    kind: unknown
    , inspect:
    • root
      composer.json
      ,
      package.json
      ,
      style.css
      ,
      block.json
      ,
      theme.json
      ,
      wp-content/
      .
  • If the repo is huge, consider narrowing scanning scope or adding ignore rules to the triage script.
  • 如果分类结果显示
    kind: unknown
    ,请检查:
    • 根目录下的
      composer.json
      package.json
      style.css
      block.json
      theme.json
      wp-content/
  • 如果仓库体积过大,考虑缩小扫描范围或为分类脚本添加忽略规则。

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?”
  • 如果路由存在歧义,请询问以下问题:
    • “这是一个WordPress插件、主题(经典/区块),还是完整站点仓库?”