wp-interactivity-api

Diagnose and implement WordPress Interactivity API directives for blocks, themes, and plugins.

Updated Jan 13, 2026
One-click install
npx skills add https://github.com/MrGKanev/agent-skills --skill wp-interactivity-api-mrgkanev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-interactivity-api
Source: https://github.com/MrGKanev/agent-skills/tree/main/skills/wp-interactivity-api
Command: npx skills add https://github.com/MrGKanev/agent-skills --skill wp-interactivity-api-mrgkanev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers diagnose and implement the WordPress Interactivity API, covering directives, stores, and hydration, so interactive blocks behave predictably.

Core Features & Use Cases

  • Triaging interactivity issues: identify problematic directives, viewScriptModule usage, and hydration gaps.
  • Guided implementation: apply store/state/actions patterns and server-side rendering guidelines.
  • Use Case: you are debugging a block that doesn’t fire on click; the Skill guides you through diagnosing directives and aligning server/client state.

Quick Start

To diagnose a non-working interactivity directive, describe your block.json settings, the directives used, and the server-rendered HTML so the AI can propose corrective steps.

Frequently Asked Questions about wp-interactivity-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my WordPress Interactivity API directive not fire on click?

To debug WordPress Interactivity API hydration gaps, inspect the server-rendered HTML for missing data-wp-interactive attributes and ensure your viewScriptModule correctly initializes the client store. Aligning server-side and client state prevents hydration mismatches.

How do I implement WordPress Interactivity API directives in a custom block?

Implement WordPress Interactivity API directives by defining data-wp-interactive and data-wp-on--* attributes in your block's HTML, then registering the viewScriptModule in block.json to handle store, state, and actions patterns for frontend interactivity.

How do I initialize derived state for WordPress blocks using PHP helpers?

Initialize derived state for WordPress blocks using the PHP helpers wp_interactivity_state() and wp_interactivity_data_wp_context(). These functions pass server-side data directly into the Interactivity API store before frontend hydration occurs.

Does the WordPress Interactivity API support server-side rendering?

Yes, the WordPress Interactivity API fully supports server-side rendering. You can use PHP helpers to inject context and state into the rendered HTML, ensuring interactive blocks receive proper data before client-side hydration begins.

What is the best way to troubleshoot a non-working WordPress interactive block?

The best way to troubleshoot a non-working WordPress interactive block is to triage the directives, viewScriptModule usage, and hydration gaps. Describe your block.json settings and server-rendered HTML to pinpoint corrective steps.