MCPInstall

magento-model-developer

Designs and implements data layer architecture for Magento 2. Use when creating data models, designing database schemas, implementing repositories, or working with EAV/flat table structures. Masters entity design, repository patterns, collections, and database optimization.

Installs
193
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-model-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-model-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 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.

FAQ

What does the magento-model-developer skill do?

Designs and implements data layer architecture for Magento 2. Use when creating data models, designing database schemas, implementing repositories, or working with EAV/flat table structures. Masters entity design, repository patterns, collections, and database optimization.

How do I install magento-model-developer?

Run npx skills add https://github.com/maxnorm/magento2-agent-skills --skill magento-model-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-model-developer/ (personal) or .claude/skills/magento-model-developer/ (project).

Which AI agents can use magento-model-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-model-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-model-developer?

It is published by maxnorm in maxnorm/magento2-agent-skills. It has 193 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-module-developer

maxnorm/magento2-agent-skills

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.

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

Creates comprehensive Magento 2 frontend solutions. Use when developing frontend features, working with layout XML, templates, JavaScript, or responsive design. Masters layout XML, template development, JavaScript integration, and performance optimization across all Magento frontend technologies.

Frontend & Design401 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

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases462.2K installs

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases393.5K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases392.3K installs

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases390.8K installs

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases384.4K installs

Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.

OfficialData & Databases378.9K installs