magento-model-developer
БесплатноБез исполняемых скриптовНе проверенDesigns and implements data layer architecture for Magento 2. Use when creating data models, designing database schemas, implementing repositories, or working…
от maxnorm★ 34 звезды на GitHubОб этом скилле
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="Ent
Установить magento-model-developer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл 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.
Как установить скилл magento-model-developer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл magento-model-developer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic