Skip to content

feat(skill): add wp-block-post-content — raw block markup generation and validation#60

Open
marcel-za wants to merge 3 commits into
WordPress:trunkfrom
marcel-za:trunk
Open

feat(skill): add wp-block-post-content — raw block markup generation and validation#60
marcel-za wants to merge 3 commits into
WordPress:trunkfrom
marcel-za:trunk

Conversation

@marcel-za

Copy link
Copy Markdown

Adds a new wp-block-post-content skill for generating, editing, and debugging
raw WordPress block comment markup in post content, patterns, and programmatic
post creation (wp_insert_post, wp_update_post, $wpdb->update).

What's included

skills/wp-block-post-content/SKILL.md
A procedural skill with a three-gate validation process: WP-CLI wp eval-file
round-trip (Gate 1), followed by mandatory Chrome DevTools JS save() contract
verification (Gate 2) for all static block content. Includes a surgical content
replacement pattern for updating single blocks without rebuilding full post content.

skills/wp-block-post-content/references/core-block-markup-reference.md
Exact save() output signatures for WordPress 7.0 core blocks, covering image
(basic, resized, border-radius), buttons (colour presets, inline font-size), group
(background colour, background image overlay), columns (width, verticalAlignment),
cover (parallax/gradient), file, list, details, separator, and dynamic blocks.
Includes an inline style property ordering reference — wrong order passes PHP
validation but fails JS validation.

skills/wp-block-post-content/references/wp-block-validation.md
Tiered validation reference (Tiers 1–4) with a rewritten Tier 3 Chrome DevTools
snippet, documentation of the non-block HTML comment footgun (silent Tier 1 pass /
fatal Tier 3 fail), and a PHP preg_replace fix. Includes the full block validation
diagnostic pipeline.

skills/wp-block-post-content/scripts/validate-markup.mjs
Node.js Tier 2 validator using @wordpress/block-serialization-default-parser.
Reads a file and reports any blocks with null blockName.

eval/scenarios/fix-block-validation-error.md
Eval scenario for the Chrome DevTools MCP workflow for diagnosing and fixing
"unexpected or invalid content" errors.

eval/scenarios/generate-page-layout.md
Eval scenario for structured block markup generation with mandatory pre-insertion
validation.

Relates to

Closes #57

marcel-za added 3 commits June 3, 2026 16:20
Add new wp-block-post-content skill for generating, editing, and
debugging raw WordPress block comment markup in post content, patterns,
and programmatic post creation. Includes a tiered validation protocol
(WP-CLI round-trip, Node.js sandbox, Chrome DevTools, manual cross-
reference), a core block markup reference with exact save() signatures,
and a Node.js validate-markup.mjs script using the official WordPress
block serialisation parser.

Also adds two eval scenarios: fix-block-validation-error (DevTools MCP
workflow for diagnosing validation errors) and generate-page-layout
(structured markup generation with pre-insertion validation).
…on gates

Expand core-block-markup-reference to WordPress 7.0: add image resized/
border-radius variants, button colour presets and inline font-size, group
with background colour and background image overlay, column width and
verticalAlignment, cover block with parallax/gradient, and a new inline
style property ordering reference.

Harden SKILL.md validation gates: Gate 2 (Tier 3 Chrome DevTools) is now
mandatory for all static block content, /tmp/ paths are banned in favour
of /wordpress/wp-content/uploads/, and a surgical content replacement
pattern is added for updating single blocks without rebuilding post content.

Update wp-block-validation.md: rewrite Tier 3 verification snippet with
wp.data guard, document the non-block HTML comment footgun (silent Tier 1
pass / fatal Tier 3 fail) with diagnostic snippet and PHP fix, and
reformat the diagnostic pipeline.
…cation section

Replace inline wp eval command with wp eval-file in the Tier 1 description
to match the hardened Procedure section and wp-block-validation.md. Also
tighten the Tier 3 description to reference the verification snippet in
wp-block-validation.md consistently.
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: marcel-za <magicwand@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@marcel-za

Copy link
Copy Markdown
Author

I linked my wordpress.org and Github accounts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New skill proposal: wp-block-post-content

1 participant