/spree-commerce:spree-catalogfrom spree-commerce
Builds and customizes Spree's catalog: products, variants, option types, taxonomies, properties, ActiveStorage images, multi-currency pricing, PriceList overrides, MeiliSearch faceted search, CSV import/export, and SEO.
Ships in spree-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
spree meilisearch faceted search v5.4 for the current search backend wiring.Spree::Product / Spree::Variant source for column names — they shift between minors.Product — the catalog entity (T-shirt, novel, subscription box). Has a master_variant.Variant — the sellable SKU. Even simple products have one master variant; products with options have additional variants per OptionValue combination.A Variant has:
StockItem per StockLocationPrice per currencyOptionValues defining its position on the option axesOptionType: size
OptionValues: small, medium, large
OptionType: color
OptionValues: red, blue, black
A T-shirt product with [size, color] option types has 3 × 3 = 9 variants (or fewer if some combos are unavailable).
A Taxonomy is a category tree (e.g., "Categories", "Collections"). A Taxon is a node in that tree using acts_as_nested_set (or awesome_nested_set). Products are tagged with many Taxons via Spree::Classification.
Taxonomy: Categories
├── Taxon: Apparel
│ ├── Taxon: Shirts
│ └── Taxon: Pants
└── Taxon: Accessories
Free-form attribute table:
Product → ProductProperty(property: Property("Material"), value: "Cotton")
Properties show up on the storefront's spec table. Distinct from Metafield — properties are user-visible product details; metafields are typically internal custom data.
Spree uses ActiveStorage for images attached to Variants and Products. Variant-level images override product-level for that specific SKU. Image variants (resizing) are computed lazily by ActiveStorage with libvips / ImageMagick.
Price row per (Variant, Currency).PriceList (v5.3+) lets you define an override list scoped to a CustomerGroup, Country, or Store. The pricing resolver picks the right price by precedence: user's CustomerGroup → Store's PriceList → default Price.Activate currencies on the Store; create one Price per Variant per Currency. The storefront and APIs select the right Price based on Store#default_currency or the user's selected currency.
| Backend | Notes |
|---|---|
| MeiliSearch (v5.4+, recommended) | Faceted, typo-tolerant, fast |
| Algolia (community gem) | Hosted, mature |
| PostgreSQL full-text | Fallback / dev |
The v5.4 spree gem wires MeiliSearch by default when the env vars are present.
| Event | Cause |
|---|---|
product.activate | Product made available |
product.archive | Product hidden (not deleted — preserves order history) |
product.out_of_stock | Inventory hit zero |
product.back_in_stock | Inventory restored |
Use archive instead of destroy — preserves order history.
v5.0+ ships CSV import/export for products, customers, orders. Background-job-driven (Sidekiq), reports errors per row.
product = Spree::Product.create!(
name: 'Classic Tee',
description: '100% cotton',
price: 19.99,
shipping_category: Spree::ShippingCategory.first,
tax_category: Spree::TaxCategory.find_by(name: 'Clothing'),
available_on: Time.current,
stores: [Spree::Store.default]
)
Then add option types, option values, and variants:
size = Spree::OptionType.create!(name: 'tshirt-size', presentation: 'Size')
size.option_values.create!([
{ name: 'small', presentation: 'S' },
{ name: 'medium', presentation: 'M' },
{ name: 'large', presentation: 'L' }
])
product.option_types << size
product.variants.create!(
sku: 'TEE-S',
option_values: [size.option_values.find_by(name: 'small')],
price: 19.99
)
taxon = Spree::Taxon.find_by(name: 'Shirts')
product.taxons << taxon
product.master.price_in('USD').amount # 19.99
product.master.price_in('EUR').display_price # "€18.50"
price = Spree::Pricing::PriceFinder.new(
variant: variant, store: store, user: user, currency: 'USD'
).call
Verify the exact service class name in the version you're on.
MeiliSearch indexing is event-driven — product.updated, product.activate, etc., enqueue background jobs. Force reindex:
bin/rails spree:search:reindex
Verify the exact rake task name in the current release.
bin/rails console
> Spree::ImportCsvJob.perform_later('products', file_path: '/path/to/products.csv')
Or via admin: Products → Import. Verify the job class name in the live code.
In the Next.js storefront, the product page is built from API v3 calls:
// Server component
const product = await spree.products.find(slug, { include: 'variants,images,taxons' });
(Pseudo — verify against @spree/sdk docs.)
product.updated events; throttle the search-indexing subscriber for batch operations.Spree::Cache.clear or version-bumped cache keys.Always verify model relationships and column names against the live spree gem source — catalog modeling evolves more than the order graph.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
spree, ecommerce-catalog, product-modeling, faceted-search, csv-import
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin spree-commerce22 skills in this plugin
/spree-admin-customizationCustomize the Spree v5 Admin Dashboard — Tailwind 4 + Hotwire/Turbo/Stimulus stack, the `Spree.admin.navigation` declarative API (v5.2+) for menu items, partial injection slots (`store_nav_partials`, `store_products_nav_partials`, `store_orders_nav_partials`, `settings_nav_partials`), the Admin SDK components + form builder, custom dashboard reports, the Page Builder for storefront editing, and theme management. Use when adding admin pages, injecting UI into existing screens, or building admin extensions./spree-api-v3Build with Spree's v3 APIs (v5.4+) — Store API at `/api/v3/store/*` (publishable key + per-user JWT, customer-facing) and Admin API at `/api/v3/admin/*` (per-user API keys + OAuth2 Doorkeeper, admin/operations). Covers the flat-JSON Stripe-like envelope, `?expand=` / `?include=` parameters, prefixed IDs (`prod_…`, `ord_…`), OpenAPI 3.0 spec, rate limiting, idempotency, and migration from v2 JSON:API. Use when building API clients, SDKs, or extending API endpoints in a Spree v5.4+ deployment./spree-checkoutImplement Spree's checkout — the Order state machine (cart → address → delivery → payment → confirm → complete), the Payment and Shipment sub-state machines, the return flow (ReturnAuthorization → CustomerReturn → Reimbursement → Refund), guest checkout, payment-step skipping for credit-covered orders, and the V3 checkout API surface. Use when building or customizing checkout flows, debugging state transitions, or wiring custom checkout steps.Other plugins' skills for the same job