MCPInstall

magento-module-developer

Creates robust, maintainable, and extensible Magento 2 modules following enterprise architecture patterns. Use when developing custom modules, implementing new functionality, creating extensions, or building Magento 2 components. Masters dependency injection, service contracts, repository patterns, and module architecture.

Installs
439
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/maxnorm/magento2-agent-skills --skill magento-module-developer
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads magento-module-developer automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Magento 2 Module Developer

Expert specialist in creating well-architected, maintainable, and extensible Magento 2 modules that seamlessly integrate with Magento's core framework following Adobe Commerce best practices.

When to Use

  • Creating new Magento 2 modules or extensions
  • Implementing custom functionality
  • Building module architecture and structure
  • Setting up module dependencies and configuration
  • Implementing service contracts and APIs
  • Creating database schemas and data patches

Module Development Process

1. Planning & Architecture

  • Requirements Analysis: Break down functional and non-functional requirements
  • Architecture Design: Plan module structure and integration points
  • Database Design: Design entity relationships and data flow
  • API Design: Define service contracts and data transfer objects
  • Performance Considerations: Plan for scalability and optimization

2. Module Setup

  • Module Structure: Create proper directory structure following Magento conventions:
    app/code/Vendor/ModuleName/
    ├── etc/
    │   ├── module.xml
    │   ├── di.xml
    │   ├── routes.xml
    │   ├── system.xml
    │   ├── acl.xml
    │   └── db_schema.xml
    ├── Model/
    ├── Block/
    ├── Controller/
    ├── Api/
    ├── view/
    └── registration.php
    
  • Registration: Create registration.php and composer.json
  • Module Declaration: Create etc/module.xml with proper dependencies
  • Version Control: Set up Git with proper .gitignore

3. Core Implementation

Models & Entities

  • Entity models extending Magento\Framework\Model\AbstractModel
  • Resource models extending Magento\Framework\Model\ResourceModel\Db\AbstractDb
  • Collections extending Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
  • Use db_schema.xml for database schema definitions

Repositories

  • Implement repository pattern for data access
  • Create repository interfaces in Api/ directory
  • Implement repositories in Model/ directory
  • Use service contracts for clean API interfaces

Service Classes

  • Business logic in service classes
  • Use dependency injection for all dependencies
  • Implement service contracts for extensibility

Controllers

  • Frontend controllers extending Magento\Framework\App\Action\Action
  • Admin controllers extending Magento\Backend\App\Action
  • API controllers implementing service contracts

4. Configuration Files

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="Vendor_ModuleName" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Store"/>
        </sequence>
    </module>
</config>

di.xml

  • Configure dependency injection
  • Define preferences, virtual types, plugins
  • Use proper scope (global, frontend, adminhtml, webapi_rest, webapi_soap)

db_schema.xml

  • Define database tables, columns, indexes
  • Use proper data types and constraints
  • Follow Magento naming conventions

Design Patterns & Principles

Service Contracts

  • Create interfaces in Api/ directory
  • Implement clean API interfaces
  • Use data transfer objects (DTOs) for data exchange
  • Maintain backward compatibility

Repository Pattern

  • Separate data access from business logic
  • Use repositories for all data operations
  • Implement proper error handling
  • Support transactions where needed

Dependency Injection

  • Use constructor injection only
  • Avoid service locator pattern
  • Leverage Magento's DI container
  • Use type hints for all dependencies

Plugin System

  • Use plugins to extend functionality
  • Prefer before/after plugins over around plugins
  • Avoid around plugins unless necessary
  • Document plugin execution order

Event/Observer Pattern

  • Dispatch events for extensibility
  • Implement observers for loose coupling
  • Use proper event naming conventions
  • Document event data structure

Module Components

Backend Components

  • Models: Entity models, resource models, collections
  • Repositories: Data access layer implementations
  • Services: Business logic and application services
  • Controllers: Admin controllers and API endpoints
  • Blocks: Admin interface building blocks
  • UI Components: Admin grids, forms, and components

Frontend Components

  • Controllers: Frontend page controllers and actions
  • Blocks: View logic and data preparation
  • Templates: PHTML template files with proper escaping
  • Layout Files: XML layout configurations
  • JavaScript: Frontend interaction and AJAX functionality
  • CSS/LESS: Styling and responsive design

Database Components

  • db_schema.xml: Database schema definitions
  • Data Patches: Data migration and setup scripts
  • Schema Patches: Database structure modifications
  • Indexers: Custom search and filter indexers

Advanced Features

API Development

  • Create REST endpoints with proper authentication
  • Implement GraphQL resolvers and schemas
  • Design clean API interfaces
  • Implement rate limiting and security measures

Event System Integration

  • Dispatch custom events for extensibility
  • Implement event observers
  • Create before/after/around plugins
  • Use virtual types for flexibility

Caching & Performance

  • Implement custom cache types and tags
  • Handle cache invalidation properly
  • Use lazy loading for expensive operations
  • Optimize database queries and joins

Multi-Store Support

  • Handle multi-store configurations
  • Implement proper configuration scopes
  • Ensure proper data separation
  • Support store context switching

Best Practices

Code Quality

  • Follow PSR-12 and Magento coding standards
  • Use declare(strict_types=1); in all PHP files
  • Implement comprehensive type hinting
  • Write unit and integration tests
  • Maintain high code coverage

Security

  • Implement input validation
  • Use proper output escaping in templates
  • Implement CSRF protection
  • Enforce proper access control (ACL)
  • Handle sensitive data appropriately

Performance

  • Optimize database queries
  • Use proper indexes
  • Implement caching strategies
  • Monitor memory usage
  • Optimize collection loading

Extensibility

  • Provide extension points via plugins
  • Dispatch events for third-party integration
  • Allow configuration without code changes
  • Use interface segregation
  • Maintain backward compatibility

Testing

  • Unit Tests: Test individual classes and methods
  • Integration Tests: Test module integration with core
  • Functional Tests: End-to-end test scenarios
  • Static Analysis: Use PHPStan/Psalm for code quality

Documentation

  • Technical documentation for developers
  • User documentation for end users
  • API documentation for all public APIs
  • Installation guides
  • Troubleshooting guides

References

Focus on creating modules that are maintainable, extensible, and aligned with Magento's enterprise-grade architecture principles.

FAQ

What does the magento-module-developer skill do?

Creates robust, maintainable, and extensible Magento 2 modules following enterprise architecture patterns. Use when developing custom modules, implementing new functionality, creating extensions, or building Magento 2 components. Masters dependency injection, service contracts, repository patterns, and module architecture.

How do I install magento-module-developer?

Run npx skills add https://github.com/maxnorm/magento2-agent-skills --skill magento-module-developer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/magento-module-developer/ (personal) or .claude/skills/magento-module-developer/ (project).

Which AI agents can use magento-module-developer?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is magento-module-developer safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains magento-module-developer?

It is published by maxnorm in maxnorm/magento2-agent-skills. It has 439 recorded installs.

More from maxnorm/magento2-agent-skills

View all →

magento-hyva-specialist

maxnorm/magento2-agent-skills

Develops high-performance Magento 2 storefronts using Hyvä theme framework. Use when working with Hyvä themes, Alpine.js, Tailwind CSS, or modern frontend development. Masters Alpine.js architecture, Tailwind CSS styling, and performance optimization for blazing-fast e-commerce experiences.

Frontend & Design857 installs

magento-code-reviewer

maxnorm/magento2-agent-skills

Reviews Magento 2 code for quality, security, performance, and compliance with PSR-12 and Magento coding standards. Use proactively when reviewing code, before commits, during pull requests, or when ensuring code quality. Enforces strict type declarations, proper dependency injection, security best practices, and performance optimization.

Security477 installs

magento-performance-analyst

maxnorm/magento2-agent-skills

Conducts comprehensive Magento 2 performance analysis and optimization. Use when analyzing performance bottlenecks, profiling applications, optimizing database queries, or improving system scalability. Masters profiling tools, database optimization, and enterprise-scale performance tuning.

magento-frontend-developer

maxnorm/magento2-agent-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design400 installs

magento-xml-specialist

maxnorm/magento2-agent-skills

Creates XML configurations for Magento 2 including layout XML, dependency injection, system configuration, and module definition. Use when working with XML configuration files, layout XML, di.xml, or system.xml. Masters XML schema design, validation, and configuration management.

Frontend & Design376 installs

magento-issue-debugger

maxnorm/magento2-agent-skills

Open the skill to read its SKILL.md instructions.

AI & Agents255 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.