mirror of
https://github.com/WordPress/agent-skills.git
synced 2026-09-14 15:56:59 +08:00
977b40746e
## Summary Refactors the `wp-playground` skill into a thin routing wrapper and splits its prior procedure into focused references (`cli.md`, `website.md`), clarifies the ownership boundary with the `blueprint` skill, and adds eval scenarios that cover the new routing. ## Motivation for the change, related issues The previous `wp-playground` SKILL.md mixed CLI commands, browser/share-link tips, and Blueprint guidance into a single procedure, which: - duplicated Blueprint schema details that already live in the `blueprint` skill, - buried the browser-only `playground.wordpress.net` surface area (Query API, `window.playgroundSites`, active `PlaygroundClient`) under a single bullet, - left the router unable to delegate "Blueprint JSON" vs. "run/share a Playground" cleanly. This PR makes the split explicit so each skill owns one concern and the router can route by intent. ## Implementation details ### `wp-playground` becomes a routing wrapper - `skills/wp-playground/SKILL.md` is rewritten as a short router: pick Blueprint vs. CLI vs. website vs. debugging, then load the matching reference. - Description is sharpened to say it covers ambiguous Playground work, CLI runs, share links, browser previews, snapshots, mounts, version switching, and Xdebug, and to defer Blueprint JSON authoring to the `blueprint` skill. ### Focused references under `wp-playground` - New `skills/wp-playground/references/cli.md` covers `@wp-playground/cli` workflows: `start` for the common local plugin/theme dev loop, `server` for advanced/CI use, manual `--mount`, `run-blueprint`, `build-snapshot`, version switching, verification, and failure modes. - New `skills/wp-playground/references/website.md` covers `playground.wordpress.net`: URL setup (Query API + Blueprint URLs/fragments), the `window.playgroundSites` site-manager, and the active `window.playground` `PlaygroundClient`. Includes CORS, persistence, and browser-only constraints. - `skills/wp-playground/references/debugging.md` is updated to match current CLI flags (`--xdebug`, `--debug`, `--workers=<n|auto>`) and drops stale references like `--experimental-multi-worker`. - Old `references/blueprints.md` and `references/cli-commands.md` are removed since their content now lives in `blueprint` and the new `cli.md` respectively. ### `blueprint` skill claims schema ownership - `skills/blueprint/SKILL.md` description now explicitly owns Blueprint JSON authoring, validation, and review, and points purely-runtime requests to `wp-playground`. - Documents the deprecated top-level `description` and `phpExtensionBundles` keys, and corrects the supported `preferredVersions.php` enumeration plus `wp: false` semantics. - Inline-Blueprint URL example now uses `encodeURIComponent()` so it does not silently break for JSON with reserved characters, and points to `wp-playground/references/website.md` for share-link guidance. ### Router updates - `skills/wordpress-router/references/decision-tree.md` replaces the single Playground line with intent-based rules: ambiguous Playground → `wp-playground`; Blueprint JSON/schema/steps/bundles → `blueprint`; CLI flows → `wp-playground` + `cli.md`; website/share links → `wp-playground` + `website.md`. ### Eval scenarios Adds four scenarios that exercise the new boundaries: - `eval/scenarios/wp-playground-cli-auto-mount.json` — local CLI auto-mount workflow goes through `wp-playground` + `cli.md`. - `eval/scenarios/wp-playground-website-share-url.json` — share-link workflow goes through `wp-playground` + `website.md`, with CORS + encoding rules. - `eval/scenarios/wp-playground-router-delegation.json` — multi-part request delegates JSON to `blueprint` and runtime/share to `wp-playground`. - `eval/scenarios/blueprint-current-schema-keys.json` — Blueprint JSON authoring routes directly to `blueprint` and avoids deprecated keys. ### Out of scope - No new top-level `playground-cli` or `playground-website` skills; both stay as `wp-playground` references. - No changes to the Playground CLI itself or to `playground.wordpress.net`. ## Testing Instructions 1. Read `skills/wp-playground/SKILL.md` and confirm it routes by intent without restating Blueprint schema or full CLI procedures. 2. Open `skills/wp-playground/references/cli.md` and `skills/wp-playground/references/website.md` and confirm each covers a single concern (local CLI vs. browser website). 3. Open `skills/blueprint/SKILL.md` and confirm Blueprint JSON authoring (schema keys, deprecated fields, inline-URL encoding) lives there and no longer in `wp-playground`. 4. Open `skills/wordpress-router/references/decision-tree.md` and walk through the four Playground-related bullets to confirm intent-based routing. 5. Review the four new scenarios under `eval/scenarios/` and confirm `expected_behavior` and `success_criteria` match the new skill boundaries. 6. Optional sanity check — run a real local Playground command from the new reference, e.g.: ```bash cd <plugin-or-theme-root> npx @wp-playground/cli@latest start ``` and confirm the plugin/theme is auto-mounted and active in `wp-admin`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Mikey Arce <mikeyarce@gmail.com>