Back to Skills

wp-block-development

Use when developing WordPress (Gutenberg) blocks: block.json metadata, register_block_type(_from_metadata), attributes/serialization, supports, dynamic rendering (render.php/render_callback), deprecations/migrations, viewScript vs viewScriptModule, and @wordpress/scripts/@wordpress/create-block build and test workflows.

1,657stars241forksUpdated 6/10/2026

Security Assessment

Safe(100/100)
Security Score100/100

About wp-block-development

The wp-block-development skill is designed to streamline the process of developing WordPress Gutenberg blocks. It addresses common challenges developers face, such as managing block metadata, registering blocks correctly, handling dynamic rendering, and ensuring attributes persist properly. By guiding developers through the necessary steps for block creation, modification, and maintenance, this skill reduces errors like invalid blocks or non-persistent attributes and helps maintain compatibility across WordPress versions. It integrates both PHP and JavaScript workflows, supporting a filesystem-based environment with bash and Node.js, and leverages WP-CLI where applicable.

Key features include scaffolding new blocks using @wordpress/create-block, ensuring blocks comply with apiVersion 3 for WordPress 6.9+, managing static, dynamic, and interactive block models, and updating block.json safely. The skill covers the registration of blocks, serialization of attributes, deprecation handling, migrations, and the proper use of viewScript and viewScriptModule for frontend interactivity. It also addresses build workflows with @wordpress/scripts and supports testing via wp-env, providing developers with a complete toolkit to develop, debug, and maintain Gutenberg blocks efficiently.

This skill is ideal for WordPress developers working on plugins, themes, or full-site block implementations who need structured guidance for creating and updating blocks. Typical use cases include adding new blocks, updating block metadata, migrating blocks to newer API versions, resolving attribute persistence issues, implementing dynamic rendering, and managing deprecated block versions. It is particularly useful for developers targeting WordPress 6.9+ and working in environments that combine PHP, Node.js, and WP-CLI tools.

FAQ

Which WordPress versions are compatible with this skill?

This skill targets WordPress 6.9 and above and requires PHP 7.2.24 or higher. It ensures that blocks use apiVersion 3 to maintain compatibility with modern editor behavior.

Can this skill be used for both plugin and theme blocks?

Yes, it supports block development in plugins, themes, or full-site implementations. The repo root and target type must be specified to properly locate and update blocks.

What should I do if a block's attributes are not saving?

Ensure that attribute sources and serialization are correctly defined in block.json. Adding new attributes without proper source definitions can prevent them from persisting.

Does this skill support dynamic blocks?

Yes, dynamic blocks are supported using the render field in block.json or render_callback in PHP. Static blocks can use save(), while interactive blocks can utilize viewScriptModule for module-based scripts.

Are there any tooling requirements for using this skill?

Some workflows require Node.js, bash, and WP-CLI. Additionally, build and testing may involve @wordpress/scripts, @wordpress/create-block, and wp-env for local development.

All Files

12 files
references/block-json.md2.3 KB
View
references/deprecations.md0.6 KB
View
references/creating-new-blocks.md1.6 KB
View
references/dynamic-rendering.md0.7 KB
View
references/attributes-and-serialization.md0.7 KB
View
references/debugging.md1.3 KB
View
references/inner-blocks.md1.2 KB
View
references/registration.md0.9 KB
View
scripts/list_blocks.mjs2.8 KB
View
references/supports-and-wrappers.md0.5 KB
View
SKILL.md6.3 KB
View
references/tooling-and-testing.md0.9 KB
View

Install wp-block-development

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill