New advertisers: 50% off your first month with code FIRSTMONTHSee slots
wordpress avatar

Wp Interactivity Api

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

skills.sh installs
4.6K
GitHub stars
2.4K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the full workflow: detecting existing usage, identifying stores, server-side rendering, directive changes, build alignment, and failure triage
  • Includes PHP helpers like wp_interactivity_state(), wp_interactivity_data_wp_context(), and wp_interactivity_process_directives(), plus WordPress 6.9 directive and navigation changes
  • Enforces server-rendered initial state and warns against data-wp-ignore, which is deprecated in WordPress 6.9
  • Designed for blocks, themes, and plugins that use viewScriptModule and need hydration-safe directive behavior

Install

$ npx -y skills add wordpress/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/wordpress/agent-skills
Categories
PHP & Laravel, Frontend & UI Code
First seen
Apr 16, 2026

More from wordpress/agent-skills

All 17

Similar to Wp Interactivity Api

More PHP & Laravel