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

magento-model-developermagento 模型开发人员

Agent Skill

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

总安装

2,020

周安装

85

GitHub Stars

9

下载量

707
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

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

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

SKILL.md

Magento 2 Model Developer

Expert specialist in designing and implementing robust data layer architectures, creating efficient, scalable data models that serve as the foundation for enterprise e-commerce applications.

When to Use

  • Creating data models and entities
  • Designing database schemas
  • Implementing repository patterns
  • Working with EAV or flat table structures
  • Optimizing database queries
  • Building data collections

Data Architecture

  • Model Design: Create efficient entity models following Magento patterns
  • EAV vs Flat Tables: Choose optimal data storage strategies for different scenarios
  • Repository Pattern: Implement clean data access layers and service contracts
  • Collection Optimization: Build high-performance data collections and queries
  • Database Schema Design: Design normalized, efficient database structures

Model Development Process

1. Data Requirements Analysis

  • Business Requirements: Understand entity relationships and business rules
  • Performance Requirements: Plan for expected data volume and query patterns
  • Storage Strategy: Choose between EAV and flat table storage approaches
  • Relationship Mapping: Design entity relationships and dependencies
  • Scalability Planning: Plan for future growth and data expansion

2. Database Schema Design

  • Table Structure: Design efficient table structures and relationships
  • Data Types: Choose appropriate data types for optimal storage and performance
  • Indexing Strategy: Plan indexes for search, sorting, and filtering operations
  • Constraints: Implement proper database constraints and validation
  • Migration Scripts: Create database migration and upgrade scripts

3. Model Implementation

  • Entity Classes: Implement model classes with proper validation and logic
  • Resource Models: Create efficient database interaction layers
  • Collection Development: Build optimized collection classes with filtering
  • Repository Implementation: Create repository classes following service contracts
  • Factory Classes: Implement proper object factories and builders

4. Integration & Testing

  • API Integration: Integrate models with REST and GraphQL APIs
  • Cache Integration: Implement proper caching strategies for model data
  • Performance Testing: Validate model performance under expected load
  • Data Validation: Test data integrity and validation rules
  • Migration Testing: Test database migrations and data consistency

Model Types

Entity Model

<?php

declare(strict_types=1);

namespace Vendor\Module\Model;

use Magento\Framework\Model\AbstractModel;
use Vendor\Module\Model\ResourceModel\Entity as ResourceModel;

class Entity extends AbstractModel
{
    protected function _construct(): void
    {
        $this->_init(ResourceModel::class);
    }
}

Resource Model

<?php

declare(strict_types=1);

namespace Vendor\Module\Model\ResourceModel;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class Entity extends AbstractDb
{
    protected function _construct(): void
    {
        $this->_init('vendor_module_entity', 'entity_id');
    }
}

Collection

<?php

declare(strict_types=1);

namespace Vendor\Module\Model\ResourceModel\Entity;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Vendor\Module\Model\Entity;
use Vendor\Module\Model\ResourceModel\Entity as ResourceModel;

class Collection extends AbstractCollection
{
    protected function _construct(): void
    {
        $this->_init(Entity::class, ResourceModel::class);
    }
}

Repository Implementation

<?php

declare(strict_types=1);

namespace Vendor\Module\Model;

use Vendor\Module\Api\Data\EntityInterface;
use Vendor\Module\Api\EntityRepositoryInterface;
use Vendor\Module\Model\ResourceModel\Entity as ResourceModel;
use Magento\Framework\Exception\NoSuchEntityException;

class EntityRepository implements EntityRepositoryInterface
{
    /**
     * @param ResourceModel $resource
     */
    public function __construct(
        private readonly ResourceModel $resource
    ) {
    }

    /**
     * @param int $id
     * @return EntityInterface
     * @throws NoSuchEntityException
     */
    public function getById(int $id): EntityInterface
    {
        $entity = $this->resource->load($id);
        if (!$entity->getId()) {
            throw new NoSuchEntityException(__('Entity with id "%1" does not exist.', $id));
        }
        return $entity;
    }
}

Database Schema (db_schema.xml)

<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="vendor_module_entity" resource="default" engine="innodb" comment="Entity Table">
        <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
        <column xsi:type="varchar" name="name" length="255" nullable="false" comment="Name"/>
        <column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
        <index referenceId="VENDOR_MODULE_ENTITY_NAME" indexType="btree">
            <column name="name"/>
        </index>
    </table>
</schema>

EAV vs Flat Tables

EAV (Entity-Attribute-Value)

  • Use for entities with many optional attributes
  • Flexible attribute management
  • Higher query complexity
  • Use for products, customers, categories

Flat Tables

  • Use for entities with fixed attributes
  • Better query performance
  • Simpler data model
  • Use for orders, quotes, simple entities

Best Practices

Performance

  • Query Optimization: Optimize database queries and eliminate N+1 problems
  • Index Strategy: Design efficient database indexing
  • Collection Optimization: Use proper filters and pagination
  • Lazy Loading: Implement lazy loading for expensive operations
  • Caching: Cache frequently accessed data

Data Integrity

  • Validation: Implement comprehensive data validation
  • Constraints: Use database constraints where appropriate
  • Transactions: Use transactions for multi-step operations
  • Referential Integrity: Maintain proper foreign key relationships
  • Data Consistency: Ensure data consistency across operations

Code Quality

  • Service Contracts: Use interfaces for repositories
  • Type Hints: Use proper type hints throughout
  • Error Handling: Comprehensive error handling
  • Documentation: Document data models and relationships
  • Testing: Write tests for models and repositories

References

Focus on creating efficient, scalable data models that serve as a solid foundation for enterprise applications.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

32.15%
按下载量换算227

Claude

30.32%
按下载量换算214

Cursor

18.76%
按下载量换算133

Gemini CLI

8.86%
按下载量换算63

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills