dist/cursor/magento2-commerce/skills/magento-eav-attributes/SKILL.md
Work with Magento 2 EAV (Entity-Attribute-Value) system — create custom attributes, attribute sets, manage EAV tables, and understand the EAV data model. Use when adding product/category/customer attributes or working with the attribute system.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins magento-eav-attributesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch live docs:
site:developer.adobe.com commerce php development components attributes for attribute development guidesite:developer.adobe.com commerce php tutorials backend custom-attributes for attribute creation tutorialmagento 2 EAV attribute data patch for current patterns using data patchesEntity-Attribute-Value is Magento's flexible storage pattern. Instead of one column per attribute, values are stored in separate typed tables. This allows merchants to add unlimited attributes without schema changes.
Four entity types use EAV:
catalog_product_entity)catalog_category_entity)customer_entity)customer_address_entity)Each entity has typed value tables:
*_entity — base entity table (entity_id, sku, type_id, etc.)*_entity_varchar — short text values*_entity_int — integer values (including boolean, select)*_entity_decimal — decimal/price values*_entity_datetime — date/time values*_entity_text — long text valuesKey properties when creating attributes:
The modern approach uses Data Patches with EavSetupFactory:
Setup/Patch/Data/EavSetupFactory (or CategorySetupFactory for categories)$eavSetup->addAttribute() with entity type, code, and propertiesFor select/multiselect attributes, source models provide options:
Magento\Eav\Model\Entity\Attribute\Source\Boolean, TableAbstractSource, implement getAllOptions()Attributes with type static are stored as columns directly on the entity table rather than in EAV value tables. Used for frequently queried fields (e.g., sku, type_id, created_at).
int for select/boolean, decimal for pricessearchable, filterable, comparable thoughtfully — each adds indexing overheadstatic type sparingly — it modifies the entity table schemasetup:upgradeFetch the attribute development docs for exact addAttribute() parameters, source model patterns, and current entity type constants before implementing.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.