Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

feat: add ai governance for basic template

Jakub Sieradzki6ae1edfd3892
diff --git a/bun.lock b/bun.lock
index c4d80399d..d1ff1bb21 100644
--- a/bun.lock
+++ b/bun.lock
@@ -38,7 +38,7 @@
},
"packages/admin": {
"name": "@mercurjs/admin",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"dependencies": {
"@ariakit/react": "^0.4.15",
"@babel/runtime": "^7.26.10",
@@ -51,8 +51,8 @@
"@medusajs/dashboard": "^2.13.3",
"@medusajs/icons": "2.13.3",
"@medusajs/ui": "4.1.1",
- "@mercurjs/client": "2.0.0-canary.85",
- "@mercurjs/dashboard-shared": "2.0.0-canary.85",
+ "@mercurjs/client": "2.0.0-canary.97",
+ "@mercurjs/dashboard-shared": "2.0.0-canary.97",
"@radix-ui/react-dialog": "1.1.4",
"@radix-ui/react-dismissable-layer": "1.1.4",
"@tanstack/react-query": "5.64.2",
@@ -98,7 +98,7 @@
},
"packages/cli": {
"name": "@mercurjs/cli",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"bin": {
"mercurjs": "./dist/index.js",
},
@@ -109,7 +109,7 @@
"@medusajs/admin-vite-plugin": "2.13.3",
"@medusajs/dashboard": "2.13.3",
"@medusajs/framework": "2.13.3",
- "@mercurjs/dashboard-sdk": "2.0.0-canary.94",
+ "@mercurjs/dashboard-sdk": "2.0.0-canary.97",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"commander": "^14.0.2",
@@ -153,7 +153,7 @@
},
"packages/client": {
"name": "@mercurjs/client",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"dependencies": {
"@tanstack/react-query": "^5.64.2",
"qs": "^6.12.1",
@@ -170,7 +170,7 @@
},
"packages/core-plugin": {
"name": "@mercurjs/core-plugin",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"devDependencies": {
"@medusajs/cli": "^2.13.3",
"@medusajs/core-flows": "^2.13.3",
@@ -211,7 +211,7 @@
},
"packages/dashboard-sdk": {
"name": "@mercurjs/dashboard-sdk",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"dependencies": {
"@babel/parser": "7.25.6",
"@babel/traverse": "7.25.6",
@@ -228,7 +228,7 @@
},
"packages/dashboard-shared": {
"name": "@mercurjs/dashboard-shared",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"dependencies": {
"@ariakit/react": "^0.4.15",
"@babel/runtime": "^7.26.10",
@@ -241,7 +241,7 @@
"@medusajs/dashboard": "^2.13.3",
"@medusajs/icons": "2.13.3",
"@medusajs/ui": "4.1.1",
- "@mercurjs/client": "2.0.0-canary.94",
+ "@mercurjs/client": "2.0.0-canary.97",
"@radix-ui/react-dialog": "1.1.4",
"@radix-ui/react-dismissable-layer": "1.1.4",
"@tanstack/react-query": "5.64.2",
@@ -282,13 +282,13 @@
},
"packages/providers/payout-stripe-connect": {
"name": "@mercurjs/payout-stripe-connect",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.97",
"dependencies": {
"stripe": "^15.5.0",
},
"devDependencies": {
"@medusajs/framework": "2.13.4",
- "@mercurjs/types": "2.0.0-canary.94",
+ "@mercurjs/types": "2.0.0-canary.97",
"tsup": "^8.5.0",
},
"peerDependencies": {
@@ -335,7 +335,7 @@
},
"packages/types": {
"name": "@mercurjs/types",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"dependencies": {
"@medusajs/types": "2.13.3",
},
@@ -345,7 +345,7 @@
},
"packages/vendor": {
"name": "@mercurjs/vendor",
- "version": "2.0.0-canary.94",
+ "version": "2.0.0-canary.98",
"dependencies": {
"@ariakit/react": "^0.4.15",
"@babel/runtime": "^7.26.10",
@@ -358,8 +358,8 @@
"@medusajs/dashboard": "^2.13.3",
"@medusajs/icons": "2.13.3",
"@medusajs/ui": "4.1.1",
- "@mercurjs/client": "2.0.0-canary.94",
- "@mercurjs/dashboard-shared": "2.0.0-canary.94",
+ "@mercurjs/client": "2.0.0-canary.97",
+ "@mercurjs/dashboard-shared": "2.0.0-canary.97",
"@radix-ui/react-dialog": "1.1.4",
"@radix-ui/react-dismissable-layer": "1.1.4",
"@tanstack/react-query": "5.64.2",
@@ -3527,16 +3527,26 @@
"@medusajs/ui/@medusajs/icons": ["@medusajs/[email protected]", "", { "peerDependencies": { "react": "^18.3.1" } }, "sha512-A0j+C4jURXSWARbxjEOXh3get9N7dY7n3TNTdmpOeY0XPZeDfKaL1yVBD2EC90jVTWY045whrMBCJUuV7kjYPg=="],
+ "@mercurjs/admin/@mercurjs/client": ["@mercurjs/[email protected]", "", { "dependencies": { "@tanstack/react-query": "^5.64.2", "qs": "^6.12.1" }, "peerDependencies": { "typescript": ">=4.8.0" } }, "sha512-K/cFfsuJas2JC7d4aM5MJuYR9O3fgDP1HaNfj25FmAjWvuHpRpDIQTpOBCYuoURftrKOTPzopNvP7zxwue/IXg=="],
+
+ "@mercurjs/admin/@mercurjs/dashboard-shared": ["@mercurjs/[email protected]", "", { "dependencies": { "@ariakit/react": "^0.4.15", "@babel/runtime": "^7.26.10", "@dnd-kit/core": "^6.1.0", "@dnd-kit/sortable": "^8.0.0", "@dnd-kit/utilities": "^3.2.2", "@hookform/error-message": "^2.0.1", "@hookform/resolvers": "3.4.2", "@medusajs/admin-shared": "^2.13.3", "@medusajs/dashboard": "^2.13.3", "@medusajs/icons": "2.13.3", "@medusajs/ui": "4.1.1", "@mercurjs/client": "2.0.0-canary.97", "@radix-ui/react-dialog": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.4", "@tanstack/react-query": "5.64.2", "@tanstack/react-table": "8.20.5", "@tanstack/react-virtual": "^3.8.3", "@uiw/react-json-view": "^2.0.0-alpha.17", "cmdk": "^0.2.0", "copy-to-clipboard": "^3.3.3", "date-fns": "^3.6.0", "i18next": "23.7.11", "i18next-browser-languagedetector": "7.2.0", "i18next-http-backend": "2.4.2", "lodash.debounce": "^4.0.8", "lodash.isequal": "^4.5.0", "match-sorter": "^6.3.4", "motion": "^11.15.0", "qs": "^6.12.1", "radix-ui": "1.1.2", "react-country-flag": "^3.1.0", "react-currency-input-field": "^3.6.11", "react-helmet-async": "^2.0.5", "react-hook-form": "7.49.1", "react-i18next": "13.5.0", "react-jwt": "^1.2.0", "react-router-dom": "6.30.3", "zod": "3.25.76" } }, "sha512-LueWIqtFE/5jcOsApZxuDO8iJs3FAcwo5135Y0xA17QJHzjYSDoZbx+QBiJWQxIu/eobnGxRJxTtC0fPM69uJg=="],
+
+ "@mercurjs/cli/@mercurjs/dashboard-sdk": ["@mercurjs/[email protected]", "", { "dependencies": { "@babel/parser": "7.25.6", "@babel/traverse": "7.25.6", "@babel/types": "7.25.6", "esbuild-register": "^3.6.0" } }, "sha512-Q0W+bOjALdwrwte503rIrEoE0MrMwNe//MtdiGNJAP20jO9VWxTUS0R1bABCT3HHjXP4SDMv3/7C0OcfSVUU2w=="],
+
"@mercurjs/client/@medusajs/framework": ["@medusajs/[email protected]", "", { "dependencies": { "@aws-sdk/client-dynamodb": "^3.218.0", "@jercle/yargonaut": "^1.1.5", "@medusajs/deps": "2.13.4", "@medusajs/modules-sdk": "2.13.4", "@medusajs/orchestration": "2.13.4", "@medusajs/telemetry": "2.13.4", "@medusajs/types": "2.13.4", "@medusajs/utils": "2.13.4", "@medusajs/workflows-sdk": "2.13.4", "@types/express": "^4.17.21", "chokidar": "^4.0.3", "compression": "^1.8.1", "connect-dynamodb": "^3.0.5", "connect-redis": "5.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "express": "^4.21.0", "express-session": "^1.17.3", "glob": "11.1.0", "jsonwebtoken": "^9.0.2", "lodash.memoize": "^4.1.2", "morgan": "^1.9.1", "path-to-regexp": "^8.2.0", "tsconfig-paths": "^4.2.0", "zod-validation-error": "3.5.1" }, "peerDependencies": { "@medusajs/cli": "2.13.4", "ioredis": "^5.4.1" }, "optionalPeers": ["ioredis"], "bin": { "medusa-mikro-orm": "dist/mikro-orm-cli/bin.js" } }, "sha512-OoamovYj/hkDyDSfj7zyaO48o4uyn+Us0+t789z5G90b5KYuUjx2Y2QX7OXy3pRLv6RbsgnyMfUfY5oi1iNFtQ=="],
"@mercurjs/core-plugin/@medusajs/framework": ["@medusajs/[email protected]", "", { "dependencies": { "@aws-sdk/client-dynamodb": "^3.218.0", "@jercle/yargonaut": "^1.1.5", "@medusajs/deps": "2.13.4", "@medusajs/modules-sdk": "2.13.4", "@medusajs/orchestration": "2.13.4", "@medusajs/telemetry": "2.13.4", "@medusajs/types": "2.13.4", "@medusajs/utils": "2.13.4", "@medusajs/workflows-sdk": "2.13.4", "@types/express": "^4.17.21", "chokidar": "^4.0.3", "compression": "^1.8.1", "connect-dynamodb": "^3.0.5", "connect-redis": "5.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "express": "^4.21.0", "express-session": "^1.17.3", "glob": "11.1.0", "jsonwebtoken": "^9.0.2", "lodash.memoize": "^4.1.2", "morgan": "^1.9.1", "path-to-regexp": "^8.2.0", "tsconfig-paths": "^4.2.0", "zod-validation-error": "3.5.1" }, "peerDependencies": { "@medusajs/cli": "2.13.4", "ioredis": "^5.4.1" }, "optionalPeers": ["ioredis"], "bin": { "medusa-mikro-orm": "dist/mikro-orm-cli/bin.js" } }, "sha512-OoamovYj/hkDyDSfj7zyaO48o4uyn+Us0+t789z5G90b5KYuUjx2Y2QX7OXy3pRLv6RbsgnyMfUfY5oi1iNFtQ=="],
"@mercurjs/dashboard-sdk/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg=="],
+ "@mercurjs/dashboard-shared/@mercurjs/client": ["@mercurjs/[email protected]", "", { "dependencies": { "@tanstack/react-query": "^5.64.2", "qs": "^6.12.1" }, "peerDependencies": { "typescript": ">=4.8.0" } }, "sha512-K/cFfsuJas2JC7d4aM5MJuYR9O3fgDP1HaNfj25FmAjWvuHpRpDIQTpOBCYuoURftrKOTPzopNvP7zxwue/IXg=="],
+
"@mercurjs/integration-tests/@medusajs/framework": ["@medusajs/[email protected]", "", { "dependencies": { "@aws-sdk/client-dynamodb": "^3.218.0", "@jercle/yargonaut": "^1.1.5", "@medusajs/deps": "2.13.4", "@medusajs/modules-sdk": "2.13.4", "@medusajs/orchestration": "2.13.4", "@medusajs/telemetry": "2.13.4", "@medusajs/types": "2.13.4", "@medusajs/utils": "2.13.4", "@medusajs/workflows-sdk": "2.13.4", "@types/express": "^4.17.21", "chokidar": "^4.0.3", "compression": "^1.8.1", "connect-dynamodb": "^3.0.5", "connect-redis": "5.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "express": "^4.21.0", "express-session": "^1.17.3", "glob": "11.1.0", "jsonwebtoken": "^9.0.2", "lodash.memoize": "^4.1.2", "morgan": "^1.9.1", "path-to-regexp": "^8.2.0", "tsconfig-paths": "^4.2.0", "zod-validation-error": "3.5.1" }, "peerDependencies": { "@medusajs/cli": "2.13.4", "ioredis": "^5.4.1" }, "optionalPeers": ["ioredis"], "bin": { "medusa-mikro-orm": "dist/mikro-orm-cli/bin.js" } }, "sha512-OoamovYj/hkDyDSfj7zyaO48o4uyn+Us0+t789z5G90b5KYuUjx2Y2QX7OXy3pRLv6RbsgnyMfUfY5oi1iNFtQ=="],
"@mercurjs/payout-stripe-connect/@medusajs/framework": ["@medusajs/[email protected]", "", { "dependencies": { "@aws-sdk/client-dynamodb": "^3.218.0", "@jercle/yargonaut": "^1.1.5", "@medusajs/deps": "2.13.4", "@medusajs/modules-sdk": "2.13.4", "@medusajs/orchestration": "2.13.4", "@medusajs/telemetry": "2.13.4", "@medusajs/types": "2.13.4", "@medusajs/utils": "2.13.4", "@medusajs/workflows-sdk": "2.13.4", "@types/express": "^4.17.21", "chokidar": "^4.0.3", "compression": "^1.8.1", "connect-dynamodb": "^3.0.5", "connect-redis": "5.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "express": "^4.21.0", "express-session": "^1.17.3", "glob": "11.1.0", "jsonwebtoken": "^9.0.2", "lodash.memoize": "^4.1.2", "morgan": "^1.9.1", "path-to-regexp": "^8.2.0", "tsconfig-paths": "^4.2.0", "zod-validation-error": "3.5.1" }, "peerDependencies": { "@medusajs/cli": "2.13.4", "ioredis": "^5.4.1" }, "optionalPeers": ["ioredis"], "bin": { "medusa-mikro-orm": "dist/mikro-orm-cli/bin.js" } }, "sha512-OoamovYj/hkDyDSfj7zyaO48o4uyn+Us0+t789z5G90b5KYuUjx2Y2QX7OXy3pRLv6RbsgnyMfUfY5oi1iNFtQ=="],
+ "@mercurjs/payout-stripe-connect/@mercurjs/types": ["@mercurjs/[email protected]", "", { "dependencies": { "@medusajs/types": "2.13.3" } }, "sha512-lnxnuohkm/donxoDIgruRw0s5NfnFRQ9h7G8PwIm7G2C7+2YrHZ2HIU+pDR9c0lX4BcdJLi3dt275wCyRFy7KA=="],
+
"@mercurjs/registry/@medusajs/framework": ["@medusajs/[email protected]", "", { "dependencies": { "@aws-sdk/client-dynamodb": "^3.218.0", "@jercle/yargonaut": "^1.1.5", "@medusajs/deps": "2.13.4", "@medusajs/modules-sdk": "2.13.4", "@medusajs/orchestration": "2.13.4", "@medusajs/telemetry": "2.13.4", "@medusajs/types": "2.13.4", "@medusajs/utils": "2.13.4", "@medusajs/workflows-sdk": "2.13.4", "@types/express": "^4.17.21", "chokidar": "^4.0.3", "compression": "^1.8.1", "connect-dynamodb": "^3.0.5", "connect-redis": "5.2.0", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "express": "^4.21.0", "express-session": "^1.17.3", "glob": "11.1.0", "jsonwebtoken": "^9.0.2", "lodash.memoize": "^4.1.2", "morgan": "^1.9.1", "path-to-regexp": "^8.2.0", "tsconfig-paths": "^4.2.0", "zod-validation-error": "3.5.1" }, "peerDependencies": { "@medusajs/cli": "2.13.4", "ioredis": "^5.4.1" }, "optionalPeers": ["ioredis"], "bin": { "medusa-mikro-orm": "dist/mikro-orm-cli/bin.js" } }, "sha512-OoamovYj/hkDyDSfj7zyaO48o4uyn+Us0+t789z5G90b5KYuUjx2Y2QX7OXy3pRLv6RbsgnyMfUfY5oi1iNFtQ=="],
"@mercurjs/registry/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg=="],
@@ -3545,6 +3555,10 @@
"@mercurjs/registry/react-jwt": ["[email protected]", "", { "optionalDependencies": { "fsevents": "^2.3.3" }, "peerDependencies": { "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-3TL+KTT51VLHNzXzM89UpKALtgnJrS5+jfo1p48CU1IpPwf62F/P1U+VKZTuQs+kCirPduT9TacrV5lvXqIH5Q=="],
+ "@mercurjs/vendor/@mercurjs/client": ["@mercurjs/[email protected]", "", { "dependencies": { "@tanstack/react-query": "^5.64.2", "qs": "^6.12.1" }, "peerDependencies": { "typescript": ">=4.8.0" } }, "sha512-K/cFfsuJas2JC7d4aM5MJuYR9O3fgDP1HaNfj25FmAjWvuHpRpDIQTpOBCYuoURftrKOTPzopNvP7zxwue/IXg=="],
+
+ "@mercurjs/vendor/@mercurjs/dashboard-shared": ["@mercurjs/[email protected]", "", { "dependencies": { "@ariakit/react": "^0.4.15", "@babel/runtime": "^7.26.10", "@dnd-kit/core": "^6.1.0", "@dnd-kit/sortable": "^8.0.0", "@dnd-kit/utilities": "^3.2.2", "@hookform/error-message": "^2.0.1", "@hookform/resolvers": "3.4.2", "@medusajs/admin-shared": "^2.13.3", "@medusajs/dashboard": "^2.13.3", "@medusajs/icons": "2.13.3", "@medusajs/ui": "4.1.1", "@mercurjs/client": "2.0.0-canary.97", "@radix-ui/react-dialog": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.4", "@tanstack/react-query": "5.64.2", "@tanstack/react-table": "8.20.5", "@tanstack/react-virtual": "^3.8.3", "@uiw/react-json-view": "^2.0.0-alpha.17", "cmdk": "^0.2.0", "copy-to-clipboard": "^3.3.3", "date-fns": "^3.6.0", "i18next": "23.7.11", "i18next-browser-languagedetector": "7.2.0", "i18next-http-backend": "2.4.2", "lodash.debounce": "^4.0.8", "lodash.isequal": "^4.5.0", "match-sorter": "^6.3.4", "motion": "^11.15.0", "qs": "^6.12.1", "radix-ui": "1.1.2", "react-country-flag": "^3.1.0", "react-currency-input-field": "^3.6.11", "react-helmet-async": "^2.0.5", "react-hook-form": "7.49.1", "react-i18next": "13.5.0", "react-jwt": "^1.2.0", "react-router-dom": "6.30.3", "zod": "3.25.76" } }, "sha512-LueWIqtFE/5jcOsApZxuDO8iJs3FAcwo5135Y0xA17QJHzjYSDoZbx+QBiJWQxIu/eobnGxRJxTtC0fPM69uJg=="],
+
"@mikro-orm/cli/fs-extra": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew=="],
"@mikro-orm/core/dotenv": ["[email protected]", "", {}, "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg=="],
diff --git a/templates/basic/.ai/skills/README.md b/templates/basic/.ai/skills/README.md
new file mode 100644
index 000000000..9fd63fead
--- /dev/null
+++ b/templates/basic/.ai/skills/README.md
@@ -0,0 +1,39 @@
+# Mercur Basic Starter Skills
+
+This directory contains the canonical, starter-safe skills shipped with the `basic` Mercur template.
+
+Use these skills for repeated workflows in a project created from this starter.
+
+## Available skills
+
+- `mercur-cli`
+- `mercur-blocks`
+- `medusa-ui-conformance`
+- `admin-page-ui`
+- `admin-form-ui`
+- `admin-tab-ui`
+
+## Linking to your agent runtime
+
+`.ai/skills/` is the single source of truth. Link it to your runtime:
+
+### Claude Code
+
+```bash
+mkdir -p .claude
+ln -s ../.ai/skills .claude/skills
+```
+
+### Codex
+
+```bash
+mkdir -p .codex
+ln -s ../.ai/skills .codex/skills
+```
+
+### Verify
+
+```bash
+# Claude Code — type /skills to see available skills
+# Codex — type /skills to see available skills
+```
diff --git a/templates/basic/.ai/skills/admin-form-ui/SKILL.md b/templates/basic/.ai/skills/admin-form-ui/SKILL.md
new file mode 100644
index 000000000..ab5481751
--- /dev/null
+++ b/templates/basic/.ai/skills/admin-form-ui/SKILL.md
@@ -0,0 +1,44 @@
+---
+name: admin-form-ui
+description: Create or modify admin forms in the Mercur basic starter using stable form structure, validation, submission guards, and dashboard UI conventions.
+---
+
+# Admin Form UI
+
+Use this skill when:
+- adding or editing an admin form
+- wiring page-level create or edit flows
+- reviewing submission, validation, or field structure
+
+## Core rule
+
+Prefer the existing Mercur admin form pattern already present in the screen or package. Do not introduce a parallel form system just because it is locally convenient.
+
+Before introducing custom field wrappers, selectors, overlays, or other interactive form UI, apply `medusa-ui-conformance`.
+
+## Hard rules
+
+1. Do not hardcode labels, hints, or button text; use i18n.
+2. Do not ship forms without explicit validation behavior.
+3. Do not rely only on button disabled state; submission guards must also protect non-button submit paths.
+4. Do not flatten large forms into one unstructured wall of fields.
+5. Do not add ad hoc field wrappers when the existing project already has a preferred form composition.
+
+## Preferred patterns
+
+- Use schema-driven validation when the form is non-trivial.
+- Group related fields together and keep labels, hints, and errors predictable.
+- Preserve loading, pending, success, and failure behavior in submission flows.
+- When extending an existing Mercur form, follow its established wrapper, field, and footer shape.
+
+## When to switch skills
+
+- If the task is mainly page structure, use `admin-page-ui`.
+- If the task is mainly a tabbed wizard, use `admin-tab-ui`.
+
+## Verification
+
+- confirm validation fires on the expected fields
+- confirm the submit path is guarded during pending async work
+- confirm translated copy, hints, and errors remain coherent
+- run admin build or lint after non-trivial form changes
diff --git a/templates/basic/.ai/skills/admin-page-ui/SKILL.md b/templates/basic/.ai/skills/admin-page-ui/SKILL.md
new file mode 100644
index 000000000..f80e98e80
--- /dev/null
+++ b/templates/basic/.ai/skills/admin-page-ui/SKILL.md
@@ -0,0 +1,46 @@
+---
+name: admin-page-ui
+description: Create or modify admin pages in the Mercur basic starter using correct routing, page composition, i18n, and dashboard UI conventions.
+---
+
+# Admin Page UI
+
+Use this skill when:
+- adding a new admin page under `apps/admin/src/pages`
+- extending a list or detail page
+- adding page-level actions, sections, or empty states
+
+## First checks
+
+- Confirm the route file belongs under `apps/admin/src/pages`.
+- Decide whether the task is page-level, form-level, or tab-level.
+- Before inventing custom UI, apply `medusa-ui-conformance`.
+- If it is form-only, use `admin-form-ui`.
+- If it is tabbed wizard work, use `admin-tab-ui`.
+
+## Hard rules
+
+1. Do not hardcode user-facing strings; use i18n.
+2. Do not hide route behavior behind unclear folder structure; keep file-based routing obvious.
+3. Do not ship a page without explicit loading, empty, error, and success-state thinking.
+4. Do not invent a brand-new page anatomy when an existing Mercur admin page pattern already fits.
+5. Do not scatter action buttons and page actions without a clear header structure.
+
+## Page patterns
+
+- List pages should have a clear title, actions, and data state handling.
+- Detail pages should have a stable header plus clearly grouped sections.
+- Section-heavy screens should stay scannable and avoid one giant unstructured column.
+
+## Routing expectations
+
+- `page.tsx` controls the route.
+- Export route metadata when the page should appear in navigation.
+- Keep nested routes and dynamic segments easy to infer from the folder path.
+
+## Verification
+
+- confirm the route resolves
+- confirm the page copy is translated or translation-ready
+- confirm loading and error behavior still make sense
+- run admin build or lint after non-trivial page work
diff --git a/templates/basic/.ai/skills/admin-tab-ui/SKILL.md b/templates/basic/.ai/skills/admin-tab-ui/SKILL.md
new file mode 100644
index 000000000..bb2fc8d81
--- /dev/null
+++ b/templates/basic/.ai/skills/admin-tab-ui/SKILL.md
@@ -0,0 +1,40 @@
+---
+name: admin-tab-ui
+description: Create or modify tabbed admin workflows in the Mercur basic starter using stable tab structure, validation scope, and i18n-aware wizard conventions.
+---
+
+# Admin Tab UI
+
+Use this skill when:
+- adding a custom tab to a tabbed admin flow
+- extending a multi-step wizard
+- reviewing tab layout, validation scope, or navigation behavior
+
+Before introducing custom interactive UI inside a tab, apply `medusa-ui-conformance`.
+
+## Hard rules
+
+1. Do not hardcode tab labels; use i18n-aware metadata.
+2. Do not put all fields into one flat tab without section structure.
+3. Do not ignore forward-navigation validation scope.
+4. Do not break keyboard or submit behavior when adding a tab.
+5. Do not assume tabs are static if visibility depends on form state.
+
+## Preferred patterns
+
+- Give each tab a single clear purpose.
+- Keep a visible header and grouped sections inside the tab body.
+- Keep validation fields scoped to the tab when the flow expects step-by-step validation.
+- Preserve navigation behavior when tabs appear or disappear dynamically.
+
+## When to switch skills
+
+- Page shell work -> `admin-page-ui`
+- Form field work without wizard concerns -> `admin-form-ui`
+
+## Verification
+
+- confirm the tab label and content are translation-ready
+- confirm forward navigation validates the intended fields
+- confirm dynamic visibility does not leave the flow in an invalid state
+- run admin build or lint after non-trivial tab work
diff --git a/templates/basic/.ai/skills/medusa-ui-conformance/SKILL.md b/templates/basic/.ai/skills/medusa-ui-conformance/SKILL.md
new file mode 100644
index 000000000..006b51017
--- /dev/null
+++ b/templates/basic/.ai/skills/medusa-ui-conformance/SKILL.md
@@ -0,0 +1,49 @@
+---
+name: medusa-ui-conformance
+description: Keep custom admin and vendor UI in the Mercur basic starter aligned with local wrappers and @medusajs/ui. Use when adding reusable UI, interactive primitives, overlays, menus, selectors, or custom dashboard components.
+---
+
+# Medusa UI Conformance
+
+Use this skill when:
+- adding custom admin or vendor UI
+- creating reusable components
+- deciding whether to build, reuse, or compose an interaction pattern
+
+This starter does not assume direct Radix usage on day one.
+
+Use this order:
+1. existing local wrapper
+2. `@medusajs/ui`
+3. composition of existing wrappers plus `@medusajs/ui`
+4. only then add a lower-level primitive if the project genuinely needs it
+
+## Hard rules
+
+1. Do not build a custom dropdown, dialog, drawer, tooltip, popover, tabs, accordion, or select if `@medusajs/ui` already covers the interaction.
+2. Do not add a new shared component when an existing local wrapper already solves the pattern.
+3. Do not introduce custom interactive UI without keyboard behavior, focus handling, i18n, and stable `data-testid` coverage.
+4. Do not create a one-off visual language that fights the rest of the dashboard.
+5. Do not treat low-level primitives as the default starting point for UI work.
+
+## Decision checks
+
+Before creating custom UI, ask:
+- does this pattern already exist in shared components?
+- can `@medusajs/ui` solve this directly?
+- can I compose the solution from existing wrappers and Medusa UI components?
+- if not, is the gap real and reusable enough to justify a new shared component?
+
+## Review checklist
+
+- reused an existing wrapper where possible
+- preferred `@medusajs/ui` over custom primitives
+- kept copy translation-ready
+- kept interaction accessible and testable
+- kept the component reusable if the pattern is shared
+
+## Verification
+
+- run the relevant app lint/build
+- manually check keyboard and focus behavior for non-trivial interactions
+- verify translated copy and labels
diff --git a/templates/basic/.ai/skills/mercur-blocks/SKILL.md b/templates/basic/.ai/skills/mercur-blocks/SKILL.md
new file mode 100644
index 000000000..59a585f0a
--- /dev/null
+++ b/templates/basic/.ai/skills/mercur-blocks/SKILL.md
@@ -0,0 +1,53 @@
+---
+name: mercur-blocks
+description: Discover, evaluate, install, and verify Mercur blocks in the basic starter using `blocks.json` aliases and CLI workflows.
+---
+
+# Mercur Blocks Workflow
+
+Use this skill when:
+- evaluating whether a block fits the starter project
+- adding a block
+- checking installed block impact
+- updating a block and reviewing drift
+
+## Alias map
+
+In the basic starter:
+- `api` -> `packages/api/src`
+- `admin` -> `apps/admin/src`
+- `vendor` -> `apps/vendor/src`
+
+Think about block impact by alias destination, not just by name.
+
+## Workflow
+
+1. Search if the exact block name is not known.
+2. View the block before installation.
+3. Identify which aliases and workspaces it will touch.
+4. Add the block.
+5. Inspect the installed files.
+6. Run the smallest relevant verification set.
+
+## Post-install checklist
+
+- Did files land under `packages/api/src`, `apps/admin/src`, or `apps/vendor/src`?
+- Does `packages/api/medusa-config.ts` need module or provider registration?
+- Did the block add API routes that require codegen?
+- Did the block add UI routes that require admin or vendor build verification?
+- Did the block docs require env vars, middleware, or config changes?
+
+## Useful commands
+
+```bash
+npx @mercurjs/cli@canary search --query <keyword>
+npx @mercurjs/cli@canary view <block>
+npx @mercurjs/cli@canary add <block>
+npx @mercurjs/cli@canary diff <block>
+```
+
+## Avoid
+
+- adding blocks without reviewing their docs first
+- ignoring config or env follow-up after install
+- skipping `diff` when reviewing block updates
diff --git a/templates/basic/.ai/skills/mercur-cli/SKILL.md b/templates/basic/.ai/skills/mercur-cli/SKILL.md
new file mode 100644
index 000000000..51783f596
--- /dev/null
+++ b/templates/basic/.ai/skills/mercur-cli/SKILL.md
@@ -0,0 +1,62 @@
+---
+name: mercur-cli
+description: 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`.
+---
+
+# Mercur CLI
+
+Use this skill when:
+- creating a new Mercur project
+- initializing `blocks.json`
+- searching, viewing, adding, or diffing blocks
+- deciding whether a command should run from the project root or a workspace
+
+## Command map
+
+- `create` — create a new Mercur project
+- `init` — create `blocks.json` in an existing project
+- `search` — search the registry
+- `view` — inspect a block before installation
+- `add` — install a block
+- `diff` — compare local installed block files against the registry
+
+## Where commands run
+
+- Run Mercur CLI registry commands from the project root where `blocks.json` lives.
+- Run backend verification from `packages/api` after install if backend files changed.
+- Run admin or vendor verification from `apps/admin` or `apps/vendor` after UI installs or edits.
+
+## Common flows
+
+### Discover and inspect a block
+
+```bash
+npx @mercurjs/cli@canary search --query review
+npx @mercurjs/cli@canary view reviews
+```
+
+### Add a block
+
+```bash
+npx @mercurjs/cli@canary add reviews
+```
+
+### Check local drift
+
+```bash
+npx @mercurjs/cli@canary diff reviews
+```
+
+## After `add`
+
+Always inspect:
+- where files landed based on `blocks.json`
+- whether `packages/api/medusa-config.ts` needs an update
+- whether route types need codegen
+- whether backend or app builds should run
+
+## Avoid
+
+- running registry commands outside the project root
+- guessing block names without `search` or `view`
+- assuming an installed block only changed one workspace
diff --git a/templates/basic/.ai/skills/migration-guide/SKILL.md b/templates/basic/.ai/skills/migration-guide/SKILL.md
new file mode 100644
index 000000000..43c8418bd
--- /dev/null
+++ b/templates/basic/.ai/skills/migration-guide/SKILL.md
@@ -0,0 +1,160 @@
+---
+name: migration-guide
+description: Analyze a Mercur 1.x project and guide migration to 2.0. Self-contained — works without access to the mercur monorepo.
+argument-hint: "[path-to-old-project]"
+---
+
+# Migration Guide: Mercur 1.x → 2.0
+
+Use this skill when:
+- Migrating an existing Mercur 1.x project to 2.0
+- Evaluating migration scope or effort
+- Porting custom backend or dashboard code
+
+## Package Mapping
+
+| 1.x | 2.0 |
+|-------|--------|
+| `@mercurjs/b2c-core` | `@mercurjs/core-plugin` — all core modules built in |
+| `@mercurjs/commission` | Built into core-plugin |
+| `@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) |
+
+## Directory Mapping
+
+| 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/pages/` |
+| `apps/vendor/src/routes/` | `apps/vendor/src/pages/` |
+
+## Import Changes
+
+| 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-plugin"` |
+
+## Provider Registration
+
+Custom providers in `medusa-config.ts` must use `./src/` prefix:
+
+```typescript
+// 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`:
+
+```typescript
+import { Modules, ModuleProvider } from "@medusajs/framework/utils"
+```
+
+## Config Migration
+
+`medusa-config.ts` plugin registration changed:
+
+```typescript
+// 1.x
+plugins: [{ resolve: "@mercurjs/b2c-core", options: {} }]
+
+// 2.0
+plugins: [{ resolve: "@mercurjs/core-plugin", options: {} }]
+// + individual module registrations in modules array
+```
+
+## Workflow
+
+### Step 1: Analyze the old project
+
+Scan the 1.x project the user provides:
+- Read `package.json` — list all `@mercurjs/*` and `@medusajs/*` dependencies. Note the `@mercurjs/b2c-core` version to determine project version.
+- If version < 1.4.0: custom admin code is inside the backend repo (not `apps/admin/`) — search `apps/backend/` when scanning for custom dashboard pages
+- Read `medusa-config.ts` — list plugins, modules, providers
+- Scan `src/modules/` — count and list custom modules
+- Scan `src/workflows/` — count custom workflows
+- Scan `src/api/` — count custom API routes
+- Scan `src/subscribers/` — count subscribers
+- Scan `src/links/` — count custom links
+- Check `apps/admin/src/` and `apps/vendor/src/` for custom pages
+
+### Step 2: Classify
+
+| 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.
+
+### Step 3: Map each element
+
+For every custom element found, determine:
+- Has 2.0 equivalent in core-plugin? → skip, already there
+- Has registry block? → install with `mercurjs add <block>`
+- Needs manual port? → queue for Step 4
+
+### Step 4: Execute migration
+
+Port in this order:
+1. **Config** — update `medusa-config.ts` (plugins, modules, providers)
+2. **Providers** — copy to `packages/api/src/providers/`, fix imports
+3. **Modules** — copy to `packages/api/src/modules/`, register in config
+4. **Workflows** — copy to `packages/api/src/workflows/<entity>/`
+5. **Links** — copy to `packages/api/src/links/` (skip core-plugin duplicates)
+6. **Subscribers** — copy to `packages/api/src/subscribers/`
+7. **API routes** — copy to `packages/api/src/api/`, type both generics
+8. **Middleware** — merge into `packages/api/src/api/middlewares.ts`
+9. **Dashboard pages** — move to `src/pages/`, update imports
+
+After each group: run `bun medusa develop` and verify server starts.
+
+After API routes: run `bunx @mercurjs/cli@canary codegen`.
+
+After dashboard: run `bun vite build` in `apps/admin` and `apps/vendor`.
+
+### Step 5: Verify
+
+- Server starts without errors
+- All custom endpoints respond
+- Dashboard builds without errors
+- Custom pages render in browser
+
+## Stop Conditions
+
+Stop and ask the user when:
+- A custom module depends on internal APIs not in core-plugin
+- A third-party integration has no clear migration path
+- Database schema conflicts arise
+- The old project uses MedusaJS core modifications
+- You cannot classify the project difficulty
+- Server fails to start after porting and the cause is unclear
+
+## Avoid
+
+- Do not attempt in-place upgrades of 1.x projects
+- Do not install 1.x packages in a 2.0 project
+- Do not create barrel `index.ts` files in `workflows/` or `steps/` (conflicts with block installation)
+- Do not duplicate links that core-plugin already provides
+
+## More Info
+
+Full migration documentation: https://docs.mercur.js/v2/migrations/overview
diff --git a/templates/basic/CLAUDE.md b/templates/basic/CLAUDE.md
new file mode 100644
index 000000000..594196adb
--- /dev/null
+++ b/templates/basic/CLAUDE.md
@@ -0,0 +1,80 @@
+# Mercur Basic Starter Agent Guide
+
+This file is the primary workflow guide for agents working inside a project created from the `basic` Mercur template.
+
+Use this file to answer four questions before making a non-trivial change:
+- where should I work?
+- which starter contract surfaces am I touching?
+- which shared skill should I use?
+- what should I verify before I finish?
+
+This starter does not require a spec-first workflow. Teams can add planning artifacts later if they want, but this template focuses on operational knowledge for shipping changes safely.
+
+## Workflow
+
+For any non-trivial task:
+1. understand the request
+2. read this file
+3. read every matching area guide from the Task Router
+4. load a matching skill from `.ai/skills/` when the task is a repeated workflow
+5. implement in small steps
+6. run the smallest relevant verification set
+7. report what was verified and what was not
+
+## Task Router
+
+- Backend API, modules, workflows, links, subscribers, jobs: `packages/api/AGENTS.md`
+- Admin extensions, custom pages, forms, tabs: `apps/admin/AGENTS.md`
+- Vendor extensions, custom pages, vendor flows: `apps/vendor/AGENTS.md`
+
+## Starter Contract Surfaces
+
+Treat these as public starter contracts. Do not change them silently:
+
+- `blocks.json` aliases and registry configuration
+- `packages/api/src/*` structure and custom backend entrypoints
+- `packages/api/medusa-config.ts`
+- `@acme/api/_generated` route types and codegen-dependent behavior
+- `apps/admin/src/*` route and page structure
+- `apps/vendor/src/*` route and page structure
+- `apps/admin/vite.config.ts` — panel bootstrap via `mercurDashboardPlugin`
+- `apps/vendor/vite.config.ts` — panel bootstrap via `mercurDashboardPlugin`
+
+## Shared Skills
+
+Canonical shared skills live in `.ai/skills/`.
+
+Focused core skills in this starter:
+- `mercur-cli`
+- `mercur-blocks`
+- `medusa-ui-conformance`
+- `admin-page-ui`
+- `admin-form-ui`
+- `admin-tab-ui`
+- `migration-guide`
+
+Runtime mirrors exist in:
+- `.claude/skills/`
+- `.codex/skills/`
+
+Use `.ai/skills/` as the source of truth. The runtime folders are compatibility mirrors.
+
+## Typical Verification
+
+Run only what matches the touched area, but do not skip checks that prove a touched contract still holds.
+
+Typical checks:
+- root build or workspace build
+- backend tests from `packages/api`
+- admin or vendor lint/build
+- codegen when routes or generated types changed
+- manual verification for new pages, routes, or block installs
+
+## Starter Notes
+
+- Mercur CLI registry commands run from the project root where `blocks.json` lives.
+- Backend verification often runs from `packages/api`.
+- Admin and vendor custom routes are file-based under `src/pages`.
+- If a task is about blocks, always use `mercur-blocks`.
+- If a task is about CLI choice, initialization, or registry commands, use `mercur-cli`.
+- If a task adds custom admin or vendor UI, load `medusa-ui-conformance` before inventing new components.
diff --git a/templates/basic/apps/admin/CLAUDE.md b/templates/basic/apps/admin/CLAUDE.md
new file mode 100644
index 000000000..9908a980f
--- /dev/null
+++ b/templates/basic/apps/admin/CLAUDE.md
@@ -0,0 +1,66 @@
+# Admin App Guide
+
+This guide covers work in `apps/admin`.
+
+Read this guide when a task touches:
+- custom admin pages
+- page-level UI and section layout
+- admin forms
+- custom admin tabs or wizard steps
+- admin route configuration or extension wiring
+
+## Scope
+
+`apps/admin` owns:
+- custom file-based routes under `src/pages`
+- admin-specific route exports and navigation metadata
+- Vite bootstrap configuration in `vite.config.ts`
+
+Dashboard mounting (which app, which path) is configured in `packages/api/medusa-config.ts` via the `admin-ui` module — not in this app.
+
+If `src/pages` does not exist yet, create it when adding the first custom page.
+
+## Routing
+
+Admin pages are file-based:
+- create `page.tsx` files under `src/pages`
+- use file path shape to control route path
+- export route config when the page should appear in navigation
+
+Use `templates/basic/apps/admin/src/README.md` as the starter routing reference.
+
+## Which skill to use
+
+- Any custom UI or reusable interaction pattern -> `medusa-ui-conformance`
+- Page or section work -> `admin-page-ui`
+- Form work -> `admin-form-ui`
+- Tabbed wizard work -> `admin-tab-ui`
+
+Load the matching skill before editing page, form, or tab-heavy UI.
+
+## Preferred patterns
+
+- Keep routing explicit and aligned with file-based page structure.
+- Prefer existing local wrappers and `@medusajs/ui` before introducing new primitives or custom components.
+- Use i18n for user-facing strings instead of hardcoded copy.
+- Prefer typed API usage through shared Mercur client patterns.
+- Preserve loading, error, empty, and success states when extending screens.
+- Keep page composition intentional: header, actions, sections, and data states should be easy to scan.
+
+## Dashboard wiring
+
+Dashboard mounting (path, appDir) lives in `packages/api/medusa-config.ts` under the `admin-ui` module entry.
+
+Review `vite.config.ts` when a change:
+- updates the `medusaConfigPath` reference
+- adds or changes Vite plugins for the admin app
+
+## Verification
+
+After non-trivial admin changes, verify the smallest relevant set:
+- app build
+- app lint
+- manual route check for newly added pages
+- manual form or tab behavior check if the task changed a submission flow
+
+If the page depends on backend changes, also verify the matching backend behavior.
diff --git a/templates/basic/apps/vendor/CLAUDE.md b/templates/basic/apps/vendor/CLAUDE.md
new file mode 100644
index 000000000..e50b28f78
--- /dev/null
+++ b/templates/basic/apps/vendor/CLAUDE.md
@@ -0,0 +1,62 @@
+# Vendor App Guide
+
+This guide covers work in `apps/vendor`.
+
+Read this guide when a task touches:
+- custom vendor pages
+- vendor routing and navigation
+- vendor-facing request or data flows
+- vendor i18n or UI behavior
+
+## Scope
+
+`apps/vendor` owns:
+- custom vendor routes under `src/pages`
+- vendor page composition and request flow
+- Vite bootstrap configuration in `vite.config.ts`
+
+Dashboard mounting (which app, which path) is configured in `packages/api/medusa-config.ts` via the `vendor-ui` module — not in this app.
+
+If `src/pages` does not exist yet, create it when adding the first custom page.
+
+## Routing
+
+Vendor pages are file-based:
+- create `page.tsx` files under `src/pages`
+- use the file path to control the route
+- export route metadata when needed for navigation or nested behavior
+
+## Preferred patterns
+
+- Keep route structure explicit and easy to trace.
+- Load `medusa-ui-conformance` before introducing custom reusable UI or new interaction primitives.
+- Prefer existing local wrappers and `@medusajs/ui` before adding lower-level primitives.
+- Use i18n for user-facing strings.
+- Prefer typed client access over ad hoc request code.
+- Preserve loading, empty, error, and success states when extending flows.
+- Think through backend and block dependencies together when adding vendor pages.
+
+## Dashboard wiring
+
+Dashboard mounting (path, appDir) lives in `packages/api/medusa-config.ts` under the `vendor-ui` module entry.
+
+Review `vite.config.ts` when a change:
+- updates the `medusaConfigPath` reference
+- adds or changes Vite plugins for the vendor app
+
+## Blocks and backend coupling
+
+Many vendor changes arrive through blocks. When a task installs or extends a block:
+- inspect the `vendor` alias output
+- verify whether the block also touched `api`
+- re-check the vendor page flow against the backend behavior
+
+## Verification
+
+After non-trivial vendor changes, verify the smallest relevant set:
+- app build
+- app lint
+- manual route check for newly added pages
+- manual flow verification for pages that depend on backend responses or auth state
+
+If the task depends on backend changes, verify the matching backend checks too.
diff --git a/templates/basic/packages/api/CLAUDE.md b/templates/basic/packages/api/CLAUDE.md
new file mode 100644
index 000000000..1d85993a9
--- /dev/null
+++ b/templates/basic/packages/api/CLAUDE.md
@@ -0,0 +1,83 @@
+# API Workspace Guide
+
+This guide covers work in `packages/api`.
+
+Read this guide when a task touches:
+- custom API routes
+- modules, services, models, and migrations
+- workflows, links, subscribers, or jobs
+- backend configuration or generated route types
+
+## Scope
+
+`packages/api` owns:
+- Medusa backend configuration in `medusa-config.ts`
+- custom code under `src/`
+- route type codegen consumed through `./_generated`
+- backend tests and verification commands
+
+If `src/` does not exist yet, create only the folders needed for the feature:
+- `src/api`
+- `src/modules`
+- `src/workflows`
+- `src/links`
+- `src/subscribers`
+- `src/jobs`
+- `src/scripts`
+
+## Choosing the right backend surface
+
+- Use a **route** when you need an HTTP endpoint.
+- Use a **module** when you need a persistent domain model or service boundary.
+- Use a **workflow** when the feature is a multi-step business process.
+- Use a **link** when the feature defines a relationship across modules.
+- Use a **subscriber** when the feature reacts to domain events.
+- Use a **job** when the feature runs on a schedule or in the background.
+
+## `blocks.json` relationship
+
+Blocks installed through Mercur CLI route backend files through the `api` alias:
+- `api` -> `packages/api/src`
+
+If a block touches backend code, inspect:
+- installed file locations
+- required updates to `medusa-config.ts`
+- whether codegen or backend tests must run afterwards
+
+## Commands that already exist
+
+Run these from `packages/api` unless noted otherwise:
+- `dev`
+- `dev:codegen`
+- `build`
+- `test:integration:http`
+- `test:integration:modules`
+- `test:unit`
+
+## Codegen
+
+Run route codegen when a task changes:
+- route paths
+- request or response typing used by generated routes
+- block-installed API routes that should surface in generated types
+
+If a route task changes generated types, confirm `@acme/api/_generated` still makes sense for consumers.
+
+## `medusa-config.ts`
+
+Review `medusa-config.ts` when a task:
+- adds a module
+- adds module options
+- needs env-driven configuration
+- adds a provider, feature, or plugin-level dependency
+
+## Verification
+
+After non-trivial backend changes, verify the smallest relevant set:
+- `build`
+- `test:integration:http` for changed route behavior
+- `test:integration:modules` for module-level behavior
+- `test:unit` for local utility or service logic
+- `dev:codegen` or equivalent codegen verification when generated types changed
+
+If a block was installed, also verify the files landed in the expected `src/*` locations.