Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
hyva-themes avatar

Hyva Create Module

  • 781 installs
  • 78 repo stars
  • Updated July 31, 2026
  • hyva-themes/hyva-ai-tools

hyva-create-module is a Magento 2 scaffolding skill that instantly generates a standards-compliant module with registration.php, composer.json, and module.xml in app/code/.

About

hyva-create-module is a hyva-themes/hyva-ai-tools utility skill that creates new Magento 2 modules in app/code/ with configurable dependencies. The skill generates registration.php, composer.json, and module.xml boilerplate and is designed to be called by other Hyvä skills needing module scaffolding, requiring the hyva-exec-shell-cmd skill for command execution inside the development environment. Developers reach for hyva-create-module when they need to create, scaffold, or generate a custom Magento 2 module rather than hand-writing registration and composer files.

  • Generates registration.php, composer.json, and module.xml in one step
  • Supports configurable vendor, module name, description, and dependencies
  • Handles <sequence> ordering for module dependencies automatically
  • Designed to be called by other skills for reliable scaffolding
  • Requires hyva-exec-shell-cmd for environment-aware command execution

Hyva Create Module by the numbers

  • 781 all-time installs (skills.sh)
  • +29 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #488 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hyva-themes/hyva-ai-tools --skill hyva-create-module

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs781
repo stars78
Last updatedJuly 31, 2026
Repositoryhyva-themes/hyva-ai-tools

How do you scaffold a new Magento 2 module?

Instantly scaffold a complete, standards-compliant Magento 2 module with registration.php, composer.json, and module.xml.

Who is it for?

Magento 2 developers using Hyvä AI tools who need fast standards-compliant module boilerplate in app/code/.

Skip if: Non-Magento PHP projects or manual module editing when scaffolding is unnecessary.

When should I use this skill?

User says create module, new module, scaffold module, or generate module for Magento 2 in app/code/.

What you get

Magento 2 module directory with registration.php, composer.json, and module.xml plus configured dependencies.

  • registration.php
  • composer.json
  • module.xml

By the numbers

  • Generates 3 core files: registration.php, composer.json, and module.xml

Files

SKILL.mdMarkdownGitHub ↗

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.

Parameters

When invoking this skill, the calling skill should provide:

ParameterRequiredDescription
vendorYesVendor name in PascalCase (e.g., Acme)
moduleYesModule name in PascalCase (e.g., CustomFeature)
descriptionNoModule description for composer.json (default: "[Vendor] [Module] module")
dependenciesNoArray of module dependencies for <sequence> in module.xml
composer_requireNoObject 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.

Error Handling

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

ConditionAction
Vendor name not PascalCaseReport: "Invalid vendor name '{name}': must start with uppercase letter and contain only alphanumeric characters"
Module name not PascalCaseReport: "Invalid module name '{name}': must start with uppercase letter and contain only alphanumeric characters"
Directory already existsReport: "Module already exists at app/code/{Vendor}/{Module}"
Cannot create directoryReport: "Failed to create directory app/code/{Vendor}/{Module}: {error}"
Cannot write fileReport: "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

PlaceholderDescriptionExample
{{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 descriptionAcme 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:

PascalCasekebab-case
CustomFeaturecustom-feature
ShoppingCartGraphQlshopping-cart-graph-ql
CmsComponentscms-components
MyModulemy-module

Usage by Other Skills

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": "*"}

Example Output

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 -->

Related skills

How it compares

Use hyva-create-module over generic PHP scaffolding skills when the target is Magento 2 app/code/ module structure within the Hyvä AI tools chain.

FAQ

What files does hyva-create-module generate?

hyva-create-module scaffolds registration.php, composer.json, and module.xml for a new Magento 2 module in app/code/, with configurable module dependencies.

What does hyva-create-module depend on?

hyva-create-module requires the hyva-exec-shell-cmd skill to run commands inside the Magento development environment and is intended as a utility for other Hyvä skills.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.