medusa-development
БесплатноБез исполняемых скриптовНе проверенExtend the open-source Medusa commerce platform with custom services, event subscribers, and API endpoints for unique business requirements
от finsilabs★ 69 звёзд на GitHubОб этом скилле
Medusa.js Development
Overview
Build and extend headless e-commerce backends with Medusa.js using custom services, subscribers (event handlers), API route extensions, custom entities with migrations, and module architecture. This skill covers Medusa v2 project setup, the dependency injection container, custom workflows, admin UI extensions, and integration patterns for connecting Medusa to storefronts, ERPs, and payment providers.
When to Use This Skill
- When setting up a new headless e-commerce backend with Medusa
- When building custom business logic as Medusa services and workflows
- When extending the Medusa API with custom endpoints for storefront or admin use
- When implementing event-driven automation via subscribers (e.g., send email on order placed)
- When integrating external systems (ERP, CMS, fulfillment) with Medusa
Prerequisites & Platform Notes
This skill is written for custom/headless storefronts (Node.js, Python, or similar backend). The code examples use TypeScript/Node.js and can be adapted to any stack.
Shopify: Shopify Hydrogen is Shopify's headless framework. MACH/composable patterns apply when using Shopify as the commerce backend with a custom frontend, or when mixing Shopify with other best-of-breed services. WooCommerce: WooCommerce can serve as a headless backend via its REST API and WPGraphQL. These patterns apply when decoupling the frontend from WordPress. Magento: Magento's GraphQL API and PWA Studio support headless architectures. These composable patterns apply to Magento as a backend service in a MACH stack.
You'll need:
- Node.js 18+ (or adapt to your backend language)
- PostgreSQL (or your preferred relational database)
- Redis for caching/queues
- Stripe account and API keys
- An email sending service (SendGrid, AWS SES, or Postmark)
Core Instructions
Set up a Medusa project
# Create a new Medusa project npx create-medusa-app@latest my-store # Project structure (Medusa v2) # my-store/ # ├── src/ # │ ├── api/ # Custom API routes # │ ├── jobs/ # Scheduled jobs # │ ├── links/ # Module links # │ ├── modules/ # Custom modules # │ ├── subscribers/ # Event subscribers # │ └── workflows/ # Custom workflows # ├── medusa-config.ts # └── package.json # Start the development server npx medusa developConfigure
medusa-config.ts:import { defineConfig, loadEnv } from '@medusajs/framework/utils'; loadEnv(process.env.NODE_ENV || 'development', process.cwd()); export default defineConfig({ projectConfig: { databaseUrl: process.env.DATABASE_URL, redisUrl: process.env.REDIS_URL, http: { storeCors: process.env.STORE_CORS || 'http://localhost:8000', adminCors: process.env.ADMIN_CORS || 'http://localhost:9000', authCors: process.env.AUTH_CORS || 'http://localhost:8000,http://localhost:9000', }, }, modules: [ // Register custom modules here ], });Create a custom module with a service
// src/modules/loyalty/service.ts import { MedusaService } from '@medusajs/framework/utils'; import { LoyaltyPoints } from './models/loyalty-points'; class LoyaltyModuleService extends MedusaService({ LoyaltyPoints, }) { async awardPoints(customerId: string, points: number, reason: string) { return await this.createLoyaltyPointss({ customer_id: customerId, points, reason, type: 'earned', }); } async redeemPoints(customerId: string, points: number) { const balance = await this.getBalance(customerId); if (balance < points) { throw new Error(`Insufficient points. Balance: ${balance}, requested: ${points}`); } return await this.createLoyaltyPointss({ customer_id: customerId, points: -points, reason: 'redeemed', type: 'redeemed', }); } async getBalance(customerId: string): Promise<number> { const records = await this.listLoyaltyPointss({ customer_id: customerId, }); return records.reduce((sum, r) => sum + r.points, 0); } } export default LoyaltyModuleService;Define the data model:
// src/modules/loyalty/models/loyalty-points.ts import { model } from '@medusajs/framework/utils'; export const LoyaltyPoints = model.define('loyalty_points', { id: model.id().primaryKey(), customer_id: model.text(), points: model.number(), reason: model.text(), type: model.enum(['earned', 'redeemed', 'adjusted']), });Register the module:
// src/modules/loyalty/index.ts import LoyaltyModuleService from './service'; import { Module } from '@medusajs/framework/utils'; export const LOYALTY_MODULE = 'loyalt
Установить medusa-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
claude-codecursorgemini-clicopilotcodex-clikiroopencodeВложенные файлы
FAQ
Что делает скилл medusa-development?
Extend the open-source Medusa commerce platform with custom services, event subscribers, and API endpoints for unique business requirements
Как установить скилл medusa-development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл medusa-development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic