[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70DCE8597Q5XW6XW1KEVZ73":3,"skill-same:01M70DCE8597Q5XW6XW1KEVZ73":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":14,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M70DCE8597Q5XW6XW1KEVZ73","wp-interactivity-api",null,"Use when building or debugging WordPress Interactivity API features (data-wp-* directives, @wordpress\u002Finteractivity store\u002Fstate\u002Factions, block viewScriptModule integration, wp_interactivity_*()) including performance, hydration, and directive behavior.","Spaghetti-Dojo\u002Ftosuto","Spaghetti-Dojo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F171473277?v=4","01M70D7HTSB1T6F7P71CN4CA4K","Spaghetti Dojo","01M70D7HVFH1GMH0R0ZFAZRXM6",0,"GPL-2.0","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-interactivity-api\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"wp interactivity api","api","data","block","features","integration","behavior","directive","state","store","when","debugging","use","actions","wordpress","performance","directives","2026-11-10 10:12:30",false,"---\nname: wp-interactivity-api\ndescription: \"Use when building or debugging WordPress Interactivity API features (data-wp-* directives, @wordpress\u002Finteractivity store\u002Fstate\u002Factions, block viewScriptModule integration, wp_interactivity_*()) including performance, hydration, and directive behavior.\"\n---\n\n# WP Interactivity API\n\n## When to use\n\nUse this skill when the user mentions:\n\n- Interactivity API, `@wordpress\u002Finteractivity`,\n- `data-wp-interactive`, `data-wp-on--*`, `data-wp-bind--*`, `data-wp-context`,\n- block `viewScriptModule` \u002F module-based view scripts,\n- hydration issues or “directives don’t fire”.\n\n## Inputs required\n\n- Repo root + triage output (`wp-project-triage`).\n- Which block\u002Ftheme\u002Fplugin surfaces are affected (frontend, editor, both).\n- Any constraints: WP version, whether modules are supported in the build.\n\n## Procedure\n\n### 1) Detect existing usage + integration style\n\nSearch for:\n\n- `data-wp-interactive`\n- `@wordpress\u002Finteractivity`\n- `viewScriptModule`\n\nDecide:\n\n- Is this a block providing interactivity via `block.json` view script module?\n- Is this theme-level interactivity?\n- Is this plugin-side “enhance existing markup” usage?\n\nIf you’re creating a new interactive block (not just debugging), prefer the official scaffold template:\n\n- `@wordpress\u002Fcreate-block-interactive-template` (via `@wordpress\u002Fcreate-block`)\n\n### 2) Identify the store(s)\n\nLocate store definitions and confirm:\n\n- state shape,\n- actions (mutations),\n- callbacks\u002Fevent handlers used by `data-wp-on--*`.\n\n### 3) Server-side rendering (best practice)\n\n**Pre-render HTML on the server** before outputting to ensure:\n\n- Correct initial state in the HTML before JavaScript loads (no layout shift).\n- SEO benefits and faster perceived load time.\n- Seamless hydration when the client-side JavaScript takes over.\n\n#### Enable server directive processing\n\nFor components using `block.json`, add `supports.interactivity`:\n\n```json\n{\n  \"supports\": {\n    \"interactivity\": true\n  }\n}\n```\n\nFor themes\u002Fplugins without `block.json`, use `wp_interactivity_process_directives()` to process directives.\n\n#### Initialize state\u002Fcontext in PHP\n\nUse `wp_interactivity_state()` to define initial global state:\n\n```php\nwp_interactivity_state( 'myPlugin', array(\n  'items'    => array( 'Apple', 'Banana', 'Cherry' ),\n  'hasItems' => true,\n));\n```\n\nFor local context, use `wp_interactivity_data_wp_context()`:\n\n```php\n\u003C?php\n$context = array( 'isOpen' => false );\n?>\n\u003Cdiv \u003C?php echo wp_interactivity_data_wp_context( $context ); ?>>\n  ...\n\u003C\u002Fdiv>\n```\n\n#### Define derived state in PHP\n\nWhen derived state affects initial HTML rendering, replicate the logic in PHP:\n\n```php\nwp_interactivity_state( 'myPlugin', array(\n  'items'    => array( 'Apple', 'Banana' ),\n  'hasItems' => function() {\n    $state = wp_interactivity_state();\n    return count( $state['items'] ) > 0;\n  }\n));\n```\n\nThis ensures directives like `data-wp-bind--hidden=\"!state.hasItems\"` render correctly on first load.\n\nFor detailed examples and patterns, see `references\u002Fserver-side-rendering.md`.\n\n### 4) Implement or change directives safely\n\nWhen touching markup directives:\n\n- keep directive usage minimal and scoped,\n- prefer stable data attributes that map clearly to store state,\n- ensure server-rendered markup + client hydration align.\n\n**WordPress 6.9 changes:**\n\n- **`data-wp-ignore` is deprecated** and will be removed in future versions. It broke context inheritance and caused issues with client-side navigation. Avoid using it.\n- **Unique directive IDs**: Multiple directives of the same type can now exist on one element using the `---` separator (e.g., `data-wp-on--click---plugin-a=\"...\"` and `data-wp-on--click---plugin-b=\"...\"`).\n- **New TypeScript types**: `AsyncAction\u003CReturnType>` and `TypeYield\u003CT>` help with async action typing.\n\nFor quick directive reminders, see `references\u002Fdirectives-quickref.md`.\n\n### 5) Build\u002Ftooling alignment\n\nVerify the repo supports the required module build path:\n\n- if it uses `@wordpress\u002Fscripts`, prefer its conventions.\n- if it uses custom bundling, confirm module output is supported.\n\n### 6) Debug common failure modes\n\nIf “nothing happens” on interaction:\n\n- confirm the `viewScriptModule` is enqueued\u002Floaded,\n- confirm the DOM element has `data-wp-interactive`,\n- confirm the store namespace matches the directive’s value,\n- confirm there are no JS errors before hydration.\n\nSee `references\u002Fdebugging.md`.\n\n## Verification\n\n- `wp-project-triage` indicates `signals.usesInteractivityApi: true` after your change (if applicable).\n- Manual smoke test: directive triggers and state updates as expected.\n- If tests exist: add\u002Fextend Playwright E2E around the interaction path.\n\n## Failure modes \u002F debugging\n\n- Directives present but inert:\n  - view script not loading, wrong module entrypoint, or missing `data-wp-interactive`.\n- Hydration mismatch \u002F flicker:\n  - server markup differs from client expectations; simplify or align initial state.\n  - derived state not defined in PHP: use `wp_interactivity_state()` with closures.\n- Initial content missing or wrong:\n  - `supports.interactivity` not set in `block.json` (for blocks).\n  - `wp_interactivity_process_directives()` not called (for themes\u002Fplugins).\n  - state\u002Fcontext not initialized in PHP before render.\n- Layout shift on load:\n  - derived state like `state.hasItems` missing on server, causing `hidden` attribute to be absent.\n- Performance regressions:\n  - overly broad interactive roots; scope interactivity to smaller subtrees.\n- Client-side navigation issues (WordPress 6.9):\n  - `getServerState()` and `getServerContext()` now reset between page transitions—ensure your code doesn't assume stale values persist.\n  - Router regions now support `attachTo` for rendering overlays (modals, pop-ups) dynamically.\n\n## Escalation\n\n- If repo build constraints are unclear, ask: \"Is this using `@wordpress\u002Fscripts` or a custom bundler (webpack\u002Fvite)?\"\n- Consult:\n  - `references\u002Fserver-side-rendering.md`\n  - `references\u002Fdirectives-quickref.md`\n  - `references\u002Fdebugging.md`\n","# WP Interactivity API\n\n## When to use\n\nUse this skill when the user mentions:\n\n- Interactivity API, `@wordpress\u002Finteractivity`,\n- `data-wp-interactive`, `data-wp-on--*`, `data-wp-bind--*`, `data-wp-context`,\n- block `viewScriptModule` \u002F module-based view scripts,\n- hydration issues or “directives don’t fire”.\n\n## Inputs required\n\n- Repo root + triage output (`wp-project-triage`).\n- Which block\u002Ftheme\u002Fplugin surfaces are affected (frontend, editor, both).\n- Any constraints: WP version, whether modules are supported in the build.\n\n## Procedure\n\n### 1) Detect existing usage + integration style\n\nSearch for:\n\n- `data-wp-interactive`\n- `@wordpress\u002Finteractivity`\n- `viewScriptModule`\n\nDecide:\n\n- Is this a block providing interactivity via `block.json` view script module?\n- Is this theme-level interactivity?\n- Is this plugin-side “enhance existing markup” usage?\n\nIf you’re creating a new interactive block (not just debugging), prefer the official scaffold template:\n\n- `@wordpress\u002Fcreate-block-interactive-template` (via `@wordpress\u002Fcreate-block`)\n\n### 2) Identify the store(s)\n\nLocate store definitions and confirm:\n\n- state shape,\n- actions (mutations),\n- callbacks\u002Fevent handlers used by `data-wp-on--*`.\n\n### 3) Server-side rendering (best practice)\n\n**Pre-render HTML on the server** before outputting to ensure:\n\n- Correct initial state in the HTML before JavaScript loads (no layout shift).\n- SEO benefits and faster perceived load time.\n- Seamless hydration when the client-side JavaScript takes over.\n\n#### Enable server directive processing\n\nFor components using `block.json`, add `supports.interactivity`:\n\n```json\n{\n  \"supports\": {\n    \"interactivity\": true\n  }\n}\n```\n\nFor themes\u002Fplugins without `block.json`, use `wp_interactivity_process_directives()` to process directives.\n\n#### Initialize state\u002Fcontext in PHP\n\nUse `wp_interactivity_state()` to define initial global state:\n\n```php\nwp_interactivity_state( 'myPlugin', array(\n  'items'    => array( 'Apple', 'Banana', 'Cherry' ),\n  'hasItems' => true,\n));\n```\n\nFor local context, use `wp_interactivity_data_wp_context()`:\n\n```php\n\u003C?php\n$context = array( 'isOpen' => false );\n?>\n\u003Cdiv \u003C?php echo wp_interactivity_data_wp_context( $context ); ?>>\n  ...\n\u003C\u002Fdiv>\n```\n\n#### Define derived state in PHP\n\nWhen derived state affects initial HTML rendering, replicate the logic in PHP:\n\n```php\nwp_interactivity_state( 'myPlugin', array(\n  'items'    => array( 'Apple', 'Banana' ),\n  'hasItems' => function() {\n    $state = wp_interactivity_state();\n    return count( $state['items'] ) > 0;\n  }\n));\n```\n\nThis ensures directives like `data-wp-bind--hidden=\"!state.hasItems\"` render correctly on first load.\n\nFor detailed examples and patterns, see `references\u002Fserver-side-rendering.md`.\n\n### 4) Implement or change directives safely\n\nWhen touching markup directives:\n\n- keep directive usage minimal and scoped,\n- prefer stable data attributes that map clearly to store state,\n- ensure server-rendered markup + client hydration align.\n\n**WordPress 6.9 changes:**\n\n- **`data-wp-ignore` is deprecated** and will be removed in future versions. It broke context inheritance and caused issues with client-side navigation. Avoid using it.\n- **Unique directive IDs**: Multiple directives of the same type can now exist on one element using the `---` separator (e.g., `data-wp-on--click---plugin-a=\"...\"` and `data-wp-on--click---plugin-b=\"...\"`).\n- **New TypeScript types**: `AsyncAction\u003CReturnType>` and `TypeYield\u003CT>` help with async action typing.\n\nFor quick directive reminders, see `references\u002Fdirectives-quickref.md`.\n\n### 5) Build\u002Ftooling alignment\n\nVerify the repo supports the required module build path:\n\n- if it uses `@wordpress\u002Fscripts`, prefer its conventions.\n- if it uses custom bundling, confirm module output is supported.\n\n### 6) Debug common failure modes\n\nIf “nothing happens” on interaction:\n\n- confirm the `viewScriptModule` is enqueued\u002Floaded,\n- confirm the DOM element has `data-wp-interactive`,\n- confirm the store namespace matches the directive’s value,\n- confirm there are no JS errors before hydration.\n\nSee `references\u002Fdebugging.md`.\n\n## Verification\n\n- `wp-project-triage` indicates `signals.usesInteractivityApi: true` after your change (if applicable).\n- Manual smoke test: directive triggers and state updates as expected.\n- If tests exist: add\u002Fextend Playwright E2E around the interaction path.\n\n## Failure modes \u002F debugging\n\n- Directives present but inert:\n  - view script not loading, wrong module entrypoint, or missing `data-wp-interactive`.\n- Hydration mismatch \u002F flicker:\n  - server markup differs from client expectations; simplify or align initial state.\n  - derived state not defined in PHP: use `wp_interactivity_state()` with closures.\n- Initial content missing or wrong:\n  - `supports.interactivity` not set in `block.json` (for blocks).\n  - `wp_interactivity_process_directives()` not called (for themes\u002Fplugins).\n  - state\u002Fcontext not initialized in PHP before render.\n- Layout shift on load:\n  - derived state like `state.hasItems` missing on server, causing `hidden` attribute to be absent.\n- Performance regressions:\n  - overly broad interactive roots; scope interactivity to smaller subtrees.\n- Client-side navigation issues (WordPress 6.9):\n  - `getServerState()` and `getServerContext()` now reset between page transitions—ensure your code doesn't assume stale values persist.\n  - Router regions now support `attachTo` for rendering overlays (modals, pop-ups) dynamically.\n\n## Escalation\n\n- If repo build constraints are unclear, ask: \"Is this using `@wordpress\u002Fscripts` or a custom bundler (webpack\u002Fvite)?\"\n- Consult:\n  - `references\u002Fserver-side-rendering.md`\n  - `references\u002Fdirectives-quickref.md`\n  - `references\u002Fdebugging.md`\n",{"name":5,"description":7},"main","c5c9f6be96a3086970a7b9e89f09a99a9bf5d585",".claude\u002Fskills\u002Fwp-interactivity-api","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto","https:\u002F\u002Fspaghetti-dojo.github.io\u002Ftosuto\u002F","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo","A place where to experiment","2026-05-27 16:04:29",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add Spaghetti-Dojo\u002Ftosuto --skill wp-interactivity-api",{"tool":55,"command":56},"bunx","bunx skills add Spaghetti-Dojo\u002Ftosuto --skill wp-interactivity-api",{"tool":58,"command":59},"pnpm","pnpm dlx skills add Spaghetti-Dojo\u002Ftosuto --skill wp-interactivity-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-interactivity-api\u002FSKILL.md",true,[63,69,73],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fdebugging.md","REFERENCE","参考文档",1371,"https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-interactivity-api\u002Freferences\u002Fdebugging.md",{"path":70,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fdirectives-quickref.md",1163,"https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-interactivity-api\u002Freferences\u002Fdirectives-quickref.md",{"path":74,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fserver-side-rendering.md",7733,"https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-interactivity-api\u002Freferences\u002Fserver-side-rendering.md",[78,91,115,137,159,181],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":36},"01M70DDJXEN0BM5TZPB5GF9TA6","wpds","Use when building UIs leveraging the WordPress Design System (WPDS) and its components, tokens, patterns, etc.","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwpds\u002FSKILL.md",[],[80,33,85,86,87,31,88,29,89,90],"system","tokens","design","design system","patterns","components",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":36},"01M70DDG4PMCJVM2MAH4BQ4F6C","wp-wpcli-and-ops","Use when working with WP-CLI (wp) for WordPress operations: safe search-replace, db export\u002Fimport, plugin\u002Ftheme\u002Fuser\u002Fcontent management, cron, cache flushing, multisite, and scripting\u002Fautomation with wp-cli.yml.","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-wpcli-and-ops\u002FSKILL.md",[],[98,99,100,101,102,103,33,104,105,31,29,106,107,108,109,110,111,112,113,114],"ops","wp wpcli and ops","import","theme","for","db","search","wp-cli","automation","cache","with","plugin","cli","scripting","operations","safe","export",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":36},"01M70DDD8SMSRYCT6CMZAZ79V8","wp-rest-api","Use when building, extending, or debugging WordPress REST API endpoints\u002Froutes: register_rest_route, WP_REST_Controller\u002Fcontroller classes, schema\u002Fargument validation, permission_callback\u002Fauthentication, response shaping, register_rest_field\u002Fregister_meta, or exposing CPTs\u002Ftaxonomies via show_in_rest.","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-rest-api\u002FSKILL.md",[],[122,20,123,124,125,126,33,127,128,129,31,130,30,29,131,132,133,134,135,136],"wp rest api","REST","rest api","show","register","authentication","Meta","schema","taxonomies","route","shaping","controller","endpoints","callback","argument",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":36},"01M70DDB298BG7A74YZ3XEWHQY","wp-project-triage","Use when you need a deterministic inspection of a WordPress repository (plugin\u002Ftheme\u002Fblock theme\u002FWP core\u002FGutenberg\u002Ffull site) including tooling\u002Ftests\u002Fversion hints, and a structured JSON report to guide workflows and guardrails.","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-project-triage\u002FSKILL.md",[],[144,145,146,147,101,148,33,149,150,151,31,152,29,153,154,109,155,156,157,158],"project","wp project triage","triage","deterministic","core","Guardrails","tests","inspection","workflows","you","version","tooling","json","repository","report",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":36},"01M70DD924A87SK645B5HKE39A","wp-plugin-development","Use when developing WordPress plugins: architecture and hooks, activation\u002Fdeactivation\u002Funinstall, admin UI and Settings API, data storage, cron\u002Ftasks, security (nonces\u002Fcapabilities\u002Fsanitization\u002Fescaping), and release packaging.","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-plugin-development\u002FSKILL.md",[],[166,167,168,109,169,33,170,171,31,29,172,173,20,174,175,176,177,178,179,180],"development","plugin development","wp plugin development","uninstall","packaging","hooks","tasks","architecture","capabilities","admin","storage","release","settings","plugins","data storage",{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":36},"01M70DD5JTD6MBJV9KAQBZ5191","wp-playground","Use for WordPress Playground workflows: fast disposable WP instances in the browser or locally via @wp-playground\u002Fcli (server, run-blueprint, build-snapshot), auto-mounting plugins\u002Fthemes, switching WP\u002FPHP versions, blueprints, and debugging (Xdebug).","https:\u002F\u002Fgithub.com\u002FSpaghetti-Dojo\u002Ftosuto\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwp-playground\u002FSKILL.md",[],[188,189,190,102,33,191,192,31,193,194,30,152,195,196,110,197,198,199,200,179],"playground","wp playground","instances","themes","auto","switching","Blueprint","browser","server","via","build","run","snapshot"]