templates/basic/.claude/skills/migration-guide/SKILL.md
Analyze a Mercur 1.x project and guide migration to 2.0. Self-contained — works without access to the mercur monorepo.
npx skillsauth add mercurjs/mercur migration-guideInstall 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.
Use this skill when:
| 1.x | 2.0 |
|-------|--------|
| @mercurjs/b2c-core | @mercurjs/core — all core modules built in |
| @mercurjs/commission | Built into core |
| @mercurjs/algolia | Registry block: mercurjs add algolia |
| @mercurjs/resend | No 2.0 equivalent — port manually |
| @mercurjs/payment-stripe-connect | No 2.0 equivalent — port manually |
| @mercurjs/stripe-tax-provider | No 2.0 equivalent — port manually |
| @medusajs/admin-vite-plugin | @mercurjs/dashboard-sdk |
| @medusajs/js-sdk | @mercurjs/client (generated typed client) |
| 1.x | 2.0 |
|-------|--------|
| apps/backend/src/* | packages/api/src/* |
| apps/backend/src/modules/ | packages/api/src/modules/ |
| apps/backend/src/workflows/ | packages/api/src/workflows/ |
| apps/backend/src/api/ | packages/api/src/api/ |
| apps/backend/src/subscribers/ | packages/api/src/subscribers/ |
| apps/backend/src/links/ | packages/api/src/links/ |
| apps/admin/src/routes/ | apps/admin/src/routes/ |
| apps/vendor/src/routes/ | apps/vendor/src/routes/ |
| Old | New |
|-----|-----|
| from "@medusajs/utils" | from "@medusajs/framework/utils" |
| from "@medusajs/js-sdk" | from "@mercurjs/client" |
| from "@custom-types/*" | from "@mercurjs/types" |
| from "@hooks/*" | from "@mercurjs/dashboard-shared" or local |
| from "@components/*" | from "@mercurjs/dashboard-shared" |
| from "@lib/*" | from "@mercurjs/dashboard-shared" |
| from "@mercurjs/b2c-core" | from "@mercurjs/core" |
Custom providers in medusa-config.ts must use ./src/ prefix:
// Wrong (will fail with "Cannot find module")
resolve: './providers/my-provider'
// Correct
resolve: './src/providers/my-provider'
Provider entry files must import from @medusajs/framework/utils, not @medusajs/utils:
import { Modules, ModuleProvider } from "@medusajs/framework/utils"
medusa-config.ts plugin registration changed:
// 1.x
plugins: [{ resolve: "@mercurjs/b2c-core", options: {} }]
// 2.0
plugins: [{ resolve: "@mercurjs/core", options: {} }]
// + individual module registrations in modules array
Scan the 1.x project the user provides:
package.json — list all @mercurjs/* and @medusajs/* dependencies. Note the @mercurjs/b2c-core version to determine project version.apps/admin/) — search apps/backend/ when scanning for custom dashboard pagesmedusa-config.ts — list plugins, modules, providerssrc/modules/ — count and list custom modulessrc/workflows/ — count custom workflowssrc/api/ — count custom API routessrc/subscribers/ — count subscriberssrc/links/ — count custom linksapps/admin/src/ and apps/vendor/src/ for custom pages| Level | Criteria | |-------|----------| | Starter | No custom code beyond configuration | | Light custom | < 10 custom endpoints, < 5 workflows, no custom modules | | Heavy custom | Custom modules, > 10 workflows, custom admin pages, third-party integrations |
Communicate classification to user before proceeding.
For every custom element found, determine:
mercurjs add <block>Port in this order:
medusa-config.ts (plugins, modules, providers)packages/api/src/providers/, fix importspackages/api/src/modules/, register in configpackages/api/src/workflows/<entity>/packages/api/src/links/ (skip core duplicates)packages/api/src/subscribers/packages/api/src/api/, type both genericspackages/api/src/api/middlewares.tssrc/routes/ (NOT src/pages/ — dashboard SDK scans src/routes/), update importsAfter each group: run bun medusa develop and verify server starts.
After API routes: run bunx @mercurjs/cli@latest codegen.
After dashboard: run bun vite build in apps/admin and apps/vendor.
Stop and ask the user when:
index.ts files in workflows/ or steps/ (conflicts with block installation)Full migration documentation: https://docs.mercur.js/v2/migrations/overview
documentation
Plan and execute migration from Mercur 1.x to 2.0. Classifies project difficulty, reads relevant migration docs, and follows stop conditions.
development
Review code changes for contract compliance, type safety, and regression risk. Use after completing any non-trivial implementation, before merging PRs, or when asked to review code quality across any mercur package.
tools
Use Mercur CLI commands correctly inside a project created from the Mercur basic starter. Use when choosing between `create`, `init`, `add`, `search`, `view`, and `diff`.
tools
Discover, evaluate, install, and verify Mercur blocks in the basic starter using `blocks.json` aliases and CLI workflows.