editing-blocks

작성자: automattic

Guidelines for modifying existing WordPress blocks — load this before editing block files

npx skills add https://github.com/automattic/studio --skill editing-blocks

When to use me

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

Editing Guidelines

  • Read all existing block files before making changes — understand the current architecture, attributes, and rendering approach
  • Make minimal, targeted changes — only modify what the user requested
  • Only touch files that need to change — do not rewrite unrelated files
  • Use the edit tool for targeted changes; only use write when replacing more than 50% of a file
  • Do not convert between static and dynamic blocks, or change the block name/slug, unless the user explicitly asks
  • When adding or modifying attributes, update all relevant files (block.json, edit.js, and save.js or render.php)
  • After changes, verify the block is still registered correctly and renders on the front end
  • Use the InnerBlocks component from @wordpress/block-editor as much as possible.
  • When adding interactivity to an existing block, convert it to dynamic first if it isn't already (add render.php, remove save.js, add "render": "file:./render.php" to block.json)
  • When converting a block to interactive: add "viewScript": "file:./view.js" to block.json, write view.js using plain JavaScript with standard DOM APIs (querySelector, addEventListener, classList, etc.) — never use the WordPress Interactivity API

Reference Files

Before editing block files, read the relevant references from the references/ directory next to this skill file.

  • references/artefact-templates.md — read this to verify correct file structure, paths, and asset references (especially register_block_type path and block.json asset filenames)
  • references/file-templates.md — additional guidelines for each block file type
  • references/inner-blocks.md — read this if the block uses InnerBlocks or child blocks
  • references/interactivity-api.md — read this when adding interactive behavior to a block that needs frontend JavaScript

automattic의 다른 스킬

wp-phpstan
automattic
WordPress 프로젝트(플러그인/테마/사이트)에서 PHPStan 정적 분석을 설정, 실행 또는 수정할 때 사용: phpstan.neon 설정, 기준선,…
official
wp-playground
automattic
WordPress Playground 워크플로우에 사용: 브라우저 또는 @wp-playground/cli(서버, run-blueprint, build-snapshot)를 통해 로컬에서 빠르게 일회용 WP 인스턴스를 실행합니다.
official
wp-plugin-development
automattic
WordPress 플러그인 개발 시 사용: 아키텍처 및 훅, 활성화/비활성화/제거, 관리자 UI 및 설정 API, 데이터 저장, 크론/작업, 보안…
official
wp-project-triage
automattic
WordPress 저장소(플러그인/테마/블록 테마/WP 코어/Gutenberg/전체 사이트)의 도구/테스트/버전 등을 포함한 결정론적 검사가 필요할 때 사용합니다.
official
wp-rest-api
automattic
WordPress REST API 엔드포인트/라우트를 구축, 확장 또는 디버깅할 때 사용: register_rest_route, WP_REST_Controller/컨트롤러 클래스, 스키마/인수…
official
wp-wpcli-and-ops
automattic
WP-CLI(wp)를 사용하여 WordPress 작업을 수행할 때 사용: 안전한 검색-바꾸기, DB 내보내기/가져오기, 플러그인/테마/사용자/콘텐츠 관리, 크론, 캐시 플러싱 등
official
wpds
automattic
WordPress 디자인 시스템(WPDS)과 그 컴포넌트, 토큰, 패턴 등을 활용하여 UI를 구축할 때 사용합니다.
official
woocommerce-finalize
automattic
WooCommerce 플러그인을 위한 사전 릴리스 코드 건강 및 추적성 감사. 코드 리뷰 후 실행되며, 죽은 코드, 중복, 구조적 복잡성 등을 중점적으로 확인합니다…
official