wp-pattern

wp-pattern is a command for coding agents from siddik-web/wp-block-theme-converter. It costs 17 tokens per session (1,120 once invoked), scanned A, original, MIT.

A command that turns one HTML section into a registered WordPress block pattern, a reusable layout that can be inserted into pages. It derives pattern details such as its name, category, keywords, and theme settings.

In plain words
What is it for?
Use it to convert hero sections, feature grids, calls to action, headers, footers, product layouts, and other HTML snippets into WordPress patterns.
Why use it?
It saves developers from manually writing the PHP registration and metadata needed to make a section reusable in WordPress.

Command

Part of the wp-block-theme-converter plugin — 1 skill, 11 commands, 1 agent, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/siddik-web/wp-block-theme-converter/wp-pattern
Clone the repo
git clone --depth 1 https://github.com/siddik-web/wp-block-theme-converter

Or install wp-block-theme-converter, the plugin that ships this one along with the rest of its 1 skill, 11 commands, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wp-pattern

README.md
[![agentmods](https://agentmods.dev/badge/commands/siddik-web/wp-block-theme-converter/wp-pattern.svg)](https://agentmods.dev/commands/siddik-web/wp-block-theme-converter/wp-pattern)
Your own site
<a href="https://agentmods.dev/commands/siddik-web/wp-block-theme-converter/wp-pattern"><img src="https://agentmods.dev/badge/commands/siddik-web/wp-block-theme-converter/wp-pattern.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,120 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.01120
Opus 5 $0.00009 $0.00560
Sonnet 5 $0.00003 $0.00224
Haiku 4.5 $0.00002 $0.00112

Measured 3d ago against content hash 8ebf88afd63c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wp-pattern scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/wp-pattern.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/wp-pattern

Purpose: Convert a single HTML section/snippet into a registered WordPress block pattern PHP file.

Trigger

User types /wp-pattern followed by HTML markup, OR pastes HTML and asks for a pattern.

Workflow

Step 1: Identify Pattern Metadata

From the HTML, infer:

  • Pattern name — descriptive (e.g., "Hero with CTA", "Three-Column Features")
  • Pattern slug — kebab-case (e.g., "hero-with-cta")
  • Category — choose from: featured, hero, header, footer, gallery, posts, products, services, testimonials, contact, pricing, faq, team, cta
  • Keywords — 3-5 search keywords
  • Theme slug — ask if not in conversation context (default: "my-theme")
  • Text domain — same as theme slug
  • Block Types — controls where the pattern appears in the inserter. Pick from:
Pattern context Block Types value
General page content (hero, CTA, features, etc.) core/post-content
Inside a Query Loop (post card, archive item) core/query
WooCommerce product grid item woocommerce/product-template
WooCommerce single product woocommerce/product-details
Header / navigation patterns core/template-part/header
Footer patterns core/template-part/footer
No specific insertion context (general-purpose) Omit the line entirely

Step 2: Convert HTML to Block Markup

Apply the conversion map from references/block-conversion-map.md. Key rules:

  1. Wrap top-level in <!-- wp:group {"layout":{"type":"constrained"}} --> unless the section needs full-width
  2. Convert each HTML element to its block equivalent (see map)
  3. Replace hardcoded colors with var(--wp--preset--color--{slug}) references
  4. Replace hardcoded font sizes with preset references
  5. Convert all user-facing strings to <?php esc_html_e( 'string', 'text-domain' ); ?>
  6. Convert all asset paths to <?php echo esc_url( get_template_directory_uri() ); ?>/assets/...
  7. NEVER include inline <style> or <script> tags
  8. NEVER include inline style="" attributes — use block attributes instead

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 137 lines · 17 tokens per session scan A 8ebf88afd63c

Subscribe to this mod's changes

wp-pattern is a command published in the GitHub repository siddik-web/wp-block-theme-converter (44 stars, last pushed 3mo ago), licensed MIT. It adds 17 tokens to every session and 1,120 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.