Help us improve
Share bugs, ideas, or general feedback.
From magento2-commerce
Guides creation of Magento 2 custom modules: registration, directory structure, models, resource models, collections, declarative schema, data/schema patches. For building modules or reviewing architecture.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin magento2-commerceHow this skill is triggered — by the user, by Claude, or both
Slash command
/magento2-commerce:magento-module-devThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Configures Magento 2 dependency injection via di.xml: types, virtual types, preferences, argument replacement, Object Manager. Use for wiring dependencies, class variations, module integrations.
Builds custom Medusa v2 modules with DML data models, services extending MedusaService, loaders, module links, and container registration. Use when extending Medusa.
Scaffold a new Marko Composer package with composer.json, namespaced src/, Pest tests, and optional module.php.
Share bugs, ideas, or general feedback.
Fetch live docs:
https://developer.adobe.com/commerce/php/development/build/component-file-structure/ for module structurehttps://developer.adobe.com/commerce/php/development/ for development overviewsite:developer.adobe.com commerce php development build for build guidesapp/code/VendorName/ModuleName/
├── Api/ # Service contract interfaces
│ └── Data/ # Data interfaces
├── Block/ # View blocks
├── Console/ # CLI commands
├── Controller/ # Controllers
│ └── Adminhtml/ # Admin controllers
├── Cron/ # Cron job classes
├── etc/ # Configuration XML
│ ├── adminhtml/ # Admin-area configs
│ ├── frontend/ # Frontend configs
│ ├── module.xml # Module declaration
│ ├── di.xml # Dependency injection
│ ├── db_schema.xml # Declarative schema
│ └── db_schema_whitelist.json
├── Helper/ # Utility classes
├── Model/ # Models
│ └── ResourceModel/ # Resource models + collections
├── Observer/ # Event observers
├── Plugin/ # Interceptor classes
├── Setup/
│ └── Patch/
│ ├── Data/ # Data patches
│ └── Schema/ # Schema patches
├── Test/ # Tests
├── ViewModel/ # MVVM view models
├── view/ # Templates, layouts, JS, CSS
├── registration.php # Module registration
└── composer.json # Composer definition
Registers the module with Magento's component registrar. Uses ComponentRegistrar::register() with type MODULE.
Declares the module name and sequence dependencies (modules that must load before this one).
Package definition with type magento2-module, PSR-4 autoload mapping, and Magento module dependencies.
AbstractModel, represents a single entity, _construct() initializes resource modelAbstractDb, handles CRUD against a specific table, _init() sets table and primary keyAbstractCollection, represents a set of models, _init() maps model to resource modelSince Magento 2.3+, database schema is declared in XML rather than install/upgrade scripts. The system computes diffs and applies changes automatically on setup:upgrade.
DataPatchInterface or SchemaPatchInterfaceapply() method contains the migration logicpatch_list tableConsole commands extend Symfony\Component\Console\Command\Command:
etc/di.xml as arguments to Magento\Framework\Console\CommandListInterfaceconfigure() for name/description and execute() for logicVendorName_ModuleName naming conventionmodule.xml sequenceApi/Fetch the component file structure guide for exact directory conventions and required files before creating a module.