一键导入
module-scaffold
Create a new Magento 2 module with the required directory structure, registration files, composer autoloading, and module sequence declarations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a new Magento 2 module with the required directory structure, registration files, composer autoloading, and module sequence declarations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build Magento 2 admin grids using UI Component listing XML, data providers, and admin controllers with proper ACL integration
Implement Magento 2 GraphQL resolvers — define schema.graphqls types, write query and mutation resolvers, and handle authorization
Run Magento 2 CLI commands through Warden's Docker environment: warden shell, bin/magento, composer, Redis/Valkey, Varnish, OpenSearch, RabbitMQ, n98-magerun2, mutagen sync, and env lifecycle.
Adapt Luma-oriented Magento 2 modules to work with Hyva themes — replace RequireJS and Knockout with Alpine.js, Tailwind CSS, and ViewModels
Configure Magento 2 dependency injection — preferences, virtual types, constructor arguments, and proxy generation via di.xml
Implement Magento 2 plugins (interceptors) following best practices for before, after, and around method interception
| name | module-scaffold |
| description | Create a new Magento 2 module with the required directory structure, registration files, composer autoloading, and module sequence declarations |
| installed_version | 1.0.0 |
| magehub_version | 0.1.13 |
Every custom module requires three files before Magento will recognize it:
registration.php, etc/module.xml, and composer.json. Missing any one of
these causes the module to be silently ignored during setup:upgrade.
Place module source under app/code/<Vendor>/<Module>/ for project-level
modules or ship as a Composer package installed into vendor/. The directory
name must match the Vendor_Module identifier exactly — case-sensitive on
Linux filesystems.
Recommended initial structure:
registration.php — registers the component with the frameworketc/module.xml — declares the module name and setup version sequencecomposer.json — PSR-4 autoloading, package metadata, and dependenciesregistration.php must call ComponentRegistrar::register() with the
MODULE type and the Vendor_ModuleName identifier. This file is
auto-included by the Composer-generated autoloader; it must not contain class
definitions or side-effects beyond the single register call.
Declare <module name="Vendor_ModuleName"> in etc/module.xml. Use the
<sequence> element to list modules that must load before yours — this
controls schema patch and config merge ordering, not runtime dependency
injection. Only declare sequence entries for modules whose configuration,
schema, or layout your module directly overrides.
Set type to magento2-module so the Magento Composer installer places the
package correctly. Map the PSR-4 namespace root to the module directory.
Require magento/framework at a minimum and add specific module dependencies
as Composer require entries, keeping them aligned with <sequence>.
Run bin/magento module:enable Vendor_ModuleName followed by
bin/magento setup:upgrade to register the module in config.php and
execute any setup patches.
Standard module registration file with strict types and the single required ComponentRegistrar call
<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__);
Module declaration with a sequence dependency on Magento_Catalog to ensure correct config merge and schema patch order
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
Composer package definition with PSR-4 autoloading, magento2-module type, and framework dependency
{
"name": "vendor/module-module",
"description": "Custom Magento 2 module",
"type": "magento2-module",
"require": {
"php": ">=8.1",
"magento/framework": "*"
},
"autoload": {
"files": ["registration.php"],
"psr-4": {
"Vendor\\Module\\": ""
}
}
}
Path template:
registration.php
Module registration file — required for Magento to discover the module
<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, '{{vendor}}_{{module}}', __DIR__);
Path template:
etc/module.xml
Module declaration with optional sequence dependencies
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="{{vendor}}_{{module}}"/>
</config>