К основному содержанию
скилл CX Codex

magento-api-developer — скилл для Claude Code

Скилл magento-api-developer помогает агенту проектировать и писать API для Magento 2: сервисные контракты, DTO, REST-контроллеры, GraphQL-резолверы и тесты.

MIT 259 установок ★ 33 обновлён 2026-01-24

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add maxnorm/magento2-agent-skills --skill magento-api-developer -a claude-code
Открыть на GitHub

Что делает magento-api-developer

Скилл объясняет агенту, как устроена работа с API в Magento 2: сервисные контракты, DTO, репозитории, REST-контроллеры и GraphQL-резолверы. Внутри один файл SKILL.md с разделами: от планирования эндпоинтов до тестов и документации.

Процесс разбит на четыре шага: сначала требования и модель данных, потом интерфейсы в каталоге Api/, затем реализация, затем модульные и интеграционные тесты. Отдельные блоки описывают типовые сценарии: товары, заказы, клиенты, остатки, платежи. Для GraphQL это запросы товаров, мутации корзины и резолверы поиска, плюс админские API с массовыми операциями и отчётами.

Ещё в скилле есть указания по производительности и безопасности: пагинация, выборка полей, кэш ответов, OAuth 2.0 и JWT, ограничение частоты запросов, CORS. Это набор инструкций, а не генератор кода, поэтому модуль и сущности придётся назвать самому. Без этого агент начнёт угадывать имена классов и методов.

Какие задачи решает

  • спроектировать сервисный контракт и DTO для нового модуля
  • добавить GraphQL-резолвер к товарам с вложенными опциями
  • собрать REST-эндпоинт оформления заказа с правильными статус-кодами
  • настроить OAuth 2.0 и JWT для внешней интеграции
  • убрать N+1 в запросах корзины и добавить пагинацию

Примеры запросов агенту

  • Спроектируй сервисный контракт в Api/ и DTO для модуля отзывов в Magento 2
  • Добавь GraphQL-резолвер для товаров с вложенными опциями и кэшированием ответа
  • Опиши REST-эндпоинт оформления заказа: маршрут, коды ответов и валидацию входных данных

Как установить magento-api-developer

1Через Skills CLI (Vercel)

npx skills add maxnorm/magento2-agent-skills --skill magento-api-developer -a claude-code

2Вручную: положить файлы

~/.claude/skills/magento-api-developer/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/magento-api-developer/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о magento-api-developer

Как установить magento-api-developer в Claude Code?

Выполните npx skills add maxnorm/magento2-agent-skills --skill magento-api-developer -a claude-code. Файл скилла появится по пути ~/.claude/skills/magento-api-developer/SKILL.md.

Что делает magento-api-developer?

Описывает агенту, как проектировать и реализовывать REST и GraphQL API в Magento 2: сервисные контракты, DTO, эндпоинты, обработка ошибок и тесты.

Подойдёт ли скилл для headless-витрины?

Да. В нём есть работа с GraphQL-запросами товаров и мутациями корзины, а также REST-эндпоинты для мобильных приложений и сторонних систем.

Исходный текст

SKILL.md · MIT
---
name: magento-api-developer
description: Designs and implements REST and GraphQL APIs for Magento 2. Use when developing APIs, creating service contracts, building headless commerce solutions, or integrating with external systems. Masters service contracts, data transfer objects, authentication, and enterprise-grade API architecture.
---

# Magento 2 API Developer

Expert specialist in designing and implementing robust, scalable REST and GraphQL APIs that serve as reliable data interfaces for headless commerce, mobile applications, and third-party integrations.

## When to Use

- Developing REST or GraphQL APIs
- Creating service contracts
- Building headless commerce solutions
- Integrating with external systems
- Implementing API authentication and authorization
- Designing data transfer objects

## API Architecture

### Service Contracts
- Design clean, versioned API interfaces
- Create data transfer objects (DTOs) for data exchange
- Implement repository pattern for data access
- Maintain backward compatibility

### REST API Design
- Implement RESTful endpoints following industry best practices
- Use proper HTTP methods (GET, POST, PUT, DELETE)
- Design consistent URL structures
- Implement proper status codes

### GraphQL Implementation
- Build efficient GraphQL schemas and resolvers
- Optimize query complexity
- Implement proper caching strategies
- Handle nested relationships efficiently

## API Development Process

### 1. API Planning & Design
- **Requirements Analysis**: Gather API requirements from stakeholders
- **Data Modeling**: Design data structures and entity relationships
- **Endpoint Architecture**: Plan REST endpoints and GraphQL schema structure
- **Security Design**: Plan authentication, authorization, and data protection
- **Performance Planning**: Design for scalability and optimal response times

### 2. Service Contract Definition
- **Interface Design**: Create comprehensive service interfaces in `Api/` directory
- **Data Contract Specification**: Define DTOs and data structures
- **Error Handling**: Design consistent error response patterns
- **Validation Rules**: Implement robust input validation and sanitization
- **Documentation**: Create comprehensive API documentation

### 3. Implementation Development
- **Endpoint Implementation**: Build REST controllers and GraphQL resolvers
- **Business Logic**: Implement service layer business logic
- **Data Access**: Create repository implementations for data operations
- **Response Formatting**: Ensure consistent response structures
- **Error Handling**: Implement comprehensive error handling and logging

### 4. Testing & Quality Assurance
- **Unit Testing**: Write comprehensive tests for service and repository layers
- **Integration Testing**: Test complete API workflows and data flow
- **Performance Testing**: Validate API performance under load
- **Security Testing**: Test authentication, authorization, and data protection
- **Documentation Testing**: Ensure API documentation accuracy

## API Types

### E-commerce REST APIs
- **Product Management**: Product CRUD operations, catalog management
- **Order Processing**: Order creation, updates, and fulfillment workflows
- **Customer Management**: Customer registration, authentication, and profile management
- **Inventory Operations**: Stock management, reservations, and availability
- **Payment Processing**: Payment method integration and transaction handling

### GraphQL Schema Development
- **Product Queries**: Efficient product data retrieval with nested relationships
- **Cart Operations**: Shopping cart mutations and real-time updates
- **Customer Queries**: Customer data and order history with fine-grained control
- **Search Resolvers**: Advanced search and filtering capabilities
- **Performance Optimization**: Query complexity analysis and caching strategies

### Administrative APIs
- **Admin Operations**: Backend management and configuration APIs
- **Bulk Operations**: Mass data import/export and batch processing
- **Reporting APIs**: Data analytics and business intelligence endpoints
- **System Configuration**: Dynamic configuration management APIs
- **User Management**: Admin user and role management interfaces

## Advanced Techniques

### Performance Optimization
- **Query Optimization**: Efficient database queries and N+1 problem resolution
- **Caching Strategies**: Implement API response caching and cache invalidation
- **Pagination**: Efficient large dataset pagination and cursor-based navigation
- **Field Selection**: Allow clients to specify required fields for optimization
- **Batch Operations**: Implement batch endpoints for bulk operations

### Security Implementation
- **Authentication Methods**: OAuth 2.0, JWT tokens, and API key management
- **Authorization Patterns**: Role-based and resource-based access control
- **Rate Limiting**: Implement API throttling and abuse prevention
- **Input Validation**: Comprehensive input sanitization and validation
- **CORS Management**: Proper cross-origin resource sharing configuration

### Error Handling & Monitoring
- **Consistent Error Responses**: Standardized error format and HTTP status codes
- **Logging Strategy**: Comprehensive API request and error logging
- **Monitoring Integration**: API performance and health monitoring
- **Alert Systems**: Automated alerting for API issues and anomalies
- **Debugging Tools**: Debug logging and request tracing capabilities

## Best Practices

### Design Principles
- **Resource-Oriented Design**: Design APIs around resources and collections
- **Stateless Operations**: Ensure API operations are stateless and idempotent
- **Consistency**: Maintain consistent naming, patterns, and response formats
- **Simplicity**: Provide simple, intuitive interfaces for common operations
- **Flexibility**: Design for extensibility and future requirements

### Documentation & Developer Experience
- **Interactive Documentation**: Provide Swagger/OpenAPI interactive documentation
- **Code Examples**: Include practical examples in multiple programming languages
- **SDKs & Libraries**: Provide client libraries for popular programming languages
- **Sandbox Environment**: Offer testing environments for API consumers
- **Developer Support**: Establish support channels and community resources

## References

- [Adobe Commerce REST APIs](https://developer.adobe.com/commerce/web-api/rest/)
- [Adobe Commerce GraphQL](https://developer.adobe.com/commerce/web-api/graphql/)
- [Service Contracts](https://developer.adobe.com/commerce/php/development/components/service-contracts/)

Focus on creating APIs that meet current integration needs while providing a foundation for future digital commerce innovations.

© maxnorm · MIT · maxnorm/magento2-agent-skills

Похожие скиллы

Все скиллы по теме «Бэкенд и API» →
api-and-interface-design addyosmani Скилл api-and-interface-design помогает проектировать API и границы модулей так, чтобы их было проще использовать и менять. Подходит для REST, GraphQL и публичных интерфейсов. CX Codex +1 79 800установок api-design-principles Seth Hobson Скилл api-design-principles помогает проектировать и проверять REST- и GraphQL API. Пригодится при подготовке спецификации, пересмотре существующего API или согласовании стандартов команды. CX Codex +1 30 348установок shopify-developer tech-leads-club Скилл shopify-developer для Claude Code даёт агенту справочник по Liquid, темам OS 2.0, GraphQL API, Functions и Hydrogen для разработки под Shopify. CX Codex +1 ★ 7 191звёзд репо api-security-testing usestrix Скилл api-security-testing помогает проверить REST, GraphQL и gRPC API с помощью Strix: агенты ищут уязвимости и прикладывают запрос для проверки находки. CX Codex +1 17 500установок api-rate-limit-policy Samuel Berthe Скилл api-rate-limit-policy для Claude Code, Codex, Cursor и других агентов, который проектирует политику rate limit публичного API: модели измерения трафика, квоты по тирам, заголовки и поведение 429. CX Codex +1 10 400установок api-integration-surface-strategy Samuel Berthe Скилл api-integration-surface-strategy помогает решить, какие поверхности интеграции платформа отдаёт наружу — REST, GraphQL, gRPC, вебхуки, SDK, MCP — и в каком порядке их строить. CX Codex +1 10 400установок

Из того же набора30

Весь набор →
magento-frontend-developer Скилл magento-frontend-developer задаёт правила вёрстки и клиентской разработки под Magento 2: от макетов layout XML и шаблонов PHTML до скриптов на KnockoutJS и оптимизации Core Web Vitals. CX Codex +1 420установок magento-xml-specialist Скилл magento-xml-specialist для ИИ-агента, который пишет и проверяет XML-конфигурации Magento 2: layout, di.xml, system.xml, module.xml и db_schema.xml. CX Codex +1 394установок magento-issue-debugger Скилл magento-issue-debugger для Claude Code разбирает сбои Magento 2: воспроизводит проблему, собирает логи и помогает найти корневую причину. CX Codex +1 274установок magento-php-specialist Скилл magento-php-specialist для разработки под Magento 2 на PHP. Задаёт правила PSR-12, строгое оформление классов и базовые шаблоны платформы вроде репозиториев и плагинов. CX Codex +1 263установок magento-security-analyst Скилл magento-security-analyst разбирает безопасность магазина на Magento 2 по слоям и подсказывает, что закрыть: код, конфигурацию, зависимости, подготовку к PCI DSS и GDPR. CX Codex +1 212установок magento-model-developer Скилл magento-model-developer помогает проектировать слой данных в Magento 2: строить модели, декларативные схемы db_schema.xml, репозитории и коллекции под EAV или плоские таблицы. CX Codex +1 210установок magento-feature-developer Скилл magento-feature-developer помогает проектировать и внедрять бизнес-функции для Magento 2: от сервисных контрактов и интеграций до тестов. Пригодится при создании модулей и расширении существующей функциональности. CX Codex +1 207установок magento-ui-component-developer Скилл magento-ui-component-developer для Claude Code создаёт сложные компоненты Magento UI Component: админские таблицы, формы, модальные окна и интерфейсы на данных. CX Codex +1 200установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой