All skills
wordpress avatar

/wp-block-development

@20324d2 official
by wordpresswordpress/agent-skills2.2k stars
327

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.

Use this Skill: https://skilld.dev/gh/wordpress/agent-skills/wp-block-development

This session only. Nothing lands on disk.

referencescreating-new-blocks.md

≈399 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Creating new blocks (scaffolding)

Use this file when you are creating a new block (or a new block plugin) from scratch.

Preferred path: @wordpress/create-block

@wordpress/create-block scaffolds a modern block setup that tends to track current best practices.

Typical options to decide up front:

  • TypeScript vs JavaScript
  • Static vs dynamic (render.php / server rendering)
  • Whether the block should be interactive on the frontend

Canonical docs:

“Most up-to-date” interactive blocks

For a modern interactive block, prefer the official Interactivity API template:

  • Template: @wordpress/create-block-interactive-template

This template is designed to integrate:

  • Interactivity API directives (data-wp-*)
  • module-based view scripts (viewScriptModule)
  • server rendering (render.php)

References:

Manual fallback (when scaffolding is not available)

If you cannot run create-block (no Node tooling or restricted network):

  1. Create a plugin or theme location that will register the block.
  2. Create a block folder with a valid block.json.
  3. Register via register_block_type_from_metadata() in PHP.
  4. Add editor JS and (optionally) frontend view assets.

Then follow the rest of wp-block-development for metadata, registration, and serialization.

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a legitimate development assistant for WordPress block development. It includes instructions and a utility script to help developers manage block metadata, registration, and build workflows using official WordPress tools and documentation. No malicious patterns or security vulnerabilities were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    12/12 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 20324d2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 3 months ago
Other metadata
compatibility
Targets WordPress 7.0+ (PHP 7.4.0+). Filesystem-based agent with bash + node. Some workflows require WP-CLI.
  • React
  • wordpress
  • gutenberg
  • block-development
  • block-json
  • php
  • javascript
  • wp-scripts
  • dynamic-rendering
  • deprecations

README badge

README badge for wordpress/agent-skills/wp-block-development

Guides block development for WordPress 6.9+ using Gutenberg, covering block.json metadata, PHP registration, static vs dynamic rendering, attributes/serialization, deprecations, and @wordpress/scripts build workflows. Targets developers working with block.json, register_block_type, render.php, and the Block Editor's wrapper patterns.

Generated from the current SKILL.md.

Does this skill work with WordPress versions before 6.9?
The skill targets WordPress 6.9+ (PHP 7.2.24+). Blocks with apiVersion 2 or lower will trigger console warnings on 6.9, and WordPress 7.0 will run the editor in an iframe regardless of block apiVersion, so migration to apiVersion 3 is recommended.
Can I use this skill for dynamic blocks with server-side rendering?
Yes. The skill covers dynamic rendering via render.php or render_callback in block.json, including best practices for wrapper attributes with get_block_wrapper_attributes().
Does this skill handle block deprecations and migrations?
Yes. The skill provides guidance on adding deprecated entries, writing save() functions for old versions, and using migrate() to normalize attributes when you change saved markup or attributes.
What build tools does this skill support?
The skill assumes you're using whatever build tooling the repo already has in place, typically @wordpress/scripts or @wordpress/create-block. It also covers wp-env for local WordPress development and E2E testing.
Does this skill require WP-CLI?
Some workflows require WP-CLI, but it is not always necessary. The skill uses filesystem-based agent work with bash and node as the primary approach.

Generated from the current SKILL.md. These answers refresh after source changes.