Wordpress custom template generator

From lightspeedwp/.github · View interactive version

Wordpress custom template generator is an AI agent skill from the GitHub repository lightspeedwp/.github. create wordpress block theme custom templates, matching template files and theme.json customtemplates entries for specific post types or editorial workflows. use when the user asks to register a custom template, create a page-specific template outside the default hierarchy, or generate both the temp

How to use this skill

Skill file

WordPress Custom Template Generator

Purpose

Generate WordPress block theme custom templates as a paired deliverable:

This skill is for template needs that sit outside the normal hierarchy flow, such as named editorial layouts, landing-page layouts, or post-type-specific custom templates.

It does not replace the normal hierarchy-aware template generator for index, single, page, archive, or similar standard templates.

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 the name, title, or postTypes values are incomplete, use wordpress-asset-parameter-generator behavior first and state assumptions.

Fast Decision Flow

  1. Confirm this is a custom template rather than a normal hierarchy template.
  2. Normalize:
  1. Draft the target file path in /templates/{name}.html.
  2. Generate the matching customTemplates entry for theme.json.
  3. Generate the template markup.
  4. Include core/post-content when editable entry content must render.
  5. Mark anything that should be reviewed by wordpress-block-asset-validator.

Workflow

  1. Inspect the request and capture confirmed facts only.
  2. Choose a stable hyphen-case template name.
  3. Draft the file path in /templates.
  4. Generate the theme.json customTemplates entry with:
  1. Compose the template with shared parts and patterns where appropriate.
  2. Add core/post-content when the template should render editable content.
  3. Return the file path, template file, theme.json fragment, assumptions, and validation notes.

Custom Template Rules

Output Format

By default, return:

  1. the intended file path
  2. the complete template file
  3. the theme.json fragment
  4. assumptions
  5. validation notes

Example output shape:

## File path
/templates/content-canvas.html

## Template file

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

<!-- wp:main -->

<main>

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

</main>

<!-- /wp:main -->

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


## theme.json fragment

{

"customTemplates": [

{

"name": "content-canvas",

"title": "Content Canvas",

"postTypes": ["page", "post"]

}

]

}


## Assumptions
- The template is intended for both pages and posts.

## Validation notes
- Confirm the post type list and title.
- 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: editorial custom template

Prompt:

Create a Content Canvas custom template for pages and posts with shared header and footer and editable entry content.

Expected behaviour:

Test prompt: landing-page template

Prompt:

Build a Landing Page custom template for pages only. It should support a hero pattern and a simpler footer.

Expected behaviour:

Test prompt: boundary case

Prompt:

Create single.html for blog posts using the standard hierarchy.

Expected behaviour:

References

_Docs signed by 🤖 Copilot for LightSpeedWP – always fresh!_

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.