--- name: playground-website-debugging description: Debug the WordPress Playground website by running the dev server from source and interacting with it via Playwright MCP. Use when investigating UI bugs, testing website features, checking for JavaScript errors, debugging hanging requests, or verifying WordPress behavior in the browser-based Playground. --- # Playground Dev Server Debugging with Playwright MCP Debug the WordPress Playground website by running the dev server from source and interacting with it via Playwright MCP. **Requires:** Node.js, Playwright MCP server ## Quick Start ```bash # Ensure the correct Node.js version is active as per .nvmrc nvm use # Kill any leftover dev server from a previous run lsof -ti:5400 -ti:5263 -ti:6400 | xargs kill 2>/dev/null; sleep 1 # Start dev server in background npm run dev > /tmp/playground-dev.log 2>&1 & # Wait for server to respond (up to ~120s for first build) until curl -s -o /dev/null http://127.0.0.1:5400/website-server/ 2>/dev/null; do sleep 2 done echo "Ready!" ``` Then use Playwright MCP to interact: ``` browser_navigate → http://127.0.0.1:5400/website-server/ browser_snapshot → inspect the page structure browser_take_screenshot → visual state ``` ## Architecture: The Iframe Boundary The Playground website has a three-layer structure that's critical to understand: ``` ┌───────────────────────────────────────────────────┐ │ Parent page (Playground chrome / React app) │ │ ┌───────────────────────────────────────────────┐ │ │ │ URL bar │ Save │ Settings │ Site Mgr │ │ │ ├───────────────────────────────────────────────┤ │ │ │ │ │ │ │