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.

referencesinner-blocks.md

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

Inner Blocks (nested blocks)

Use this file when your block contains other blocks (container blocks).

Canonical references

Practical patterns

  • Editor:
    • Use useInnerBlocksProps( useBlockProps(), { ... } ) to combine wrapper props with inner blocks.
    • Use templates/allowed blocks only when you have a clear UX reason (too strict is frustrating).
  • Save:
    • Use useInnerBlocksProps.save( useBlockProps.save(), { ... } ) if you need wrapper props.
    • Output nested content via <InnerBlocks.Content /> when appropriate.

Common pitfalls

  • Only one InnerBlocks should exist per block.
  • Changing the wrapper structure that contains inner blocks can invalidate existing content; consider deprecations/migrations.
  • If you need to constrain allowed blocks, prefer doing it intentionally and documenting why.

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    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.

  • Socket17d

    No alerts

  • Snyk17d

    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.