module-create
Skill4 starsChanged 56 days agoMITView on GitHub
Create a new Magento 2 module under the project's vendor namespace. Use when asked to create, scaffold, generate, or build a Magento 2 module, extension, component, or package. Generated files pass all 12 magento2-tools:review categories. Surface-driven: creates only files for declared surfaces. Works without a running Magento instance or Docker. For a standalone admin form use magento2-tools:admin-form, a GraphQL surface magento2-tools:graphql, or one EAV attribute magento2-tools:eav-attribute.
In this repository35 other files it gives its agents.
- a11y-auditSkill
- admin-formSkill
- admin-listingSkill
- auditSkill
- breeze-adaptSkill
- breeze-compatSkill
- breeze-themeSkill
- cli-commandSkill
- contextSkill
- data-migrationSkill
- debugSkill
- deploySkill
- docsSkill
- eav-attributeSkill
- extension-pointSkill
- featureSkill
- fixSkill
- frontendSkill
- graphqlSkill
- i18nSkill
- indexerSkill
- lintSkill
- marketplaceSkill
- message-queueSkill
- perf-auditSkill
- releaseSkill
- remediateSkill
- reviewSkill
- securitySkill
- system-configSkill
- test-generateSkill
- triageSkill
- upgradeSkill
- webapiSkill
- widgetSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. About 0 are common, 8 are distinctive, and 23 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
23
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Create Magento 2 modules surface-by-surface.
- Distinctive: line 23
Never guess: If module name, purpose, or surfaces are ambiguous, ask before generating any files.
- Distinctive: line 24
Surface-driven: Create only files required by explicitly declared surfaces.
- Very specific: line 26
Use a template for every file: Every file type listed in references/surfaces.md maps to a template under templates/.
- Distinctive: line 28
Compliance-first: Every generated file satisfies all applicable review categories on creation.
- Distinctive: line 29
No compliance TODOs remain after the skill completes.
- Very specific: line 30
Script-then-fill: Use ${CLAUDE_SKILL_DIR}/scripts/create-dirs.sh for directory structure.
- Very specific: line 33
Verify before done: Run available static tools after generation.
- Very specific: line 35
Generate surfaces in order: When surfaces are independent, follow: core → persistence → service_contracts → admin_config → admin_ui → …
- Very specific: line 58
Read $ARGUMENTS. If empty: ask *"What is the module name (PascalCase, e.g.
- Very specific: line 63
Use {ctx.vendor} for {Vendor}, {ctx.php_constraint} for the composer.json php value, {ctx.framework_constraint} for magento/framework, and …
- Very specific: line 66
If {ctx.php_constraint} is null and the project has no src/composer.json, ask the user.
- Distinctive: line 91
Ask them all at once — do not interrupt mid-generation.
- Very specific: line 96
Run ${CLAUDE_SKILL_DIR}/scripts/create-dirs.sh {Vendor} {ModuleName} {surface...} from the workspace root (prints a one-line summary.
- Distinctive: line 101
Verify exit code 0 before proceeding.
- Very specific: line 102
If the script is unavailable: use the Bash tool with mkdir -p for each surface's directory list from references/surfaces.md.
- Very specific: line 113
Stamp copyright headers (required, run first): After all files are generated, run …
- Very specific: line 125
Run php -l on every generated PHP file.
- Very specific: line 126
Run xmllint --noout on every generated XML file.
- Very specific: line 127
Run composer validate --no-check-publish on the generated composer.json.
- Very specific: line 132
Run available quality tools opportunistically (phpcs, phpstan) using the same probing approach as review.
- Very specific: line 134
Do NOT run bin/magento setup:di:compile, setup:upgrade, or setup:db-declaration:generate-whitelist automatically — offer them as next steps.
- Very specific: line 153
When rest_api or graphql is declared, write contract-derived request/response payload examples under docs/api-examples/ and reference them …
- Very specific: line 155
Add other helpful artifacts (Postman collection, ER/sequence diagram) under docs/artifacts/ as the surfaces warrant.
- Very specific: line 162
Run the completeness checklist in references/documentation-guide.md.
- Very specific: line 172
When persistence surface declared — generate schema whitelist: docker compose exec -u magento php bin/magento …
- Very specific: line 175
Run the deploy skill to enable and deploy.
- Very specific: line 176
Run the review skill on {Vendor}/{ModuleName} to confirm the full quality gate (PHPCS, PHPStan, PHPUnit) and all 12 review categories pass.
- Distinctive: line 192
Does not create interfaces, models, controllers, templates, or tests.
- Very specific: line 199
After creation, list all skipped surfaces and state: *"Run /module-create {ModuleName} {surface} to add a surface when ready."*
- Distinctive: line 219
When the user's description is ambiguous, ask about surfaces explicitly before building the plan.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Magento 2 Module Create
Create Magento 2 modules surface-by-surface. Every file generated must pass the review
checklist with zero post-creation fixes required.
Core Rules
- Resolve context first. Invoke the
contextskill at the start of Step 1 and use its resolved values for{Vendor},{runner},{magento_cli},{php_constraint}, and{framework_constraint}. Do not re-resolve these independently. - Never guess. If module name, purpose, or surfaces are ambiguous, ask before generating any files.
- Surface-driven. Create only files required by explicitly declared surfaces. Do not create empty placeholder directories or stub files for undeclared surfaces.
- Use a template for every file. Every file type listed in
references/surfaces.mdmaps to a template undertemplates/. Do not invent file content from prose rules when a template exists. - Compliance-first. Every generated file satisfies all applicable review categories on creation. No compliance TODOs remain after the skill completes.
- Script-then-fill. Use
${CLAUDE_SKILL_DIR}/scripts/create-dirs.shfor directory structure; usetemplates/as the base for each file type; use AI to fill in module-specific implementation content. - Verify before done. Run available static tools after generation. Do not mark creation complete if
any PHP file fails
php -lor any XML file failsxmllint. - Generate surfaces in order. When surfaces are independent, follow:
core→persistence→service_contracts→admin_config→admin_ui→frontend_ui→rest_api→graphql→cron→queue→extensions. - Document before report (required). Step 6 generates the module's documentation set; Step 7
(report) may not start until it exists on disk and is current. The set is code-derived (this
skill assumes no running instance) and is delegated in full to
docs: README, CHANGELOG, technical reference, developer guide (when a public surface exists), and user guide (when a UI/config surface exists, with screenshots or named placeholders when no instance is available). This skill does not hand-write any of those. When a REST/GraphQL surface is declared, this skill separately writes request/response payload examples, plus other helpful artifacts as the surfaces warrant. Reduced in Quick Create Mode; refresh-only in--mode=augment. The delegation, per-mode scope, and completeness gate live inreferences/documentation-guide.md. - Source of truth. Generate from templates → shared references → baked-in Magento 2 knowledge
→ official Magento/Adobe docs (live-fetched only when uncertain). Do NOT read, grep, or "study"
other modules under
app/code/vendor/*/Magento core to infer conventions, entity shapes, naming, or wiring. Narrow exceptions: the target module/class of this operation, and the specific contract of a module this code explicitly depends on. Affirm sources in the final report. Seecontext/references/source-of-truth.md. - After a context compaction, re-read the reference for the phase in progress before continuing.
Workflow
- Resolve module identity and load project context.
- Read
$ARGUMENTS. If empty: ask "What is the module name (PascalCase, e.g.OrderExport) and which surfaces does it need?" and wait. - Validate module name: PascalCase, letters only, 2–50 characters. Reject anything else.
- Invoke
contextvia theSkilltool (or run${CLAUDE_PLUGIN_ROOT}/skills/context/scripts/resolve-context.sh). Capture the JSON as{ctx}. Use{ctx.vendor}for{Vendor},{ctx.php_constraint}for the composer.jsonphpvalue,{ctx.framework_constraint}formagento/framework, and{ctx.runner}/{ctx.magento_cli}for any tool invocations. If{ctx.vendor}is null, ask the user for the vendor prefix. If{ctx.php_constraint}is null and the project has nosrc/composer.json, ask the user. - Set
{module_lower}= ModuleName converted to snake_case (seecontext/references/naming.md). - Resolve the target path:
{ctx.module_dir}/{Vendor}/{ModuleName}(typically{ctx.magento_root}/app/code/{Vendor}/{ModuleName}). Abort if the directory already exists unless--mode=augmentis set. - Map the user's description to surfaces using
references/surfaces.md. - Present a module profile — vendor, name, path, surfaces, estimated file count — and confirm before proceeding for multi-surface modules. Single-surface requests may proceed without confirmation.
- Read
- Build creation plan.
- For each declared surface, list the exact files to create using
references/surfaces.md. - Shared files created regardless of surfaces:
registration.php,etc/module.xml,composer.json,etc/di.xml,README.md,CHANGELOG.md,LICENSE.txt,.gitignore. README.mdstarts as a minimal stub — just# {ModuleName}and one sentence describing what the module does — so later steps have a file to reference. Do not hand-write Features, Installation, Configuration, Public API, or other sections here: Step 6 overwrites the stub with the full generated README viadocs.- Auto-add
i18n/en_US.csvwhen any UI surface (admin_ui,frontend_ui) is declared. - Auto-add a minimal MFTF smoke test under
Test/Mftf/(templates/mftf-test.xml, plustemplates/mftf-actiongroup.xmlfor UI surfaces) when any UI surface (admin_ui,frontend_ui) is declared — Marketplace weighs functional coverage alongside the unit tests. - Auto-add
Test/Unit/for all non-vendor modules. - Gather open questions about entity names, service method signatures, or config paths. Ask them all at once — do not interrupt mid-generation.
- For modules with ≥ 3 surfaces or ≥ 20 estimated PHP files: present the full plan and ask for confirmation before generating.
- For each declared surface, list the exact files to create using
- Create directory structure.
- Run
${CLAUDE_SKILL_DIR}/scripts/create-dirs.sh {Vendor} {ModuleName} {surface...}from the workspace root (prints a one-line summary;VERBOSE=1adds the per-surface lines and directory tree). Resolve{Vendor}fromcontext.vendorand exportMODULE_DIRfromcontext.module_dirso the script writes to the correct path (it auto-detectssrc/app/codevsapp/codeifMODULE_DIRis not set). - Verify exit code 0 before proceeding.
- If the script is unavailable: use the
Bashtool withmkdir -pfor each surface's directory list fromreferences/surfaces.md. Report unavailability; do not abort.
- Run
Generate implementation files.
- Work surface by surface in the order from the "Generate surfaces in order" Core Rule, using
templates/as the base for every file. Applyreferences/naming-conventions.mdandreferences/composer-metadata.md; PHPDoc on every public method. - No
ObjectManager::getInstance(), noecho/print/die()/exit()/var_dump()/eval()/@; do not hand-write the copyright header (Step 5 stamps it). - Read
references/workflow-surfaces.mdbefore starting this step.
- Work surface by surface in the order from the "Generate surfaces in order" Core Rule, using
- Verify compliance.
- Stamp copyright headers (required, run first). After all files are generated, run
${CLAUDE_PLUGIN_ROOT}/skills/context/scripts/add-license-headers.sh {module_path} {Vendor}. It prepends the standard header (pointing atLICENSE.txt) to every.phpfile, idempotently — safe to re-run in--mode=augment. If the script is unavailable, prepend the block by hand to each PHP file:<?php /** * Copyright © {Vendor}. All rights reserved. * See LICENSE.txt for license details. */ - Run
php -lon every generated PHP file. Fix syntax errors before proceeding. - Run
xmllint --noouton every generated XML file. Fix well-formedness errors before proceeding. - Run
composer validate --no-check-publishon the generatedcomposer.json. - Run the creation gate:
${CLAUDE_SKILL_DIR}/scripts/verify-created.sh {module_path}. It checks the required files (incl.LICENSE.txt), composer metadata (no wildcard constraints,authors), and the copyright header on every PHP file. Treat any ✗ as blocking — fix and re-run before Step 6. Output is quiet by default (every ⚠/✗ + a tally);VERBOSE=1adds the per-check ✓ lines. - Run available quality tools opportunistically (phpcs, phpstan) using the same probing approach as
review. Unavailable tools are reported, not treated as failures. - Do NOT run
bin/magento setup:di:compile,setup:upgrade, orsetup:db-declaration:generate-whitelistautomatically — offer them as next steps. - Record all results: pass / fail / skipped per check.
- Stamp copyright headers (required, run first). After all files are generated, run
- Generate documentation (required).
- Load
references/documentation-guide.md. It defines the delegation, the per-mode scope, screenshot handling, API payload examples, and the completeness gate. - Delegate the full module doc set to
docsfor the created module:
This single call (re)generatesSkill: docs Args: --module={Vendor}_{ModuleName}README.md(overwriting the Step 2 stub),CHANGELOG.md,docs/technical-reference.md,docs/developer-guide.md(when the module exposes a public surface — service contracts, REST/GraphQL, events, plugins), anddocs/user-guide.md(whenadmin_config,admin_ui, orfrontend_uiis declared, including screenshot placeholders when no running instance is available) — all straight from the module's own code. This skill does not hand-write any of these;docsowns their section structure, per-surface omission rules, and content derivation (see itsreferences/doc-structure.md). - When
rest_apiorgraphqlis declared, write contract-derived request/response payload examples underdocs/api-examples/and reference them from the developer guide. - Add other helpful artifacts (Postman collection, ER/sequence diagram) under
docs/artifacts/as the surfaces warrant. Omit those that do not apply — no empty placeholder files. - Quick Create Mode: the delegation call above naturally produces
README.md,CHANGELOG.md, anddocs/technical-reference.mdwhen no other surfaces are declared —docsalways emits the technical reference, even for a surface-less module.--mode=augment: re-run the delegation so every doc reflects the augmented surfaces — never leave a doc describing the pre-augment module. - Run the completeness checklist in
references/documentation-guide.md. Do not proceed to Step 7 until every required artifact for the current mode exists on disk.
- Load
- Report and offer next steps.
- Show the created file tree (all files, relative to module root).
- Show the creation checklist status from
references/creation-checklist.md(all 12 categories, each marked ✓ compliant / ⚠ partial / ✗ gap). - Show verification results.
- Offer next steps in priority order:
- Fill in implementation TODOs (list specific files and what to add).
- When persistence surface declared — generate schema whitelist:
docker compose exec -u magento php bin/magento setup:db-declaration:generate-whitelist --module-name={Vendor}_{ModuleName} - Run the
deployskill to enable and deploy. - Run the
reviewskill on{Vendor}/{ModuleName}to confirm the full quality gate (PHPCS, PHPStan, PHPUnit) and all 12 review categories pass. - Marketplace preflight (when the module is bound for Adobe Marketplace/EQP): run the
marketplaceskill (or its read-only${CLAUDE_PLUGIN_ROOT}/skills/marketplace/scripts/check-readiness.sh {module_path}) for a readiness verdict before packaging/release. The Step 5 gate already covers the common blockers (LICENSE, bounded constraints, headers,authors).
Quick Create Mode
Triggered when the user includes: quick, minimal, skeleton, bare, or scaffold only.
Creates only the core surface files:
registration.php, etc/module.xml, composer.json, etc/di.xml, README.md, CHANGELOG.md,
LICENSE.txt, .gitignore. The copyright-header stamp (Step 5) still runs.
Does not create interfaces, models, controllers, templates, or tests. All files must still fully comply with Categories 1, 2, and 3 of the review checklist.
Documentation (Step 6) is reduced to README.md + CHANGELOG.md + docs/technical-reference.md
(what docs always produces for a surface-less module) — the rest of the full
doc set (developer/user guides, API examples) is generated when surfaces are added.
After creation, list all skipped surfaces and state:
"Run /module-create {ModuleName} {surface} to add a surface when ready."
Surface-to-File Mapping
Load references/surfaces.md when building the creation plan. Do not assume surface contents from memory.
| Surface | Common trigger phrases |
core | Always included |
persistence | database, table, entity, model, resource model, CRUD, schema, store data |
service_contracts | service, contract, repository, API interface, business logic |
admin_config | configuration, settings, system.xml, admin config, store settings |
admin_ui | admin grid, admin form, admin panel, backend, adminhtml |
frontend_ui | storefront, frontend, customer-facing, block, template, page |
rest_api | REST, web API, endpoint, webapi.xml |
graphql | GraphQL, resolver, query, mutation |
cron | cron, scheduled task, recurring job |
queue | message queue, consumer, async, RabbitMQ |
When the user's description is ambiguous, ask about surfaces explicitly before building the plan.
Optional Parallel Create
Parallel agent creation requires explicit user authorization. When a module meets the threshold
criteria in references/parallel-create.md (≥ 4 surfaces or ≥ 30 estimated PHP files), offer
parallel creation to the user and wait for a yes/no answer before proceeding. Read
references/parallel-create.md before spawning agents.
Reference Files
references/surfaces.md: surface-to-file mapping, per-file template references, directory lists, and cross-surface integration rules.references/creation-checklist.md: per-category creation requirements mapping all 12 review categories to concrete generation rules.references/naming-conventions.md: legacy local naming reference — pointer to the sharedcontext/references/naming.md(authoritative).references/composer-metadata.md:composer.jsonconstraints, autoload format, and metadata rules.references/phpdoc-rules.md: full PHPDoc generation rules for all class types — scope, format, FQCN requirements, brevity rules, and common mistakes to avoid.references/parallel-create.md: agent split guidance for large or complex modules.references/docs-format.md: pointer todocs's templates andreferences/doc-structure.md— this skill does not define its own README/CHANGELOG format.references/documentation-guide.md: Step 6 delegation todocsfor the full doc set, screenshot handling, contract-derived API examples, per-mode scope, and the completeness gate.references/workflow-surfaces.md: Step 4 detail — per-file PHP/XML/phtml/controller generation rules.references/template-inventory.md: per-surface list of thetemplates/files.context/references/source-of-truth.md— source-of-truth hierarchy + the no-unrelated-module-scanning rule (allowed reads, live-doc fetch protocol, report affirmation).
Template Inventory
templates/ has a template for every file type any surface can produce; look one up via references/surfaces.md and never invent file content from prose.
Read references/template-inventory.md for the per-surface template list.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

