module-scaffold

Create Magento 2 module skeleton files with registration.php, module.xml, and composer.json.

2|3|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/caravanglory/magehub --skill module-scaffold-caravanglory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: module-scaffold
Source: https://github.com/caravanglory/magehub/tree/main/skills/module/module-scaffold
Command: npx skills add https://github.com/caravanglory/magehub --skill module-scaffold-caravanglory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the repetitive work of starting or repairing Magento 2 modules by generating the core files and structure Magento expects.

Core Features & Use Cases

  • Module Bootstrap: Creates the minimal module foundation, including registration, module declaration, and Composer autoload metadata.
  • Dependency Sequencing: Adds only the sequence entries needed for modules that depend on existing Magento configuration or schema.
  • Use Case: Use it when a developer needs to start a new app code module, fix a missing module declaration, or prepare a package for Magento discovery.

Quick Start

Ask the assistant to scaffold a new Magento 2 module named Vendor_Module with registration.php, module.xml, and composer.json.

Frequently Asked Questions about module-scaffold

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new Magento 2 module with the correct skeleton files?

Scaffold a Magento 2 module by generating registration.php, etc/module.xml, and composer.json to establish the minimal module foundation for Magento discovery. This creates the core skeleton structure Magento expects for app/code or Composer-based packages.

What files do I need to fix a missing Magento module declaration?

Fixing a missing Magento module declaration requires repairing registration.php, etc/module.xml, and composer.json. These files restore module discovery and ensure PSR-4 autoloading aligns with Magento validation.

Does scaffolding a Magento module require PSR-4 autoloading in composer.json?

Yes, scaffolding a Magento module requires PSR-4 autoloading in composer.json to ensure proper class discovery. This configuration aligns the module with Magento validation and bootstrap requirements.

How do I set up dependency sequencing in a Magento module.xml file?

Set up dependency sequencing in module.xml by adding only the sequence entries needed for modules depending on existing Magento configuration or schema. This ensures correct loading order during bootstrap.

Can I use module scaffolding for both app/code and Composer-based Magento packages?

Yes, module scaffolding applies to both app/code and Composer-based Magento package setups. It generates the registration.php, module.xml, and composer.json files required for Magento discovery across both installation types.