ワンクリックで
creating-themes
Guidelines for creating new WordPress block themes from scratch — load this before generating theme files
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guidelines for creating new WordPress block themes from scratch — load this before generating theme files
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | creating-themes |
| description | Guidelines for creating new WordPress block themes from scratch — load this before generating theme files |
| disable-model-invocation | true |
Use this skill when creating a new theme from scratch. Do not use this skill when modifying an existing theme.
Follow these rules carefully unless the user explicitly requests otherwise:
index.html. Avoid creating additional templates like single.html, page.html, archive.html, etc. unless the user specifically requests them. Keep the initial scope focused.index.html template. This produces a richer, more polished result. Load the generating-patterns skill for detailed guidance.patterns/ directory without being used in any template are hard to discover.<!-- wp:paragraph --><p>Powered by <a href="https://wordpress.org" target="_blank" rel="noopener noreferrer">WordPress</a></p><!-- /wp:paragraph -->enqueue_block_assets hook for fonts (not wp_enqueue_scripts) to ensure they load in both front-end and editorstyle.css # Required — theme header comment and base styles
theme.json # Central configuration (colors, typography, spacing, layout)
functions.php # Minimal — enqueue assets, register patterns, add theme support
templates/ # Block templates
index.html # Required — fallback template
single.html # Single post
page.html # Page
archive.html # Archive
404.html # Not found
home.html # Blog home (optional)
search.html # Search results (optional)
parts/ # Reusable template parts
header.html # Site header
footer.html # Site footer
patterns/ # Block patterns for reusable sections
assets/ # Static assets (images, local fonts)
/*
Theme Name: Theme Name
Theme URI: https://example.com
Author: Author Name
Description: Theme description
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: theme-slug
*/
When replicating a liberated site, self-host the source's fonts rather than substituting a Google Font or leaving a system fallback. The deterministic scaffold (liberate_theme_scaffold) already does this: it parses @font-face rules from the captured HTML/CSS, downloads the referenced font files into assets/fonts/, emits @font-face rules in style.css, and registers the family in theme.json settings.typography.fontFamilies with a fontFace[] (each entry's src is file:./assets/fonts/<file>). This is generic — capture whatever the source loads (e.g. Larsseit from a Shopify CDN), not a hardcoded family. Heading (display) and body families bind to the captured fonts; the display family is rebound to the real typeface even when the foundation recorded an open substitute. NEVER ship headings/body in a system fallback when the source font is self-hostable. Sanitize bogus captured line-heights (0 / 0px) to a sane default (e.g. 1.2).
Uncapturable fonts → free substitution (self-hosted). Some source fonts can't be self-hosted: Adobe Typekit (use.typekit.net serves CSS only, no reachable woff), Monotype, or hashed builder family names. For these the scaffold AUTO-SUBSTITUTES to the closest FREE web font, downloads that font's woff2 into assets/fonts/, and binds the body/display family to it — so body copy renders in a real web font, never a bare sans-serif. The mapping table + gstatic URLs live in src/lib/replicate/font-substitution.ts; the human-readable starter table is in skills/design-foundations/references/theme-tokens.md (e.g. quasimoda → Hanken Grotesk, Proxima Nova → Montserrat, Avenir → Inter). Only genuinely uncapturable families are swapped — a self-hostable source font (e.g. Larsseit on a CDN) is always preferred. Verify the substitute computes live (body paragraphs report the substituted family).
Build the site header from the SOURCE header, not WordPress's page list:
core/image / site-logo of the header <img>/SVG), not wp:site-title text and not a product image. Localize it — download the CDN logo into the theme assets/ (or WP media) and reference it locally (/wp-content/themes/<slug>/assets/<file>); never hot-link the source CDN. The scaffold does this via localLogoPath.wp:navigation-links for the source's top-level primary menu only. NEVER use wp:page-list — it auto-lists every published WP page (Sample Page, Checkout, account, etc.) as junk. Drop mega-menu sub-links and the mobile-drawer duplicate from the menu.assets/icon-*.svg, explicit stroke color) referenced from a core/image link — NOT wp:html (banned). cart→/cart, account→/account, search→/?s=. The scaffold emits this.When a font is genuinely not self-hostable, use enqueue_block_assets hook (not wp_enqueue_scripts) to ensure fonts load in BOTH the front-end AND block editor:
function theme_fonts() {
wp_enqueue_style(
'theme-fonts',
'https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap',
array(),
null
);
}
add_action( 'enqueue_block_assets', 'theme_fonts' );
"style":{"spacing":{"margin":{"top":"0"}}} to every top-level Group block that wraps a landing page section. This overrides WordPress's default top margin on direct children of .wp-site-blocks and can be easily adjusted by users in the editor."align":"wide" or "align":"full" rather than defaulting to narrow content width. Only use default (content) alignment for text-heavy reading sections.<inner-blocks>; output the full expanded markup inside each block.<!-- Hero Section --> or <!-- Services Section --> in templates, template parts, or patterns. Only WordPress block comments (<!-- wp:block-name -->) are allowed.<typography> instructions.
Apply those font stacks via inline style attributes (e.g.,
style="font-family: 'Space Grotesk', 'Helvetica Neue', sans-serif;") on the root wrapper and any hero/headline elements —
do NOT output <style> tags (the build strips them).sticky top-0 z-50) when appropriate, but ensure it degrades gracefully on mobile.transition, duration-300, motion-safe:animate-fade, scroll-mt-24, etc.) to add gentle entry animations and interactive feedback without custom JavaScript.Before generating theme files, read the relevant references from the references/ directory next to this skill file.
references/block-html.md — REQUIRED: read this FIRST. Block HTML validity rules, block comment ↔ HTML matching, image/cover/button block structure. Violating these causes "unexpected or invalid content" errors.references/design-direction.md — REQUIRED: read this before generating any theme files. Contains guidelines and good design directions.references/navigation.md — read this before generating any header template part, covers wp:navigation block markup, overlay (hamburger menu)references/query-loop.md — read this if the theme must display dynamic content (blog posts, archives, search results) in templates or patternsImport and rebuild a website from a closed platform (Wix, Squarespace, Webflow, Shopify, GoDaddy, Hostinger, HubSpot, Weebly) into a Studio WordPress site. Extracts pages/posts/products + media, then reconstructs the design as editable blocks + WooCommerce OR as a high-fidelity replica theme. Invoke when the user wants to migrate, import, liberate, or rebuild a site from one of these platforms.
Choose recommended plugins and plugin-provided blocks for features core WordPress blocks do not cover - ecommerce (WooCommerce), forms and newsletters (Jetpack), online courses and quizzes (Sensei LMS), polls, surveys and ratings (Crowdsignal), spam protection (Akismet) - while keeping generated content editable and avoiding raw HTML fallbacks. Any request to sell products or build a shop, store, or storefront requires WooCommerce with products.
Gather the site name and layout preference before building a WordPress site. Run this before creating any new site.
Use the Studio CLI to manage local WordPress sites, authentication, and preview sites. Invoke this skill when you need to run Studio CLI commands, manage sites, or troubleshoot site issues.
Write editable WordPress block markup for local Studio sites, including core/html limits, block-theme layout rules, full-width sections, validation, and skeleton-first page/CSS recipes.
Answer WordPress.com plan, pricing, upgrade, and feature-tier questions (plan names, what each tier unlocks — plugins, themes, custom code, SSH, hosting — and current prices) from authoritative live data. Load before answering ANY plan, pricing, or feature-gating question; never answer these from memory.