wp-theme-json

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

A tool that creates WordPress's theme.json settings file from design tokens, CSS variables, or a written visual description. This file controls shared colors, fonts, spacing, sizes, borders, shadows, and layout settings.

In plain words
What is it for?
Use it to create a complete theme.json file from CSS custom properties, JSON or YAML design tokens, or descriptions such as a dark theme with gold accents.
Why use it?
It removes the need to build the theme settings file by hand and helps turn an existing design system into WordPress settings.

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-theme-json
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-theme-json

README.md
[![agentmods](https://agentmods.dev/badge/commands/siddik-web/wp-block-theme-converter/wp-theme-json.svg)](https://agentmods.dev/commands/siddik-web/wp-block-theme-converter/wp-theme-json)
Your own site
<a href="https://agentmods.dev/commands/siddik-web/wp-block-theme-converter/wp-theme-json"><img src="https://agentmods.dev/badge/commands/siddik-web/wp-block-theme-converter/wp-theme-json.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 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,767 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.00025 $0.01767
Opus 5 $0.00013 $0.00883
Sonnet 5 $0.00005 $0.00353
Haiku 4.5 $0.00003 $0.00177

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

Security

Grade A, and why

wp-theme-json 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 5d 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-theme-json.md · 210 lines

How it starts

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

/wp-theme-json

Purpose: Generate a complete, valid theme.json (schema v3) from a design system, CSS custom properties, or design token specification.

Trigger

User types /wp-theme-json followed by:

  • CSS custom properties (:root { --color-primary: #000; ... })
  • A design tokens spec (JSON, YAML, or plain description)
  • A natural language description ("dark theme with gold accents and serif headings")

Workflow

Step 1: Extract Design Tokens

From the input, identify:

Token Category What to Extract
Colors Primary, secondary, accent, background, surface, text, muted, border, success, warning, error
Gradients Any linear/radial gradients used
Font Families Heading, body, mono — note if self-hosted
Font Sizes All discrete sizes — convert to fluid type if a clear scale exists
Spacing Padding/margin scale (e.g., 4, 8, 16, 24, 32, 48, 64, 96)
Border Radius sm, md, lg, pill, etc.
Shadows sm, md, lg presets
Layout Container width, wide width

If anything is missing, use defaults from references/defaults.md.

Step 2: Build theme.json Structure

Read references/theme-json-schema.md for the full schema. The output MUST include:

{
  "$schema": "https://schemas.wp.org/trunk/theme.json",
  "version": 3,
  "settings": {
    "appearanceTools": true,
    "useRootPaddingAwareAlignments": true,
    "layout": {
      "contentSize": "...",
      "wideSize": "..."
    },
    "color": {
      "palette": [...],
      "gradients": [...],
      "duotone": [...],
      "defaultPalette": false,
      "defaultGradients": false,
      "customDuotone": true,
      "link": true
    },
    "typography": {
      "fluid": true,
      "fontFamilies": [...],
      "fontSizes": [...],
      "lineHeight": true,
      "letterSpacing": true,
      "fontWeight": true,
      "textTransform": true,
      "textDecoration": true
    },
    "spacing": {
      "spacingScale": { "operator": "*", "increment": 1.5, "steps": 7, "mediumStep": 1.5, "unit": "rem" },
      "spacingSizes": [...],
      "padding": true,
      "margin": true,
      "blockGap": true,
      "units": ["px", "em", "rem", "vh", "vw", "%"]
    },
    "border": {
      "color": true,
      "radius": true,
      "style": true,
      "width": true
    },
    "shadow": {
      "presets": [...],
      "defaultPresets": false
    },
    "blocks": {
      "core/button": { ... },
      "core/heading": { ... }
    }
  },
  "styles": {
    "color": {
      "background": "var(--wp--preset--color--background)",
      "text": "var(--wp--preset--color--text)"
    },
    "typography": {
      "fontFamily": "var(--wp--preset--font-family--body)",
      "fontSize": "var(--wp--preset--font-size--medium)",
      "lineHeight": "1.6"
    },
    "spacing": {
      "padding": {
        "top": "0",
        "right": "var(--wp--preset--spacing--40)",
        "bottom": "0",
        "left": "var(--wp--preset--spacing--40)"
      },
      "blockGap": "var(--wp--preset--spacing--30)"
    },
    "elements": {
      "h1": { ... },
      "h2": { ... },
      "h3": { ... },
      "h4": { ... },
      "h5": { ... },
      "h6": { ... },
      "link": {
        "color": { "text": "var(--wp--preset--color--accent)" },
        ":hover": { "color": { "text": "var(--wp--preset--color--primary)" } },
        ":focus": { "color": { "text": "var(--wp--preset--color--primary)" } }
      },
      "button": {
        "color": { ... },
        ":hover": { ... },
        ":focus": { ... },
        ":active": { ... }
      }
    },
    "blocks": {
      "core/button": { ... },
      "core/heading": { ... },
      "core/quote": { ... }
    }
  },
  "templateParts": [
    { "name": "header", "title": "Header", "area": "header" },
    { "name": "footer", "title": "Footer", "area": "footer" }
  ],
  "customTemplates": []
}

Read the full file on GitHub · 210 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. 5d ago First seen · 210 lines · 25 tokens per session scan A 1d04995293ef

Subscribe to this mod's changes

wp-theme-json is a command published in the GitHub repository siddik-web/wp-block-theme-converter (45 stars, last pushed 3mo ago), licensed MIT. It adds 25 tokens to every session and 1,767 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.