editing-blocks

Directrices para modificar bloques existentes de WordPress: carga esto antes de editar archivos de bloques

npx skills add https://github.com/automattic/data-liberation-agent --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

Más skills de automattic

wp-phpstan
automattic
Úsalo al configurar, ejecutar o corregir el análisis estático de PHPStan en proyectos de WordPress (plugins/temas/sitios): configuración de phpstan.neon, líneas base,…
official
wp-playground
automattic
Usar para flujos de trabajo de WordPress Playground: instancias rápidas y desechables de WP en el navegador o localmente mediante @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
Úsese al desarrollar plugins de WordPress: arquitectura y hooks, activación/desactivación/desinstalación, interfaz de administración y API de Settings, almacenamiento de datos, cron/tareas, seguridad…
official
wp-project-triage
automattic
Úselo cuando necesite una inspección determinista de un repositorio de WordPress (plugin/tema/tema de bloque/WP core/Gutenberg/sitio completo) incluyendo herramientas/pruebas/versión…
official
wp-rest-api
automattic
Úsalo al construir, extender o depurar endpoints/rutas de la API REST de WordPress: register_rest_route, clases WP_REST_Controller/controller, esquema/argumentos…
official
wp-wpcli-and-ops
automattic
Úsalo al trabajar con WP-CLI (wp) para operaciones de WordPress: búsqueda y reemplazo seguros, exportación/importación de base de datos, gestión de plugins/temas/usuarios/contenido, cron, vaciado de caché,…
official
wpds
automattic
Úsalo al construir interfaces de usuario que aprovechen el Sistema de Diseño de WordPress (WPDS) y sus componentes, tokens, patrones, etc.
official
woocommerce-finalize
automattic
Auditoría de salud de código y trazabilidad previa al lanzamiento para plugins de WooCommerce. Se ejecuta después de la revisión de código — se enfoca en código muerto, duplicación, complejidad estructural y…
official