Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

hyva-create-module

БесплатноБез исполняемых скриптовНе проверен

Create a new Magento 2 module in app/code/. This skill should be used when the user wants to create a module, scaffold a new module, generate module…

hyva-themesот hyva-themes★ 86 звёзд на GitHub

Об этом скилле

Create Magento 2 Module

This utility skill creates new Magento 2 modules in app/code/. It is designed to be called by other skills that need module scaffolding.

Command execution: For commands that need to run inside the development environment (e.g., bin/magento), use the hyva-exec-shell-cmd skill to detect the environment and determine the appropriate command wrapper.

Skill deps (read via <skill_path>/../{name}/SKILL.md, where <skill_path> is the directory containing this SKILL.md file): hyva-exec-shell-cmd

Parameters

When invoking this skill, the calling skill should provide:

Parameter Required Description
vendor Yes Vendor name in PascalCase (e.g., Acme)
module Yes Module name in PascalCase (e.g., CustomFeature)
description No Module description for composer.json (default: "[Vendor] [Module] module")
dependencies No Array of module dependencies for <sequence> in module.xml
composer_require No Object of composer requirements (package: version)

Workflow

Step 1: Validate Input

  • Verify vendor name is PascalCase (starts with uppercase, alphanumeric only)
  • Verify module name is PascalCase
  • Check that app/code/{Vendor}/{Module} does not already exist

Step 2: Create Directory Structure

app/code/{Vendor}/{Module}/
├── registration.php
├── composer.json
└── etc/
    └── module.xml

Step 3: Generate Files

registration.php

Use template assets/templates/registration.php.tpl:

  • Replace {{VENDOR}} with vendor name
  • Replace {{MODULE}} with module name

composer.json

Use template assets/templates/composer.json.tpl:

  • Replace {{VENDOR}} with vendor name (PascalCase)
  • Replace {{MODULE}} with module name (PascalCase)
  • Replace {{vendor_kebabcase}} with kebab-case, hyphenated vendor name
  • Replace {{module_kebabcase}} with kebab-case, hyphenated module name
  • Replace {{DESCRIPTION}} with description
  • Add entries from composer_require parameter to the require section

module.xml

Use template assets/templates/module.xml.tpl:

  • Replace {{VENDOR}} with PascalCase vendor name
  • Replace {{MODULE}} with PascalCase module name
  • Replace {{SEQUENCE}} with <sequence> block containing dependencies, or empty string if none

Step 4: Run Setup (Optional)

If the calling skill requests it, run bin/magento setup:upgrade using the hyva-exec-shell-cmd skill for the appropriate wrapper.

Step 5: Register for Tailwind Compilation (Optional)

Only when the user or the calling skill asked for the new module to ship its own Tailwind styles or config: register it for Tailwind compilation (optionally with the hyva-register-module-tailwind skill, if it is installed; without that skill, do not register it by hand and state in the final report that it is not registered). That skill adds the hyva_config_generate_before observer, the module's view/frontend/tailwind/ files, and regenerates app/etc/hyva-themes.json.

Do not do this, and do not ask about it, for a plain module scaffold.

Error Handling

Abort module creation and report the error to the calling skill when:

Condition Action
Vendor name not PascalCase Report: "Invalid vendor name '{name}': must start with uppercase letter and contain only alphanumeric characters"
Module name not PascalCase Report: "Invalid module name '{name}': must start with uppercase letter and contain only alphanumeric characters"
Directory already exists Report: "Module already exists at app/code/{Vendor}/{Module}"
Cannot create directory Report: "Failed to create directory app/code/{Vendor}/{Module}: {error}"
Cannot write file Report: "Failed to write {filename}: {error}"

If hyva-exec-shell-cmd skill is unavailable when Step 4 is requested, skip the setup:upgrade step and report: "Skipped setup:upgrade - hyva-exec-shell-cmd skill not available. Run manually: bin/magento setup:upgrade"

Template Placeholders

Placeholder Description Example
{{VENDOR}} Vendor name (PascalCase) Acme
{{MODULE}} Module name (PascalCase) CustomFeature
{{vendor_kebabcase}} Vendor name (kebab-case, split on capitals) acme
{{module_kebabcase}} Module name (kebab-case, split on capitals) custom-feature
{{DESCRIPTION}} Module description Acme CustomFeature module
{{SEQUENCE}} Module sequence XML or empty <sequence><module name="Magento_Catalog"/></sequence>

PascalCase to kebab-case Conversion

Convert module names by inserting a hyphen before each capital letter and lowercasing:

PascalCase kebab-case
CustomFeature custom-feature
ShoppingCartGraphQl shopping-cart-graph-ql
CmsComponents cms-components
`
Полный SKILL.md на GitHub

Установить hyva-create-module в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/templates/composer.json.tplassets/templates/module.xml.tplassets/templates/registration.php.tpl

FAQ

Что делает скилл hyva-create-module?

Create a new Magento 2 module in app/code/. This skill should be used when the user wants to create a module, scaffold a new module, generate module boilerplate, or set up a custom module. It handles registration.php, composer.json, module.xml generation with configurable dependencies. Trigger phrases include "create module", "new module", "scaffold module", "generate module".

Как установить скилл hyva-create-module?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hyva-create-module запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить hyva-create-module с