site-specification
Extract comprehensive site specifications from simple descriptions. Use when analyzing a user's theme request to determine site type, audience, tone, layout…
WordPress Full Site Editing (FSE) theme architecture. Use when generating theme.json, block templates, template parts, patterns, and functions.php for WordPress block themes.
$ npx -y skills add Automattic/wordpress-agent-skills --skill wordpress-block-theming --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/wordpress-block-themingContext preview
The summary Claude sees to decide when to auto-load this skill.
WordPress Full Site Editing (FSE) theme architecture. Use when generating theme.json, block templates, template parts, patterns, and functions.php for WordPress block themes.
name: wordpress-block-theming description: WordPress Full Site Editing (FSE) theme architecture. Use when generating theme.json, block templates, template parts, patterns, and functions.php for WordPress block themes.
Comprehensive knowledge for building WordPress block themes using Full Site Editing (FSE) architecture.
theme-slug/
├── theme.json # Central configuration file
├── style.css # Theme metadata + custom CSS
├── functions.php # Asset enqueuing, pattern registration
├── templates/ # Block templates
│ ├── index.html # Main/fallback template
│ ├── single.html # Single post
│ ├── page.html # Single page
│ ├── archive.html # Archive listings
│ ├── search.html # Search results
│ └── 404.html # Not found
├── parts/ # Reusable template parts
│ ├── header.html # Site header
│ └── footer.html # Site footer
└── patterns/ # Block patterns
├── hero.php
├── features.php
└── cta.phpThe `theme.json` file is the central configuration for block themes. It defines:
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3
}Define available options for the editor:
{
"settings": {
"appearanceTools": true,
"layout": { "contentSize": "800px", "wideSize": "1280px" },
"color": {
"palette": [ /* 5 colors: primary, secondary, accent, light, dark */ ],
"defaultPalette": false,
"defaultGradients": false
},
"typography": {
"fontFamilies": [ /* heading + body font families */ ],
"fontSizes": [ /* 5-6 step scale: small through huge */ ]
},
"spacing": {
"units": ["px", "em", "rem", "%", "vw", "vh"],
"spacingSizes": [ /* 6 steps from compact to spacious */ ]
}
}
}Define default styles for the site and blocks:
{
"styles": {
"color": { /* background + text from palette */ },
"typography": { /* body font family, medium size, line-height 1.5-1.65 */ },
"elements": {
"heading": { /* heading font family, appropriate weight, line-height 1.1-1.3 */ },
"link": { /* accent color */ },
"button": { /* accent background, light text, border-radius */ }
}
}
}Templates use WordPress block markup (HTML comments with JSON attributes).
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-group">
<!-- Content blocks here -->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->Patterns are PHP files that register reusable block content.
<?php
/**
* Title: Hero Section
* Slug: theme-slug/hero
* Categories: featured
*/
?>
<!-- wp:group {"backgroundColor":"primary","textColor":"light","layout":{"type":"constrained"}} -->
...
<!-- /wp:group -->Keep functions.php minimal. Primary uses:
**IMPORTANT:** Always use `enqueue_block_assets` hook (not `wp_enqueue_scripts`) to ensure fonts load in BOTH the front-end AND block editor.
<?php
/**
* Theme functions and definitions
*/
// Enqueue Google Fonts and theme stylesheet for both front-end and block editor
function theme_slug_enqueue_assets() {
wp_enqueue_style(
'theme-slug-fonts',
'https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap',
array(),
null
);
wp_enqueue_style(
'theme-slug-style',
get_stylesheet_uri(),
array( 'theme-slug-fonts' ),
wp_get_theme()->get( 'Version' )
);
}
add_action( 'enqueue_block_assets', 'theme_slug_enqueue_assets' );
// Register block patterns
function theme_slug_register_patterns() {
register_block_pattern_category(
'theme-slug',
array( 'label' => __( 'Theme Patterns', 'theme-slug' ) )
);
}
add_action( 'init', 'theme_slug_register_patterns' );This repository contains early prototypes of Agent Skills for building WordPress themes/sites and easily sharing them with the world.
Repo: Automattic/wordpress-agent-skills
Extract comprehensive site specifications from simple descriptions. Use when analyzing a user's theme request to determine site type, audience, tone, layout…
Bold aesthetic direction guidance for web design. Use when making creative decisions about typography, color, motion, spatial composition, and overall visual…