Use when developing WordPress block themes: theme.json (global settings/styles), templates and template parts, patterns, style variations, and Site Editor troubleshooting (style hierarchy, overrides, caching).
Add this skill
npx mdskills install WordPress/wp-block-themesComprehensive block theme skill with clear triage, strong references, and well-scoped workflows
1---2name: wp-block-themes3description: "Use when developing WordPress block themes: theme.json (global settings/styles), templates and template parts, patterns, style variations, and Site Editor troubleshooting (style hierarchy, overrides, caching)."4compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."5---67# WP Block Themes89## When to use1011Use this skill for block theme work such as:1213- editing `theme.json` (presets, settings, styles, per-block styles)14- adding or changing templates (`templates/*.html`) and template parts (`parts/*.html`)15- adding patterns (`patterns/*.php`) and controlling what appears in the inserter16- adding style variations (`styles/*.json`)17- debugging “styles not applying” / “editor doesn’t reflect theme.json”1819## Inputs required2021- Repo root and which theme is targeted (theme directory if multiple exist).22- Target WordPress version range (theme.json version and features vary by core version).23- Where the issue manifests: Site Editor, post editor, frontend, or all.2425## Procedure2627### 0) Triage and locate block theme roots28291. Run triage:30 - `node skills/wp-project-triage/scripts/detect_wp_project.mjs`312. Detect theme roots + key folders:32 - `node skills/wp-block-themes/scripts/detect_block_themes.mjs`3334If multiple themes exist, pick one and scope all changes to that theme root.3536### 1) Create a new block theme (if needed)3738If you are creating a new block theme from scratch (or converting a classic theme):3940- Prefer starting from a known-good scaffold (or exporting from a WP environment) rather than guessing file layout.41- Be explicit about the minimum supported WordPress version because `theme.json` schema versions differ.4243Read:44- `references/creating-new-block-theme.md`4546After creating the theme root, re-run `detect_block_themes` and continue below.4748### 2) Confirm theme type and override expectations4950- Block theme indicators:51 - `theme.json` present52 - `templates/` and/or `parts/` present53- Remember the style hierarchy:54 - core defaults → theme.json → child theme → user customizations55 - user customizations can make theme.json edits appear “ignored”5657Read:58- `references/debugging.md` (style hierarchy + fastest checks)5960### 3) Make `theme.json` changes safely6162Decide whether you are changing:6364- **settings** (what the UI allows): presets, typography scale, colors, layout, spacing65- **styles** (how it looks by default): CSS-like rules for elements/blocks6667Read:68- `references/theme-json.md`6970### 4) Templates and template parts7172- Templates live under `templates/` and are HTML.73- Template parts live under `parts/` and must not be nested in subdirectories.7475Read:76- `references/templates-and-parts.md`7778### 5) Patterns7980Prefer filesystem patterns under `patterns/` when you want theme-owned patterns.8182Read:83- `references/patterns.md`8485### 6) Style variations8687Style variations are JSON files under `styles/`. Note: once a user picks a style variation, that selection is stored in the DB, so changing the file may not “update what the user sees” automatically.8889Read:90- `references/style-variations.md`9192## Verification9394- Site Editor reflects changes where expected (Styles UI, templates, patterns).95- Frontend renders with expected styles.96- If styles aren’t changing, confirm whether user customizations override theme defaults.97- Run the repo’s build/lint scripts if assets are involved (fonts, custom JS/CSS build).9899## Failure modes / debugging100101Start with:102103- `references/debugging.md`104105Common issues:106107- wrong theme root (editing an inactive theme)108- user customizations override your defaults109- invalid `theme.json` shape/typos prevent application110- templates/parts in wrong folders (or nested parts)111112## Escalation113114If upstream behavior is unclear, consult canonical docs:115116- Theme Handbook and Block Editor Handbook for `theme.json`, templates, patterns, and style variations.117
Full transparency — inspect the skill content before installing.