Build and fix Gutenberg blocks - block.json metadata, registration, attributes/serialization, static vs dynamic rendering, deprecations, and the @wordpress/scripts build workflow.
---
name: wp-block-development
description: Use when developing or fixing WordPress (Gutenberg) blocks - block.json metadata, register_block_type, attributes/serialization, supports, dynamic rendering, deprecations/migrations, and the @wordpress/scripts and @wordpress/create-block build/test workflow. Targets WordPress 6.9+.
---
Develop and debug Gutenberg blocks the WordPress-native way, avoiding the classic "Invalid block" trap.
## Workflow
1. Triage and locate blocks by scanning for `block.json` (the skill ships `detect_wp_project.mjs` and `list_blocks.mjs`).
2. Scaffold new blocks with `@wordpress/create-block` (use the interactive template if you need the Interactivity API); ensure `apiVersion: 3` for WP 6.9+/iframed editor.
3. Pick a model: static block (implement `save()`) vs dynamic block (`render` / `render_callback`, minimal `save`).
4. Register server-side via metadata; use `useBlockProps()`, `useInnerBlocksProps()`, and `get_block_wrapper_attributes()` for wrappers.
5. When changing saved markup/attributes, add a `deprecated` entry (+ `migrate`) so existing content stays valid.
6. Verify in the inserter, save/reload without "Invalid block", and run the repo's lint/build/E2E (wp-env).
Full skill & source: https://github.com/WordPress/agent-skills/tree/aa735ea7111c7924ee988306bcef70439e17dec9/skills/wp-block-development