Skip to content
automattic avatar

Wp Interactivity Api

Practical guide for building and debugging WordPress Interactivity API features, covering directives, store state, and server-side rendering.

CCM score
60 of 100
skills.sh installs
343
GitHub stars
211
last updated
Jun 3, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the full workflow: detecting existing usage, identifying stores, server-side pre-rendering, directive changes, build alignment, and debugging
  • Includes reference files for server-side rendering, a directives quick reference, and debugging, plus steps for supports.interactivity and wp_interactivity_state()
  • Enforces avoiding the deprecated data-wp-ignore directive and aligning server markup with client hydration to prevent layout shift
  • Designed for WordPress 6.9+ block, theme, and plugin developers working with data-wp-* directives and @wordpress/interactivity

Install

$ npx -y skills add automattic/agent-skills --skill wp-interactivity-api -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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/interactivity
  • viewScriptModule

Decide:

  • Is this a block providing interactivity via block.json view 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:

Details

Repository
github.com/automattic/agent-skills
Categories
PHP & Laravel, Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the wp-interactivity-api skill do?

It guides an agent building or debugging WordPress Interactivity API features, including data-wp-* directives, @wordpress/interactivity stores, state and actions, and block viewScriptModule integration. It also covers server-side rendering, hydration, and directive behavior, following procedures from SKILL.md.

How do I install the wp-interactivity-api skill?

Run npx -y skills add automattic/agent-skills --skill wp-interactivity-api -y in your project. Once installed, the agent can follow the skill's steps for detecting Interactivity API usage, defining stores, and pre-rendering initial state on the server.

Who is the wp-interactivity-api skill for?

It is for developers working on WordPress blocks, themes, or plugins that use the Interactivity API. The skill targets WordPress 6.9 and later with PHP 7.2.24 or newer, and some workflows require WP-CLI.

Where does wp-interactivity-api stand among PHP and Laravel skills?

It sits in the PHP and Laravel category and ranks in the top 100 there, alongside laravel-specialist, php-pro, laravel-patterns, laravel-verification and laravel-plugin-discovery. Its focus is WordPress frontend interactivity rather than Laravel application code.

More from automattic/agent-skills

All 12

Similar to Wp Interactivity Api

More PHP & Laravel