editing-blocks

द्वारा automattic

मौजूदा वर्डप्रेस ब्लॉक्स को संशोधित करने के दिशानिर्देश — ब्लॉक फ़ाइलों को संपादित करने से पहले इसे लोड करें

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

automattic की और Skills

wp-phpstan
automattic
वर्डप्रेस प्रोजेक्ट्स (प्लगइन्स/थीम्स/साइट्स) में PHPStan स्टैटिक एनालिसिस को कॉन्फ़िगर करने, चलाने या ठीक करने के लिए उपयोग करें: phpstan.neon सेटअप, बेसलाइन्स,…
official
wp-playground
automattic
वर्डप्रेस प्लेग्राउंड वर्कफ़्लो के लिए उपयोग करें: ब्राउज़र में या स्थानीय रूप से @wp-playground/cli (सर्वर, रन-ब्लूप्रिंट, बिल्ड-स्नैपशॉट) के माध्यम से तेज़ डिस्पोज़ेबल WP इंस्टेंस,…
official
wp-plugin-development
automattic
वर्डप्रेस प्लगइन विकसित करते समय उपयोग करें: आर्किटेक्चर और हुक्स, सक्रियण/निष्क्रियण/अनइंस्टॉल, एडमिन यूआई और सेटिंग्स एपीआई, डेटा स्टोरेज, क्रॉन/कार्य, सुरक्षा…
official
wp-project-triage
automattic
जब आपको किसी वर्डप्रेस रिपॉजिटरी (प्लगइन/थीम/ब्लॉक थीम/WP कोर/गुटेनबर्ग/पूर्ण साइट) का निर्धारित निरीक्षण चाहिए, जिसमें टूलिंग/टेस्ट/संस्करण… शामिल हों।
official
wp-rest-api
automattic
वर्डप्रेस REST API एंडपॉइंट/रूट्स बनाने, विस्तारित करने या डीबग करने के लिए उपयोग करें: register_rest_route, WP_REST_Controller/कंट्रोलर क्लासेस, स्कीमा/आर्गुमेंट…
official
wp-wpcli-and-ops
automattic
WP-CLI (wp) के साथ WordPress संचालन के लिए उपयोग करें: सुरक्षित खोज-बदलाव, db निर्यात/आयात, प्लगइन/थीम/उपयोगकर्ता/सामग्री प्रबंधन, क्रॉन, कैश फ्लशिंग,…
official
wpds
automattic
जब वर्डप्रेस डिज़ाइन सिस्टम (WPDS) और इसके घटकों, टोकन, पैटर्न आदि का उपयोग करके यूआई बनाया जा रहा हो, तब उपयोग करें।
official
woocommerce-finalize
automattic
WooCommerce प्लगइन्स के लिए प्री-रिलीज़ कोड स्वास्थ्य और ट्रेसेबिलिटी ऑडिट। कोड समीक्षा के बाद चलता है -- मृत कोड, डुप्लिकेशन, संरचनात्मक जटिलता, और… पर ध्यान केंद्रित करता है।
official