editing-themes

โดย automattic

แนวทางสำหรับการปรับเปลี่ยนธีมบล็อก WordPress ที่มีอยู่ — โหลดสิ่งนี้ก่อนแก้ไขไฟล์ธีม

npx skills add https://github.com/automattic/data-liberation-agent --skill editing-themes

When to use me

Use this skill when modifying an existing theme (files already exist in the workspace). Do not use this skill when creating a new theme from scratch.

Absolute Rules

  • NEVER recreate or overwrite files the user did not ask you to change. If the user asks to "add a newsletter template", you add the new template/pattern files and update the index template to include it — nothing else.
  • NEVER rewrite theme.json, functions.php, or style.css unless the user's request specifically requires changes to them (e.g., adding a new color, changing fonts, registering a new asset).
  • NEVER change the theme's topic, branding, or content direction. If the theme is for a dance studio, new additions must be contextually appropriate for a dance studio — not generic placeholder content.
  • NEVER delete existing patterns, templates, or template parts unless the user explicitly asks to remove them.

Editing Guidelines

  • Read theme.json, style.css, and functions.php before making changes — understand the current configuration, design tokens, and registered assets
  • Make minimal, targeted changes — only modify what the user requested
  • Only touch files that need to change — do not rewrite unrelated templates or patterns
  • Use the edit tool for targeted changes; only use write when replacing more than 50% of a file
  • When modifying colors, typography, or spacing, update theme.json — not CSS — unless the change cannot be expressed in theme.json
  • When adding or modifying template parts, ensure they are registered in theme.json if needed
  • Preserve the theme's existing design direction and aesthetic unless the user explicitly asks to change it
  • New content (patterns, templates) must match the theme's existing topic, tone, and visual style
  • After changes, verify templates still reference valid template parts and patterns

Reference Files

Before editing theme files, read the relevant references from the creating-themes/references/ directory.

  • creating-themes/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.
  • creating-themes/references/design-direction.md — REQUIRED: read this before generating any theme files. Contains guidelines and good design directions.
  • creating-themes/references/navigation.md — read this before generating any header template part, covers wp:navigation block markup, overlay (hamburger menu)
  • creating-themes/references/query-loop.md — read this if the theme must display dynamic content (blog posts, archives, search results) in templates or patterns

Skills เพิ่มเติมจาก automattic

wp-phpstan
automattic
ใช้เมื่อกำหนดค่า เรียกใช้ หรือแก้ไขการวิเคราะห์แบบสแตติกของ PHPStan ในโปรเจกต์ WordPress (ปลั๊กอิน/ธีม/ไซต์): การตั้งค่า phpstan.neon, เบสไลน์,…
official
wp-playground
automattic
ใช้สำหรับเวิร์กโฟลว์ของ WordPress Playground: อินสแตนซ์ WP แบบใช้แล้วทิ้งที่รวดเร็วในเบราว์เซอร์หรือในเครื่องผ่าน @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
ใช้เมื่อพัฒนา WordPress plugins: สถาปัตยกรรมและ hooks, การเปิดใช้งาน/ปิดใช้งาน/ถอนการติดตั้ง, UI สำหรับผู้ดูแลระบบและ Settings API, การจัดเก็บข้อมูล, cron/งาน, ความปลอดภัย…
official
wp-project-triage
automattic
ใช้เมื่อคุณต้องการตรวจสอบที่เก็บ WordPress (ปลั๊กอิน/ธีม/ธีมบล็อก/WP core/Gutenberg/ทั้งไซต์) อย่างแน่นอน รวมถึงเครื่องมือ/การทดสอบ/เวอร์ชัน…
official
wp-rest-api
automattic
ใช้เมื่อสร้าง ขยาย หรือดีบักเอนด์พอยต์/เส้นทางของ WordPress REST API: register_rest_route, คลาส WP_REST_Controller/controller, schema/argument…
official
wp-wpcli-and-ops
automattic
ใช้เมื่อทำงานกับ WP-CLI (wp) สำหรับการดำเนินการ WordPress: การค้นหาและแทนที่อย่างปลอดภัย, การส่งออก/นำเข้าฐานข้อมูล, การจัดการปลั๊กอิน/ธีม/ผู้ใช้/เนื้อหา, cron, การล้างแคช,…
official
wpds
automattic
ใช้เมื่อสร้าง UI ที่ใช้ประโยชน์จาก WordPress Design System (WPDS) และส่วนประกอบ โทเค็น รูปแบบ ฯลฯ
official
woocommerce-finalize
automattic
การตรวจสอบสุขภาพโค้ดและความสามารถในการตรวจสอบย้อนกลับก่อนเผยแพร่สำหรับปลั๊กอิน WooCommerce ดำเนินการหลังจากการตรวจสอบโค้ด -- เน้นที่โค้ดที่ไม่ได้ใช้ การซ้ำซ้อน ความซับซ้อนเชิงโครงสร้าง และ...
official