mcpField
W
wp-theme-development

wp-theme-development

github.com/jorgerosalテスト・品質11181 回インストール20 週間前に更新
リポジトリ

wp-theme-development について

ブロック、クラシック、ハイブリッド、子テーマを対象とする WordPress テーマのレビュー技能です。テーマの種類や移行状況に応じて、構造と設定を検証します。

主な機能

  1. 01テーマの種類と状況の判定
  2. 02theme.json 構造の検証
  3. 03テンプレート階層とパーツの確認
  4. 04グローバルスタイルとバリエーションの確認
  5. 05子テーマと移行の評価

活用シーン

  1. 01Full Site Editing テーマのレビュー
  2. 02theme.json v3 設定の確認
  3. 03WordPress.org 提出用テーマの準備

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/jorgerosal/wordpress-skills --skill wp-theme-development

インストール後、Claude Code で/wp-theme-developmentを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
classic-to-block-guide.md
fse-guide.md
template-patterns.md
theme-json-guide.md

詳細

WordPress テーマ開発レビューのスキル

概要

WordPress 6.6 以降を対象とした体系的なテーマ開発レビューです。主にブロックテーマ(フルサイト編集)を扱い、移行ガイダンスとしてクラシックテーマも取り上げます。基本原則: WordPress テーマはパラダイムシフトを遂げています。ブロックテーマでは、PHP テンプレートや add_theme_support() 呼び出しに代わり、ブロックマークアップを含む HTML テンプレートと、グローバル設定やスタイルを扱う theme.json を使用します。theme.json v3 は、デザイン設定の唯一の信頼できる情報源です。レビューでは、theme.json の構造、ブロックテンプレートの階層(templates/ 内の HTML ファイル)、テンプレートパーツ(parts/)、グローバルスタイル、テーマ内のブロックパターン、子テーマとの互換性、クラシックテーマからブロックテーマへの移行機会を検証します。テーマの種類(ブロック/クラシック/ハイブリッド/子テーマ/WordPress.org)を自動検出し、それに応じてガイダンスを調整します。レビュー結果は、実際のパスに基づき、PHP、HTML テンプレート、JSON ファイルを混在させてファイルごとにまとめ、行番号、重要度ラベル(CRITICAL/WARNING/INFO)、BAD/GOOD のコード例を示します。

注: このスキルでは、PHP ファイル(functions.php、クラシックテンプレート)、HTML ブロックテンプレートファイル(templates/、parts/)、JSON ファイル(theme.json、スタイルバリエーション)、PHP パターンファイル(patterns/)をレビューします。PHP では WordPress PHP コーディング規約(括弧内のスペース、array() を使用して [] は使わない、ヨーダ条件)に従います。HTML テンプレートでは有効なブロックマークアップを使用します。JSON は theme.json v3 スキーマに従います。

使用する場合

次の場合に使用します:

  • ブロックテーマのコードレビュー(theme.json、HTML テンプレート、テンプレートパーツ)
  • theme.json v3 のスキーマ検証と構造チェック
  • テンプレート階層の監査(.html ファイルを含むブロックテーマ、.php ファイルを含むクラシックテーマ)
  • テンプレートパーツのレビュー(parts/header.html、parts/footer.html、parts/sidebar.html)
  • グローバルスタイルの分析(カラーパレット、タイポグラフィ、間隔、レイアウト設定)
  • スタイルバリエーションの検証(別の theme.json ファイルを含む styles/ ディレクトリ)
  • テーマ内のブロックパターンのレビュー(PHP ファイルを含む patterns/ ディレクトリ)
  • 子テーマとの互換性チェック(ブロックまたはクラシックの子テーマ)
  • クラシックテーマからブロックテーマへの移行評価
  • WordPress.org へのテーマ申請準備(Theme Check 準拠)
  • ブロックテーマ内のハードコードされたスタイルの検出
  • 全幅配置の useRootPaddingAwareAlignments 検証

次の場合には使用しません:

  • ブロックエディターのコンポーネントレビュー(React/JSX ブロックには wp-block-development を使用)
  • プラグインアーキテクチャの監査(プラグイン構造には wp-plugin-development を使用)
  • セキュリティに限定した監査(包括的なセキュリティレビューには wp-security-review を使用)
  • パフォーマンスに限定した監査(パフォーマンス分析には wp-performance-review を使用)
  • WooCommerce のテーマ統合(利用可能な場合は wp-woocommerce-dev を使用)
  • ビジュアルデザインの評価(これはコードレビューのみであり、UI/UX のレビューではありません)

コードレビューワークフロー

体系的なテーマレビューのため、次の 7 ステップのワークフローに従います。

  1. テーマの種類とコンテキストを特定する(THM-01)

    • ブロックテーマ → templates/index.html + theme.json + style.css がある
    • クラシックテーマ → index.php + style.css + functions.php がある(templates/ ディレクトリはない)
    • ハイブリッドテーマ → index.php と theme.json の両方がある(ブロックエディターをサポートするクラシックテーマ)
    • 子テーマ → style.css に親テーマを指す「Template:」ヘッダーがある
    • WordPress.org への申請 → より厳格な基準が適用される(Theme Check への準拠が必要)

    自動検出パターン:

    # Block theme detection
    [ -f templates/index.html ] && [ -f theme.json ] && echo "Block theme"
    
    # Classic theme detection
    [ -f index.php ] && [ ! -d templates ] && echo "Classic theme"
    
    # Hybrid theme detection
    [ -f index.php ] && [ -f theme.json ] && [ ! -d templates ] && echo "Hybrid theme"
    
    # Child theme detection
    grep -q "^Template:" style.css && echo "Child theme"
    
  2. theme.json スキーマの検証(THM-02、THM-03、THM-04、THM-05)

    • バージョンフィールドは 3 である必要があります(WP 6.6 以降)。v1 は CRITICAL(非推奨)、v2 は WARNING(アップグレード可能)として報告します
    • 必須セクション:settings、styles
    • settings の構造を検証します:color、typography、spacing、layout、border、shadow
    • v3 の破壊的変更を確認します:defaultFontSizes と defaultSpacingSizes はどちらもデフォルトで true です(テーマでカスタムサイズを定義する場合は、明示的に false に設定する必要があります)
    • templateParts 配列を検証します:name、title、area(header/footer/uncategorized)
    • customTemplates 配列を検証します:name、title、postTypes
    • $schema フィールドの有無を確認します(ない場合は INFO。IDE の自動補完が強化されます)
    • ルートのパディングがある場合は useRootPaddingAwareAlignments を検証します
  3. テンプレート階層の確認(THM-06、THM-07)

    • ブロックテーマ:templates/index.html が必須で、その他(home.html、front-page.html、single.html、page.html、archive.html、404.html、search.html)は任意です
    • クラシックテーマ:index.php が必須で、標準的な階層は header.php、footer.php、single.php、page.php、archive.php です
    • テンプレートファイルで正しいマークアップが使用されていることを確認します:ブロックテーマでは HTML ブロックマークアップ、クラシックテーマでは PHP テンプレートタグ
    • ブロックテンプレートにハードコードされたスタイルがないか確認します(CRITICAL のアンチパターン)
    • テンプレート内のテンプレートパーツ参照を検証します
  4. テンプレートパーツの確認(THM-08)

    • parts/ ディレクトリの構成:header.html、footer.html、sidebar.html
    • theme.json の templateParts 登録がファイルと一致していることを確認します
    • area の指定(header/footer/uncategorized)を確認します
    • テンプレートパーツ内のブロックマークアップを検証します
    • ブロックを介したテンプレート内でのテンプレートパーツの使用を確認します
  5. CRITICAL/WARNING/INFO パターンのスキャン

    • CRITICAL: 必須ファイルの欠落(ブロックテーマでは templates/index.html、クラシックテーマでは index.php、style.css)、theme.json のバージョンまたは構造が無効、style.css のヘッダーフィールドが欠落、テンプレート階層の違反、theme.json の目的を損なうハードコードされたインラインスタイルを含むブロックテーマ
    • WARNING: theme.json v2(v3 へのアップグレードを推奨)、CSS 変数の代わりに style.css で色やフォントの値をハードコード、ルートのパディングがある状態で useRootPaddingAwareAlignments が欠落、ブロックパターンが望ましい場面でのクラシックなパターン、ブロックテーマでの非推奨の add_theme_support()
    • INFO: スタイルバリエーションがない、add_theme_support() の代わりに theme.json を使用できる、フォントをローカルホスティングにできる、カスタムテンプレートの登録がない
  6. コンテキストに応じた重大度の調整

    • ブロックテーマのコンテキスト:ハードコードされたスタイル = WARNING、theme.json セクションの欠落 = WARNING
    • クラシックテーマのコンテキスト:移行の機会 = INFO、theme.json の欠落 = INFO
    • ハイブリッドテーマのコンテキスト:段階的な導入方法を案内し、クラシックと theme.json の両方のパターンを検証します
    • 子テーマのコンテキスト:親テーマとの互換性、オーバーライドの検証
    • WordPress.org のコンテキスト:Theme Check の失敗 = CRITICAL
  7. 相互参照を含めて報告

    • ファイル別にグループ化します(PHP、HTML、JSON をパスごとに混在させて表示)
    • 行番号、重大度、BAD/GOOD の組み合わせを含めます
    • セキュリティの問題(テンプレートのエスケープ処理)が見つかった場合:「セキュリティの問題を検出しました。包括的なセキュリティ分析を行うには /wp-sec-review を実行してください。」
    • プラグインに似たパターン(functions.php のフック)が見つかった場合:「プラグインアーキテクチャのパターンを検出しました。プラグイン開発のガイダンスについては /wp-plugin-review を実行してください。」
    • ブロックマークアップの問題が見つかった場合:「ブロックマークアップの問題を検出しました。ブロック開発のガイダンスについては /wp-block-review を実行してください。」

ファイルタイプ別の確認

theme.json(THM-02、THM-03、THM-04、THM-05)

version フィールド:

  • 重大:version フィールドがない場合 → テーマは正しく読み込まれません
  • 重大:version 1 → 非推奨です。v3 にアップグレードする必要があります
  • 警告:version 2 → v3 へのアップグレードを推奨します(defaultFontSizes と defaultSpacingSizes に破壊的変更があります)
  • パターン:"version": 3

$schema フィールド:

  • 情報:$schema がない場合 → IDE で検証できません
  • パターン:"$schema": "https://schemas.wp.org/trunk/theme.json"

settings.color:

  • 警告:パレットがない場合 → ユーザーはサイトエディターから色をカスタマイズできません
  • 警告:パレットの定義がないまま、色の HEX 値がハードコードされています
  • パターン:slug、color、name を含む color.palette 配列
  • 利用可能なプロパティ:palette、gradients、duotone、custom、defaultPalette、link、heading、button、caption

settings.typography:

  • 警告:fontSizes がない場合 → ユーザーはフォントサイズをカスタマイズできません
  • 重大(v3):テーマで fontSizes を定義しているのに "defaultFontSizes": false がない場合 → WordPress のデフォルト値がテーマのサイズを上書きします
  • 警告:ローカルのフォントファイルではなく、Google Fonts CDN を使用しています(GDPR、パフォーマンス)
  • パターン:typography.fontSizes 配列、ローカルフォント用の fontFace を含む fontFamilies
  • 利用可能なプロパティ:fontSizes、fontFamilies、fluid、lineHeight、fontWeight、letterSpacing、textDecoration、textTransform、defaultFontSizes

settings.spacing:

  • 警告:spacingSizes がない場合 → ユーザーはサイトエディターから間隔をカスタマイズできません
  • 重大(v3):テーマで spacingSizes を定義しているのに "defaultSpacingSizes": false がない場合 → WordPress のデフォルト値がテーマのサイズを上書きします
  • パターン:slug、size、name を含む spacing.spacingSizes 配列
  • 利用可能なプロパティ:spacingSizes、padding、margin、blockGap、units、customSpacingSize、spacingScale、defaultSpacingSizes

settings.layout:

  • 警告:contentSize と wideSize がない場合 → 全幅ブロックが正しく動作しないことがあります
  • パターン:"contentSize": "640px", "wideSize": "1200px"

settings.useRootPaddingAwareAlignments:

  • 警告:ルートレベルの padding があるのに useRootPaddingAwareAlignments がない場合 → 全幅ブロックがビューポートの端まで届きません
  • 重大:useRootPaddingAwareAlignments が true なのに padding で CSS のショートハンドを使用している場合 → オブジェクト形式を使用する必要があります
  • パターン:styles.spacing.padding がある場合は true に設定します

styles セクション:

  • 警告:CSS 変数の代わりに値がハードコードされています → theme.json の目的が損なわれます
  • パターン:"#0073aa" ではなく var(--wp--preset--color--primary) を使用します
  • 利用可能なプロパティ:color、typography、spacing、border、shadow、elements、blocks

templateParts 配列:

  • 情報:templateParts の登録がない場合 → テンプレートパーツは動作しますが、適切なラベルで UI に表示されません
  • パターン:name、title、area(header/footer/uncategorized)を含む配列

customTemplates 配列:

  • 情報:customTemplates がない場合 → ユーザーはエディターでカスタムテンプレートを選択できません
  • パターン:name、title、postTypes を含む配列
style.css(THM-09、THM-10)

必須のヘッダーフィールド:

  • 重大:"Theme Name" がない場合 → WordPress はテーマを認識しません
  • 警告:"Text Domain" がない場合 → 国際化が機能しません
  • 警告:"Version" がない場合 → 更新が正しく機能しません
  • 情報:"Requires at least"、"Tested up to"、"Requires PHP" がない場合 → バージョン要件を適用できません
  • WordPress.org の必須項目:Theme Name、Theme URI、Author、Author URI、Description、Version、Requires at least、Tested up to、Requires PHP、License、License URI、Text Domain

ブロックテーマのスタイルパターン:

  • 警告:theme.json の代わりに広範な CSS を使用しているブロックテーマ → FSE の目的が損なわれます
  • 情報:ハードコードされた色やフォントの値を theme.json のプリセットに移せる可能性があります
  • パターン:ブロックテーマの style.css は最小限にします(メタデータと重要な CSS のみ)。スタイルは theme.json で設定します

クラシックテーマのスタイルパターン:

  • 情報:クラシックテーマでは、ブロックエディターをサポートするために theme.json を採用できます(ハイブリッド方式)

子テーマのパターン:

  • 重大:子テーマに "Template:" ヘッダーがない場合 → 親テーマを継承しません
  • 警告:子テーマの Template が親ディレクトリ名と一致しない場合 → 親テーマが見つかりません
ブロックテンプレート(templates/*.html)(THM-06、THM-11、THM-14)

必須テンプレート:

  • CRITICAL:ブロックテーマに templates/index.html がない → テーマが動作しません

テンプレートファイルの命名:

  • INFO:階層構造をより適切にカバーするため、特定のテンプレート(single.html、page.html、archive.html、404.html、search.html、home.html、front-page.html)を追加できます

ブロックマークアップの検証:

  • CRITICAL:ブロックコメントの構文が無効 → テンプレートを解析できません
  • WARNING:インラインスタイル属性がハードコードされている → theme.json の効果が損なわれ、ユーザーがカスタマイズできません
  • WARNING:theme.json のプリセットではなく、色の16進数値がハードコードされている
  • WARNING:theme.json の流動的タイポグラフィではなく、ピクセル単位のフォントサイズがハードコードされている
  • パターン:インラインスタイルではなく、theme.json のプリセットを参照するブロック属性を使用します

テンプレートパーツの使用:

  • WARNING:テンプレートパーツ(ヘッダー/フッター)の参照がない → ユーザーは標準的な構造を期待します
  • パターン:``

useBlockProps 相当の機能:

  • INFO:ブロックテンプレートでは、動的ブロックのようなラッパー属性は必要ありません(静的HTML)
テンプレートパーツ(parts/*.html)(THM-08)

テンプレートパーツファイル:

  • WARNING:theme.json に templateParts が登録されているが、ファイルがない → サイトエディターで404になります
  • WARNING:テンプレートパーツファイルはあるが、theme.json に登録されていない → 適切なラベルで UI に表示されません
  • パターン:parts/header.html、parts/footer.html、parts/sidebar.html

エリアの指定:

  • WARNING:theme.json と使用箇所でテンプレートパーツのエリアが一致しない → 正しい位置に表示されない可能性があります
  • 使用可能なエリア:header、footer、uncategorized(または WP 6.0 以降のカスタムエリア)

ブロックマークアップ:

  • ブロックテンプレートと同じ検証を行います。スタイルをハードコードせず、theme.json のプリセットを使用します
functions.php(THM-12、THM-13)

ABSPATH チェック:

  • WARNING:defined( 'ABSPATH' ) || exit; がない → ファイルへの直接アクセスが可能です
  • 関連項目:セキュリティの詳細については wp-security-review を参照してください

ブロックテーマのセットアップ:

  • WARNING:theme.json に記述すべき add_theme_support() の呼び出し → 非推奨のパターンです
  • ブロックテーマで使用できる add_theme_support():wp-block-styles、responsive-embeds、editor-styles(theme.json では置き換えられません)
  • パターン:ほとんどの add_theme_support() 呼び出しは theme.json の設定に移行します

クラシックテーマのセットアップ:

  • INFO:クラシックテーマでは、ハイブリッド方式として add_theme_support() の内容を theme.json に移行できます
  • パターン:カラーパレット、フォントサイズ、行の高さ、間隔 → theme.json の設定

テーマフック:

  • パターン:テーマのセットアップには after_setup_theme、アセットには wp_enqueue_scripts、カスタム投稿タイプには init を使用します
  • 関連項目:フックシステムのパターンについては wp-plugin-development を参照してください

アセットのエンキュー:

  • WARNING:条件チェックなしですべてのページにアセットをエンキューする → パフォーマンス上の問題になります
  • パターン:条件タグ(is_front_page、is_singular)または管理画面のチェックを使用します
ブロックパターン(patterns/*.php)(THM-15、THM-16)

パターンファイルのヘッダー:

  • CRITICAL:パターンファイルに Title または Slug ヘッダーがない → 登録されません
  • WARNING:パターンスラッグが名前空間化されていない(themename/pattern-slug)→ 衝突のリスクがあります
  • パターン:Title、Slug、Categories、Description、Keywords、Block Types、Viewport Width を含むコメントブロックを記述した PHP ファイル

パターンファイルの構造:

  • WARNING:パターンファイルに PHP タグがない → 動的な値が処理されません
  • パターン:PHP コードには <?php ?> タグを使用し、その後にブロックマークアップを記述します

パターン内のブロックマークアップ:

  • テンプレートと同じ検証を行います。theme.json のプリセットを使用し、スタイルをハードコードしません
  • 動的な値には PHP 関数を使用します:get_theme_file_uri()、esc_url()、esc_html()、翻訳関数

パターンの登録:

  • INFO:patterns/ ディレクトリ内のパターンは自動登録されるため、手動で register_block_pattern() を呼び出す必要はありません(テーマのみ。プラグインは対象外)
スタイルバリエーション(styles/*.json)(THM-17、THM-18、THM-19)

バリエーションファイルの構造:

  • WARNING:スタイルバリエーションに version フィールドがありません → 正しく読み込まれない可能性があります
  • WARNING:スタイルバリエーションに title がありません → UI にファイル名が表示されます
  • パターン:version、title、settings、styles を含む JSON ファイル

バリエーションの命名:

  • INFO:バリエーションのファイル名がバリエーションのスラッグになります(dark.json → 「dark」)。title は表示名を上書きします
  • パターン:説明的なファイル名を使用します(dark.json、minimal.json、high-contrast.json)

バリエーションのスキーマ:

  • WARNING:バリエーションの theme.json 構造が無効です → 適用されません
  • パターン:theme.json と同じスキーマ(settings セクションと styles セクション)を使用し、version はメインの theme.json と一致させる必要があります
子テーマ(THM-20)

子テーマの検出:

  • パターン:「Template:」ヘッダーを含む style.css

テンプレートの上書き:

  • WARNING:子テーマの block theme parts/header.html が親テーマを上書きしません → ファイル名を完全に一致させる必要があります
  • WARNING:子テーマの theme.json が親テーマの templateParts を上書きしません → templateParts 配列をコピーして変更する必要があります
  • パターン:子テーマのファイルは、ファイル名が完全に一致する場合に親テーマを上書きします

子テーマの互換性:

  • WARNING:子テーマは、変更される可能性のある親テーマのテンプレートパーツに依存しています → 上書きが壊れやすくなります
  • INFO:子テーマでは unregister_block_pattern() を使用して、親テーマのパターンを削除できます

素早く検出するための検索パターン(THM-21)

テーマを素早くスキャンするには、以下の rg コマンドとシェルチェックを使用します。重要度別に整理しています。PHP、HTML テンプレート、JSON ファイルを対象とします。

CRITICAL パターン
# Missing required files for block theme
[ ! -f templates/index.html ] && [ -f theme.json ] && echo "CRITICAL: Block theme missing templates/index.html"
[ ! -f theme.json ] && [ -d templates ] && echo "CRITICAL: templates/ exists but theme.json missing"

# Missing required files for classic theme
[ ! -f index.php ] && [ ! -d templates ] && echo "CRITICAL: Classic theme missing index.php"

# theme.json with invalid or missing version
test -f theme.json && ! rg -q "\"version\"" theme.json && echo "CRITICAL: theme.json missing version"
rg -n "\"version\": 1" theme.json  # Deprecated
rg -n "\"version\": [^23]" theme.json  # Invalid version

# Missing style.css required header
test -f style.css && ! rg -q "Theme Name:" style.css && echo "CRITICAL: style.css missing Theme Name header"

# v3 theme.json with custom fontSizes but missing defaultFontSizes: false
rg -n "\"fontSizes\"" theme.json
# Manual follow-up: if custom fontSizes are defined, confirm defaultFontSizes is explicitly false.

# v3 theme.json with custom spacingSizes but missing defaultSpacingSizes: false
rg -n "\"spacingSizes\"" theme.json
# Manual follow-up: if custom spacingSizes are defined, confirm defaultSpacingSizes is explicitly false.

# Child theme missing Template header
test -f style.css && ! rg -q "Template:" style.css && echo "CRITICAL: If this is a child theme, style.css is missing Template header"
WARNING パターン
# theme.json version 2 (should upgrade to v3)
rg -n "\"version\": 2" theme.json

# Hardcoded inline styles in block templates
rg -n "style=\"" templates/ parts/ -g '*.html'

# Hardcoded color hex values in templates
rg -n "#[0-9a-fA-F]{6}" templates/ parts/ -g '*.html'

# Hardcoded pixel font sizes in templates
rg -n "font-size:\s*[0-9]+px" templates/ parts/ -g '*.html'

# Root padding without useRootPaddingAwareAlignments
rg -n "\"padding\"" theme.json
# Manual follow-up: if root padding is present, confirm useRootPaddingAwareAlignments is enabled.

# useRootPaddingAwareAlignments with CSS shorthand padding (won't work)
rg -n "useRootPaddingAwareAlignments.*true" theme.json
rg -n "\"padding\":\s*\"" theme.json

# Block theme with add_theme_support() that should be in theme.json
rg -n "add_theme_support.*editor-color-palette" functions.php
rg -n "add_theme_support.*editor-font-sizes" functions.php
rg -n "add_theme_support.*custom-line-height" functions.php
rg -n "add_theme_support.*custom-spacing" functions.php

# Missing ABSPATH check in functions.php
test -f functions.php && ! sed -n '1,10p' functions.php | rg -q "defined.*ABSPATH" && echo "WARNING: functions.php missing ABSPATH check in first 10 lines"

# Pattern file without required headers
rg -L "Title:" patterns -g '*.php'
rg -L "Slug:" patterns -g '*.php'
INFO パターン
# Missing $schema in theme.json
test -f theme.json && ! rg -q "\"\\$schema\"" theme.json && echo "INFO: theme.json missing \$schema"

# Missing style variations directory
[ ! -d styles ] && echo "INFO: Could add style variations in styles/"

# Missing block patterns directory
[ ! -d patterns ] && echo "INFO: Could add block patterns in patterns/"

# Missing templateParts registration in theme.json
test -f theme.json && ! rg -q "\"templateParts\"" theme.json && echo "INFO: theme.json missing templateParts registration"

# Missing customTemplates registration in theme.json
test -f theme.json && ! rg -q "\"customTemplates\"" theme.json && echo "INFO: theme.json missing customTemplates registration"

# Google Fonts CDN usage (could use local fonts)
rg -n "fonts.googleapis.com" .

# Classic theme without theme.json (could be hybrid)
[ -f index.php ] && [ ! -f theme.json ] && echo "INFO: Classic theme could add theme.json for block editor support"

注: HTML テンプレートのパターンには、PHP とは異なる正規表現が必要です。テンプレートには --include="*.html"、PHP ファイルには --include="*.php"、theme.json とバリエーションには --include="*.json" を使用します。

テーマコンテキストの検出

検出されたテーマの種類に基づく、コンテキストを考慮したレビューの注意事項:

ブロックテーマ

構造: templates/index.html + theme.json + style.css、任意で parts/、patterns/、styles/ レビューの重点:

  • 主な確認事項は theme.json v3 の検証です
  • テンプレート内のハードコードされたスタイル = WARNING(FSE の目的に反します)
  • テンプレート階層の完全性
  • パディングがある場合は useRootPaddingAwareAlignments を使用します
  • 機能強化の機会として、スタイルバリエーションとパターンを検討します よくある間違い: useRootPaddingAwareAlignments の欠落、インラインスタイルのハードコード、v3 への移行をしていない theme.json v2
クラシックテーマ

構造: index.php + style.css + functions.php、header.php、footer.php、テンプレートファイル レビューの重点:

  • テンプレートのエスケープ処理(wp-security-review と照合)
  • クラシックテーマのテンプレート階層
  • ブロックテーマまたはハイブリッド方式への移行機会
  • ブロックエディターをサポートするため、theme.json の採用を提案します よくある間違い: エスケープ処理の欠落、非推奨のテンプレートタグ、最新のエディター機能に必要な theme.json がない
ハイブリッドテーマ

構造: index.php + theme.json + functions.php(theme.json を使用するクラシックテンプレート) レビューの重点:

  • クラシックと theme.json の両方のパターンを検証します
  • クラシックテンプレートでの CSS 変数の使用を確認します
  • theme.json がブロックコンテンツに適用されることを確認します
  • ブロックテンプレートへの段階的な移行を提案します よくある間違い: theme.json の設定がクラシックテンプレートの出力に影響しないこと、theme.json で PHP テンプレートをスタイル設定できると思い込むこと
子テーマ(ブロックまたはクラシック)

構造: 「Template:」ヘッダーを含む style.css、任意のテンプレート上書き レビューの重点:

  • 親テーマとの互換性(テンプレートのファイル名を完全に一致させる必要があります)
  • theme.json の上書きパターン(子テーマでは親テーマの templateParts をコピーして変更する必要があります)
  • テンプレートパーツの上書き
  • unregister_block_pattern() によるパターンの削除 よくある間違い: テンプレートパーツが上書きされない(ファイル名が異なる)、theme.json が親テーマの設定を上書きしない
WordPress.org テーマの審査提出

構成: あらゆる種類のテーマが対象ですが、基準はより厳格です 審査の重点項目:

  • Theme Check プラグインへの準拠(エラーはすべて重大な問題です)
  • 必須ファイル:完全なヘッダーを含む style.css、readme.txt、screenshot.png
  • ライセンスの互換性(GPL または GPL 互換)
  • 難読化されたコード、外部への自動通信、無料テーマでのアップセルがないこと
  • すべての関数とクラスに接頭辞を付けること よくある間違い: readme.txt の不足、style.css ヘッダーの不備、Theme Check のエラー

クイックリファレンス:テーマ開発のパターン(THM-22、THM-23)

関心事ごとに整理した、一般的なテーマのパターンです。PHP の例では WordPress PHP コーディング規約(括弧内のスペース、[] ではなく array()、ヨーダ条件式)を使用しています。HTML テンプレートでは有効なブロックマークアップを使用しています。JSON の例では有効な theme.json v3 構文を使用しています。

theme.json v3 の完全な構造
{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 3,
	"settings": {
		"appearanceTools": true,
		"useRootPaddingAwareAlignments": true,
		"color": {
			"defaultPalette": false,
			"palette": [
				{
					"slug": "primary",
					"color": "#0073aa",
					"name": "Primary"
				},
				{
					"slug": "secondary",
					"color": "#005177",
					"name": "Secondary"
				},
				{
					"slug": "foreground",
					"color": "#333333",
					"name": "Foreground"
				},
				{
					"slug": "background",
					"color": "#ffffff",
					"name": "Background"
				}
			]
		},
		"typography": {
			"defaultFontSizes": false,
			"fluid": true,
			"fontFamilies": [
				{
					"fontFamily": "\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif",
					"name": "Inter",
					"slug": "inter",
					"fontFace": [
						{
							"fontFamily": "Inter",
							"fontWeight": "400",
							"fontStyle": "normal",
							"src": [ "file:./assets/fonts/inter-regular.woff2" ]
						},
						{
							"fontFamily": "Inter",
							"fontWeight": "700",
							"fontStyle": "normal",
							"src": [ "file:./assets/fonts/inter-bold.woff2" ]
						}
					]
				}
			],
			"fontSizes": [
				{
					"slug": "small",
					"size": "0.875rem",
					"name": "Small"
				},
				{
					"slug": "medium",
					"size": "1rem",
					"name": "Medium"
				},
				{
					"slug": "large",
					"size": "1.5rem",
					"name": "Large"
				}
			]
		},
		"spacing": {
			"defaultSpacingSizes": false,
			"spacingSizes": [
				{
					"slug": "30",
					"size": "1rem",
					"name": "Small"
				},
				{
					"slug": "40",
					"size": "1.5rem",
					"name": "Medium"
				},
				{
					"slug": "50",
					"size": "2rem",
					"name": "Large"
				}
			],
			"units": [ "px", "rem", "vh", "vw", "%" ]
		},
		"layout": {
			"contentSize": "640px",
			"wideSize": "1200px"
		},
		"border": {
			"radius": true,
			"color": true,
			"style": true,
			"width": true
		}
	},
	"styles": {
		"color": {
			"background": "var(--wp--preset--color--background)",
			"text": "var(--wp--preset--color--foreground)"
		},
		"typography": {
			"fontFamily": "var(--wp--preset--font-family--inter)",
			"fontSize": "var(--wp--preset--font-size--medium)",
			"lineHeight": "1.6"
		},
		"spacing": {
			"padding": {
				"top": "var(--wp--preset--spacing--50)",
				"right": "var(--wp--preset--spacing--50)",
				"bottom": "var(--wp--preset--spacing--50)",
				"left": "var(--wp--preset--spacing--50)"
			}
		},
		"elements": {
			"link": {
				"color": {
					"text": "var(--wp--preset--color--primary)"
				}
			},
			"heading": {
				"typography": {
					"fontWeight": "700",
					"lineHeight": "1.2"
				}
			}
		},
		"blocks": {
			"core/button": {
				"color": {
					"background": "var(--wp--preset--color--primary)",
					"text": "var(--wp--preset--color--background)"
				}
			}
		}
	},
	"customTemplates": [
		{
			"name": "page-no-title",
			"title": "Page Without Title",
			"postTypes": [ "page" ]
		}
	],
	"templateParts": [
		{
			"name": "header",
			"title": "Header",
			"area": "header"
		},
		{
			"name": "footer",
			"title": "Footer",
			"area": "footer"
		}
	]
}
ブロックテンプレートの構造(templates/single.html)

❌ 悪い例:ハードコードされたインラインスタイルは theme.json の効果を損ないます



<main style="max-width: 1200px; margin: 0 auto; padding: 2rem; color: #333;">
	<h1 style="font-size: 32px; color: #0073aa;">Post Title</h1>
	<div style="font-size: 16px; line-height: 1.6;">
		
	</div>
</main>


✅ 良い例:ブロック属性と theme.json のプリセットを使用します




<main class="wp-block-group">
	

	
	<div class="wp-block-group">
		
		
	</div>
	

	
</main>



テンプレートパーツの構造(parts/header.html)

❌ 悪い例:色と余白をハードコードしています

<div style="background: #ffffff; padding: 20px; border-bottom: 1px solid #cccccc;">
	<div style="max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between;">
		<h1 style="font-size: 24px; color: #0073aa;">Site Title</h1>
		<nav>Navigation</nav>
	</div>
</div>

✅ 良い例:theme.json のプリセット参照を指定したブロック属性を使用します


<div class="wp-block-group alignfull">
	
	<div class="wp-block-group">
		
		

		
	</div>
	
</div>

useRootPaddingAwareAlignments

❌ 悪い例:useRootPaddingAwareAlignments を指定せずにルートのパディングを設定しています

{
	"version": 3,
	"styles": {
		"spacing": {
			"padding": {
				"left": "2rem",
				"right": "2rem"
			}
		}
	}
}

結果:全幅ブロックの左右の端に余白ができます

❌ 悪い例:CSS の省略記法で useRootPaddingAwareAlignments を設定しています

{
	"version": 3,
	"settings": {
		"useRootPaddingAwareAlignments": true
	},
	"styles": {
		"spacing": {
			"padding": "2rem"
		}
	}
}

結果:機能しません。オブジェクト記法を使用する必要があります

✅ 良い例:オブジェクト記法で useRootPaddingAwareAlignments を設定しています

{
	"version": 3,
	"settings": {
		"useRootPaddingAwareAlignments": true
	},
	"styles": {
		"spacing": {
			"padding": {
				"top": "var(--wp--preset--spacing--50)",
				"right": "var(--wp--preset--spacing--50)",
				"bottom": "var(--wp--preset--spacing--50)",
				"left": "var(--wp--preset--spacing--50)"
			}
		}
	}
}
theme.json v2 から v3 への移行

❌ 悪い例:デフォルト設定を調整せずにバージョンを更新しています

{
	"version": 3,
	"settings": {
		"typography": {
			"fontSizes": [
				{ "slug": "small", "size": "14px" },
				{ "slug": "medium", "size": "16px" }
			]
		}
	}
}

結果:WordPress のデフォルトのフォントサイズも表示され、テーマのサイズが優先されません

✅ 良い例:defaultFontSizes: false を明示した v3

{
	"version": 3,
	"settings": {
		"typography": {
			"defaultFontSizes": false,
			"fontSizes": [
				{ "slug": "small", "size": "0.875rem", "name": "Small" },
				{ "slug": "medium", "size": "1rem", "name": "Medium" }
			]
		},
		"spacing": {
			"defaultSpacingSizes": false,
			"spacingSizes": [
				{ "slug": "30", "size": "1rem", "name": "Small" }
			]
		}
	}
}
テーマ内のブロックパターン(patterns/hero.php)

❌ 悪い例:必須ヘッダーがないパターン

<?php
// Missing Title and Slug headers
?>

<div class="wp-block-cover">
	<h1>Welcome</h1>
</div>

✅ 良い例:ヘッダーと動的な値を含む完全なパターン

<?php
/**
 * Title: Hero Section
 * Slug: mytheme/hero
 * Categories: featured, banner
 * Keywords: hero, banner, header
 * Block Types: core/cover
 * Viewport Width: 1400
 * Description: Full-width hero section with heading and CTA
 */
?>

<div class="wp-block-cover alignfull">
	<span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span>
	<img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( get_theme_file_uri( 'assets/images/hero.jpg' ) ); ?>" data-object-fit="cover" />

	<div class="wp-block-cover__inner-container">
		
		<h1 class="has-text-align-center"><?php echo esc_html_x( 'Welcome to Our Site', 'Pattern placeholder', 'mytheme' ); ?></h1>
		

		
		<div class="wp-block-buttons">
			
			<div class="wp-block-button">
				<a class="wp-block-button__link wp-element-button"><?php echo esc_html_x( 'Get Started', 'Pattern placeholder', 'mytheme' ); ?></a>
			</div>
			
		</div>
		
	</div>
</div>

スタイルバリエーション(styles/dark.json)

❌ 悪い例:バージョンまたはタイトルがないバリエーション

{
	"settings": {
		"color": {
			"palette": [
				{ "slug": "background", "color": "#1a1a1a" }
			]
		}
	}
}

✅ 良い例:バージョンとタイトルを含む完全なバリエーション

{
	"version": 3,
	"title": "Dark Mode",
	"settings": {
		"color": {
			"palette": [
				{
					"slug": "foreground",
					"color": "#ffffff",
					"name": "Foreground"
				},
				{
					"slug": "background",
					"color": "#1a1a1a",
					"name": "Background"
				},
				{
					"slug": "primary",
					"color": "#3dadff",
					"name": "Primary"
				}
			]
		}
	},
	"styles": {
		"color": {
			"background": "var(--wp--preset--color--background)",
			"text": "var(--wp--preset--color--foreground)"
		}
	}
}
ブロックテーマの functions.php

❌ 悪い例:theme.json の代わりに add_theme_support() を使用しています

<?php
function mytheme_setup() {
	add_theme_support( 'align-wide' );
	add_theme_support( 'custom-line-height' );
	add_theme_support( 'custom-spacing' );
	add_theme_support( 'editor-color-palette', array(
		array(
			'name'  => 'Primary',
			'slug'  => 'primary',
			'color' => '#0073aa',
		),
	) );
}
add_action( 'after_setup_theme', 'mytheme_setup' );

✅ 良い例:最小限の functions.php と theme.json による設定

<?php
/**
 * Theme setup and initialization
 */

defined( 'ABSPATH' ) || exit;

/**
 * Theme setup
 */
function mytheme_setup() {
	// Still valid in block themes
	add_theme_support( 'wp-block-styles' );
	add_theme_support( 'responsive-embeds' );
	add_theme_support( 'editor-styles' );

	// Load editor stylesheet
	add_editor_style( 'style.css' );

	// Internationalization
	load_theme_textdomain( 'mytheme', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'mytheme_setup' );

/**
 * Enqueue additional scripts (if needed)
 */
function mytheme_enqueue_assets() {
	// Only if theme needs custom JS
	if ( is_front_page() ) {
		wp_enqueue_script(
			'mytheme-interactions',
			get_theme_file_uri( '/assets/js/interactions.js' ),
			array(),
			wp_get_theme()->get( 'Version' ),
			true
		);
	}
}
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_assets' );
クラシックテーマからブロックテーマへの移行

❌ 悪い例:クラシックな方法(ブロックテーマでは非推奨)

<?php
// functions.php in classic theme
function classictheme_setup() {
	add_theme_support( 'custom-logo' );
	add_theme_support( 'custom-header' );
	add_theme_support( 'custom-background' );
	add_theme_support( 'editor-color-palette', array(
		array( 'name' => 'Primary', 'slug' => 'primary', 'color' => '#0073aa' ),
	) );
	add_theme_support( 'editor-font-sizes', array(
		array( 'name' => 'Small', 'size' => 14, 'slug' => 'small' ),
	) );
}
add_action( 'after_setup_theme', 'classictheme_setup' );

✅ 良い例:theme.json を使用するブロックテーマの方法

{
	"version": 3,
	"settings": {
		"layout": {
			"contentSize": "640px",
			"wideSize": "1200px"
		},
		"typography": {
			"defaultFontSizes": false,
			"fontSizes": [
				{
					"slug": "small",
					"size": "0.875rem",
					"name": "Small"
				}
			]
		},
		"color": {
			"defaultPalette": false,
			"palette": [
				{
					"slug": "primary",
					"color": "#0073aa",
					"name": "Primary"
				}
			]
		}
	}
}
子テーマのパターン

❌ 悪い例:子テーマの style.css に Template ヘッダーがありません

/*
Theme Name: My Child Theme
Description: A child theme
Author: Author Name
*/

結果:WordPress が親テーマを認識できません

✅ 良い例:必要な情報がそろった子テーマの style.css

/*
Theme Name: My Child Theme
Template: parent-theme-folder
Description: A child theme extending Parent Theme
Author: Author Name
Author URI: https://example.com
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: my-child-theme
*/

子テーマでのテンプレートパーツの上書き:

parent-theme/
├── parts/
│   └── header.html

child-theme/
├── style.css (with Template: parent-theme)
└── parts/
    └── header.html  ← Must match filename exactly to override

重大度の定義(THM-23)

重大度定義例
CRITICALテーマが動作しない、または WordPress.org に却下される必須ファイルの欠落(ブロックテーマでは templates/index.html、クラシックテーマでは index.php、すべてのテーマでは style.css)、無効な theme.json のバージョン(v1 は非推奨)、style.css の「Theme Name」ヘッダーの欠落、テンプレート階層の違反、子テーマの「Template:」ヘッダーの欠落、カスタムの fontSizes/spacingSizes を設定した theme.json v3 に defaultFontSizes/defaultSpacingSizes: false がない(WordPress のデフォルト設定がテーマを上書きする)、useRootPaddingAwareAlignments で CSS の省略形 padding を使用している(オブジェクト形式を使用する必要があります)、パターンファイルの Title または Slug ヘッダーの欠落
WARNINGテーマは動作するが、品質や互換性に問題があるtheme.json v2(破壊的変更に対応するため v3 へのアップグレードを推奨)、ブロックテーマのテンプレートにハードコードされたスタイルがある(インライン style 属性、ハードコードされた 16 進数カラー、ピクセル指定のフォントサイズ)、ルートの padding があるのに useRootPaddingAwareAlignments がない(全幅ブロックが画面の端まで届かない)、ブロックパターンが望ましい場面でクラシックパターンを使用している、ブロックテーマで非推奨の add_theme_support() 呼び出しがある(editor-color-palette、editor-font-sizes、custom-line-height、custom-spacing は theme.json に設定する必要があります)、functions.php に ABSPATH チェックがない、theme.json に登録されていないテンプレートパーツファイル、ハードコードされた WordPress パス(/wp-content/themes/)
INFOベストプラクティスの改善、または最適化の機会theme.json に $schema がない(IDE の検証用)、スタイルバリエーションディレクトリがない、ブロックパターンディレクトリがない、templateParts または customTemplates の登録がない、ローカルフォントではなく Google Fonts CDN を使用している(GDPR、パフォーマンス)、theme.json のないクラシックテーマ(ハイブリッドテーマにできる可能性があります)、階層を適切にするための個別テンプレート(single.html、page.html)を追加できる、親テーマのパターンを削除するために子テーマで unregister_block_pattern() を使用できる、style.css にバージョン要件(Requires at least、Tested up to、Requires PHP)がない

出力形式(THM-24)

ファイルごと(PHP、HTML テンプレート、JSON ファイルは実際のファイルパスに従って混在)に検出事項をまとめ、行番号と重大度ラベルを付けて報告してください。各検出事項には BAD/GOOD のコード例を使用してください。

# WordPress Theme Review: my-theme

## Theme Type: Block Theme
**Detected:** templates/index.html + theme.json + style.css

## FILE: theme.json

### Line 2: WARNING - theme.json version 2 (upgrade to v3)
theme.json v2 still works but v3 is recommended for WP 6.6+. Breaking changes: defaultFontSizes and defaultSpacingSizes now default to true.

❌ **BAD:**
```json
{
	"version": 2
}

✅ GOOD:

{
	"version": 3,
	"settings": {
		"typography": {
			"defaultFontSizes": false,
			"fontSizes": [ /* custom sizes */ ]
		}
	}
}
45 行目:WARNING - useRootPaddingAwareAlignments がない

ルートレベルに padding が設定されていますが、useRootPaddingAwareAlignments が設定されていません。全幅ブロックが画面の端まで届きません。

❌ BAD:

{
	"styles": {
		"spacing": {
			"padding": { "left": "2rem", "right": "2rem" }
		}
	}
}

✅ GOOD:

{
	"settings": {
		"useRootPaddingAwareAlignments": true
	},
	"styles": {
		"spacing": {
			"padding": {
				"top": "2rem",
				"right": "2rem",
				"bottom": "2rem",
				"left": "2rem"
			}
		}
	}
}

ファイル:templates/single.html

8 行目:WARNING - インラインスタイルがハードコードされている

インライン style 属性を使用すると、theme.json の目的が損なわれます。ユーザーはサイトエディターからカスタマイズできません。

❌ BAD:

<div style="max-width: 1200px; padding: 2rem;">

✅ GOOD:


<div class="wp-block-group">

ファイル:functions.php

1 行目:WARNING - ABSPATH チェックがない

直接アクセスを防ぐため、ファイルの先頭に ABSPATH チェックを追加してください。

❌ BAD:

<?php
function mytheme_setup() {

✅ GOOD:

<?php
defined( 'ABSPATH' ) || exit;

function mytheme_setup() {
15 行目:WARNING - ブロックテーマで add_theme_support() は非推奨

ブロックテーマでは、editor-color-palette を theme.json に設定してください。

❌ BAD:

add_theme_support( 'editor-color-palette', array(
	array( 'name' => 'Primary', 'slug' => 'primary', 'color' => '#0073aa' ),
) );

✅ GOOD:

// In theme.json:
{
	"settings": {
		"color": {
			"palette": [
				{ "slug": "primary", "color": "#0073aa", "name": "Primary" }
			]
		}
	}
}

ファイル:style.css

1 行目:INFO - バージョン要件がない

バージョンを適用するため、Requires at least、Tested up to、Requires PHP を追加してください。

/*
Theme Name: My Theme
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.7
Requires PHP: 7.4
*/

概要

問題の合計:6 件

  • CRITICAL:0 件
  • WARNING:4 件(品質/互換性の改善が必要)
  • INFO:2 件(ベストプラクティスの強化)

アップグレードの推奨事項: defaultFontSizes と defaultSpacingSizes を明示的に設定して、theme.json を v3 に更新してください。 ハードコードされたスタイル: テンプレート内で見つかりました。ユーザーがカスタマイズできるよう、theme.json のプリセットに移行してください。 セキュリティに関する注意: ABSPATH チェックがありません。包括的なセキュリティ分析を行うには、/wp-sec-review を実行してください。 プラグインに関する注意: functions.php でフックが検出されました。プラグイン開発のパターンを確認するには、/wp-plugin-review を実行してください。


## Common Mistakes (THM-25)

Patterns that look like issues but are NOT problems:

| Pattern | Why It's NOT a Problem | Context |
|---------|------------------------|---------|
| **Block theme with minimal style.css** | Block themes use theme.json for styling, style.css is primarily metadata | Correct for block themes - style.css contains theme header, minimal CSS |
| **Classic theme without theme.json** | Classic themes work without theme.json, optional for block editor support | Valid classic theme - theme.json is optional for hybrid approach |
| **Hybrid theme with both index.php and theme.json** | Intentional pattern for incremental block editor adoption | Valid hybrid approach - theme.json enhances block editor, classic templates still work |
| **Template part without theme.json registration** | Template parts work by filename, registration is for UI labels only | Works correctly - registration enhances Site Editor UI but not required |
| **Style variation missing some settings sections** | Variations only need to override specific settings, not full schema | Intentional - variations merge with main theme.json |
| **Block template without template-part blocks** | Not all templates need header/footer, valid for custom layouts | Intentional for special templates (404, search results without chrome) |
| **functions.php with add_theme_support() in block theme** | Some add_theme_support() calls are still valid (wp-block-styles, responsive-embeds, editor-styles) | Valid - these can't be replaced by theme.json |
| **Pattern file with only static markup (no PHP)** | If pattern doesn't need dynamic values, static HTML is fine | Valid - PHP optional for static patterns |
| **Child theme without functions.php** | Child themes don't need functions.php if only overriding styles/templates | Valid minimal child theme - functions.php is optional |
| **Block theme without patterns/ directory** | Patterns are optional, not all themes need bundled patterns | Valid - themes can rely on WordPress.org pattern directory |
| **Missing viewScript in theme** | Themes typically don't need frontend JavaScript, unlike blocks | Expected - most themes are HTML/CSS only |
| **CSS variables in style.css referencing theme.json** | Correct usage - theme.json generates CSS variables that style.css can reference | Intentional integration between theme.json and style.css |

## Version Compatibility Reference

Quick reference for WordPress version requirements:

| Feature | WordPress Version | Notes |
|---------|-------------------|-------|
| Block themes (FSE) | 5.9+ | Full Site Editing stable release |
| theme.json v1 | 5.8+ | Initial theme.json support |
| theme.json v2 | 5.9+ | Expanded settings and styles options |
| theme.json v3 | 6.6+ | Breaking changes: defaultFontSizes and defaultSpacingSizes defaults |
| useRootPaddingAwareAlignments | 6.1+ | Full-width alignment with root padding |
| Template parts areas | 6.0+ | header, footer, uncategorized areas |
| fontFace support in theme.json | 6.0+ | Local font hosting via theme.json |
| Block theme patterns (patterns/) | 6.3+ | Auto-registration of PHP pattern files |
| Navigation block | 5.9+ | Replaces wp_nav_menu() in block themes |
| Site Editor | 5.9+ | Full Site Editing interface |
| Global Styles | 5.9+ | User customization of theme.json via UI |
| Style variations | 6.0+ | Alternate theme.json files in styles/ |

## Deep-Dive References

For advanced theme development patterns, load these companion reference documents:

| Task | Reference to Load |
|------|-------------------|
| theme.json v3 complete schema, all sections explained (settings, styles, templateParts, customTemplates, patterns), property catalog with valid values, v2→v3 migration notes, common mistakes, WordPress.org requirements | `references/theme-json-guide.md` |
| Template hierarchy for both classic and block themes side-by-side, template parts and areas, conditional tags, get_template_part() for classic, block markup in HTML templates, custom templates registration | `references/template-patterns.md` |
| Full Site Editing comprehensive guide: site editor workflow, global styles UI mapping to theme.json, style variations creation, block patterns in themes (patterns/ directory), navigation configuration, font management, layout system (contentSize, wideSize, root padding) | `references/fse-guide.md` |
| Step-by-step classic-to-block migration: functions.php → theme.json mapping table, template.php → template.html conversion, sidebar widgets → template parts, Customizer → global styles, add_theme_support → theme.json equivalents, incremental hybrid adoption path | `references/classic-to-block-guide.md` |

**Note:** Reference docs provide deep-dive content. This SKILL.md is self-sufficient for standard theme reviews.

**Security crossover:** When encountering security-relevant patterns (template escaping in classic themes, child theme security, sanitization in theme customizer), this skill provides brief reminders but defers to wp-security-review for comprehensive security analysis. For detailed security patterns, use `/wp-sec-review` command.

**Plugin crossover:** When encountering plugin-level patterns (functions.php hooks like after_setup_theme, wp_enqueue_scripts, init for CPT registration), this skill provides brief mentions but defers to wp-plugin-development for plugin architecture depth. For detailed plugin patterns, use `/wp-plugin-review` command.

**Block crossover:** When encountering block development patterns (block patterns registration in themes vs plugins, block markup in templates, block supports defined in theme.json), this skill provides brief context but defers to wp-block-development for block-specific depth. For detailed block patterns, use `/wp-block-review` command.

コメント