From magento2-commerce
Implement Magento 2 service contracts: repository/data interfaces, SearchCriteria patterns, and repositories for module APIs, data access layers, Web API.
How this skill is triggered — by the user, by Claude, or both
Slash command
/magento2-commerce:magento-service-contractsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Fetch live docs:
https://developer.adobe.com/commerce/php/development/components/web-api/services/ for service contract guidehttps://developer.adobe.com/commerce/php/development/components/searching-with-repositories/ for SearchCriteria patternssite:developer.adobe.com commerce php development components service-contracts for additional referenceService contracts are PHP interfaces that define a module's public API. They guarantee backward compatibility — implementations can change across versions without breaking consumers.
Repository Interfaces (Api/SomeRepositoryInterface.php)
getById($id) — retrieve single entitysave(SomeInterface $entity) — create or updatedelete(SomeInterface $entity) — removegetList(SearchCriteriaInterface $criteria) — filtered/sorted/paginated resultsData Interfaces (Api/Data/SomeInterface.php)
getId(), setId($id), getName(), setName($name), etc.const NAME = 'name';SearchResults Interface (Api/Data/SomeSearchResultsInterface.php)
Magento\Framework\Api\SearchResultsInterfacegetItems() / setItems() with typed returnsUsed for querying repositories with filters, sorting, and pagination:
eq, neq, gt, gteq, lt, lteq, like, in, nin, notnull, null, from, toThe concrete repository class:
getById() — creates model via factory, loads via resource modelsave() — calls resource model save(), handles exceptionsdelete() — calls resource model delete()getList() — creates collection, applies criteria via CollectionProcessor, wraps in SearchResultsWhen you define a service contract interface and map it in webapi.xml, the same code serves:
@api annotation to indicate public API stabilitySearchCriteriaBuilder instead of raw collection filtering in service layerNoSuchEntityException, CouldNotSaveException, CouldNotDeleteExceptionwebapi.xml for automatic REST/SOAP exposureFetch the service contracts and searching-with-repositories docs for exact interface signatures, exception classes, and CollectionProcessor usage before implementing.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin magento2-commerceGuides creation of Magento 2 custom modules: registration, directory structure, models, resource models, collections, declarative schema, data/schema patches. For building modules or reviewing architecture.
Applies PHP design patterns—Singleton, Factory, Strategy, Observer, Repository, Decorator, DI—with WooCommerce examples for plugin structure and business logic.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.