Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

magento-module-developermagento 模块开发者

Agent Skill

magento-module-developer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,842

周安装

194

GitHub Stars

9

下载量

1,568
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:magento-module-developer(magento 模块开发者)
来源仓库:https://github.com/maxnorm/magento2-agent-skills
仓库路径:skills/magento-module-developer
安装命令:
npx skills add https://github.com/maxnorm/magento2-agent-skills --skill magento-module-developer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

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

简介

magento-module-developer 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 该技能适用于 Magento 2 模块开发相关的信息检索与筛选需求。

SKILL.md

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.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.68%
按下载量换算559

Claude

29.18%
按下载量换算458

Cursor

19.62%
按下载量换算308

Gemini CLI

9.44%
按下载量换算148

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills