Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wordpress avatar

Wp Block Development

  • 3.2k installs
  • 1.9k repo stars
  • Updated July 27, 2026
  • wordpress/agent-skills

wp-block-development is an agent skill for WordPress Gutenberg block.json authoring, registration, dynamic rendering, deprecations, and @wordpress/scripts build workflows.

About

wp-block-development is an agent skill for WordPress Gutenberg block work including block.json metadata, register_block_type_from_metadata, attributes and serialization, supports, dynamic rendering through render.php or render_callback, deprecations, viewScript versus viewScriptModule, and build workflows with @wordpress/scripts and @wordpress/create-block. It targets WordPress 6.9 plus with apiVersion 3 enforcement because version 2 blocks trigger SCRIPT_DEBUG warnings and WordPress 7.0 will run the post editor in an iframe regardless. The procedure triages projects with detect_wp_project.mjs, lists blocks via list_blocks.mjs, scaffolds new blocks through @wordpress/create-block, chooses static versus dynamic versus interactive models, updates block.json safely, registers server-side with metadata, implements useBlockProps and get_block_wrapper_attributes, handles inner blocks with useInnerBlocksProps, manages attributes and serialization, and adds deprecated entries before markup changes. Verification requires inserter success, no Invalid block after save, correct frontend output, and passing repo lint build tests. Developers reach for it when creating blocks, fixing attribute p.

  • Ten-step procedure from triage and scaffolding through block.json, registration, render patterns, and deprecations.
  • Enforces apiVersion 3 for WordPress 6.9 plus and upcoming iframe editor compatibility.
  • Covers static save, dynamic render.php, and viewScriptModule interactive frontend models.
  • Scripts detect_wp_project.mjs and list_blocks.mjs locate block roots deterministically.
  • Debugging references target invalid block, attribute persistence, and serialization failures.

Wp Block Development by the numbers

  • 3,239 all-time installs (skills.sh)
  • +179 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #148 of 2,277 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

wp-block-development capabilities & compatibility

Capabilities
block.json metadata editing · server side register_block_type_from_metadata · dynamic render.php patterns · deprecation and migrate handlers · wp scripts build and test workflows
Use cases
frontend · ui design
From the docs

What wp-block-development says it does

WordPress 6.9 enforces `apiVersion: 3` in the block.json schema.
SKILL.md
npx skills add https://github.com/wordpress/agent-skills --skill wp-block-development

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3.2k
repo stars1.9k
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorywordpress/agent-skills

How do I create or fix WordPress blocks without invalid block errors, broken attributes, or apiVersion incompatibilities?

Create and debug WordPress Gutenberg blocks with block.json, dynamic rendering, deprecations, and @wordpress/scripts tooling.

Who is it for?

Developers building WordPress plugins or themes with custom Gutenberg blocks on WordPress 6.9 or newer.

Skip if: Skip when the task is pure PHP backend logic without block editor metadata or when targeting legacy apiVersion 2 without migration.

When should I use this skill?

User creates Gutenberg blocks, edits block.json, fixes invalid block errors, or adds dynamic render.php rendering.

What you get

Blocks registered from metadata with correct save or render patterns, deprecations for markup changes, and verified inserter and frontend output.

  • block.json
  • render.php
  • compiled block assets

By the numbers

  • Targets WordPress 6.9+ and PHP 7.2.24+

Files

SKILL.mdMarkdownGitHub ↗

WP Block Development

When to use

Use this skill for block work such as:

  • creating a new block, or updating an existing one
  • changing block.json (scripts/styles/supports/attributes/render/viewScriptModule)
  • fixing “block invalid / not saving / attributes not persisting”
  • adding dynamic rendering (render.php / render_callback)
  • block deprecations and migrations (deprecated versions)
  • build tooling for blocks (@wordpress/scripts, @wordpress/create-block, wp-env)

Inputs required

  • Repo root and target (plugin vs theme vs full site).
  • The block name/namespace and where it lives (path to block.json if known).
  • Target WordPress version range (especially if using modules / viewScriptModule).

Procedure

0) Triage and locate blocks

1. Run triage:

  • node skills/wp-project-triage/scripts/detect_wp_project.mjs

2. List blocks (deterministic scan):

  • node skills/wp-block-development/scripts/list_blocks.mjs

3. Identify the block root (directory containing block.json) you’re changing.

If this repo is a full site (wp-content/ present), be explicit about which plugin/theme contains the block.

1) Create a new block (if needed)

If you are creating a new block, prefer scaffolding rather than hand-rolling structure:

  • Use @wordpress/create-block to scaffold a modern block/plugin setup.
  • If you need Interactivity API from day 1, use the interactive template.

Read:

  • references/creating-new-blocks.md

After scaffolding:

1. Re-run the block list script and confirm the new block root. 2. Continue with the remaining steps (model choice, metadata, registration, serialization).

2) Ensure apiVersion 3 (WordPress 6.9+)

WordPress 6.9 enforces apiVersion: 3 in the block.json schema. Blocks with apiVersion 2 or lower trigger console warnings when SCRIPT_DEBUG is enabled.

Why this matters:

  • WordPress 7.0 will run the post editor in an iframe regardless of block apiVersion.
  • apiVersion 3 ensures your block works correctly inside the iframed editor (style isolation, viewport units, media queries).

Migration: Changing from version 2 to 3 is usually as simple as updating the apiVersion field in block.json. However:

  • Test in a local environment with the iframe editor enabled.
  • Ensure any style handles are included in block.json (styles missing from the iframe won't apply).
  • Third-party scripts attached to a specific window may have scoping issues.

Read:

  • references/block-json.md (apiVersion and schema details)

3) Pick the right block model

  • Static block (markup saved into post content): implement save(); keep attributes serialization stable.
  • Dynamic block (server-rendered): use render in block.json (or render_callback in PHP) and keep save() minimal or null.
  • Interactive frontend behavior:
  • Prefer viewScriptModule for modern module-based view scripts where supported.
  • If you're working primarily on data-wp-* directives or stores, also use wp-interactivity-api.

4) Update block.json safely

Make changes in the block’s block.json, then confirm registration matches metadata.

For field-by-field guidance, read:

  • references/block-json.md

Common pitfalls:

  • changing name breaks compatibility (treat it as stable API)
  • changing saved markup without adding deprecated causes “Invalid block”
  • adding attributes without defining source/serialization correctly causes “attribute not saving”

5) Register the block (server-side preferred)

Prefer PHP registration using metadata, especially when:

  • you need dynamic rendering
  • you need translations (wp_set_script_translations)
  • you need conditional asset loading

Read and apply:

  • references/registration.md

6) Implement edit/save/render patterns

Follow wrapper attribute best practices:

  • Editor: useBlockProps()
  • Static save: useBlockProps.save()
  • Dynamic render (PHP): get_block_wrapper_attributes()

Read:

  • references/supports-and-wrappers.md
  • references/dynamic-rendering.md (if dynamic)

7) Inner blocks (block composition)

If your block is a “container” that nests other blocks, treat Inner Blocks as a first-class feature:

  • Use useInnerBlocksProps() to integrate inner blocks with wrapper props.
  • Keep migrations in mind if you change inner markup.

Read:

  • references/inner-blocks.md

8) Attributes and serialization

Before changing attributes:

  • confirm where the attribute value lives (comment delimiter vs HTML vs context)
  • avoid the deprecated meta attribute source

Read:

  • references/attributes-and-serialization.md

9) Migrations and deprecations (avoid "Invalid block")

If you change saved markup or attributes:

1. Add a deprecated entry (newest → oldest). 2. Provide save for old versions and an optional migrate to normalize attributes.

Read:

  • references/deprecations.md

10) Tooling and verification commands

Prefer whatever the repo already uses:

  • @wordpress/scripts (common) → run existing npm scripts
  • wp-env (common) → use for local WP + E2E

Read:

  • references/tooling-and-testing.md

Verification

  • Block appears in inserter and inserts successfully.
  • Saving + reloading does not create “Invalid block”.
  • Frontend output matches expectations (static: saved markup; dynamic: server output).
  • Assets load where expected (editor vs frontend).
  • Run the repo’s lint/build/tests that triage recommends.

Failure modes / debugging

If something fails, start here:

  • references/debugging.md (common failures + fastest checks)
  • references/attributes-and-serialization.md (attributes not saving)
  • references/deprecations.md (invalid block after change)

Escalation

If you’re uncertain about upstream behavior/version support, consult canonical docs first:

  • WordPress Developer Resources (Block Editor Handbook, Theme Handbook, Plugin Handbook)
  • Gutenberg repo docs for bleeding-edge behaviors

Related skills

How it compares

Use wp-block-development for native Gutenberg block.json workflows rather than generic React component skills that omit WordPress registration APIs.

FAQ

Why must block.json use apiVersion 3?

WordPress 6.9 enforces apiVersion 3 in the schema and WordPress 7.0 runs the post editor in an iframe that requires version 3 style isolation.

When should a block use dynamic rendering?

Use render in block.json or render_callback in PHP with minimal or null save when server output must stay current instead of saved markup.

Is Wp Block Development safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.