spree-dependencies

Replace core Spree services with custom dependency-injected implementations.

4|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/spree/agent-skills --skill spree-dependencies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spree-dependencies
Source: https://github.com/spree/agent-skills/tree/main/skills/spree-dependencies
Command: npx skills add https://github.com/spree/agent-skills --skill spree-dependencies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables users to swap core Spree services for custom implementations, providing flexibility and customization in their e-commerce applications.

Core Features & Use Cases

  • Service Replacement: Replace core Spree services such as cart, checkout, payment processing, and ability checks.
  • Customization: Implement custom logic without modifying the core codebase.
  • Use Case: Use this Skill to replace the default cart recalculate service with a custom one that aligns with your specific business rules.

Quick Start

To customize the cart add service, subclass Spree::Cart::AddItem and register your custom class with Spree.cart_add_item_service = MyApp::Cart::AddItem.

Frequently Asked Questions about spree-dependencies

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

FAQPage Schema
How do I replace core Spree services with custom implementations?

Replace core Spree services by subclassing the default service class and registering your custom class, such as setting `Spree.cart_add_item_service` to your custom implementation for dependency injection.

Can I customize Spree checkout and payment processing without modifying the core codebase?

Yes, you can customize Spree checkout and payment processing without modifying the core codebase by using dependency injection to swap default services for your custom business logic implementations.

What is dependency injection in Spree e-commerce customization?

Dependency injection in Spree e-commerce customization is a mechanism allowing developers to override default platform services like cart and checkout by registering custom classes.

Does Spree support replacing the default cart recalculate service for specific business rules?

Yes, Spree supports replacing the default cart recalculate service by subclassing `Spree::Cart::AddItem` and registering your custom class to align with your specific business rules.

What Spree services can I swap using dependency injection?

Using dependency injection, you can swap core Spree services including cart operations, checkout processes, payment processing, and ability checks to fit specific business needs.

What is the best way to extend a Spree e-commerce application?

The best way to extend a Spree e-commerce application is through dependency injection, replacing default core services with custom subclasses rather than modifying the core codebase directly.