Skip to content
understanding-saleor-domain logo

Saleor Domain Expert

understanding-saleor-domain

Explains Saleor e-commerce domain and Configurator business rules. Covers entity identification (slug vs name), deployment pipeline stages, and configuration schema. Triggers on: entity types, deployment pipeline, config schema, slug identification, categories, products, channels, YAML configurat...

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Saleor Domain Expert

Purpose

Provide deep domain knowledge about the Saleor e-commerce platform and the Configurator's business logic for entity management, configuration, deployment, and synchronization.

When to Use

  • Implementing new entity types or features
  • Understanding entity identification patterns
  • Working with deployment pipeline stages
  • Debugging configuration synchronization issues
  • Understanding business rules and constraints

Table of Contents

Core Concepts

What is Saleor Configurator?

A "commerce as code" CLI tool that enables declarative configuration management for Saleor e-commerce platforms. It allows developers to:

  1. Introspect: Download remote Saleor configuration to local YAML files
  2. Deploy: Apply local YAML configuration to remote Saleor instance
  3. Diff: Compare local and remote configurations
  4. Start: Interactive wizard for first-time setup

Configuration as Code Philosophy

  • Single source of truth for store state
  • Version-controlled configuration (YAML in git)
  • Reproducible deployments across environments
  • Declarative over imperative management

Entity Identification System

Critical Rule: Every entity has exactly ONE identification strategy.

Slug-Based Entities

Identified by slug field. Used for entities that need URL-friendly identifiers.

EntityIdentifier FieldExample
Categoriesslugelectronics
Channelsslugdefault-channel
Collectionsslugsummer-sale
Menusslugmain-navigation
Productsslugiphone-15-pro
Warehousesslugus-east-warehouse

Implementation Pattern:

// Comparison uses slug
const isSameEntity = (local: Category, remote: Category) =>
  local.slug === remote.slug;

// Lookups use slug
const existing = await repository.findBySlug(entity.slug);

Name-Based Entities

Identified by name field. Used for internal configuration entities.

EntityIdentifier FieldExample
ProductTypesnamePhysical Product
PageTypesnameBlog Post
TaxClassesnameStandard Rate
ShippingZonesnameNorth America
AttributesnameColor

Implementation Pattern:

// Comparison uses name
const isSameEntity = (local: ProductType, remote: ProductType) =>
  local.name === remote.name;

Singleton Entities

Only one instance exists. No identifier needed.

EntityNotes
ShopGlobal store settings

Deployment Pipeline

Stage Order (Dependencies)

Stages execute in specific order due to dependencies:

1. Validation       → Pre-flight checks
2. Shop Settings    → Global configuration
3. Product Types    → Must exist before products
4. Page Types       → Must exist before pages
5. Attributes       → Used by product/​page types
6. Categories       → Product organization
7. Collections      → Product groupings
8. Warehouses       → Required for inventory
9. Shipping Zones   → Geographic shipping rules
10. Products        → Depends on types, categories
11. Tax Config      → Tax rules and classes
12. Channels        → Sales channels
13. Menus           → Navigation (may reference products)
14. Models          → Custom data models

Why Order Matters

Example: Cannot create a Product without its ProductType existing first.

# This product depends on "Physical Product" type
products:
  - name: "iPhone 15"
    slug: "iphone-15"
    productType: "Physical Product"  # Must exist!

Stage Execution Pattern

Each stage follows:

  1. Fetch: Get current remote state
  2. Compare: Diff local vs remote
  3. Plan: Determine creates/​updates/​deletes
  4. Execute: Apply changes with chunking
  5. Report: Log results and failures

Configuration Schema

Top-Level Structure

shop:
  # Global store settings

channels:
  # Sales channel definitions

taxClasses:
  # Tax rate classifications

productTypes:
  # Product type templates

pageTypes:
  # CMS page templates

attributes:
  # Shared attribute definitions

categories:
  # Product category hierarchy

collections:
  # Dynamic product collections

warehouses:
  # Fulfillment center definitions

shippingZones:
  # Geographic shipping configurations

products:
  # Product catalog

menus:
  # Navigation menu structures

models:
  # Custom data models

Attribute Types

Attributes can be of various types:

TypeDescriptionExample Values
DROPDOWNSingle select["Red", "Blue", "Green"]
MULTISELECTMultiple select["Feature A", "Feature B"]
RICH_TEXTHTML contentRich text editor
PLAIN_TEXTSimple textText input
BOOLEANTrue/​falseCheckbox
DATEDate picker2024-01-15
DATE_TIMEDate and time2024-01-15T10:30:00
NUMERICNumbers42.5
SWATCHColor/​image swatchColor picker
FILEFile uploadDocument/​image
REFERENCEEntity referenceLinks to other entities

Reference Attributes (Special):

attributes:
  - name: "Related Products"
    type: REFERENCE
    entityType: PRODUCT  # Must specify what it references

Bulk Operations

Chunking Strategy

Large operations are chunked to avoid timeouts and rate limits:

const CHUNK_SIZE = 50; // Default chunk size
const chunks = splitIntoChunks(items, CHUNK_SIZE);

for (const chunk of chunks) {
  await processChunk(chunk);
  // Rate limiting handled by urql retry exchange
}

Rate Limit Handling

The GraphQL client handles HTTP 429 automatically:

  • Exponential backoff with jitter
  • Max 5 retries
  • Network error recovery

Diff & Comparison Logic

Comparison Dimensions

For each entity type, comparison checks:

  1. Existence: Does entity exist remotely?
  2. Equality: Are all relevant fields equal?
  3. Children: Are nested structures equal?

Diff Result Types

type DiffAction = 'create' | 'update' | 'delete' | 'unchanged';

interface DiffResult<T> {
  action: DiffAction;
  local?: T;
  remote?: T;
  changes?: FieldChange[];
}

Comparator Pattern

Each entity has a dedicated comparator:

// src/​core/​diff/​comparators/​category-comparator.ts
export const compareCategorys = (
  local: Category[],
  remote: Category[]
): DiffResult<Category>[] => {
  // Match by slug
  // Compare relevant fields
  // Return diff results
};

Common Patterns

Adding a New Entity Type

  1. Define Zod schema in src/​modules/​config/​schema/
  2. Create service in src/​modules/<entity>/
  3. Create repository with GraphQL operations
  4. Add comparator in src/​core/​diff/​comparators/
  5. Add deployment stage in pipeline
  6. Update schema documentation

Handling Entity Dependencies

// Check dependency exists before creating
const productType = await productTypeRepository.findByName(product.productType);
if (!productType) {
  throw new EntityDependencyError(
    `ProductType "${product.productType}" not found`
  );
}

References

For detailed information, see:

  • {baseDir}/​.claude/​skills/​saleor-domain-expert/​references/​entity-identification.md - Complete entity identification rules
  • {baseDir}/​.claude/​skills/​saleor-domain-expert/​references/​deployment-stages.md - Pipeline stage details
  • {baseDir}/​.claude/​skills/​saleor-domain-expert/​references/​schema-patterns.md - YAML configuration patterns
  • {baseDir}/​docs/​ENTITY_REFERENCE.md - Full entity documentation
  • {baseDir}/​docs/​ARCHITECTURE.md - System architecture
  • {baseDir}/​src/​modules/​config/​schema/​schema.ts - Zod schema definitions

Related Skills

  • Implementing entities: See adding-entity-types for complete implementation workflow
  • Config schemas: See designing-zod-schemas for schema patterns
  • GraphQL operations: See writing-graphql-operations for Saleor API integration

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View