wordpress-workspace-preview-routing-debug

โดย automattic

ดีบักการแสดงตัวอย่าง Workspace Agent ของ WordPress โหมดแก้ไข การรับรองความถูกต้อง พร็อกซี และพฤติกรรมการกำหนดเส้นทาง URL ครอบคลุมไซต์ WordPress.com แบบง่าย Jetpack และ Atomic ใช้…

npx skills add https://github.com/automattic/workspace --skill wordpress-workspace-preview-routing-debug

WordPress Workspace Preview Routing Debug

Use this skill for preview/auth/editor-mode problems in the WordPress Agent window or detached preview.

Workflow

  1. Ground the report in the current code path.
    • Inspect Sources/WordPressAgentPreviewURLResolver.swift, Sources/WordPressAgentWindowView.swift, Sources/WPCOMClient.swift, and relevant Sources/AppState.swift preview methods.
    • Search with rg -n "preview|frame_nonce|jetpack_frame_nonce|unmapped|Atomic|cookie|requested|effective|private|proxy" Sources.
  2. Preserve the preview trust rules.
    • Show the requested user-facing URL in UI.
    • Do not expose effective preview URLs, frame nonces, auth bootstrap URLs, or private preview details.
    • Reject localhost and private-network URLs.
  3. Check site type and mode.
    • Simple WordPress.com, Jetpack, and Atomic sites can require different preview URL, unmapped-host, nonce, cookie, or read-access handling.
    • Distinguish signed-out view, authenticated preview, and editor mode.
  4. Check proxy and routing overrides.
    • Inspect Sources/NetworkRoutingSettings.swift and the WordPress.com auth-cookie bootstrap in Sources/WPCOMClient.swift.
    • The app has a developer setting to bypass the macOS system proxy for sandbox routing, but the preview cookie-bootstrap flow intentionally uses a one-off direct session because proxy routing has produced wp-login.php 200 responses with empty auth cookies.
    • Keep normal API traffic aligned with the user's network setting unless the code path is specifically browser-cookie infrastructure.
  5. Reproduce with focused signals.
    • Prefer app logs, existing preview loading states, and targeted code inspection before inventing shell-only repros.
    • Verify loading/preparation states, navigation updates, requested-vs-effective URL display, and mode switch behavior.
  6. Keep comments where behavior is non-obvious.
    • Proxy bypass, cookie bootstrap, nonce handling, and URL rewriting deserve concise code comments when changed.

Output

  • Lead with the failing route or trust boundary.
  • Include file references and the specific site/mode assumptions.
  • Recommend tests for public URL, same-site URL, preview URL, editor URL, internal navigation, and rejected private URL.

Skills เพิ่มเติมจาก automattic

wp-phpstan
automattic
ใช้เมื่อกำหนดค่า เรียกใช้ หรือแก้ไขการวิเคราะห์แบบสแตติกของ PHPStan ในโปรเจกต์ WordPress (ปลั๊กอิน/ธีม/ไซต์): การตั้งค่า phpstan.neon, เบสไลน์,…
official
wp-playground
automattic
ใช้สำหรับเวิร์กโฟลว์ของ WordPress Playground: อินสแตนซ์ WP แบบใช้แล้วทิ้งที่รวดเร็วในเบราว์เซอร์หรือในเครื่องผ่าน @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
ใช้เมื่อพัฒนา WordPress plugins: สถาปัตยกรรมและ hooks, การเปิดใช้งาน/ปิดใช้งาน/ถอนการติดตั้ง, UI สำหรับผู้ดูแลระบบและ Settings API, การจัดเก็บข้อมูล, cron/งาน, ความปลอดภัย…
official
wp-project-triage
automattic
ใช้เมื่อคุณต้องการตรวจสอบที่เก็บ WordPress (ปลั๊กอิน/ธีม/ธีมบล็อก/WP core/Gutenberg/ทั้งไซต์) อย่างแน่นอน รวมถึงเครื่องมือ/การทดสอบ/เวอร์ชัน…
official
wp-rest-api
automattic
ใช้เมื่อสร้าง ขยาย หรือดีบักเอนด์พอยต์/เส้นทางของ WordPress REST API: register_rest_route, คลาส WP_REST_Controller/controller, schema/argument…
official
wp-wpcli-and-ops
automattic
ใช้เมื่อทำงานกับ WP-CLI (wp) สำหรับการดำเนินการ WordPress: การค้นหาและแทนที่อย่างปลอดภัย, การส่งออก/นำเข้าฐานข้อมูล, การจัดการปลั๊กอิน/ธีม/ผู้ใช้/เนื้อหา, cron, การล้างแคช,…
official
wpds
automattic
ใช้เมื่อสร้าง UI ที่ใช้ประโยชน์จาก WordPress Design System (WPDS) และส่วนประกอบ โทเค็น รูปแบบ ฯลฯ
official
woocommerce-finalize
automattic
การตรวจสอบสุขภาพโค้ดและความสามารถในการตรวจสอบย้อนกลับก่อนเผยแพร่สำหรับปลั๊กอิน WooCommerce ดำเนินการหลังจากการตรวจสอบโค้ด -- เน้นที่โค้ดที่ไม่ได้ใช้ การซ้ำซ้อน ความซับซ้อนเชิงโครงสร้าง และ...
official