magento-service-contracts

Implement Magento 2 service contracts and repository interfaces with SearchCriteria.

35|16|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/OrcaQubits/agentic-commerce-claude-plugins --skill magento-service-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: magento-service-contracts
Source: https://github.com/OrcaQubits/agentic-commerce-claude-plugins/tree/main/magento2-commerce/skills/magento-service-contracts
Command: npx skills add https://github.com/OrcaQubits/agentic-commerce-claude-plugins --skill magento-service-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the development of robust and maintainable APIs and data access layers for Magento 2 modules, ensuring backward compatibility and efficient data querying.

Core Features & Use Cases

  • Service Contracts: Define stable PHP interfaces for module APIs, separating implementation from consumer.
  • Data Interfaces: Create structured data objects for entities, ensuring consistent data representation.
  • SearchCriteria: Implement powerful filtering, sorting, and pagination for data retrieval.
  • Use Case: When building a custom product import module for Magento 2, use this Skill to define the ProductRepositoryInterface and ProductInterface for consistent data handling and API exposure.

Quick Start

Use the magento-service-contracts skill to fetch the live documentation for Magento 2 service contracts and repository patterns.

Frequently Asked Questions about magento-service-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement service contracts for a custom Magento 2 module?

To implement Magento 2 service contracts, you define stable PHP interfaces for module APIs, including repository and data interfaces, separating implementation from the consumer to ensure backward compatibility.

What is the SearchCriteria pattern used for in Magento 2?

The SearchCriteria pattern in Magento 2 is used for data retrieval, enabling you to implement powerful filtering, sorting, and pagination logic when querying your module's data access layer.

How do I expose a custom Magento 2 repository as a Web API endpoint?

You expose a Magento 2 repository as a Web API endpoint by defining service contracts that adhere to Magento's API best practices, ensuring your repository interfaces are stable and maintainable for external consumers.

When do I need to use data interfaces in Magento 2?

You need to use Magento 2 data interfaces when creating structured data objects for entities, ensuring consistent data representation across your module before exposing it through repository patterns or service contracts.

Does Magento 2 repository pattern require separate interfaces for data and repository logic?

Yes, the Magento 2 repository pattern separates repository interfaces for data access from data interfaces representing entities, ensuring stable module APIs and consistent data handling throughout your custom implementations.