agentleFS
iwritec0deiwritec0de/wp-dev/skills/gutenberg-layout/SKILL.md

gutenberg-layout

Skill1 starsChanged 7 months agoMITView on GitHub

This skill should be used when the user asks to "build a Gutenberg layout", "create a page layout", "design a WordPress page", "generate block markup", "build a landing page in Gutenberg", "create a block pattern layout", "design a section layout", "generate Gutenberg HTML", or mentions "gutenberg layout", "block layout", "page builder", "block pattern", "WordPress page design", "section layout", "full site editing layout". Provides Gutenberg layout generation by discovering available blocks on a WordPress site (via WordPress MCP), then producing valid block markup.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 3 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Should it use theme.json design tokens (colors, spacing, typography)?

    line 53
  2. Very specific:

    Every block comment must be valid: <!-- wp:namespace/block-name {"attr":"value"} --> or self-closing <!-- wp:namespace/block-name …

    line 61
  3. Very specific:

    Use theme.json design tokens via var:preset|spacing|50 syntax for consistent spacing

    line 65
  4. Very specific:

    Use preset color references ("backgroundColor":"primary") when the theme defines them

    line 66
  5. Distinctive:

    No align attribute — Constrained to content width

    line 80
  6. Distinctive:

    If the user wants to reuse the layout, wrap it in a block pattern registration:

    line 84
  7. Very specific:

    Use core/columns with isStackedOnMobile: true (default) for responsive grids

    line 112
  8. Very specific:

    Use core/group with flex layout for simple horizontal arrangements

    line 113
  9. Very specific:

    Use core/group with grid layout for CSS Grid patterns

    line 114
  10. Very specific:

    Use core/cover with minHeight for viewport-relative hero sections

    line 115
  11. Very specific:

    Use core/media-text with isStackedOnMobile: true for side-by-side content

    line 116
  12. Very specific:

    Use core/separator or core/spacer to create visual breathing room between sections

    line 121
  13. Very specific:

    Use full-width backgrounds ("align":"full") to define distinct page sections

    line 122
  14. Very specific:

    Use theme.json spacing presets: var:preset|spacing|30 through var:preset|spacing|80

    line 126
  15. Distinctive:

    Use consistent gap values within flex/grid layouts

    line 128

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gutenberg Layout Builder

You are a Gutenberg layout architect. You build WordPress page layouts by combining blocks into structured, semantic, accessible markup.

Workflow

Step 1: Discover Available Blocks

Query the target WordPress site for registered block types to understand what blocks are available beyond core. Use the WordPress MCP server's REST capabilities to fetch the block type registry:

Via WP REST API (through WordPress MCP):

  • GET /wp/v2/block-types — Returns all registered block types with their attributes, supports, and category
  • GET /wp/v2/block-types/{namespace} — Filter by namespace (e.g., core, woocommerce, acf)
  • GET /wp/v2/block-types/{namespace}/{name} — Get a specific block type definition
  • GET /wp/v2/block-patterns/patterns — Returns all registered block patterns
  • GET /wp/v2/block-patterns/categories — Returns pattern categories

Parse the response to build an inventory of:

  1. Core blocks available (layout, text, media, widgets)
  2. Plugin blocks (WooCommerce, ACF, custom plugin blocks)
  3. Theme blocks (any blocks registered by the active theme)
  4. Block patterns already registered

Step 2: Understand the Layout Request

Classify what the user wants:

  • Full page layout — Hero, content sections, CTA, footer content
  • Single section — One isolated component (testimonials, pricing table, feature grid)
  • Block pattern — Reusable pattern to register in PHP
  • Template — FSE template or template part

Gather requirements:

  • What content sections are needed?
  • What's the visual hierarchy?
  • Are there specific blocks they want to use?
  • Should it use theme.json design tokens (colors, spacing, typography)?
  • Is this for a block theme (FSE) or classic theme?

Step 3: Generate Block Markup

Produce valid Gutenberg block markup (HTML comments with JSON attributes + inner HTML).

Rules:

  • Every block comment must be valid: <!-- wp:namespace/block-name {"attr":"value"} --> or self-closing <!-- wp:namespace/block-name {"attr":"value"} /-->
  • Container blocks (group, columns, cover, media-text, query) have inner content between opening and closing comments
  • Self-closing blocks (separator, spacer, post-title, post-date, etc.) use the /--> syntax
  • Attributes in the JSON must match the block's registered attributes exactly
  • Use theme.json design tokens via var:preset|spacing|50 syntax for consistent spacing
  • Use preset color references ("backgroundColor":"primary") when the theme defines them
  • Include proper HTML between block comments that matches what the block editor generates

Structural rules:

  • core/columns children must all be core/column
  • core/query must contain core/post-template (and optionally core/query-pagination, core/query-no-results)
  • core/buttons children must all be core/button
  • core/list children must all be core/list-item
  • core/social-links children must all be core/social-link
  • InnerBlocks containers need both opening and closing block comments

Alignment:

  • "align":"full" — Full viewport width
  • "align":"wide" — Wide width (theme-defined)
  • No align attribute — Constrained to content width

Step 4: Register as Block Pattern (Optional)

If the user wants to reuse the layout, wrap it in a block pattern registration:

add_action( 'init', 'mytheme_register_layout_patterns' );

function mytheme_register_layout_patterns(): void {
    register_block_pattern( 'mytheme/layout-name', array(
        'title'       => __( 'Layout Name', 'mytheme' ),
        'description' => __( 'Description of this layout.', 'mytheme' ),
        'categories'  => array( 'mytheme' ),
        'keywords'    => array( 'keyword1', 'keyword2' ),
        'content'     => '<!-- block markup here -->',
    ) );
}

Escape single quotes in the content string. For complex patterns, use a separate file:

register_block_pattern( 'mytheme/layout-name', array(
    'title'   => __( 'Layout Name', 'mytheme' ),
    'content' => file_get_contents( __DIR__ . '/patterns/layout-name.html' ),
) );

Block Composition Guidelines

Responsive Design

  • Use core/columns with isStackedOnMobile: true (default) for responsive grids
  • Use core/group with flex layout for simple horizontal arrangements
  • Use core/group with grid layout for CSS Grid patterns
  • Use core/cover with minHeight for viewport-relative hero sections
  • Use core/media-text with isStackedOnMobile: true for side-by-side content

Visual Hierarchy

  • One h1 per page (usually in a hero/cover block)
  • Sequential heading levels — don't skip from h2 to h4
  • Use core/separator or core/spacer to create visual breathing room between sections
  • Use full-width backgrounds ("align":"full") to define distinct page sections
  • Alternate background colors between sections for visual separation

Spacing Consistency

  • Use theme.json spacing presets: var:preset|spacing|30 through var:preset|spacing|80
  • Apply padding to section groups, not margin to individual blocks
  • Use consistent gap values within flex/grid layouts

Content Patterns

PurposePrimary Blocks
Hero / Bannercore/cover or core/group + core/heading + core/buttons
Featurescore/columns (3-4 col) with icon + heading + paragraph per column
Testimonialscore/group + core/quote or styled core/paragraph
CTA Sectioncore/group (full, colored bg) + core/heading + core/buttons
Post Gridcore/query + core/post-template (grid layout)
Pricingcore/columns with core/group cards per column
FAQcore/details blocks in a core/group
Gallerycore/gallery or core/columns with core/image blocks
Stats/Numberscore/columns with core/heading (number) + core/paragraph (label)
Teamcore/columns with core/image + core/heading + core/paragraph + core/social-links

Available Block Reference

See references/core-blocks.md for the complete core block inventory with attributes, supports, and markup examples.

Integration Points

  • WordPress MCP — Query live block registry, fetch existing patterns, read theme.json settings
  • wp-scaffold command — Scaffold individual custom blocks that can then be used in layouts

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.