add-extension
Create a block extension to enhance core WordPress blocks
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Create a block extension to enhance core WordPress blocks
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle 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.