All skills
automattic avatar

/wp-block-development

@ad7156c official
by automatticautomattic/agent-skills211 stars
37

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/automattic/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 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a legitimate tool for WordPress block development authored by Automattic. It provides standard workflows and utility scripts to manage and develop blocks. No security risks were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    12/12 files flagged

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

Last checked against GitHub 5 months ago.

Dormantupdated 9 months ago
Other metadata
compatibility
Targets WordPress 6.9+ (PHP 7.2.24+). 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 automattic/agent-skills/wp-block-development

Develops WordPress Gutenberg blocks: creates block.json metadata, handles block registration, static/dynamic rendering, attribute serialization, and deprecations. Targets WordPress 6.9+ with PHP 7.2.24+ and includes workflows for @wordpress/scripts, @wordpress/create-block, and block migrations.

Generated from the current SKILL.md.

What WordPress versions does this skill support?
WordPress 6.9+ with PHP 7.2.24+. The skill assumes apiVersion 3 in block.json, which is enforced in WordPress 6.9 and required for correct behavior in the iframed editor coming in WordPress 7.0.
Does this skill handle both static and dynamic blocks?
Yes. It covers static blocks (markup saved to post content), dynamic blocks (server-rendered via render.php or render_callback), and interactive blocks using viewScriptModule or the Interactivity API.
What happens if I change a block's saved markup without adding a deprecation?
Existing blocks in posts will show as invalid. You must add a deprecated entry with the old save pattern and an optional migrate function to normalize attributes when the schema changes.
Does this skill require WP-CLI or specific build tools?
Some workflows require WP-CLI. Build tooling depends on what the repo already uses — typically @wordpress/scripts or @wordpress/create-block — but the skill works with whatever is present.

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