Skip to main content
skill CX Codex

wp-interactivity-api — Claude Code skill: what it does & setup

Guides AI agents through WordPress Interactivity API implementation and debugging. Helps configure directives, connect script modules, and eliminate hydration mismatches.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add WordPress/agent-skills --skill wp-interactivity-api -a claude-code
Open on GitHub

What wp-interactivity-api does

This skill instructs coding agents on how to construct and troubleshoot WordPress Interactivity API components. It checks block metadata for viewScriptModule references, inspects data-wp-* attributes, and validates store setups under @wordpress/interactivity. When scaffolding new blocks, it points toward @wordpress/create-block-interactive-template.

Visual flickers and broken clicks usually trace back to mismatched server markup. To keep initial loads clean, the skill replicates derived state in PHP using wp_interactivity_state() and injects local context via wp_interactivity_data_wp_context(). In WordPress 6.9, data-wp-ignore is deprecated, while elements with repeated directive types rely on the --- separator.

The environment requires Node.js, Bash, WordPress 7.0+, and PHP 7.4.0+. Some workflows also call for WP-CLI. Without supports.interactivity set in block.json, server-side directive processing fails silently.

What it helps with

  • align server-rendered HTML with client stores using wp_interactivity_state
  • troubleshoot unresponsive data-wp-on directives and hydration mismatches
  • declare viewScriptModule and interactivity support inside block.json
  • handle repeated directives on a single element with the --- syntax

Example prompts for the agent

  • Why are my data-wp-on--click directives ignored after the block loads?
  • Write the PHP logic to pre-render derived state for my interactive block.
  • Verify whether block.json properly registers the view script module.

How to install wp-interactivity-api

1Skills CLI (Vercel)

npx skills add WordPress/agent-skills --skill wp-interactivity-api -a claude-code

2Manually: put the files in place

~/.claude/skills/wp-interactivity-api/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/wp-interactivity-api/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about wp-interactivity-api

How do I install wp-interactivity-api in Claude Code?

Run npx skills add WordPress/agent-skills --skill wp-interactivity-api -a claude-code in your terminal. This downloads and links the skill to your agent configuration.

What does wp-interactivity-api do?

It provides workflow guidelines for building and debugging WordPress Interactivity API directives, server-side state generation, and block module scripts.

What environment requirements does this skill expect?

The setup targets WordPress 7.0+ with PHP 7.4.0+, running in an environment with Node.js and Bash. Some advanced triage steps also need WP-CLI.

Similar skills

Everything for Frontend and UI →

From the same set19

wp-wpcli-and-ops A skill for WordPress operations through wp: move domains, export the database, install plugins, inspect cron. Useful when the agent has to touch a live site, not just theme files. CX Codex +1 5,500installs wp-playground A thin routing wrapper that picks the right WordPress Playground workflow for the agent: Blueprint, local CLI, browser share links or debugging. CX Codex +1 4,700installs wp-phpstan Sets up PHPStan static analysis in WordPress plugins and themes, while managing baselines and WordPress-specific PHPDoc types. CX Codex +1 4,600installs wp-abilities-api A skill for WordPress Abilities API work: registering abilities and categories in PHP, exposing them over REST, reading them in JS. Useful when a client can't see an ability. CX Codex +1 4,300installs wpds Feeds WordPress Design System docs to your agent through an MCP server, so UI work lands on real components and tokens instead of guesses. CX Codex +1 4,000installs blueprint Create and inspect JSON Blueprints for WordPress Playground with this skill. Use it to configure an environment as a Blueprint file, rather than just launch or share one. CX Codex +1 3,700installs wp-plugin-directory-guidelines Audits WordPress plugins against 18 WordPress.org Directory guidelines, verifying GPL license compatibility and freemium rules before submission. CX Codex +1 3,600installs wp-abilities-audit This skill reviews a WordPress plugin’s REST surface and writes a planning document for proposed Abilities API registrations. CX Codex +1 2,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor