add-extension
Create a block extension to enhance core WordPress blocks
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a block extension to enhance core WordPress blocks
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create a new Gutenberg block with scaffolding
Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.
Prepare plugin for WordPress.org deployment
Use when generating responses containing factual claims, API details, configuration specifics, version compatibility, or recalled knowledge that could be hallucinated - especially when not working directly from source code or command output
Use when executing implementation plans with independent tasks in the current session
Create a block variation with preset configurations
| name | add-extension |
| description | Create a block extension to enhance core WordPress blocks |
| argument-hint | ["block-name"] |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(mkdir *), Bash(npm run *) |
Create a new block extension to enhance a WordPress core block.
src/extensions/[block-name]-enhancements/index.js with WordPress filtersstyles.scss for frontend styleseditor.scss for editor-only stylesfrontend.js (if interactive features needed)// 1. Add attributes
addFilter('blocks.registerBlockType', 'designsetgo/add-attributes', (settings, name) => {
if (name !== 'core/group') return settings;
return {
...settings,
attributes: {
...settings.attributes,
customAttribute: { type: 'string', default: '' }
}
};
});
// 2. Add controls (conditionally!)
addFilter('editor.BlockEdit', 'designsetgo/add-controls', createHigherOrderComponent((BlockEdit) => {
return (props) => {
if (props.name !== 'core/group') return <BlockEdit {...props} />;
// Show controls conditionally based on WordPress state
// e.g., only show grid controls when layout.type === 'grid'
return (
<>
<BlockEdit {...props} />
<InspectorControls>
{/* Your controls */}
</InspectorControls>
</>
);
};
}));
// 3. Add classes on save
addFilter('blocks.getSaveContent.extraProps', 'designsetgo/add-classes', (props, block, attributes) => {
if (block.name !== 'core/group') return props;
return {
...props,
className: classnames(props.className, 'custom-class')
};
});
| Use Extension When | Use Custom Block When |
|---|---|
| ≤3 simple controls | Complex functionality |
| No DOM restructuring | Need video/media backgrounds |
| CSS-only changes | Interactive components (tabs, accordion) |
| Enhancing existing blocks | Unique UI patterns |
For DesignSetGo: Default to custom blocks for unique features. Extensions only for simple enhancements.
Import and initialize in src/index.js:
import './extensions/group-enhancements';
From CLAUDE.md:
See /review-extension command to audit your extension after creation.