
Wp Block Themes
- 3.4k installs
- 1.9k repo stars
- Updated July 27, 2026
- wordpress/agent-skills
wp-block-themes is a WordPress skill that guides block theme.json, templates, patterns, and style variation work so developers can fix Site Editor and frontend style mismatches.
About
wp-block-themes is a WordPress agent skill for block theme work on WordPress 6.9+ with PHP 7.2.24+, bash, node, and optional WP-CLI. Procedure zero triages the repo with detect_wp_project.mjs then detect_block_themes.mjs to scope edits to one theme root when multiple themes exist. It covers theme.json settings versus styles, templates under templates/*.html, template parts in parts/*.html without nested subfolders, patterns under patterns/*.php, and style variations in styles/*.json. Creating new themes defers to references/creating-new-block-theme.md with explicit minimum WordPress version notes because theme.json schema versions differ by core release. Debugging references explain style hierarchy from core defaults through theme.json, child themes, and user customizations that can make theme edits appear ignored. Verification checks Site Editor, post editor, and frontend rendering plus whether user overrides mask theme defaults. Failure modes include wrong inactive theme root, invalid theme.json shape, and nested template parts paths. Developers reach for wp-block-themes when FSE presets, patterns, or editor versus live styles diverge.
- Triage with detect_wp_project.mjs and detect_block_themes.mjs before scoped edits.
- Covers theme.json settings/styles, templates, parts, patterns, and style variations.
- Documents style hierarchy and user customization overrides causing ignored edits.
- Targets WordPress 6.9+ with filesystem agent using bash and node; some flows need WP-CLI.
- References dedicated markdown files per topic including debugging and theme-json.
Wp Block Themes by the numbers
- 3,413 all-time installs (skills.sh)
- +202 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #142 of 2,277 Frontend Development skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
wp-block-themes capabilities & compatibility
- Capabilities
- detect wordpress project and block theme roots · edit theme.json settings and styles safely · manage templates, parts, patterns, and style var · debug style hierarchy and user override issues
What wp-block-themes says it does
node skills/wp-project-triage/scripts/detect_wp_project.mjs
npx skills add https://github.com/wordpress/agent-skills --skill wp-block-themesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3.4k |
|---|---|
| repo stars | ★ 1.9k |
| Security audit | 2 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | wordpress/agent-skills ↗ |
Why are my WordPress block theme.json or template changes not showing in the Site Editor or on the live site?
Develop and debug WordPress block themes including theme.json, templates, patterns, and Site Editor style issues.
Who is it for?
Developers maintaining WordPress 6.9+ block themes who edit theme.json, templates, parts, patterns, or style variations.
Skip if: Skip for classic PHP themes without block theme.json, templates, or Site Editor workflows.
When should I use this skill?
User edits theme.json, block templates, patterns, style variations, or reports Site Editor style hierarchy problems.
What you get
Scoped theme edits with triaged theme root, valid theme.json and template files, and verified editor and frontend rendering.
- Updated theme.json
- Templates, parts, or patterns
- Debugging notes for style hierarchy
By the numbers
- Targets WordPress 6.9+ with PHP 7.2.24+ compatibility
- Covers theme.json, templates/*.html, parts/*.html, and patterns/*.php
Files
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.jsonschema 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.jsonpresenttemplates/and/orparts/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.jsonshape/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 to create a new block theme or convert a theme to block theme structure.
Two practical starting points
1. Export from a WP environment
- Use the official “Create Block Theme” plugin to generate/export a theme from the Site Editor.
- This tends to produce a structure aligned with current WordPress behavior.
2. Create the minimal filesystem structure
- Create a theme folder with:
style.css(theme header)theme.json(global settings/styles)templates/index.html(minimum viable template)parts/header.htmlandparts/footer.html(recommended)
References
- Create Block Theme plugin:
- https://wordpress.org/plugins/create-block-theme/
- Block theme structure:
- https://developer.wordpress.org/themes/block-themes/theme-structure/
- Required templates:
- https://developer.wordpress.org/themes/block-themes/templates-and-template-parts/
theme.json version choice (compatibility)
theme.json has schema versions. Pick the highest version that matches your minimum supported WordPress version.
References:
- Theme Handbook introduction:
- https://developer.wordpress.org/themes/global-settings-and-styles/introduction-to-theme-json/
- Theme.json version 3 dev note:
- https://make.wordpress.org/core/2024/06/19/theme-json-version-3/
Debugging block theme issues
Styles not applying
Fast checks:
1. Confirm you edited the active theme (Site Editor → theme). 2. Check if user customizations exist (they override theme defaults). 3. Validate theme.json structure (typos can prevent styles from applying).
Remember the hierarchy:
- core defaults → theme.json → child theme → user customizations
Templates/parts not showing
- Ensure files are in the correct folders (
templates/,parts/). - Template parts must not be nested in subdirectories.
Style variations not updating
- If a user already selected the variation, the selection is stored in the DB.
- Test with a fresh site/user or reset customizations when appropriate.
Patterns (filesystem patterns)
Use this file when adding patterns that should be available in the inserter.
Filesystem patterns
- Put patterns in
patterns/*.php. - Patterns are registered automatically by WordPress core based on file headers.
Upstream reference:
- https://developer.wordpress.org/themes/patterns/
Practical guardrails
- Keep pattern markup stable; changing block names inside patterns can break older content in subtle ways.
- If a pattern should not be inserted directly by users, mark it as non-inserter / internal-only (per upstream header conventions).
Style variations (styles/*.json)
Use this file when adding or debugging style variations.
Key points:
- Style variations are JSON files in
styles/. - Users can pick a style variation in the UI.
- Once selected, the choice is stored in the DB (so “changing the JSON file” may not update what a user already selected).
Upstream reference:
- https://developer.wordpress.org/themes/global-settings-and-styles/style-variations/
Templates and template parts
Use this file when creating or editing HTML templates/parts.
Key folders
templates/for templates.parts/for template parts.
Template parts must not be nested in subdirectories.
Upstream references:
- Templates + parts overview: https://developer.wordpress.org/themes/block-themes/theme-structure/
- Template parts details: https://developer.wordpress.org/themes/block-themes/template-parts/
theme.json guidance
Use this file when changing global settings/styles or per-block styling.
High-level structure
Common top-level keys:
versionsettings(what the UI exposes / allows)styles(default appearance)customTemplatesandtemplateParts(optional, to describe templates and parts)
Upstream references:
- Theme Handbook: https://developer.wordpress.org/themes/global-settings-and-styles/
- Block Editor Handbook (often more current): https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/
- Theme JSON living reference: https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/
- Theme JSON version 3 (dev note): https://make.wordpress.org/core/2024/06/19/theme-json-version-3/
Practical guardrails
- Prefer presets when you want editor-visible controls (colors, font sizes, spacing).
- Prefer
styleswhen you want consistent defaults without requiring user choice. - Be careful with specificity: user global styles override theme defaults.
WordPress 6.9 additions
Form element styling:
- Style text inputs and selects via
styles.elements(e.g.,styles.elements.input,styles.elements.select). - Supports border, color, outline, shadow, and spacing properties.
- Note: Focus state styling is not yet available in 6.9.
Border radius presets:
- Define presets in
settings.border.radiusSizesfor visual selection in the border radius control. - Users can still enter custom values.
{
"settings": {
"border": {
"radiusSizes": [
{ "name": "Small", "slug": "small", "size": "4px" },
{ "name": "Medium", "slug": "medium", "size": "8px" },
{ "name": "Large", "slug": "large", "size": "16px" }
]
}
}
}Button pseudo-classes:
- Style Button block hover and focus states directly in theme.json.
- No longer requires custom CSS for simple button state styling.
References:
- Border radius presets: https://make.wordpress.org/core/2025/11/12/theme-json-border-radius-presets-support-in-wordpress-6-9/
- Form element styling: https://developer.wordpress.org/news/2025/11/how-wordpress-6-9-gives-forms-a-theme-json-makeover/
import fs from "node:fs";
import path from "node:path";
const DEFAULT_IGNORES = new Set([
".git",
"node_modules",
"vendor",
"dist",
"build",
"coverage",
".next",
".turbo",
]);
function statSafe(p) {
try {
return fs.statSync(p);
} catch {
return null;
}
}
function existsDir(p) {
const st = statSafe(p);
return Boolean(st && st.isDirectory());
}
function readJsonSafe(p) {
try {
return JSON.parse(fs.readFileSync(p, "utf8"));
} catch {
return null;
}
}
function findFilesRecursive(repoRoot, predicate, { maxFiles = 6000, maxDepth = 10 } = {}) {
const results = [];
const queue = [{ dir: repoRoot, depth: 0 }];
let visited = 0;
while (queue.length > 0) {
const { dir, depth } = queue.shift();
if (depth > maxDepth) continue;
let entries;
try {
entries = fs.readdirSync(dir, { withFileTypes: true });
} catch {
continue;
}
for (const ent of entries) {
const fullPath = path.join(dir, ent.name);
if (ent.isDirectory()) {
if (DEFAULT_IGNORES.has(ent.name)) continue;
queue.push({ dir: fullPath, depth: depth + 1 });
continue;
}
if (!ent.isFile()) continue;
visited += 1;
if (visited > maxFiles) return { results, truncated: true };
if (predicate(fullPath)) results.push(fullPath);
}
}
return { results, truncated: false };
}
function summarizeTheme(repoRoot, themeJsonPath) {
const json = readJsonSafe(themeJsonPath);
const rel = path.relative(repoRoot, themeJsonPath);
const rootDir = path.dirname(rel);
const templatesDir = path.join(repoRoot, rootDir, "templates");
const partsDir = path.join(repoRoot, rootDir, "parts");
const patternsDir = path.join(repoRoot, rootDir, "patterns");
const stylesDir = path.join(repoRoot, rootDir, "styles");
const hasTemplates = existsDir(templatesDir);
const hasParts = existsDir(partsDir);
return {
themeRoot: rootDir,
themeJson: rel,
version: typeof json?.version === "number" ? json.version : null,
hasTemplates,
hasParts,
hasPatterns: existsDir(patternsDir),
hasStyles: existsDir(stylesDir),
isBlockTheme: hasTemplates || hasParts,
};
}
function main() {
const repoRoot = process.cwd();
const { results: themeJsonFiles, truncated } = findFilesRecursive(repoRoot, (p) => path.basename(p) === "theme.json", {
maxFiles: 8000,
maxDepth: 12,
});
const themes = themeJsonFiles.map((p) => summarizeTheme(repoRoot, p));
const report = {
tool: { name: "detect_block_themes", version: "0.1.0" },
repoRoot,
truncated,
count: themes.length,
themes,
};
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
}
main();
Related skills
How it compares
Choose wp-block-themes over generic CSS skills when debugging FSE theme.json hierarchy and Site Editor overrides.
FAQ
How does wp-block-themes pick the correct theme directory?
Run detect_wp_project.mjs then detect_block_themes.mjs and scope all changes to one detected theme root.
Why might theme.json edits look ignored?
User customizations in the style hierarchy can override theme defaults even after file changes.
What WordPress version does the skill target?
WordPress 6.9 or newer with PHP 7.2.24+, using bash and node; some workflows require WP-CLI.
Is Wp Block Themes safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.