Wordpress pattern generator

From lightspeedwp/.github · View interactive version

Wordpress pattern generator is an AI agent skill from the GitHub repository lightspeedwp/.github. create wordpress block theme pattern files, php pattern headers, starter patterns, block-type patterns and template-usage patterns from briefs, figma handoff, block markup notes or repository conventions. use when the user asks to generate a wordpress pattern, scaffold a pattern file, create a hidde

How to use this skill

Skill file

WordPress Pattern Generator

Purpose

Generate WordPress block theme pattern files that align with official pattern behavior and LightSpeed-style consistency.

This skill creates:

It prefers theme /patterns/*.php auto-registration and does not default to manual PHP registration unless the user explicitly needs it.

Trigger Conditions

Use this skill when the request is about:

Do not use this skill for:

Those belong to the relevant specialist skills.

Inputs

Accept any mix of:

If required metadata is incomplete, call on wordpress-asset-parameter-generator behavior first and state any assumptions.

Fast Decision Flow

  1. Identify the pattern type:
  1. Normalize the metadata.
  2. Determine path and filename in /patterns.
  3. Generate the PHP header and block markup body.
  4. Mark anything that needs validation by wordpress-block-asset-validator.

Workflow

  1. Inspect the request and pull out confirmed facts only.
  2. Decide whether the pattern is user-facing or implementation-only.
  3. Normalize the metadata:
  1. Draft the file path in /patterns/{pattern-name}.php.
  2. Generate the standard PHP header.
  3. Generate the block markup body.
  4. Return the pattern file plus assumptions and a validation handoff note.

Pattern Rules

Starter Patterns

WordPress has two kinds of starter pattern, and they are registered differently.

Starter page patterns

A page pattern appears in the new-post-type picker only when all of the following hold:

So a page starter pattern needs only Block Types: core/post-content. Omitting Post Types offers it for pages, which is the same outcome as Post Types: page; naming other post types as well widens it, for example page, wp_template. The core filter is:

( postType === 'page' && ! pattern.postTypes ) ||
( Array.isArray( pattern.postTypes ) && pattern.postTypes.includes( postType ) )

which is why neither field alone makes a non-page pattern appear for that post type.

Starter template patterns

A template pattern appears in the Site Editor when creating a new template. It is keyed on Template Types instead:

See Starter patterns.

Pattern Header Template

<?php
/**
 * Title: Hero Default
 * Slug: theme-slug/hero-default
 * Categories: banner
 * Description:
 * Viewport Width:
 * Inserter: true
 * Keywords:
 * Block Types:
 * Post Types:
 * Template Types:
 */
?>

Output Format

By default, return:

  1. the intended file path
  2. the complete PHP pattern file
  3. assumptions
  4. validation notes

Example output shape:

## File path
/patterns/hero-default.php

## Pattern file

<?php

/**

*/

?>

<!-- wp:group {"layout":{"type":"constrained"}} -->

<div class="wp-block-group"></div>

<!-- /wp:group -->


## Assumptions

- Theme slug is `theme-slug`.

## Validation notes

- Confirm category choice.
- Run the block asset validator before commit.

Safe Defaults

Failure Modes And Escalation

Escalate briefly when:

In those cases, ask at most one focused question or return a safe scaffold with explicit assumptions.

Test Prompts

Test prompt: hidden implementation pattern

Prompt:

Create a hidden hero CTA implementation pattern for the lsx theme. It should be used inside a page template and not appear in the inserter.

Expected behaviour:

Test prompt: starter pattern

Prompt:

Build a Contact page starter pattern for a block theme. It should be available for pages and use the best core category match.

Expected behaviour:

Test prompt: boundary case

Prompt:

Register a new custom template in theme.json and create the matching template file.

Expected behaviour:

References

_Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP_

Contact

_Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP_

Contact

_Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP_

Contact

_Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP_

Contact

_Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP_

Contact

Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.