
Wp Block Themes
Develop or debug WordPress block themes—theme.json, templates, patterns, and style variations—when the Site Editor and frontend disagree.
Overview
WP Block Themes is an agent skill for the Build phase that develops and debugs WordPress block themes via theme.json, templates, patterns, style variations, and Site Editor troubleshooting.
Install
npx skills add https://github.com/wordpress/agent-skills --skill wp-block-themesWhat is this skill?
- Procedure triage via detect_wp_project.mjs and detect_block_themes.mjs to scope a single theme root.
- theme.json editing: presets, settings, styles, and per-block style overrides.
- Templates (templates/*.html), template parts (parts/*.html), and patterns (patterns/*.php) with inserter behavior.
- Style variations (styles/*.json) and debugging style hierarchy, overrides, and caching mismatches.
- Targets WordPress 6.9+ with filesystem agent workflows using bash and node; some flows need WP-CLI.
- Procedure step 0 triage plus numbered workflow through theme creation and debugging
- Compatibility stated: WordPress 6.9+ (PHP 7.2.24+)
Adoption & trust: 2.2k installs on skills.sh; 1.6k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your block theme changes in theme.json or templates do not show consistently between Site Editor, post editor, and the public site.
Who is it for?
Indie developers or freelancers maintaining a single block theme in a repo who need repeatable triage and WordPress 6.9+ block-theme conventions.
Skip if: Classic PHP themes, plugin-only backends, or hosts where you cannot run node/bash detection scripts or WP-CLI when a step requires it.
When should I use this skill?
Developing WordPress block themes: theme.json, templates, template parts, patterns, style variations, or Site Editor style hierarchy and caching issues.
What do I get? / Deliverables
You get a scoped theme-root workflow—from triage scripts through theme.json and template fixes—with clearer causes for style hierarchy and caching issues.
- Scoped theme root and change plan
- Updated theme.json, templates, parts, patterns, or style variation files
- Site Editor versus frontend parity notes after hierarchy/cache checks
Recommended Skills
Journey fit
Block theme work is product construction: global styles, block templates, and editor parity are core build-time frontend delivery for WordPress shops. Canonical shelf is build/frontend because the skill targets theme.json, HTML templates, patterns, and style variations—not plugin PHP business logic or server ops.
How it compares
A procedural block-theme skill package—not a hosted WordPress MCP or generic CSS-only frontend assistant.
Common Questions / FAQ
Who is wp-block-themes for?
Solo builders and small teams using agent-assisted development on WordPress block themes who need filesystem-level guidance aligned with core theme.json and Site Editor behavior.
When should I use wp-block-themes?
Use it while building frontend theme assets—editing theme.json, templates, patterns, or style variations—or when debugging editor versus frontend style drift during active theme development.
Is wp-block-themes safe to install?
Check the Security Audits panel on this Prism page for upstream risk; the skill instructs local node scripts and optional WP-CLI—review commands before running on production.
SKILL.md
READMESKILL.md - Wp Block Themes
# WP Block Themes ## When to use Use this skill for block theme work such as: - editing `theme.json` (presets, settings, styles, per-block styles) - adding or changing templates (`templates/*.html`) and template parts (`parts/*.html`) - adding patterns (`patterns/*.php`) and controlling what appears in the inserter - adding style variations (`styles/*.json`) - debugging “styles not applying” / “editor doesn’t reflect theme.json” ## Inputs required - Repo root and which theme is targeted (theme directory if multiple exist). - Target WordPress version range (theme.json version and features vary by core version). - Where the issue manifests: Site Editor, post editor, frontend, or all. ## Procedure ### 0) Triage and locate block theme roots 1. Run triage: - `node skills/wp-project-triage/scripts/detect_wp_project.mjs` 2. Detect theme roots + key folders: - `node skills/wp-block-themes/scripts/detect_block_themes.mjs` If multiple themes exist, pick one and scope all changes to that theme root. ### 1) Create a new block theme (if needed) If you are creating a new block theme from scratch (or converting a classic theme): - Prefer starting from a known-good scaffold (or exporting from a WP environment) rather than guessing file layout. - Be explicit about the minimum supported WordPress version because `theme.json` schema versions differ. Read: - `references/creating-new-block-theme.md` After creating the theme root, re-run `detect_block_themes` and continue below. ### 2) Confirm theme type and override expectations - Block theme indicators: - `theme.json` present - `templates/` and/or `parts/` present - Remember the style hierarchy: - core defaults → theme.json → child theme → user customizations - user customizations can make theme.json edits appear “ignored” Read: - `references/debugging.md` (style hierarchy + fastest checks) ### 3) Make `theme.json` changes safely Decide whether you are changing: - **settings** (what the UI allows): presets, typography scale, colors, layout, spacing - **styles** (how it looks by default): CSS-like rules for elements/blocks Read: - `references/theme-json.md` ### 4) Templates and template parts - Templates live under `templates/` and are HTML. - Template parts live under `parts/` and must not be nested in subdirectories. Read: - `references/templates-and-parts.md` ### 5) Patterns Prefer filesystem patterns under `patterns/` when you want theme-owned patterns. Read: - `references/patterns.md` ### 6) Style variations Style 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. Read: - `references/style-variations.md` ## Verification - Site Editor reflects changes where expected (Styles UI, templates, patterns). - Frontend renders with expected styles. - If styles aren’t changing, confirm whether user customizations override theme defaults. - Run the repo’s build/lint scripts if assets are involved (fonts, custom JS/CSS build). ## Failure modes / debugging Start with: - `references/debugging.md` Common issues: - wrong theme root (editing an inactive theme) - user customizations override your defaults - invalid `theme.json` shape/typos prevent application - templates/parts in wrong folders (or nested parts) ## Escalation If upstream behavior is unclear, consult canonical docs: - Theme Handbook and Block Editor Handbook for `theme.json`, templates, patterns, and style variations. # Creating a new block theme Use this file when you need