dist/cursor/magento2-commerce/skills/magento-deploy/SKILL.md
Deploy Magento 2 — deployment modes, static content deployment, DI compilation, CLI commands, zero-downtime strategies, and CI/CD pipeline setup. Use when preparing for production deployment or building deployment automation.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins magento-deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch live docs:
https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/cli/set-mode for deployment modeshttps://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/cli/static-view/static-view-file-deployment for static content deploymagento 2 zero downtime deployment for zero-downtime strategies| Mode | Errors | Static Files | DI Compilation | Use Case | |------|--------|-------------|----------------|----------| | Developer | Displayed | Generated on demand | Automatic | Local development | | Production | Logged only | Pre-deployed | Pre-compiled | Live site | | Default | Not displayed | On demand | Not optimized | Initial install |
bin/magento deploy:mode:show
bin/magento deploy:mode:set production
bin/magento deploy:mode:set developer
# 1. Enable maintenance mode
bin/magento maintenance:enable
# 2. Pull latest code (git pull, composer install)
composer install --no-dev --optimize-autoloader
# 3. Run setup upgrade (applies db_schema changes and patches)
bin/magento setup:upgrade
# 4. Compile DI (generates interceptors, factories, proxies)
bin/magento setup:di:compile
# 5. Deploy static content (CSS, JS, images, templates)
bin/magento setup:static-content:deploy en_US --jobs=4
# 6. Flush cache
bin/magento cache:flush
# 7. Disable maintenance mode
bin/magento maintenance:disable
--exclude-theme, --no-html-minify, --jobs=N for parallelismBuild and deploy on separate systems:
setup:di:compile + setup:static-content:deploysetup:upgrade --keep-generated (no recompilation)Two identical environments with load balancer switching:
deployment/blue_green/enabled in app/etc/env.phpreleases/20260214/)current symlink to new releasevar/, pub/media/, app/etc/env.phpbin/magento module:enable VendorName_ModuleName
bin/magento module:disable VendorName_ModuleName
bin/magento module:status
bin/magento cache:clean # Clean invalidated cache types
bin/magento cache:flush # Flush all cache storage
bin/magento cache:status # Show cache type status
bin/magento cache:enable <type>
bin/magento cache:disable <type>
bin/magento indexer:reindex
bin/magento indexer:status
bin/magento indexer:set-mode schedule
bin/magento cron:run
bin/magento cron:install
bin/magento admin:user:create
bin/magento admin:user:unlock <username>
bin/magento dev:profiler:enable
bin/magento dev:template-hints:enable
bin/magento setup:config:set --<option>=<value>
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.distcomposer install --no-dev, setup:di:compile, setup:static-content:deploysetup:upgrade, cache flushsetup:di:compile or setup:static-content:deploy on production during traffic--jobs=N for parallel static content deploymentsetup:upgradeFetch the deployment documentation for exact CLI options, mode-switching requirements, and pipeline deployment configuration before deploying.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.