skills/hyva-create-module/SKILL.md
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".
npx skillsauth add hyva-themes/hyva-ai-tools hyva-create-moduleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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) |
app/code/{Vendor}/{Module} does not already existapp/code/{Vendor}/{Module}/
├── registration.php
├── composer.json
└── etc/
└── module.xml
Use template assets/templates/registration.php.tpl:
{{VENDOR}} with vendor name{{MODULE}} with module nameUse template assets/templates/composer.json.tpl:
{{VENDOR}} with vendor name (PascalCase){{MODULE}} with module name (PascalCase){{vendor_kebabcase}} with kebab-case, hyphenated vendor name{{module_kebabcase}} with kebab-case, hyphenated module name{{DESCRIPTION}} with descriptioncomposer_require parameter to the require sectionUse template assets/templates/module.xml.tpl:
{{VENDOR}} with PascalCase vendor name{{MODULE}} with PascalCase module name{{SEQUENCE}} with <sequence> block containing dependencies, or empty string if noneIf the calling skill requests it, run bin/magento setup:upgrade using the hyva-exec-shell-cmd skill for the appropriate wrapper.
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"
| 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> |
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 |
| MyModule | my-module |
Skills should reference this skill for module creation:
To create the module, use the `hyva-create-module` skill with:
- vendor: "Acme"
- module: "CmsComponents"
- dependencies: ["Hyva_CmsBase"]
- composer_require: {"hyva-themes/commerce-module-cms": "*"}
For vendor Acme, module CmsComponents, with Hyva_CmsBase dependency:
app/code/Acme/CmsComponents/registration.php:
<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Acme_CmsComponents', __DIR__);
app/code/Acme/CmsComponents/composer.json:
{
"name": "acme/module-cms-components",
"description": "Acme CmsComponents module",
"type": "magento2-module",
"require": {
"php": ">=8.1",
"hyva-themes/commerce-module-cms": "*"
},
"autoload": {
"files": ["registration.php"],
"psr-4": {
"Acme\\CmsComponents\\": ""
}
}
}
app/code/Acme/CmsComponents/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_CmsComponents">
<sequence>
<module name="Hyva_CmsBase"/>
</sequence>
</module>
</config>
<!-- Copyright © Hyvä Themes https://hyva.io. All rights reserved. Licensed under OSL 3.0 -->documentation
Apply Hyva UI template-based components to a Hyvä theme. This skill should be used when the user wants to add, install, or apply a Hyva UI component (such as header, footer, gallery, menu, minicart, etc.) to their Hyvä theme. It lists available non-CMS components and their variants, displays component README instructions, and copies component files to the theme directory.
data-ai
List all Hyvä theme paths in a Magento 2 project. This skill should be used when the user wants to find Hyvä themes, list available themes, discover theme paths, or when other skills need to locate Hyvä themes. Trigger phrases include "list hyva themes", "find themes", "show themes", "available themes", "theme paths".
development
Generate responsive image code for Hyvä Theme templates using the Media view model. This skill should be used when the user wants to render images in a Hyvä template, create responsive picture elements, add hero images, product images, or any image that needs responsive breakpoints. Trigger phrases include "render image", "add image to template", "responsive image", "picture element", "hero image", "responsive banner", "image for mobile and desktop", or "banner image".
development
Write Playwright tests for Hyvä themes with Alpine.js components. This skill should be used when writing e2e tests, creating page objects, or debugging selector issues in Playwright tests for Hyvä Magento storefronts. Trigger phrases include "write playwright test", "playwright alpine", "test hyva page", "e2e test", "playwright selector".