wordpress-block-themes

توسعه، شخصی‌سازی و عیب‌یابی حرفه‌ای WordPress Block Theme

این مهارت برای ساخت و ویرایش WordPress Block Theme استفاده می‌شود؛ از تنظیمات و استایل‌های theme.json تا templateها، template partها، patternها و style variationها.

با بررسی ساختار پروژه، سلسله‌مراتب استایل‌ها و تفاوت بین Site Editor، ویرایشگر نوشته و frontend، تغییرات دقیق‌تر اعمال می‌شود و مشکلاتی مثل اعمال‌نشدن استایل یا cache بهتر عیب‌یابی می‌شوند.

چه چیزی می‌گیرید

  • ویرایش امن تنظیمات، presetها و استایل‌های `theme.json`
  • ساخت و تغییر templateها در `templates/` و template partها در `parts/`
  • ایجاد patternهای اختصاصی در `patterns/` و کنترل نمایش آن‌ها در inserter
  • افزودن و مدیریت style variationها در `styles/`
  • عیب‌یابی style hierarchy، overrideهای کاربر و مشکلات Site Editor

برای چه کاری خوب است

  • توسعه‌دهندگان WordPress که روی Block Themeهای مدرن کار می‌کنند
  • پروژه‌هایی که نیاز به شخصی‌سازی `theme.json`، templateها یا patternها دارند
  • عیب‌یابی تفاوت ظاهر سایت بین Site Editor، frontend و ویرایشگر نوشته
  • ساخت یا تبدیل یک theme برای WordPress 6.9 و نسخه‌های جدیدتر

برای چه کاری نیست

  • توسعه Classic Themeهایی که از `theme.json` و ساختار block theme استفاده نمی‌کنند
  • تغییرات صرفاً محتوایی که به فایل‌ها و ساختار theme مربوط نیستند
  • پروژه‌هایی که به پشتیبانی از نسخه‌های قدیمی WordPress با schema متفاوت نیاز دارند

دربارهٔ این اسکیل

(no title)

URL: https://raw.githubusercontent.com/Automattic/agent-skills/trunk/skills/wp-block-themes/SKILL.md


name: wp-block-themes
description: "Use when developing WordPress block themes: theme.json (global settings/styles), templates and template parts, patterns, style variations, and Site Editor troubleshooting (style hierarchy, overrides, caching)."
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
---

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
  1. 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.json schema 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.json present
  • templates/ and/or parts/ 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, tha

دانلود ZIP