
Wp Interactivity Api
This one's for building interactive WordPress blocks with the Interactivity API, the data-wp-* directive system that shipped in WordPress 6.5+. It covers the full lifecycle: scaffolding stores and actions, wiring up directives like data-wp-on and data-wp-bind, server-side rendering with wp_interactivity_state() to avoid hydration mismatches, and debugging when directives just sit there doing nothing. The procedure emphasizes pre-rendering state in PHP so your markup is correct before JavaScript loads, which is the right way to do this but easy to skip. Targets WordPress 6.9+ and assumes you're working in a filesystem agent with WP-CLI access. Solid if you're moving beyond static blocks or trying to figure out why your interactive block flickers on load.
- skills.sh installs
- 327
- GitHub stars
- 211
- last updated
- Jun 3, 2026
Install
$ npx -y skills add automattic/agent-skills --skill wp-interactivity-api --agent claude-codeInstalls into .claude/skills of the current project.
Files
WP Interactivity API
When to use
Use this skill when the user mentions:
- Interactivity API,
@wordpress/interactivity, data-wp-interactive,data-wp-on--*,data-wp-bind--*,data-wp-context,- block
viewScriptModule/ module-based view scripts, - hydration issues or “directives don’t fire”.
Inputs required
- Repo root + triage output (
wp-project-triage). - Which block/theme/plugin surfaces are affected (frontend, editor, both).
- Any constraints: WP version, whether modules are supported in the build.
Procedure
1) Detect existing usage + integration style
Search for:
data-wp-interactive@wordpress/interactivityviewScriptModule
Decide:
- Is this a block providing interactivity via
block.jsonview script module? - Is this theme-level interactivity?
- Is this plugin-side “enhance existing markup” usage?
If you’re creating a new interactive block (not just debugging), prefer the official scaffold template:
@wordpress/create-block-interactive-template(via@wordpress/create-block)
2) Identify the store(s)
Locate store definitions and confirm:
Sponsors
Details
- Repository
- github.com/automattic/agent-skills
- Categories
- Backend & APIs, AI & Agent Building
- First seen
- Jun 3, 2026