magento-module-development
БесплатноБез исполняемых скриптовНе проверенBuild custom Magento 2 modules using dependency injection, plugins, observers, and service contracts to extend core functionality cleanly
от finsilabs★ 69 звёзд на GitHubОб этом скилле
Magento 2 Module Development
Overview
Build custom Magento 2 modules using the module architecture, dependency injection (DI), service contracts (interfaces), plugins (interceptors), observers, and the repository pattern. This skill covers the Magento 2 module skeleton, XML-based configuration, the Object Manager and DI container, custom REST/GraphQL API endpoints, and database schema management with db_schema.xml (declarative schema).
When to Use This Skill
- When building a custom module that adds new functionality to a Magento 2 store
- When extending or overriding core Magento behavior using plugins or preferences
- When creating custom REST API or GraphQL endpoints for headless integrations
- When adding custom database tables with declarative schema
- When implementing admin grids, forms, and system configuration
Core Instructions
Create the module skeleton
Every Magento 2 module lives in
app/code/Vendor/Moduleand requires at minimum two files:app/code/Acme/CustomModule/ ├── etc/ │ └── module.xml ├── registration.php ├── Api/ │ └── CustomRepositoryInterface.php ├── Model/ │ ├── CustomRepository.php │ └── ResourceModel/ ├── Controller/ ├── Block/ ├── view/ │ ├── frontend/ │ └── adminhtml/ └── Setup/ └── Patch/ └── Data/// registration.php <?php declare(strict_types=1); use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register( ComponentRegistrar::MODULE, 'Acme_CustomModule', __DIR__ );<!-- etc/module.xml --> <?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="Acme_CustomModule" setup_version="1.0.0"> <sequence> <module name="Magento_Catalog"/> <module name="Magento_Sales"/> </sequence> </module> </config>Define service contracts (interfaces) and implement them
Service contracts ensure your module provides a stable API that other modules and integrations can rely on:
// Api/Data/CustomEntityInterface.php <?php declare(strict_types=1); namespace Acme\CustomModule\Api\Data; interface CustomEntityInterface { const ENTITY_ID = 'entity_id'; const NAME = 'name'; const STATUS = 'status'; const CREATED_AT = 'created_at'; public function getEntityId(): ?int; public function getName(): string; public function setName(string $name): self; public function getStatus(): string; public function setStatus(string $status): self; public function getCreatedAt(): ?string; }// Api/CustomRepositoryInterface.php <?php declare(strict_types=1); namespace Acme\CustomModule\Api; use Acme\CustomModule\Api\Data\CustomEntityInterface; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Api\SearchResultsInterface; use Magento\Framework\Exception\NoSuchEntityException; interface CustomRepositoryInterface { /** * @throws NoSuchEntityException */ public function getById(int $id): CustomEntityInterface; public function save(CustomEntityInterface $entity): CustomEntityInterface; public function delete(CustomEntityInterface $entity): bool; public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface; }Implement the Model, ResourceModel, and Repository
// Model/CustomEntity.php <?php declare(strict_types=1); namespace Acme\CustomModule\Model; use Acme\CustomModule\Api\Data\CustomEntityInterface; use Magento\Framework\Model\AbstractModel; class CustomEntity extends AbstractModel implements CustomEntityInterface { protected function _construct(): void { $this->_init(\Acme\CustomModule\Model\ResourceModel\CustomEntity::class); } public function getEntityId(): ?int { return $this->getData(self::ENTITY_ID) ? (int) $this->getData(self::ENTITY_ID) : null; } public function getName(): string { return (string) $this->getData(self::NAME); } public function setName(string $name): CustomEntityInterface { return $this->setData(self::NAME, $name); } public function getStatus(): string { return (string) $this->getData(self::STATUS); } public function setStatus(string $status): CustomEntityInterface { return $this->setData(self::STATUS, $status); } public function getCreatedAt(): ?string { return $this->getData(self::CREATED_AT); } }// Model/ResourceMod
Установить magento-module-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
claude-codecursorgemini-clicopilotcodex-clikiroopencodeВложенные файлы
FAQ
Что делает скилл magento-module-development?
Build custom Magento 2 modules using dependency injection, plugins, observers, and service contracts to extend core functionality cleanly
Как установить скилл magento-module-development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл magento-module-development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic