Wordpress template generator

From lightspeedwp/.github · View interactive version

Wordpress template generator is an AI agent skill from the GitHub repository lightspeedwp/.github. create wordpress block theme templates, hierarchy-aware template files and template markup that composes template parts, patterns and post content correctly. use when the user asks to generate a block theme template, scaffold index home single archive or page templates, or build a template from appr

How to use this skill

Skill file

WordPress Template Generator

Purpose

Generate WordPress block theme templates that follow the official template hierarchy and compose reusable theme assets cleanly.

This skill creates:

It does not register custom templates in theme.json. That belongs to the custom-template generator.

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 structure is unclear, use wordpress-asset-parameter-generator behavior first and state assumptions.

Fast Decision Flow

  1. Identify the template type:
  1. Normalize the template name and target path.
  2. Decide which template parts and patterns belong in the composition.
  3. Generate the full block markup.
  4. Include core/post-content when the template should render editable entry content.
  5. Mark anything that should be reviewed by wordpress-block-asset-validator.

Workflow

  1. Inspect the request and extract confirmed facts.
  2. Choose the correct hierarchy-aware template filename.
  3. Draft the target path in /templates/{name}.html.
  4. Add template parts such as header and footer where appropriate.
  5. Add patterns where the request or workflow calls for them.
  6. Add core/post-content when the template is meant to render editable post or page content.
  7. Return the template file, assumptions, and validation notes.

Template Rules

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:pattern {"slug":"theme-slug/hero-default"} /-->

Output Format

By default, return:

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

Example output shape:

## File path
/templates/single.html

## Template file

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:main -->

<main>

<!-- wp:pattern {"slug":"theme-slug/article-hero"} /-->

<!-- wp:post-content /-->

</main>

<!-- /wp:main -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->


## Assumptions
- Reused shared `header` and `footer` parts.

## Validation notes
- Confirm the hierarchy choice and pattern slug.
- Run the 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: single template

Prompt:

Create a single.html template for the lsx theme with shared header and footer, an article hero pattern, and editable post content.

Expected behaviour:

Test prompt: baseline index template

Prompt:

Build the minimum index.html template for a block theme using reusable shared parts where appropriate.

Expected behaviour:

Test prompt: boundary case

Prompt:

Register a new landing-page template in theme.json for pages only and create the file.

Expected behaviour:

References

_Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!_

Contributors

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.