wp-theme-development
WordPress theme code review and block theme development patterns for WordPress 6.6+. Use when reviewing theme code, auditing theme.json schema, checking template hierarchy, validating block templates, analyzing global styles, verifying style variations, reviewing template parts, detecting hardcoded styles, checking classic-to-block migration, or when user mentions "theme review", "theme development", "theme.json", "block theme", "FSE", "Full Site Editing", "template parts", "template hierarchy", "global styles", "style variations", "classic theme", "child theme", "theme patterns", "theme.json validation", "hardcoded styles", "useRootPaddingAwareAlignments", "classic-to-block", "hybrid theme", "WordPress.org theme". Detects issues in theme.json structure, block templates, template parts, style systems, and classic theme migration patterns.
jorgerosal · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add jorgerosal/wordpress-skills --skill wp-theme-development技能说明
name: wp-theme-development description: WordPress theme code review and block theme development patterns for WordPress 6.6+. Use when reviewing theme code, auditing theme.json schema, checking template hierarchy, validating block templates, analyzing global styles, verifying style variations, reviewing template parts, detecting hardcoded styles, checking classic-to-block migration, or when user mentions "theme review", "theme development", "theme.json", "block theme", "FSE", "Full Site Editing", "template parts", "template hierarchy", "global styles", "style variations", "classic theme", "child theme", "theme patterns", "theme.json validation", "hardcoded styles", "useRootPaddingAwareAlignments", "classic-to-block", "hybrid theme", "WordPress.org theme". Detects issues in theme.json structure, block templates, template parts, style systems, and classic theme migration patterns.
WordPress Theme Development Review Skill
Overview
Systematic theme development review for WordPress 6.6+ with primary focus on block themes (Full Site Editing) and secondary coverage of classic themes for migration guidance. Core principle: WordPress themes have undergone a paradigm shift—block themes use HTML templates with block markup and theme.json for global settings/styles, replacing PHP templates and add_theme_support() calls. theme.json v3 is the single source of truth for design configuration. Review validates theme.json structure, block template hierarchy (HTML files in templates/), template parts (parts/), global styles, style variations, block patterns in themes, child theme compatibility, and classic-to-block migration opportunities. Auto-detects theme type (block/classic/hybrid/child/WordPress.org) and adjusts guidance accordingly. Report findings grouped by file (PHP, HTML template, JSON files intermixed by actual path) with line numbers, severity labels (CRITICAL/WARNING/INFO), and BAD/GOOD code pairs.
Note: This skill reviews PHP files (functions.php, classic templates), HTML block template files (templates/, parts/), JSON files (theme.json, style variations), and PHP pattern files (patterns/). PHP follows WordPress PHP Coding Standards (spaces in parentheses, array() not [], Yoda conditions). HTML templates use valid block markup. JSON follows theme.json v3 schema.
When to Use
Use when:
- Block theme code review (theme.json, HTML templates, template parts)
- theme.json v3 schema validation and structure check
- Template hierarchy audit (block themes with .html files, classic themes with .php files)
- Template parts review (parts/header.html, parts/footer.html, parts/sidebar.html)
- Global styles analysis (color palettes, typography, spacing, layout settings)
- Style variations validation (styles/ directory with alternate theme.json files)
- Block patterns in themes review (patterns/ directory with PHP files)
- Child theme compatibility check (block or classic child themes)
- Classic-to-block theme migration assessment
- WordPress.org theme submission readiness (Theme Check compliance)
- Hardcoded styles detection in block themes
- useRootPaddingAwareAlignments verification for full-width alignment
Don't use for:
- Block editor component review (use wp-block-development for React/JSX blocks)
- Plugin architecture audits (use wp-plugin-development for plugin structure)
- Security-only audits (use wp-security-review for comprehensive security)
- Performance-only audits (use wp-performance-review for performance analysis)
- WooCommerce theme integration (use wp-woocommerce-dev when available)
- Visual design assessment (this is code review only, not UI/UX review)
Code Review Workflow
Follow this seven-step workflow for systematic theme reviews:
-
Identify theme type and context (THM-01)
- Block theme → Has templates/index.html + theme.json + style.css
- Classic theme → Has index.php + style.css + functions.php (no templates/ directory)
- Hybrid theme → Has both index.php AND theme.json (classic with block editor support)
- Child theme → style.css has "Template:" header pointing to parent theme
- WordPress.org submission → Stricter standards (Theme Check compliance required)
Auto-detection pattern:
# 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" -
Validate theme.json schema (THM-02, THM-03, THM-04, THM-05)
- Version field MUST be 3 (WP 6.6+). Flag v1 as CRITICAL (deprecated), v2 as WARNING (upgrade available)
- Required sections: settings, styles
- Validate settings structure: color, typography, spacing, layout, border, shadow
- Check for v3 breaking changes: defaultFontSizes and defaultSpacingSizes both default to true (must explicitly set false if theme defines custom sizes)
- Verify templateParts array: name, title, area (header/footer/uncategorized)
- Verify customTemplates array: name, title, postTypes
- Check for $schema field (INFO if missing, enhances IDE autocomplete)
- Validate useRootPaddingAwareAlignments when root padding present
-
Check template hierarchy (THM-06, THM-07)
- Block themes: templates/index.html required, others optional (home.html, front-page.html, single.html, page.html, archive.html, 404.html, search.html)
- Classic themes: index.php required, standard hierarchy (header.php, footer.php, single.php, page.php, archive.php)
- Verify template files use correct markup: HTML block markup for block themes, PHP template tags for classic themes
- Check for hardcoded styles in block templates (CRITICAL anti-pattern)
- Validate template part references in templates
-
Check template parts (THM-08)