Loading...
Loading...
Use for any work in a Spree Commerce 6 project — orienting in the repo (server/, apps/dashboard, apps/storefront), detecting the project flavor (create-spree-app + `spree` CLI vs a classic Rails app), running commands, following Spree conventions (Spree:: namespace, Spree.base_class, Spree.customer_class, current_store scoping, has_status, prefixed IDs, custom fields vs metadata), and finding the right docs. Activates broadly — "how does Spree work", "where do I put this", "how do I run X in my Spree app", "what are the Spree conventions", "set up a Spree project". Routes to spree-customization when the question is which extension pattern to use.
npx skill4agent add spree/agent-skills spree-projectspreeComing from Spree 5.x? Read theskill first — cart/order split, no state machines, React dashboard, API v2 andspree-upgrade-5-to-6removed.spree_admin
| Signal | Flavor | How commands run |
|---|---|---|
| create-spree-app project | |
Rails app at the repo root ( | classic Rails app | Native from the app root: |
spreenpx spree …pnpm exec spree …server/backend/| Task | Spree CLI | Classic Rails app |
|---|---|---|
| Run the stack | | |
| Rails console | | |
| Shell in the container | | (you're already in one) |
| Install + run migrations | | |
| Generator | | |
| Run specs | | |
| Rake task | | |
| Sample data | | |
| Version upgrade | | |
| Anything else | | |
server/app/...app/...my-store/
├── server/ # The Spree API — a full Rails 8.1 app (spree-starter). Your Ruby code lives here.
│ ├── app/{models,services,workflows,subscribers,controllers,serializers}/
│ ├── config/initializers/spree.rb # hooks, registries, dependencies, subscribers
│ ├── Dockerfile # builds the production image (API + dashboard)
│ └── Gemfile
├── apps/
│ ├── dashboard/ # React admin (@spree/dashboard) — plugins in src/plugins.ts
│ ├── seller-dashboard/ # Marketplace seller panel (optional)
│ └── storefront/ # Next.js storefront on @spree/sdk (optional)
├── docker-compose.yml # prebuilt ghcr.io/spree/spree image + Postgres (Meilisearch optional, commented out)
├── .env # SECRET_KEY_BASE, ACTIVE_RECORD_ENCRYPTION_* keys, SPREE_PORT, SPREE_VERSION_TAG… (mode 0600)
├── AGENTS.md / CLAUDE.md # generated agent instructions
└── package.json # pins @spree/cliserver/spree ejectserver/service "web" is not running@spree/clispree initpg_isready -h 127.0.0.1@spree/clipackage.json/jobs/dashboardspree_dashboard/api/v3/storepk_…/api/v3/adminsk_…/api/v3/sellerX-Spree-Seller-Idspree-api-v3Spree::server/app/models/spree/…MyApp::…Spree.base_classSpree::BaseApplicationRecordadditional_permitted_attributesSpree.customer_classSpree::Customerspree_customerscust_…Spree.admin_user_classSpree::AdminUseradm_…Spree.user_classcurrent_store.productsstore.ordersSpree::Order.allSPREE_STORE_SCOPE_GUARD=log|raise|offSpree::CurrentstorechannelmarketcurrencylocaleSpree::Current.storeSpree::Store.defaultSpree::Current.store = storeStoreScopeGuardSpree::StoreScopeGuard.skip { … }Spree::Current.with_store(store) { … }Spree::BaseJobeach_store_of(relation) { |store_records| … }statushas_statusSpree::HasStatusapp/workflowsModel.add_status('on_hold', after: 'approved')spree-workflowsbelongs_tooptional: trueclass_name:dependent:has_manyprod_…cart_…or_…py_…Model.find_by_prefix_id!(id).to_ispree-data-modelSpree::CartSpree::Orderstatusline_item.owner.orderproduct.set_custom_field('custom.material', 'Cotton')get_custom_fieldmetadataSpree::Subscriberorder.placedSpree.hooks.register('carts.complete.validate', …)after_saveSpree::Product.additional_permitted_attributes += [:brand_id]+=<<result = Spree.cart_add_item_workflow.call(...)result.success?"135.60"display_…SPREE_*spree-customizationACTIVE_RECORD_ENCRYPTION_*create-spree-appspree encryption initspree-securityspree-customizationSPREE_*Spree.configpreferenceSpree.hooks.register('<flow>.<hook>', 'MyApp::Handler')spree-workflowsspree-events-webhooksSpree::Checkout::Registry.add_requirementregister_stepspree-checkoutspree-providersSpree.ransack.add_attribute(Spree::Product, :erp_id)Spree::Dependencies.cart_add_item_workflow = 'MyApp::Carts::AddItem'spree-dependenciesspree-decoratorsspree-dashboardspree-dashboard-pluginsspree dev # run API (+ dashboard dev server if apps/dashboard exists); first run completes setup
spree stop | restart | logs [worker]
spree console | shell | db:console
spree migrate | migrate:status | migrate:rollback
spree generate api_resource Brand name:string # → spree:api_resource
spree generate subscriber ErpSync order.placed # class + registration in initializers/spree.rb
spree test [path[:line]] # tests in RAILS_ENV=test; creates the test DB if missing (CLI 3.6+; older: spree rspec)
spree add --gem <gem> # adds the gem, runs its installer + migrations; a prebuilt project is ejected first (asks; new dev DB)
spree eject # build from server/ instead of the prebuilt image
spree build [--production] # rebuild dev image / build the production image (API + dashboard)
spree add dashboard # add apps/dashboard (also: spree add seller-dashboard)
spree plugin new <name> # scaffold a dashboard plugin monorepo
spree update # pull latest image, recreate containers (migrations run on boot)
spree upgrade [--plan] # bundle update + migrate + spree:upgrade data steps
spree seed | sample-data | user create | api-key create|list|revoke
spree encryption init [--print] # add ACTIVE_RECORD_ENCRYPTION_* keys to .env (never overwrites); --print for production
spree exec bin/rails spree:setup:token # reprint the first-run admin setup link
spree api <verb> <path> # call the Admin API from the terminal (see spree-cli)spree db:resetnode_modules/@spree/docs/dist/
├── developer/
│ ├── getting-started/ create-spree-app/ cli/
│ ├── core-concepts/ # products, carts, orders, payments, fulfillments, markets, …
│ ├── customization/ # quickstart, configuration, workflows, dependencies, decorators, permissions, validations
│ ├── providers/ # ERP, PIM, DAM, fulfillment, payouts, SSO, observability
│ ├── how-to/ # custom payment method, delivery rate provider, search provider, B2B, marketplace…
│ ├── dashboard/ # React admin: customization, plugins, recipes
│ ├── sdk/ storefront/ multi-tenant/ security/ deployment/ upgrades/ tutorial/
└── api-reference/ # Store/Admin API guides + OpenAPI specs.mdhttps://spreecommerce.org/docs/mcpclaude mcp add --transport http spree-docs https://spreecommerce.org/docs/mcpdocs/v5/spree-customizationspree-data-modelspree-resourcespree-workflowsspree-testingspree-upgradespree-upgrade-5-to-6