Wordpress template part generator

From lightspeedwp/.github · View interactive version

Wordpress template part generator is an AI agent skill from the GitHub repository lightspeedwp/.github. create wordpress block theme template parts, shared part markup and template-part insertion patterns for headers, footers, sidebars, comments and other approved parts. use when the user asks to generate a template part, scaffold a part file in /parts, wire a template part into templates, or create a

How to use this skill

Skill file

WordPress Template Part Generator

Purpose

Generate WordPress block theme template parts that are structurally correct, reusable, and aligned with official block theme conventions.

This skill creates:

It does not generate full templates or register custom templates in theme.json.

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

Fast Decision Flow

  1. Identify the part type:
  1. Normalize slug, name, and wrapper tag.
  2. Draft the file path in /parts/{slug}.html.
  3. Generate the block markup for the part body.
  4. If needed, generate insertion markup for templates.
  5. Mark anything that should be reviewed by wordpress-block-asset-validator.

Workflow

  1. Inspect the request and extract confirmed facts.
  2. Reuse a shared standard slug when appropriate:
  1. Choose a valid wrapper tag if the request needs one:
  1. Draft the file path in /parts.
  2. Generate valid block markup for the part.
  3. If the part should include a pattern, insert it with block pattern markup.
  4. Return the part file, insertion markup, assumptions, and validation notes.

Template Part Rules

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

Output Format

By default, return:

  1. the intended file path
  2. the complete template part file
  3. insertion markup for templates
  4. assumptions
  5. validation notes

Example output shape:

## File path
/parts/header.html

## Template part file

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

<header class="wp-block-group">

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

</header>

<!-- /wp:group -->


## Template insertion markup

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


## Assumptions

- Reused the shared `header` slug.

## Validation notes

- Confirm the wrapper tag 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: header part with pattern

Prompt:

Create a header template part for the lsx theme that includes a hidden implementation pattern for the top hero shell.

Expected behaviour:

Test prompt: sidebar part

Prompt:

Build a standard sidebar template part for a block theme. Keep the slug conventional and use an appropriate wrapper tag.

Expected behaviour:

Test prompt: boundary case

Prompt:

Create a full single post template with header, footer, and content.

Expected behaviour:

References

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

Contributors

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

Contributors

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

Contributors

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

Contributors

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

Contributors

_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.