Spree Development Patterns

•
32
•

Implements modern Spree Commerce architecture and customization patterns for robust e-commerce extensions.

This skill provides a comprehensive framework of best practices and architectural patterns specifically designed for Spree Commerce v5+ development. It guides users through the customization preference hierarchy—prioritizing event-driven logic and service-object swapping via Spree::Dependencies over invasive decorators. By enforcing idempotent subscribers, multi-store scoping, and modern Hotwire/Turbo idioms, the skill ensures that Spree extensions are maintainable, performant, and easy to upgrade. It is an essential tool for developers building complex commerce features, custom calculators, or integrating third-party ERP systems with the Spree ecosystem.

Key Features

01Idempotency patterns for event subscribers and webhook receivers
02Standardized customization hierarchy prioritizing events and service swapping
0332 GitHub stars
04Guidance for Hotwire, Turbo, and Stimulus integration in Spree Admin
05Modern decorator implementation using the prepend idiom and self.prepended
06Strict multi-store scoping patterns to prevent cross-store data leakage

Use Cases

01Architecting a new Spree extension that follows core maintainability standards
02Implementing complex custom promotion or shipping calculators using polymorphic base classes
03Refactoring legacy class_eval overrides into modern service objects and decorators